fix(#560): path_glob page fills from glob-filtered results instead of starving below the rank window#561
Merged
Conversation
…glob files Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ot the global rank window When path_glob is set, escalate the fetch window (x4, capped at the existing 100000 bound) until the in-glob set fills the requested page or the index is exhausted, then page over the glob-filtered view so offset/max_results address in-glob results. Previously the handler fetched offset+max_results+1 globally-ranked rows and filtered at render time, so an in-glob match ranking below the window produced '0 results' alongside a 'more results' hint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
…+ 560) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
This was referenced Jun 10, 2026
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.
Fixes #560.
Problem
handleSearchfetchedoffset+max_results+1globally-ranked results and appliedpath_globonly at render time. An in-glob match ranking below the window yielded the self-contradicting0 results … (more results — offset=20). Live repro:codedb_search query='searchContent' path_glob='src/explore.zig'→ 0 results despite the function being defined there. Same filter-after-cap family as #547/#553.Fix
Plain-search branch: with
path_globset, escalate the fetch window ×4 (existing 100000 cap) until the in-glob set fills the page or the index is exhausted, then page over the glob-filtered sequence —offsetbecomes a cursor into in-glob results andhas_morereflects in-glob continuation. No behavior change whenpath_globis unset (want_count== oldfetch_count, paging overfetchedas before). scope=/regex= branches share the bug shape; left for a follow-up per the issue.Failing Test
test "issue-560: path_glob page must not be starved by higher-ranked out-of-glob files"(src/test_search.zig), committed red: 40 tying out-of-glob decoys ahead ofsrc/gold.zig; pre-fix 67/68.Validation
zig build test: all green (729 tests), including issue-recall path_glob and issue-422 header-count tests.Note: trivial EOF conflict with #557 in src/test_search.zig if merged second (both append a test at file end).
🤖 Generated with Claude Code