Skip to content

docs(group): clarify the paired strategy never actually uses the index - #856

Merged
nh13 merged 1 commit into
mainfrom
nh/paired-index-never-engages
Aug 22, 2026
Merged

nh13 merged 1 commit into
mainfrom
nh/paired-index-never-engages

Conversation

@nh13

@nh13 nh13 commented Aug 22, 2026 •

Copy link
Copy Markdown
Member

Summary

PairedUmiAssigner::uses_index is documented as "the paired strategy indexes at every --edits value — N-gram for k=1, BK-tree for k>1", and the size gate it reads does return true above the threshold. But a paired canonical form always carries the - separator between its halves, and - is a non-ACGT byte, so NgramIndex::new and BkTree::from_umis — which encode only ACGT — invariably decline it. The paired strategy therefore always falls back to its reverse-aware linear scan, at every pool size: the index is never actually built for paired UMIs. The docs implied the opposite, which is misleading about both performance (large paired pools get no index acceleration) and correctness.

What changed

Corrects the uses_index doc and the sibling test doc to say the paired strategy is index-eligible by size but never realizes it, and adds test_paired_forms_are_never_indexed_because_of_the_dash pinning that NgramIndex::new / BkTree::from_umis decline dash-delimited forms.

That test is a deliberate guard, not just a characterization: the indexed candidate search (find_within) is forward-Hamming only, so a future change that taught the index to accept dash-delimited forms (e.g. stripping the dash for a perf win on large paired pools) would silently drop the reverse-orientation (A-B == B-A) edges the paired matcher draws. Such a change must make the indexed path reverse-aware first, and this test forces that reckoning.

Context

Surfaced while investigating (and dismissing) a CodeRabbit finding on #852 that claimed the parallel paired assigner diverges from the sequential one at ≥100 unique forms — it doesn't, precisely because the sequential paired path never indexes. This documents that invariant so the next person doesn't have to rediscover it. Docs + test only; no behavior change.

Risk: command output changes—none; unsafe changes—none, and the CLAUDE.md allowlist is unchanged; memory bounds, queue capacity, and thread/backpressure policy changes—none.

Fix: Clarify paired UMI index eligibility and document fallback to reverse-aware linear matching.

  • Add regression coverage showing that dash-delimited paired UMIs are rejected by NgramIndex and BkTree.
  • Document paired index eligibility for all edit distances.
  • No runtime behavior changes.

`PairedUmiAssigner::uses_index` is documented as "the paired strategy indexes at every
`--edits` value", and the size gate it reads does return true above the threshold. But a
paired canonical form always carries the `-` separator between its halves, and `-` is a
non-`ACGT` byte, so `NgramIndex::new` and `BkTree::from_umis` (which encode only `ACGT`)
invariably decline it. The paired strategy therefore always falls back to its reverse-aware
linear scan, at every pool size -- the index is never actually built for paired UMIs. The
docs implied the opposite, which is misleading about both performance (large paired pools
get no index acceleration) and correctness.

Correct the `uses_index` doc (and the sibling test doc) to say the paired strategy is index-
*eligible* by size but never realizes it, and add `test_paired_forms_are_never_indexed_because_of_the_dash`
pinning that `NgramIndex::new` / `BkTree::from_umis` decline dash-delimited forms. That test
is a deliberate guard: the indexed candidate search (`find_within`) is forward-Hamming only,
so a future change that taught the index to accept dash-delimited forms (e.g. stripping the
dash for a perf win) would silently drop the reverse-orientation (`A-B` == `B-A`) edges the
paired matcher draws -- such a change must make the indexed path reverse-aware, and this test
forces that reckoning.
@nh13
nh13 deployed to github-actions August 22, 2026 08:07 — with GitHub Actions Active
@coderabbitai

coderabbitai Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1225f623-9b8b-4abb-ac2d-15af80e3f69a

📥 Commits

Reviewing files that changed from the base of the PR and between cd7acdd and 143b0aa.

📒 Files selected for processing (1)
  • crates/fgumi-umi/src/assigner.rs

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


Walkthrough

The change clarifies that paired UMI index eligibility does not guarantee index use. Dash-delimited paired UMIs are rejected by NgramIndex and BkTree, so assignment uses reverse-aware linear matching. Regression coverage verifies this behavior.

Changes

Paired UMI index behavior

Layer / File(s) Summary
Paired index fallback contract
crates/fgumi-umi/src/assigner.rs
The PairedUmiAssigner documentation distinguishes eligibility from actual index use. Tests verify rejection of dash-delimited paired UMIs by NgramIndex and BkTree. Threshold documentation covers all edit distances.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 143b0

This PR clarifies paired-strategy documentation and adds a regression test without changing runtime behavior; no actionable merge-blocking risk remains beyond normal checks.

Suggested labels: fgumi group

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title uses valid Conventional Commit syntax, identifies the group scope, and accurately describes the paired index documentation change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

@nh13

nh13 commented Aug 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai pause

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews paused.

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.50%. Comparing base (cd7acdd) to head (143b0aa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
- Coverage   94.51%   94.50%   -0.01%     
==========================================
  Files         193      193              
  Lines      120001   120008       +7     
==========================================
+ Hits       113416   113419       +3     
- Misses       6585     6589       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nh13

nh13 commented Aug 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13
nh13 added this pull request to the merge queue Aug 22, 2026
Merged via the queue into main with commit a46e71d Aug 22, 2026
16 checks passed
@nh13
nh13 deleted the nh/paired-index-never-engages branch August 22, 2026 18:08
@nh13 nh13 mentioned this pull request Aug 22, 2026

This branch was successfully deployed

1 active deployment
github-actions — 143b0aa8 Deployed Aug 22, 2026 by nh13 via coverage #3886
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