Skip to content

Conversation

@shnizzedy
Copy link
Member

Related to

Related to #2140 by @birajstha
Related to #2183 by @birajstha
Related to #2204 by @shnizzedy
Related to #2225 by @shnizzedy
Related to #2230 by @shnizzedy
Related to #2267 by @birajstha

Description

It seems like we finally got our graph big enough that the Cartesian product of all strategies is too large.

This PR updates the graph-building so C-PAC filters as it builds (so if we get conflicting resources in a fork, that fork is immediately pruned, instead of waiting until the end and then pruning).

Even though this approach involves more computation up front, the reduced size of the graph quickly outweighs that overhead:

---
title: Example
---
graph RL
    subgraph A1[**before**]
    direction TB

        A@{ shape: sm-circ, label: "Small start" } --> B1[/strat_pool1 ✓/]
        A <--> B2[/strat_pool2 ✗ pruned/]:::prunedNode

        B1 --> C1[/strat_pool3 ✓/]
        B1 <--> C2[/strat_pool4 ✗ pruned/]:::prunedNode
        B2 <--> C3[/strat_pool9 ✗ pruned/]:::prunedNode
        B2 <--> C4[/strat_pool12 ✗ pruned/]:::prunedNode

        C1 --> D1[/strat_pool5 ✓/]
        C1 --> D2[/strat_pool6 ✓/]
        C2 <--> D3[/strat_pool7 ✗ pruned/]:::prunedNode
        C2 <--> D4[/strat_pool8 ✗ pruned/]:::prunedNode
        C3 <--> D5[/strat_pool10 ✗ pruned/]:::prunedNode
        C3 <--> D6[/strat_pool11 ✗ pruned/]:::prunedNode
        C4 <--> D7[/strat_pool13 ✗ pruned/]:::prunedNode
        C4 <--> D8[/strat_pool14 ✗ pruned/]:::prunedNode
    end

    subgraph A2[**after**]
    direction TB

        A_@{ shape: sm-circ, label: "Small start" } --> B1_[/strat_pool1 ✓/]
        A_ --> B2_[/strat_pool2 ✗ pruned/]:::prunedNode
        B1_ --> C1_[/strat_pool3 ✓/]
        B1_ --> C2_[/strat_pool4 ✗ pruned/]:::prunedNode
        C1_ --> D1_[/strat_pool5 ✓/]
        C1_ --> D2_[/strat_pool6 ✓/]
    end
    classDef prunedNode color:red;
    linkStyle 1,3,4,5,8,9,10,11,12,13,15,17 stroke:red,stroke-width:2px;
Loading

Technical details

Tests

Screenshots

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I updated the changelog.
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@shnizzedy shnizzedy added this to the 1.8.8 release milestone Sep 3, 2025
@shnizzedy shnizzedy requested a review from a team September 3, 2025 18:40
@shnizzedy shnizzedy self-assigned this Sep 3, 2025
@shnizzedy shnizzedy added bug 3 - Critical engine Internal implementation changes that may not be visible to users. develop issue on `develop` branch labels Sep 3, 2025
@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 59.62264% with 107 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.6%. Comparing base (97a4b37) to head (ee00500).
⚠️ Report is 22 commits behind head on develop.

Files with missing lines Patch % Lines
CPAC/qc/xcp.py 25.0% 60 Missing and 3 partials ⚠️
CPAC/anat_preproc/anat_preproc.py 47.5% 20 Missing and 1 partial ⚠️
CPAC/pipeline/engine.py 79.0% 14 Missing and 3 partials ⚠️
CPAC/pipeline/utils.py 81.5% 3 Missing and 2 partials ⚠️
CPAC/pipeline/nipype_pipeline_engine/engine.py 80.0% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #2277     +/-   ##
=========================================
+ Coverage     34.3%   34.6%   +0.4%     
=========================================
  Files          233     233             
  Lines        26472   26610    +138     
  Branches      4133    4181     +48     
=========================================
+ Hits          9076    9220    +144     
+ Misses       16667   16651     -16     
- Partials       729     739     +10     
Files with missing lines Coverage Δ
CPAC/anat_preproc/tests/test_anat_preproc.py 37.3% <100.0%> (-4.0%) ⬇️
CPAC/func_preproc/func_preproc.py 26.1% <ø> (ø)
CPAC/pipeline/cpac_pipeline.py 45.8% <ø> (ø)
CPAC/registration/registration.py 45.3% <ø> (ø)
CPAC/pipeline/nipype_pipeline_engine/engine.py 31.2% <80.0%> (+0.4%) ⬆️
CPAC/pipeline/utils.py 40.0% <81.5%> (+11.4%) ⬆️
CPAC/pipeline/engine.py 56.3% <79.0%> (+1.1%) ⬆️
CPAC/anat_preproc/anat_preproc.py 45.0% <47.5%> (+5.6%) ⬆️
CPAC/qc/xcp.py 48.1% <25.0%> (-8.2%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shnizzedy shnizzedy moved this to 🏗 In progress in C-PAC Development Sep 3, 2025
@shnizzedy
Copy link
Member Author

shnizzedy commented Sep 5, 2025

@shnizzedy shnizzedy marked this pull request as ready for review September 12, 2025 16:15
@shnizzedy shnizzedy requested a review from a team as a code owner September 12, 2025 16:15
@shnizzedy shnizzedy moved this from 🏗 In progress to 👀 In review in C-PAC Development Sep 15, 2025
@shnizzedy shnizzedy merged commit c72d516 into develop Sep 18, 2025
30 checks passed
@shnizzedy shnizzedy deleted the decrease-fragility/xcpqc branch September 18, 2025 17:49
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in C-PAC Development Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Critical bug develop issue on `develop` branch engine Internal implementation changes that may not be visible to users. performance resource usage

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants