perf: gallop the backward trace upper bound from lower - #22
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR extracts the per-step SA-interval location from ChangesSA Interval Location Refactoring
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
prmi/src/index/spectrum.rs (1)
2112-2127: ⚡ Quick winUpdate these doc comments to match the current implementation.
These comments now describe
mem_search_backward_from_hint, notmem_search_backward: Lines 1577-1580 still routemem_search_backwardthroughbackward_spectrum_inner_into, and the lower search is still launched from[pred - err, pred + err + 1)at Lines 2151-2153 rather than a unit seed atpred.Also applies to: 2166-2171
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@prmi/src/index/spectrum.rs` around lines 2112 - 2127, Update the doc comment to accurately describe the current behavior: state that these comments document mem_search_backward_from_hint (not mem_search_backward), and clarify that mem_search_backward now routes through backward_spectrum_inner_into; change the description of the lower-bound search to say it is launched from a unit seed at `pred` (not from the full model window `[pred - err, pred + err + 1)`), and note that the model window is only a hint for the gallop but the actual boundary search uses unit seeds at `pred` (lower) and at the chosen lower probe (upper). Also update the nearby similar comment block referenced around `find_boundary`/`mem_search_backward` so both blocks consistently describe the seeding and probe-count behavior of `mem_search_backward_from_hint`, `mem_search_backward`, and `find_boundary`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@prmi/src/index/spectrum.rs`:
- Around line 2112-2127: Update the doc comment to accurately describe the
current behavior: state that these comments document
mem_search_backward_from_hint (not mem_search_backward), and clarify that
mem_search_backward now routes through backward_spectrum_inner_into; change the
description of the lower-bound search to say it is launched from a unit seed at
`pred` (not from the full model window `[pred - err, pred + err + 1)`), and note
that the model window is only a hint for the gallop but the actual boundary
search uses unit seeds at `pred` (lower) and at the chosen lower probe (upper).
Also update the nearby similar comment block referenced around
`find_boundary`/`mem_search_backward` so both blocks consistently describe the
seeding and probe-count behavior of `mem_search_backward_from_hint`,
`mem_search_backward`, and `find_boundary`.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0f6db5cc-1ebf-4c75-ada4-ad16d6d333e3
📒 Files selected for processing (1)
prmi/src/index/spectrum.rs
Extract the per-base interval search in backward_spectrum_inner_into into backward_locate_step, and seed its upper bound at the just-found `lower` (gallop right, ~2*log2(occ) probes) instead of galloping back from the model's loose right edge `win_hi`; the lower bound keeps the model error window. On the synthetic occ~2028 repeat the backward full trace drops from 1550 to 1480 probes/call. Byte-identical: find_boundary is seed-independent — the gallop brackets the true boundary from any seed, so the seed sets only the probe count, never the interval returned (existing equality proptests).
|
@coderabbitai review |
✅ Action performedReview finished.
|
PR #9 of the v0.2 stack (carries
8cbee1f). Base isfeat/v0.2-prefetch(#21).Gallops the backward trace upper bound up from the lower bound instead of a full-range search. Pure perf — byte-identical (the backward-spectrum oracle proptests pass unchanged). Clean cherry-pick onto #8.
Green-pass: build / clippy -D warnings / nightly fmt /
cargo test --workspaceall ✅ (162 lib + all FFI; only Plan-3 deferrals ignored).Summary by CodeRabbit