Skip to content

perf(svar2): rebalance sharded VCF worker budget - #140

Draft
bschilder wants to merge 1 commit into
d-laub:mainfrom
bschilder:codex/sharded-vcf-thread-budget
Draft

perf(svar2): rebalance sharded VCF worker budget#140
bschilder wants to merge 1 commit into
d-laub:mainfrom
bschilder:codex/sharded-vcf-thread-budget

Conversation

@bschilder

Copy link
Copy Markdown
Contributor

Summary

  • add a backend-specific, per-contig reader_workers allocation for indexed/sharded VCF conversion
  • reclaim the monolithic reader's inactive HTSlib reservation on the sharded path
  • disable per-shard HTSlib background pools so independent readers remain within the process-wide CPU budget
  • report both monolithic-reader and sharded-VCF planned concurrency
  • update direct Rust callers, regression coverage, and parallel-conversion docs

Motivation

A real single-contig AoU chr22 conversion on a 16-CPU VM consistently used only ~299% CPU. The existing planner produced 8 HTSlib threads plus 3 processing_threads, but the sharded VCF branch uses only processing_threads as its shard-worker count and does not use the separately reserved 8-thread monolithic HTSlib pool.

With this change, the same 16-core/one-contig budget becomes:

  • 1 core reserved for OS/Python
  • 4 fixed pipeline threads
  • 11 independent indexed shard readers, decompressing inline

The allocation is per concurrent contig, so the multi-contig case remains bounded (for example, 65 cores / 10 active contigs yields 2 readers per contig and 60 planned sharded-path threads total).

Verification

  • cargo test --no-default-features --features conversion — 310 unit tests plus all Rust E2E suites pass
  • focused sharded VCF ownership and zero-HTSlib-pool Rust tests pass
  • focused Python sharded boundary-normalization, exclusion-deduplication, and worker-error tests pass (3/3)
  • full prek run --all-files --show-diff-on-failure passes, including fmt, check, Clippy (-D warnings), and Pyrefly
  • cargo check --no-default-features passes

The active Verily run was not interrupted; runtime benchmarking of this branch can follow after CI.

d-laub added a commit that referenced this pull request Jul 29, 2026
Adds a reproducible sweep over the sub-contig sharded VCF reader budget
(reader_workers x per-shard HTSlib threads x OVERSHARD_FACTOR) to evaluate
PR #140, plus BENCH-ONLY env hooks in orchestrator.rs so one build covers
the whole space (GENORAY_READER_WORKERS / GENORAY_SHARD_HTSLIB /
GENORAY_OVERSHARD). Unset, they leave the planner untouched.

Every configuration is gated by a whole-store byte-identity oracle; all 60+
swept configurations matched, confirming sharding does not perturb output at
any worker count.

Findings are written up in scripts/bench_sharded_vcf/README.md.

Co-Authored-By: Claude Opus 5 <[email protected]>
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