Skip to content

Release v1.0.10: Zero-Diff Hot-Path CPU & Heap Optimizations, Singleflight 16 MiB Illumina CRAM Cache, Hostile-Input BAM/BAI/CSI/SAM & Harness Hardening, and 691-Test Suite

[!NOTE] Historical Release Document: This document records the release certification for v1.0.10 (engine fingerprint 2d82664ff81000f7). For the current v1.1.0 release certification, see docs/release/v1.1.0-pr.md.

Target Branch: main
Source Branch: release/v1.0.10
Release Fingerprint: 2d82664ff81000f7 (perf_fingerprint 052f5458a6dd77bb)
Repository: https://github.com/palakpsheth/VarDictRust
Author / Maintainer: Palak Sheth palakpsheth@gmail.com
Governing Manifesto: rewrites.bio
Acceptance Gate: 8/8 Items PASS (harness/acceptance.sh)
Release Recertification Receipt (2d82664ff81000f7): validated vs VarDictJava 1.8.3, dataset micro + s1a-s9 + 17-modality extended + 18-slice multimodal + HG008/SEQC2/HG002(chr20)/Amplicon + 5 truth cohorts + chr1 scale, cmd bash harness/recertify.sh && bash harness/pr_check.sh && bash harness/acceptance.sh


Overview

