Repository navigation
perf: strong-mode features only for survivors, packed GBDT nodes; hidden --deep-features-top - #111
Merged
Merged
Conversation
…survive the trim Strong mode retains 25 candidates per spectrum, ranks them by the strong score and trims to the user's top-N (10). Every retained row got the full feature set, including the uncached rich-ion GBDT, the fragment-LLR battery and the site features, although the strong score needs only features computed before them. Retained rows now get a light pass, and after the trim the survivors get the full one. The calibrated strong score is still taken over the whole retained pool. The survivor pass uses a new TopNQueue::update_in_place that pushes the heap's elements back in array order, so the layout, and with it the output order of rows tied on every sort key, is unchanged (BinaryHeap::from does not preserve it). The main path also reuses the edge score from the candidate loop instead of recomputing it. The path-parity guard now also scans the shared make_features closure; edge_score is set by compute_psm_features_with_edge, so its exception was stale and is removed. Both fixture PINs are byte-identical to main.
After #105, tree-ensemble evaluation is still 31-45% of CPU on Astral, TMT and UPS1 (perf on the benchmark VM). Each node visit read five separate arrays (feature, threshold, left, right, default_left, value). GbdtPeakModel now builds, on first use, a packed copy of its trees: one 16-byte record per node holding the feature, the threshold (or the leaf value), the left child and the right child with the NaN direction in its high bit. predict_value and predict_value_batch walk it with the same comparisons in the same order, so results are bit-identical; a new test checks that against Tree::eval, including NaN and short rows. The cache lives in a new GbdtPeakModel::packed field (construct with Default::default()); equality ignores it. Both fixture PINs are byte-identical to main.
…e best K rows only Each spectrum emits up to 10 PIN rows, and every row gets the model-based features (rich-ion LLR GBDT, fragment-LLR battery, site features). Ranks 2-10 cost about a third of low-res search time. With --deep-features-top K, all rows take the light pass and only the best K (by the queue's rank score, ties included) get the full one; the others keep those columns at 0.0. Default 0 keeps every row, and output is byte-identical to before. For measurement before any default changes.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (17)
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. Comment |
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.
Three commits. With default settings, all PINs are byte-identical to
main.Changes
1. Strong mode: full features only for the rows that survive the trim.
TopNQueue::update_in_placepushes the heap's elements back in array order, so rows tied on every sort key keep their output order.BinaryHeap::fromdoes not preserve it, which was found and fixed during testing.make_featuresclosure, and its staleedge_scoreexception is removed.2. GBDT trees evaluated on packed 16-byte nodes.
Tree::eval, including NaN and short rows.GbdtPeakModel::packedfield, built on first use; equality ignores it.3. Hidden
--deep-features-top K(default 0 = all rows, byte-identical). It computes the model features only for each spectrum's best K rows. This is for measurement only, and the default does not change. Measured below, K = 3 saved 4–13% CPU with identifications flat on Astral and TMT and −0.5% on UPS1, so it is not proposed as a default.Measured on the benchmark VM
mainagainst this branch, 8 threads, binaries alternated, 2 runs each,/usr/bin/time -v:mainwall / CPUPINs are byte-identical to
mainon all four datasets.The packed-node layout contributed little: tree evaluation is bound by how many evaluations run, not by node layout. Most of the Astral gain is from change 1.
--deep-features-top(Percolator-Y, seeds 42/1/2, PSMs at 1%):Workspace tests and clippy (
-D warnings) pass.