research(nightly): content-defined chunking for incremental, witness-chained index checkpoints - #936
Draft
ruvnet wants to merge 3 commits into
Draft
research(nightly): content-defined chunking for incremental, witness-chained index checkpoints#936ruvnet wants to merge 3 commits into
ruvnet wants to merge 3 commits into
Conversation
…checkpoints Adds ruvector-cdc-checkpoint: a FastCDC-style gear-hash chunker, a content-addressed chunk store, and a witness hash chain (mirroring ruvector-retrieval-receipt's chaining pattern) for checkpointing a vector/graph index incrementally instead of full re-snapshotting. Benchmarked against a full-snapshot baseline and a fixed-block-chunking baseline over 30 rounds of realistic agent-memory churn: CDC writes 11.84% of fixed-block's steady-state bytes/round and 5.19% of full-snapshot's, with every checkpoint verified bit-identical through the witness chain. Includes a bounded parameter sweep over target chunk size and 15 passing unit tests. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_016YXsfxVgiEKRjgbCB3CrUN
Records the hypothesis, methodology, raw benchmark output, capability check (no ruvector-harness Darwin/Flywheel CLI installed), Darwin-lite parameter sweep, security/governance analysis, and RVF/RVM/ruFlo/MCP/WASM implications for the ruvector-cdc-checkpoint experiment. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_016YXsfxVgiEKRjgbCB3CrUN
… index Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_016YXsfxVgiEKRjgbCB3CrUN
Owner
Author
|
No fix exists to port (this is a CI-infra dependency-mirror issue, not code in this diff). Re-running once the rest of the workflow run finishes (the run is still in progress, so Generated by Claude Code |
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.
Summary
Nightly research + implementation: content-defined chunking (CDC) for incremental, witness-chained index checkpoints, addressing the fact that
ruvector-snapshot-style full re-snapshotting scales checkpoint cost with collection size instead of edit size.crates/ruvector-cdc-checkpoint: a deterministic FastCDC-style gear-hash chunker, a SHA-256-keyed content-addressed chunk store, and a witness hash chain (mirroringruvector-retrieval-receipt's domain-separated chaining pattern) over checkpoint manifests.docs/adr/ADR-340-cdc-witness-checkpoint.md— full ADR with hypothesis, decision, evidence, threat model, rejection criteria.docs/research/nightly/2026-08-27-cdc-witness-checkpoint/{README.md,gist.md}— full nightly research report and standalone public gist.Hypothesis
Result: ACCEPT — CDC hit 11.84% of fixed-block's bytes/round and 5.19% of full-snapshot's, throughput ~23x the floor, 100% reconstruction correctness (90/90 checks).
Benchmark command
Real benchmark results
cargo test -p ruvector-cdc-checkpoint: 15 passed, 0 failed.cargo clippy -p ruvector-cdc-checkpoint --all-targets: clean.Acceptance result
ACCEPT — all three hypothesis clauses held with wide margin. See the ADR's Rejection Criteria for what would falsify this at larger scale / against the real
ruvector-snapshotbinary format (not yet integrated — see Limitations).Darwin result
No
ruvector harness darwinCLI is installed in this environment (verified:npx ruvector harness doctor --json→npm error could not determine executable to run). Ran a bounded, disclosed in-crate substitute: 1 generation × 4 candidates sweeping CDC's target chunk size. Winner:avg_size=1024(fitness 0.5836) vs. theavg_size=2048used in the headline comparison (fitness 0.5109) — a real bytes-vs-chunk-count-overhead tradeoff, not free improvement. No candidate violated a hard constraint, so none were rejected.Flywheel result
No
ruvector harness flywheelCLI is installed either (same capability check). Evidence is instead retained as this PR's ADR + nightly README + raw benchmark output, per repo convention for prior nightly research (see e.g. ADR-304 /docs/research/nightly/2026-08-13-retrieval-receipts/).Security review
unsafecode. Only dependency issha2(already used byruvector-proof-gate/ruvector-retrieval-receipt).ruvector-proof-gate/ruvector-retrieval-receipt.Main limitations
ruvector-snapshot, not its actual binary layout) — integrating against the real format is the named next step.Production recommendation
Promising enough to pursue integration against
ruvector-snapshot's real format and re-measure at scale before any production adoption decision — not yet production-ready as implemented (synthetic format, unsigned commitments).Files changed
crates/ruvector-cdc-checkpoint/— new crate (chunker, store, witness chain, synthetic workload, benchmark, 15 tests)Cargo.toml/Cargo.lock— new workspace memberdocs/adr/ADR-340-cdc-witness-checkpoint.md— new ADRdocs/adr/INDEX.md— regenerated vianode scripts/adr-index.mjsdocs/research/nightly/2026-08-27-cdc-witness-checkpoint/{README.md,gist.md}— nightly research report + public gistTest plan
cargo build --release -p ruvector-cdc-checkpointcargo test -p ruvector-cdc-checkpoint(15/15 passing)cargo clippy -p ruvector-cdc-checkpoint --all-targets(clean)cargo fmt -p ruvector-cdc-checkpointcargo run --release -p ruvector-cdc-checkpoint --bin benchmark(run twice; byte/chunk metrics bit-identical across runs, confirming determinism)Generated by Claude Code