Skip to content

fix(search): track appended scan ranges#12

Merged
siriusctrl merged 4 commits into
mainfrom
fix/search-appends-v061
Jul 22, 2026
Merged

fix(search): track appended scan ranges#12
siriusctrl merged 4 commits into
mainfrom
fix/search-appends-v061

Conversation

@siriusctrl

Copy link
Copy Markdown
Owner

Summary

  • replace the active search cursor/budget pair with disjoint half-open spans
  • scan committed append deltas without restarting or rescanning wrapped history
  • preserve lazy older-prefix ordering, reset-tail shifts, and live match counts
  • clarify reverse boundary discovery separately from the bounded initial tail load

This supersedes the search implementation in #6 while retaining its documentation intent.

Why

Extending a wrapped search by only increasing its remaining-line budget can spend the new budget revisiting old lines and still miss appended records. Explicit unvisited spans make append and prepend deltas exact in both search directions.

Verification

  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo test --workspace --all-targets --locked (374 passed, 13 ignored)
  • cargo test --workspace --doc --locked
  • RUSTDOCFLAGS=-D warnings cargo doc --workspace --no-deps --locked
  • git diff --check
  • benches/load-performance.sh --samples 3 --case timeline

No terminal-backend video was added because the behavior is covered through backend-neutral viewer and timeline tests.

Represent active searches as disjoint half-open spans so live appends and lazy older inserts extend only unvisited ranges. Preserve true-prefix ordering while allowing committed appends to stay searchable during follow.

Add forward/backward wrap, reset-tail, completed-miss, index recount, and lazy-history regressions. Clarify committed-boundary discovery separately from the bounded initial tail load.
Grow the wrapped forward-search fixture beyond one lazy older-load batch so the regression proves a newer reverse-loaded match cannot outrank the true source prefix.
Defer independently inserted older history until a forward search reaches the true source prefix, and prioritize newer append ranges during backward scans even after an earlier append was partially consumed.

Fill bounded search windows across short ViewFile reads so reverse scans cannot consume different coordinates than they inspected. Add regressions for huge tail records, multi-append ordering, reset boundaries, short reads, and search-index rebuilds.
fix(search): preserve dynamic scan ordering
@siriusctrl
siriusctrl marked this pull request as ready for review July 22, 2026 11:10
@siriusctrl
siriusctrl merged commit 2e4827f into main Jul 22, 2026
1 check 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