apex_sim: apex-finder simulator app + sensitivity bench#67
Merged
Conversation
New crate rust/apex_sim: eframe app that synthesizes extraction products (tunable noise, ratio mismatch, absent transitions, injected peaks) and feeds them to the REAL timsseek TraceScorer -- no reimplemented scoring. Displays chromatograms, heatmap, and every intermediate trace with both scoring passes' apexes plus a full score decomposition. Bench (examples/bench.rs, apex_sim::bench): runs a catalog of canonical scenarios (clean/noise/interference/mismatched-library/absent-fragment) over many seeds, measuring apex-recovery sensitivity + scoring throughput. Simulation is built up front so it stays out of the scoring timer; one reused TraceScorer mirrors production's ScoringWorker. Fidelity: sim applies the same filter_zero_intensity_ions + select_top_n_fragments(TOP_N_FRAGMENTS) the pipeline runs before scoring (those three widened to pub in timsseek). GUI stack (egui/eframe/egui_plot) gated behind default-on 'gui' feature so the bench builds lean under --no-default-features. CI: .github/workflows/apex_bench.yml runs the bench --no-default-features and posts a sticky results comment on the PR.
Apex-finder bench
Sensitivity + timing across canonical scenarioscommit d445179 |
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.
New crate rust/apex_sim: an eframe/egui desktop app plus a bench for probing
the timsseek apex finder under synthetic conditions.
What it does
peak shape, per-fragment noise, theoretical-vs-observed ratio mismatch
(obs_scale), absent/empty transitions, randomly injected peak-like objects,
precursor isotopes, global noise floor. Deterministic (seeded ChaCha8Rng).
No scoring is reimplemented; the app runs the two production passes
(compute_traces -> suggest_apex -> score_at).
heatmap, and all intermediate traces (cosine/scribe/lazyscore/log_int/
ms1/apex_profile) with TRUE / pass1 / pass2 apex markers, plus a full
ApexScore decomposition (base_score, au/cg terms, 11 features).
Bench (examples/bench.rs, apex_sim::bench)
high_noise+interference, heavy_interference, mismatched_library,
absent_top_fragment) over many seeds and prints per-scenario detail plus
a comparison summary table (pass1/pass2 sensitivity, median error, us/run).
TraceScorer is reused across runs (matches production ScoringWorker).
Fidelity
select_top_n_fragments(TOP_N_FRAGMENTS) the pipeline runs before scoring,
so it scores exactly what timsseek would. Those three items are widened to
pub in timsseek (only visibility, no behavior change).
Build / CI
builds lean with --no-default-features (no egui/winit in CI).
PRs touching apex_sim/timsseek and upserts a sticky results comment.
Validation
findings (production filtering + reused-scorer timing) are applied here.