Skip to content

Add counts_only aggregate mode#26

Merged
dmx2 merged 1 commit into
masterfrom
counts-only
Jun 27, 2026
Merged

Add counts_only aggregate mode#26
dmx2 merged 1 commit into
masterfrom
counts-only

Conversation

@dmx2

@dmx2 dmx2 commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

New Matcher(counts_only=True) returns per (query peptide, mismatch level) hit counts instead of the full per-hit table. The Rust count path mirrors mismatch_match's dedup + validity walk exactly but tallies per mismatch level without reconstructing matched sequences, pulling metadata, or building rows, so memory is O(unique queries), not O(hits) and it skips the per-hit work. Schema: [Query ID, Query Sequence, Mismatches, Count]; honors output_format. Rejected with best_match; linear search only.

Parity test asserts counts == full output grouped by (peptide, mismatch level). Dense bench: 1106MB/11.8s (full) -> 235MB/8.9s (counts), result rows bounded by unique peptides regardless of hit count.

New Matcher(counts_only=True) returns per (query peptide, mismatch level) hit
counts instead of the full per-hit table. The Rust count path mirrors
mismatch_match's dedup + validity walk exactly but tallies per mismatch level
without reconstructing matched sequences, pulling metadata, or building rows --
so memory is O(unique queries), not O(hits), i.e. density-proof, and it skips
the per-hit work. Schema: [Query ID, Query Sequence, Mismatches, Count];
honors output_format. Rejected with best_match; linear search only.

Parity test asserts counts == full output grouped by (peptide, mismatch level).
Dense bench: 1106MB/11.8s (full) -> 235MB/8.9s (counts), result rows bounded by
unique peptides regardless of hit count.
@dmx2 dmx2 merged commit 8ef2f98 into master Jun 27, 2026
6 checks passed
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