Repository navigation
perf: low-res fragment-index path at in-RAM CPU (TMT 171 vs 179 s, UPS1 116.5 vs 119 s), Astral -20% CPU, byte-identical - #127
Conversation
…ue mass bounds during the fetch, and materialises only forms inside an exact precursor window The chunk record filter summed per-position variant bounds through a walk that returned three 64-slot buffers by value; it now sums bounds tabulated once per search, in the same order, and runs inside the parallel record scan so only kept records are sorted. Forms outside every exact (charge, isotope) window are dropped after top-k selection instead of being materialised and rejected by the scorer's precursor test. Output byte-identical. TMT 8 threads: 196.5 -> 179 s CPU, 32.5 -> 29.4 s wall. UPS1: 131.5 -> 120.5 s CPU, 20.5 -> 18.7 s wall.
…ch bin from a block offset table instead of binary-searching the bin Form ids are cut into precursor-mass blocks (about 16 entries per bin and block); the build records where each block starts in every bin after the bin sort, and a query scans from its first block's offset. Output byte-identical. TMT index query CPU 19.2 -> 14.2 s, bin sort 8.4 -> 9.5 s; total 175.5 -> 171 s CPU. UPS1 unchanged.
…s before filtering them, so the cache misses overlap Records come out of the mass-ordered index in random protein order, and each filter test missed twice (the protein, then its span) inside a loop body too long for the misses of neighbouring records to overlap. Output byte-identical. TMT index record fetch CPU 10.2 -> 5.7 s (wall 2.0 -> 1.3 s); total 173.5 -> 170.5 s CPU. UPS1 117.5 -> 116.5 s.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue was established; the change is ready for normal checks. Pre-merge checks |
|
timosachsenberg
left a comment
There was a problem hiding this comment.
Reviewed 6f73af7 against the declared base (1a9de07). No additional actionable findings.
Checked record filtering, terminal mass bounds, block offsets, precursor-window filtering and candidate ordering through materialisation and scoring. The two fragment-index integration tests and 17 matching unit tests pass. An independent oracle for the block-range arithmetic also passed 288,420 cases, including empty and repeated block boundaries.
I did not reproduce the dataset-level byte-identity or performance measurements.
ypriverol
left a comment
There was a problem hiding this comment.
Review (perf base of search stack)
Low-res fragment-index path aiming for in-RAM CPU with byte-identical output — good merge candidate if goldens/CI prove identity.
Findings / asks
| Sev | Finding |
|---|---|
| Medium | “Byte-identical” must be pinned by golden PIN tests on UPS1/TMT slices, not only wall-time tables |
| Low | Keep hidden flags out of the default CLI surface |
LLM Fix Brief
Branch: perf/lowres-index-speed-2.
1. Confirm CI runs the PIN golden / equivalence tests that prove byte-identity for low-res index path vs prior baseline.
2. If any non-determinism (rayon tie-break), add (score, peptide-bytes) tie-break before claiming byte-identical.
Acceptance: relevant andes golden tests green on this branch.
This PR makes the fragment-index path match the in-RAM path on CPU for low-resolution data, with every output byte-identical. That is the last speed condition before retiring the in-RAM path. The same changes cut Astral's high-res index CPU by about 20%.
Where the gap was
Profiling TMT on main, 8 threads, instrumented, showed that per-spectrum work was already cheaper on the index path. RAM fully scores about 3,186 candidates per spectrum. The index selects 100, and about 32 of those pass the precursor gate.
The whole gap was the per-chunk index build: 62 CPU-s and 10.5 s wall over 67 chunks. The record filter alone took 18 CPU-s, because a helper returned three 64-slot
SmallVecs by value for each of 29M fetched records.Changes (each byte-identical)
a9a5324b). It sums per-residue minimum and maximum masses that are tabulated once per search, in the same order as before, so the result is bit-identical. The filter runs inside the parallel record fetch, before the sort. Only forms inside an exact precursor window are materialised, widened by 1e-6 Da; the scorer's precursor gate still decides.daf9aae5). A block offset table per bin, about 16 entries per cell, replaces the per-bin binary search for the precursor window's start. Index memory grows by about 3%.6f73af7b). It touches each batch of 32 records' protein spans before filtering them, so the cache misses overlap.Measurements
The cleanest comparison: RAM against this branch, interleaved, 8 threads, warm cache, with no other jobs on the machine.
A second round compared main against this branch, two repeats each. It ran while other jobs shared the machine (load 9–13), so its wall times are noisy:
Output and identifications
cc21d15c58, TMT index73978cf0b1, UPS1 RAMab3d9bc861, UPS1 index3b0f9ae0b4, Astral339077c5e0.-D warningsis clean, and 1,140 tests pass.Summary by CodeRabbit
Performance
Search Accuracy