Repository navigation
feat(index): layered index A2–A3 — content-keyed grep_bloom, IndexView trait, and the A2–A8 spec - #90
Open
naamanhirschfeld-armis wants to merge 10 commits into
Open
naamanhirschfeld-armis wants to merge 10 commits into
naamanhirschfeld-armis wants to merge 10 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a revision bump Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ame-tick skip hole Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eads on the generic layer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e they diverge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ture is built Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Part of #87. This PR completes phases A2 and A3 of the layered index and the full A2–A8 specification. It does not close the issue, because A4–A8 are not started.
What's in it
Spec (ADR-0016). Adds the Specification section for A2–A8. The section was checked against the code, which corrected several assumptions in the plan:
Revscan has no resolve pass, so the base builder scans an exported tree as a working tree.code_chunksis keyed(scope, path)in Lance.repo_group_keyhashes the main worktree root, not the common dir.The section also records these owner decisions:
Daemonroute, elseInRam.BaseReader. An immutable mmapped sorted-run base is prototyped and benchmarked before A4. Fjall 3.1 takes an exclusive flock even read-only, so a Fjall base can be held by only one process.A critical review added merge-contract rules (path masks rather than tombstone rows, NameDict union, snapshot handle, Meta deltas), crash-safe publish ordering, a disk budget, observability, and per-phase acceptance criteria with fault injection.
docs/layered-index-design.mdnow defers to the ADR where they differ.A2:
grep_bloomkeyed by content hash.(size, mtime_ns)from the manifest.ROW_VERSION2. Rows of another version read as absent, which means the file is a candidate and gets scanned.INDEX_SCHEMA_VERis unchanged, so no user re-indexes.metamarker.scan_paths) deletes a row once no manifest entry holds its hash, via a per-hash refcount onStore. Without this, a long-lived daemon grows the keyspace on every edit.mtime_ns = 0), the same approach as git's racy-clean handling. Such a file is never skipped and is restamped on the next scan. This closes a same-size, same-tick edit hole that could cause a false skip.A3:
IndexViewtrait.&dyn IndexView, andIndexRoute::Localholds aStandaloneView.IndexBytes, a zero-copy wrapper overfjall::Slicetoday.rangetakesBound<&[u8]>.references_to,definition_of,bm25_stats, …) are default methods over the genericget/prefix/range/iterlayer, so a layered view inherits them. TheirIndexDbcopies are deleted.pub(in crate::index), so a read that bypasses the view does not compile.Testing
cargo testpasses: 962 lib tests and all integration targets.cargo clippy --workspace --all-targets --tests -- -D warningsis clean on default features and oncomms,code-search.cargo fmt --checkis clean.capcheck each made their new tests fail when mutated, then were restored.IndexRoute::Local.Known gaps
references/callers. A probe over a 995-file corpus showed no consistent change, but its run-to-run noise is about ±20%. The change is zero-copy by construction, at one boxed iterator per scan and one virtual call per row. A bench should land before A4.advance_stall_msis 2000. A CoW clone of the 1.7 GB armis index takes 0.36 s.max_group_bytesis auto, 4× the newest generation: about 7 GB on armis.scan_cap × 64.Also fixed
tests/cli_daemon.rsis gated oncommsonly, but it exercisesmemorymode. It therefore failed under--features comms,code-searchwithoutmemory. The memory step now runs only when that feature is built.🤖 Generated with Claude Code