-
fix(grep): enforce_time_budget option for zero-match searches (#826) (#827)
e2e Tests / e2e (macos-latest) (push) Has been cancellede2e Tests / e2e (ubuntu-latest) (push) Has been cancellede2e Tests / e2e (windows-latest) (push) Has been cancellede2e Tests / e2e (alpine-musl) (push) Has been cancelledLua CI / lua-language-server type check (push) Has been cancelledLua CI / luacheck lint (push) Has been cancelledNix CI / check (push) Has been cancelledOxc / Check packages with oxfmt and oxlint (push) Has been cancelledPython CI / Python bindings (macos-latest) (push) Has been cancelledPython CI / Python bindings (ubuntu-latest) (push) Has been cancelledPython CI / Python bindings (windows-latest) (push) Has been cancelledBuild & Publish / Build Neovim aarch64-apple-darwin (push) Has been cancelledBuild & Publish / Build Neovim aarch64-linux-android (push) Has been cancelledBuild & Publish / Build Neovim aarch64-pc-windows-msvc (push) Has been cancelledBuild & Publish / Build Neovim aarch64-unknown-linux-gnu (push) Has been cancelledBuild & Publish / Build Neovim aarch64-unknown-linux-musl (push) Has been cancelledBuild & Publish / Build Neovim x86_64-apple-darwin (push) Has been cancelledBuild & Publish / Build Neovim x86_64-pc-windows-msvc (push) Has been cancelledBuild & Publish / Build Neovim x86_64-unknown-linux-gnu (push) Has been cancelledBuild & Publish / Build Neovim x86_64-unknown-linux-musl (push) Has been cancelledBuild & Publish / Build C FFI aarch64-apple-darwin (push) Has been cancelledBuild & Publish / Build C FFI aarch64-linux-android (push) Has been cancelledBuild & Publish / Build C FFI aarch64-pc-windows-msvc (push) Has been cancelledBuild & Publish / Build C FFI aarch64-unknown-linux-gnu (push) Has been cancelledBuild & Publish / Build C FFI aarch64-unknown-linux-musl (push) Has been cancelledBuild & Publish / Build C FFI x86_64-apple-darwin (push) Has been cancelledBuild & Publish / Build C FFI x86_64-pc-windows-msvc (push) Has been cancelledBuild & Publish / Build C FFI x86_64-unknown-linux-gnu (push) Has been cancelledBuild & Publish / Build C FFI x86_64-unknown-linux-musl (push) Has been cancelledBuild & Publish / Build MCP aarch64-apple-darwin (push) Has been cancelledBuild & Publish / Build MCP aarch64-pc-windows-msvc (push) Has been cancelledBuild & Publish / Build MCP aarch64-unknown-linux-gnu (push) Has been cancelledBuild & Publish / Build MCP aarch64-unknown-linux-musl (push) Has been cancelledBuild & Publish / Build MCP x86_64-apple-darwin (push) Has been cancelledBuild & Publish / Build MCP x86_64-pc-windows-msvc (push) Has been cancelledBuild & Publish / Build MCP x86_64-unknown-linux-gnu (push) Has been cancelledBuild & Publish / Build MCP x86_64-unknown-linux-musl (push) Has been cancelledBuild & Publish / Build Python wheels aarch64 (macos-latest) (push) Has been cancelledBuild & Publish / Build Python wheels x86_64 (macos-latest) (push) Has been cancelledBuild & Publish / Build Python wheels aarch64 (ubuntu-latest) (push) Has been cancelledBuild & Publish / Build Python wheels x86_64 (ubuntu-latest) (push) Has been cancelledBuild & Publish / Build Python wheels x86_64 (windows-latest) (push) Has been cancelledBuild & Publish / Build Python sdist (push) Has been cancelledSpelling / Spell Check with Typos (push) Has been cancelledStylua / Check lua files using Stylua (push) Has been cancelledRust CI / Test (macos-latest) (push) Has been cancelledRust CI / Test (ubuntu-latest) (push) Has been cancelledRust CI / Test (windows-latest) (push) Has been cancelledRust CI / Fuzz Tests (macos-latest) (push) Has been cancelledRust CI / Fuzz Tests (ubuntu-latest) (push) Has been cancelledRust CI / Fuzz Tests (windows-latest) (push) Has been cancelledRust CI / Build i686-unknown-linux-gnu (push) Has been cancelledRust CI / cargo fmt (push) Has been cancelledRust CI / cargo clippy (push) Has been cancelledBuild & Publish / Release (push) Has been cancelledBuild & Publish / Publish Python wheels to PyPI (push) Has been cancelledBuild & Publish / Publish Rust crates (push) Has been cancelledBuild & Publish / Publish npm packages (push) Has been cancelled发布于
2026-09-08 18:53:07 +00:00 - fix: enforce grep time budget on zero-match searches (#826)
The plain/regex deadline check was gated on
all_matches.len() > 1, so a
search that matched nothing never aborted and scanned every candidate file.
Removing the gate alone is not enough: both accounting paths overwrote
files_consumedwith the full slice length whenever no file matched, which
zeroed outnext_file_offsetand lost the resume cursor.Workers now latch the abort in their
map_initstate and record the lowest
index they skipped, so the resume cursor is the exact first unsearched file.
Matches past that index are dropped and re-found on the next page, keeping
paging free of both gaps and duplicates.Closes #826
- fix(grep): gate zero-match time budget behind enforce_time_budget (#826)
Per review: enforcing the budget on zero-match searches unconditionally
changes behaviour for existing callers, who relied on a full scan when
nothing matched. Make it opt-in instead.- GrepSearchOptions.enforce_time_budget, default false. Off keeps the
historical plain/regex rule (budget dormant until matches exist). - Exposed as enforceTimeBudget (node/bun), enforce_time_budget
(lua config + python kwarg), and new fff_live_grep_ex /
fff_multi_grep_ex C symbols. The existing C symbols keep their exact
signature and forward with false. - Fuzzy grep already enforced the budget unconditionally; unchanged.
- Cursor accounting fix stays unconditional: an aborted page now reports
how far it actually got instead of claiming the whole slice. - Never skip file 0, so an abort cannot emit next_file_offset == 0,
which callers read as "done".
- test(grep): move zero-match budget helpers to end of file
Repo style: private helpers live at the bottom, plain comments not doc
comments.-
fix(python): declare enforce_time_budget in grep type stubs
-
refactor(grep): drop redundant budget_exceeded flag and tighten comments
Co-authored-by: gustav-fff 286169375+gustav-fff@users.noreply.github.com
Co-authored-by: Dmitriy Kovalenko dmtr.kovalenko@outlook.com下载附件