Skip to content

Fix: exit non-zero when all slides fail in aggregate_slide_features_batch#132

Closed
raylim wants to merge 1 commit into
mainfrom
fix/titan-exit-code
Closed

Fix: exit non-zero when all slides fail in aggregate_slide_features_batch#132
raylim wants to merge 1 commit into
mainfrom
fix/titan-exit-code

Conversation

@raylim

@raylim raylim commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

When TITAN slide aggregation fails for every slide in a batch (e.g. CUDA OOM), extract_features was silently exiting 0 with no output files. Nextflow showed confusing exit:0 Failed Tasks and spuriously retried tasks.

Changes

  1. feature_extract.py aggregate_slide_features_batch: raise RuntimeError when all slides fail (both model and non-model paths).
  2. extract_features.py _main_batch: defense-in-depth — raise if all output .pt files are missing after aggregation.

With errorStrategy='ignore' in nextflow.config, exit:1 is cleanly ignored; WDS coverage check resets slides to PENDING.

Testing

  • 27 existing tests pass: pytest tests/mussel/utils/test_feature_extract.py tests/mussel/cli/test_extract_features.py
  • 458 total suite tests pass, 0 failures

…atch

Previously, when TITAN slide aggregation failed for every slide in a batch
(e.g. CUDA OOM), extract_features would exit 0 with no output files.
Nextflow then showed confusing 'exit:0 Failed Tasks' and spuriously retried
the tasks using the cluster-profile retry policy.

Fix (two locations):
1. feature_extract.py aggregate_slide_features_batch: raise RuntimeError when
   len(failed_slides) == num_slides, for both model and non-model paths.
2. extract_features.py _main_batch: defense-in-depth check after
   aggregate_slide_features_batch — raise if all output .pt files are missing.

With errorStrategy='ignore' in nextflow.config, exit:1 is properly ignored;
WDS coverage check resets the slides to PENDING for retry in the next batch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@raylim

raylim commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

Duplicate of #131, which has been merged.

@raylim raylim closed this Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant