D12: Single-pass precision/recall alignment with in-alignment FN dropping#92
Open
TimD1 wants to merge 16 commits into
Open
D12: Single-pass precision/recall alignment with in-alignment FN dropping#92TimD1 wants to merge 16 commits into
TimD1 wants to merge 16 commits into
Conversation
…r/src/gtest on Linux CI)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces vcfdist's greedy, retry-based false-negative (FN) dropping with a single-pass, in-alignment mechanism, then wraps it in a lightweight outer re-align loop to recover swallowed neighbors.
skip_cost = ceil((1 - ct) * len)(len= variant edit size). One weighted alignment therefore identifies the missed variants directly — no per-candidate re-alignment search.evaluate_variantskeeps an outer loop: after a pass, drop the largest detected FN indel/SV and re-align the rest so its swallowed neighbors get clean credit. This replaces the old inner--max-retriesexclusion search (which did up tomax_retriesalignments per iteration just to pick what to drop) with a single detection alignment per iteration.--max-dist/-md, and--max-retries/-mr.Design and implementation notes:
docs/superpowers/specs/2026-07-17-single-pass-prec-recall-design.md,docs/superpowers/plans/2026-07-17-single-pass-prec-recall.md.Behavior vs.
dev(chr20, GIAB, default-ct 0.7)Not bit-identical to
devby design — FN dropping is now always-on and globally optimal for the bypass cost function. Four-way comparison (TRUTH_TP, recall):devfull-retry (--max-retries 5)devno-drop (--max-retries 0)Runtime (chr20)
Total wall-clock is a wash — ~1.7s for all variants (dominated by reading ~0.44s + clustering ~0.81s + writing ~0.35s). Isolating the alignment-eval phase: single-pass+loop 0.157s vs full-retry 0.126s vs no-drop 0.114s — i.e. single-pass is marginally slower here, because chr20's small, well-separated variants rarely trigger deep retries and the weighted wavefront costs a bit more per alignment. The expected runtime win only appears where the old loop actually re-aligns many times (SV-dense / large clusters). Validation at that scale (analysis-v3) is still pending a linux-64 environment.
Testing
skip_cost()including large-lenregression; existing suite green (2/2).tests/integration/): new synthetic-reference scenarios — (a) large FN SV adjacent to SNPs → SNPs TP + SV FN (swallowing recovery), (b/c) partial-match TP atct=0.7vs FN+FP atct=1.0, (d) co-located spurious call → truth FN + query FP with no distortion, (e) entangled-overlap residual (characterization). All validated against the real binary.Disclosures / follow-ups
src/cluster.cpp):g.max_dist→g.max_size.max_sizedefaults to 10000 vs oldmax_dist1000, so the per-supercluster memory estimate is ~10× larger. Correctness-safe (only makes thread/RAM bucketing more conservative; never drops work), but may reduce parallelism on genome-wide runs with large superclusters. Follow-up: base the factor on an actual wavefront score bound.-p <prefix>overwrites input VCFs when the prefix collides with an input file's basename (main.cpp:54-55). Worth a separate issue.Closes #91
Part of #55