This pull request prepares and certifies VarDictRust v1.0.10 off main (a504e85), consolidating 6 engineering pull requests (PR #135–PR #140, following the post-tag v1.0.9 Bioconda recipe SHA-256 sync in PR #134):

  1. Zero-Diff Hot-Path CPU, Heap & Engine Consolidation (PR #137, PR #138, PR #140):
  2. Replaces software count_ones() in swar_mismatch_count_u64 with a 3-op branchless multiply-shift horizontal byte sum, tightens find_35_match (Iterator::position candidate scanning + exact O(1) mm0 IEEE-754 0.1 ratio pre-rejects, 2.60× faster), adds find_conseq_slice eliminating all Sclip deep BTreeMap/IndexMap clones across realignlgdel, find_del_paths, and find_dup_disc_paths, replaces quadratic tmp3 scans in realignlgins30 with binary-searched window slices, indexes SOFTP2SV upfront via SclipSlot in find_sv, and unifies find_mm5/find_mm3 and .var/genotype/CigarModifier formatting over stack-allocated buffers (StackBuf).
  3. Clips CIGAR deletion coverage updates (parse.rs) to sorted merged ±5,000 bp loaded reference windows with idempotent i64 coordinate-compressed finish_ref_coverage sweeps for > 64 bp spans, flattens multi-tile max_read_length pre-scanning (lib.rs) into a non-nested 250 kbp band pool with disjoint alignment_start band ownership and a lazy 4 MiB 2-bit ACGT + 'N' side-map 12-mer index on 2nd+ parent-wide misses, and adds EXP_UNDERFLOW_LN_F64 = -746.0 0-ULP exp() short-circuiting and loop-invariant p3 hoisting in fisher.rs.
  4. Shrinks JavaHashMap<i32, Vars> to 96 B (Option<Box<V>> cold fallback, Option<Box<Vec<K>>> NewKeyLog, active_tree_bins: u32, ASCII java_string_hash/java_compare fast-paths, into_entries), removes the private ~572-line StrNode Red-Black tree in java_hashmap_key_order in favor of JavaHashMap<&str, usize>, adds build_aligned_variants_pruned skipping Phase-2 collect_reference_variants on doomed sub-threshold sites, consolidates .var serializers via TableModeStyle across Simple 36/38, Amplicon 38/40, and Somatic 55/61, adds i64 \(O(1)\) pre-region Match skipping / single-base Match specialization / fused paired CIGAR scans / >= 10S and >= 12S modify_pure_sm_in_place fast-paths, adds 2-slot BAM_META_TLS (BAM_CACHE_EPOCH), <= 4096 B BamFeedInner stashes, ACGTacgt= fast-skip in compute_cram_nm, SeedKey::pair_17_12, and RAII WorkerRegionGuard, retires env RUST_MIN_STACK=67108864 in harness/cram_twin.sh, and expands cargo-fuzz (fuzz_modify_cigar SeedMap + fuzz_parse_and_realign) and the Cargo workspace test suite from 664 to 691 tests.
  5. Singleflight 16 MiB Illumina CRAM Container Cache, 2-Slot CRAM_META_TLS & Shared Index Metadata (PR #136, PR #139):
  6. Raises MAX_CACHED_CRAM_CONTAINER_BYTES in crates/vardictrust-core/src/bam.rs to 16 MiB (should_cache_cram_container / fetch_cram_container_in), adds per-key singleflight container decode coalescing (InflightCramDecode / InflightCramGuard on CramContainerCacheShard), upgrades CRAM_META_TLS to 2 slots (lookup_cram_meta_tls / insert_cram_meta_tls), and buffers prevalidate_cram_container_slices through a 64 KiB seek-retaining window (SeekWindowReader) so standard 10,000–10,240-read 150–250 bp Illumina CRAM containers (~6.3–9.8 MiB) decode once across concurrent workers and hit CRAM_CONTAINER_CACHE while bounding 8 × 4 = 32 decoded-record slots to <= 512 MiB and bypassing oversized PacBio/ONT long-read containers, alongside FileStamp-validated process-wide OnceLock .fai/.gzi metadata sharing across worker threads.
  7. Hostile-Input Hardening, CLI/BGZF Sidecar Safety & CI Supply-Chain Hardening (PR #135, PR #136, PR #138):
  8. Adds pre-release libFuzzer .bai/.csi structural header and remaining-byte count pre-validation (MAX_BAI_BYTES = 512 MiB, MAX_CSI_BYTES = 256 MiB, MAX_CSI_DECOMPRESSED_BYTES = 256 MiB, bounding n_ref, n_bin, n_chunk, n_intv, and l_aux before noodles index allocation) in read_validated_bai_index and read_validated_csi_index, and terminates non-advancing text SAM CIGAR Err loops immediately in SamRecord::fill_from_alignment_record and intersects_record (crates/vardictrust-core/src/bam.rs).
  9. Makes -th/--threads positional-BED-safe (require_equals = true + free-positional counting preserving Commons-CLI first-wins duplicate -th), cleans up stale .tbi/.csi sidecars and preflight-rejects colliding or unremovable 0555 sidecars when overwriting BGZF --output paths without --tbi/--csi, stages SpillableVcfAccumulator spill files in --output's parent directory with std::env::temp_dir() fallback, and trims unused regex and noodles bed/vcf features from binary manifests.
  10. Enforces single-pass FIFO-safe VCF loading, sample-column count parity, and FORMAT subfield count parity in harness/compare_vcf.py; adds execvp-safe portable.sh --timeout, resolve_data_root, and 16-path find_gitleaks while removing BSD/macOS GNU-isms across 11 scripts (37 harness self-tests); hardens .github/workflows/release.yml (!announcement_is_prerelease, step-scoped CARGO_REGISTRY_TOKEN, idempotent crate publishing, dropped empty announce), setup-conda-env (conda-env-v3-), docs.yml (playwright==1.62.0), and gcp_paper_runner.sh; and verifies SHA-256 digests on concordance_multimodal.sh truth slices and run_stage_6.sh downloads.

Acceptance Gate & PR Check Certification

Both bash harness/pr_check.sh (6/6 stages) and bash harness/acceptance.sh (8/8 items) pass under certified engine fingerprint 2d82664ff81000f7 (perf_fingerprint 052f5458a6dd77bb):

item 1: PASS (Unit tests: 691 total workspace tests: 491 lib + 110 corpus_parity + 29 engine_behavior + 2 amplicon_stream_mem + 3 cram_stack + 29 cli + 3 profile_smoke + 23 robustness + 1 version)
item 2: PASS (Level 2: 91/92 static expected matches + UB-4 isolated; micro live oracle smoke.sh PASS)
item 3: PASS (Level 3: 17/17 benchmarks MATCH: micro + 10 slices + HG008 + SEQC2 exome + SEQC2 slices + HG002 + Amplicon + 17-mode extended + 18-slice multimodal)
item 4: PASS (Robustness: crash corpus + HG008 CRAM twin PASS)
item 5: PASS (Level 5 Scale & Perf-Budget PASS)
item 6: PASS (Level 4 Truth set: HG008, SEQC2, HG002, HG005, NA24385 b37 EQUAL across all 5 cohorts)
item 7: PASS (Hygiene: fmt, clippy, audit, deny, gitleaks 0 leaks)
item 8: PASS (Distribution: --version metadata 1.0.10, musl-ci PASS)
fingerprint 2d82664ff81000f7

Key Documentation & Validation Artifacts