Skip to content

train: model acceptance gate on the out-of-core path (search::match_spectra_out_of_core) - #124

Merged
ypriverol merged 1 commit into
mainfrom
train/gate-out-of-core
Oct 10, 2026
Merged

ypriverol merged 1 commit into
mainfrom
train/gate-out-of-core

Conversation

@ypriverol

Copy link
Copy Markdown
Contributor

The model acceptance gate in andes train (gate::count_target_psms, used by evaluate_candidate) now searches on the out-of-core path with fragment-ion retrieval instead of the in-RAM path. This removes another user of the in-RAM path, which is being retired.

The gate compares a candidate model against the current one, and both now go through the same retrieval, so the accept/reject comparison stays like-for-like. The gate is a simplified search: rank score only, 0.5 Da, its own target-decoy count. It does not try to reproduce andes search. Training-label bootstrapping (labeled::bootstrap_labels) stays on the in-RAM path for now. Moving it changes the labels, and so the retrained models, so it should go with the next model retrain and be validated against the current models.

Changes

  • search::match_spectra_out_of_core: a single-shot search on the out-of-core path with fragment-ion retrieval.
    • Spectra are sorted by precursor mass and scored in chunks of at most 80 Da (OUT_OF_CORE_SLICE_DA), so the per-chunk index stays bounded for any input size.
    • It returns one queue per input spectrum in input order, with spectrum_idx set to the input position, plus the candidates the queues reference.
    • The candidate index is cached under the temp directory.
  • index_order_mass, index_chunk_len and INDEX_CHUNK_SIZE moved from the andes binary into search::fragment_index, so the binary and the library chunk the same way. This move is mechanical.
  • gate::count_target_psms calls match_spectra_out_of_core. The module docs no longer claim the gate runs the same search as bootstrap_labels.

Verification

  • clippy -D warnings is clean, and 1,137 tests pass, including the model-train gate and end-to-end training tests.
  • New test match_spectra_out_of_core_keeps_input_order_and_finds_the_enumeration_top_hit. Spectra are passed in descending precursor mass. It checks that queues come back in input order with matching spectrum_idx, and that each top peptide equals the in-RAM enumeration's.
  • andes search output is unchanged: TMT default cc21d15c58 and Astral default 339077c5e0, byte-identical to main.

…h fragment-ion retrieval (match_spectra_out_of_core), not the in-RAM path
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 613d2543-afdd-44dd-b8af-fb19b8201782

📥 Commits

Reviewing files that changed from the base of the PR and between 64dc27f and 50274e7.


📒 Files selected for processing (6)
  • crates/andes/src/bin/andes/search.rs
  • crates/model-train/src/gate.rs
  • crates/search/src/fragment_index.rs
  • crates/search/src/lib.rs
  • crates/search/src/match_engine.rs
  • crates/search/tests/mmap_candidate_backing.rs

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ypriverol
ypriverol merged commit 1a9de07 into main Oct 10, 2026
5 checks passed
@ypriverol
ypriverol deleted the train/gate-out-of-core branch October 15, 2026 16:05
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