Skip to content

Thread CRAM decoding during FASTQ extraction - #165

Merged
theontho merged 3 commits into
mainfrom
experiment/fastq-view-threads
Oct 27, 2026
Merged

theontho merged 3 commits into
mainfrom
experiment/fastq-view-threads

Conversation

@theontho

@theontho theontho commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

FASTQ extraction left the CRAM-reading samtools view process single-threaded even when the caller requested several threads. Pass the requested thread count to this stage, alongside the existing collate and fastq thread arguments, so CRAM decoding can overlap the downstream work.

The existing pipeline test now checks that every stage receives the requested thread count. Real 2 Mb and whole-chr20 extraction was run on native Linux and a native-tools Windows VM, with decoded paired FASTQ contents checked across both versions and platforms. Full-genome installed native-Windows correctness has now passed: both FASTQ mates contain 339,819,948 records and exactly match the decoded Linux SHA-256 values; full SNP and microarray correctness also passed. Local evidence (ignored, not GitHub-hosted): out/full-validation/final-installed-correctness.json in the rollout worktree.

Local validation on this branch: Ruff check/format, mypy (123 source files), site and Actions validation, 1880 ordinary tests passed (30 skipped, 87 deselected), fake-data E2E 22 passed (8 optional-path skips), real hg19-mini smoke 44 passed, and pre-commit passed. The first matched Linux VM 2 Mb SNP cohort passed 1 warmup and 3 measured runs with exact decoded VCF body versus the prior golden. All five matched-VM performance workloads subsequently passed with exact outputs and Windows/Linux ratios at or below 1.20. After merging current main, Ruff check/format, mypy (124 source files), site validation, actionlint, and Actions validation passed again.

Initial observed chr20 elapsed times with --threads 2 --memory 512M: Windows 49.27s control / 42.99s candidate; native Linux 44.17s control / 34.65s candidate. These single serialized measurements were exploratory; native Linux is a reference, and the accepted performance gate is the completed matched Windows/Linux VM comparison above.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@theontho
theontho marked this pull request as ready for review October 27, 2026 07:54
Copilot AI balanced review requested due to automatic review settings October 27, 2026 07:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the change enabling threaded CRAM decoding in FASTQ extraction.

No open issues 🎉

What changed in this PR

This PR enables threaded CRAM decoding in the FASTQ extraction pipeline by passing the requested thread count to samtools view, matching the existing downstream stages.

Changes:

  • Adds -@ with the requested thread count to samtools view.
  • Updates the pipeline test to request three threads and verify that every stage receives that count.
File Description
tests/​test_alignment_commands.py Verifies thread-count propagation across all pipeline stages.
src/​wgsextract_cli/​commands/​_extract_helpers.py Enables threading in the alignment-reading stage of FASTQ extraction.

Review effort: Balanced

@theontho
theontho merged commit 989dfbd into main Oct 27, 2026
17 checks passed
@theontho
theontho deleted the experiment/fastq-view-threads branch October 27, 2026 08:14
@theontho theontho mentioned this pull request Oct 27, 2026
@theontho
theontho restored the experiment/fastq-view-threads branch October 27, 2026 08:51
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.

2 participants