Repository navigation
perf(cli): skip historical cache scans on all-hit file-fact builds - #3855
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedNext included review available in 31 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head source inspection — REVIEW_INCOMPLETE
Author inspection, not independent approval. No additional actionable source finding is emitted from the inspected diff; missing execution and integration evidence still block merge-readiness.
reviewed_head_sha: 43eab94ba9dc4b2fda5a512796c042c4830bdb6c
integration_basis: dc66cecc2fd8a2217e944f13723e53dac68e8f67
candidate_tree: 5230482c3fcf1b9b6fdb3ee6dafee71fe5fb5057
changed_blob: 96d5f671473a380f568227d068dbbc92a872d80a
review_date: 2026-09-22
claim_boundary: no historical file-fact inventory when no genuine miss needs attribution
Changed surfaces and owners inspected
Complete one-file patch and original/candidate source; build_index_from_loaded_files_with_cache_and_adapters → private build_index_with_file_fact_cache; RepoFileFactCache lookup, historical envelope inventory and store owner; FileFactCacheStats including merged #3837 failure rows; retained cold/warm, invalidation, input-order, error-order, cancellation and 70-file parity fixtures; SPEC-0123 and the repository review contract.
The wrapper binds the inventory callback to the same cache used for reads/stores. Only CacheLoad::Miss initializes the optional set, and the whole lookup phase still precedes parse/store. Thus same-build writes cannot make a newly introduced file appear historically invalidated. Corrupt exact-key entries remain a distinct recompute route, not hits or ordinary misses. The FnMut counter seam has no public DTO, global state, timing assertion or output-schema effect.
Five new tests exercise actual builder control flow with real isolated caches/adapters. The warm fixture retains an older cache generation and compares current facts; mixed misses assert exactly one pre-store inventory and exactly two invalidated existing paths; corruption is forced through real envelope decoding and checked after recovery; empty and pre-cancelled controls assert zero loader calls. New simple parity fixtures do not contain test functions; their empty test-vector equality is not independent test-fact parity proof. The preserved nonempty multi-file/function/test parity fixtures must also execute.
Observed proof and CI
- Local source-only review tree: original Git blob identity matches; corrected candidate hash equals the published blob;
git diff --checksucceeds; 278 additions / 3 deletions in one file, existing tests retained. - First hosted run 35688765624, job 106621131773: synthetic merge
aca6f6991afa374f27a94b84e87ec1e0d8f330f8; Rust 1.95.0 setup succeeded, formatting failed on one assertion layout, required Rust/product evidence steps did not run. The current commit applies the exact printed correction. The failed run remains history, not a product-test pass. - Current-head run 35689112373, job 106622164874: formatting preflight succeeded, CI tool installation/cache restore succeeded, required Rust gates were in progress at inspection; PR evidence was pending. The current PR synthetic merge is
0a5f5ea141995021ff544617326f6f0f781f6706. - Current-head Security and PR Plan runs report success. Windows Advisory and Future Clippy are skipped, not platform/Clippy proof. Droid Auto Review is pending; ub-review is in progress. No independent current-head review completion has been observed.
Missing proof / blocking acceptance evidence
Native compile/test results for this exact head, the five cache_inventory tests plus retained broader build/cache/rerun parity tests, negative-control execution, completed required gates/PR evidence, applicable goldens/dogfood, rendered installed CLI cold/warm replay, and platform-relevant proof remain NOT_PROVEN. No local Cargo/rustc/rustfmt is available in this runtime. Hosted formatting success is not a Rust test result.
Focused proof:
cargo test -p ripr --lib analysis::facts::build::tests::cache_inventory -- --nocapture
cargo test -p ripr --lib analysis::facts::build::tests -- --nocapture
On a review-owned tree, challenge the oracle with eager Some(load_known_file_paths()) initialization (zero-call controls must fail), a per-miss scan (one-snapshot control must fail), and a post-store scan (new-path/pre-store control must fail). These are proposed discriminators, not executed mutation results. Retain the existing consolidated precommit/routed rail rather than creating another workflow or weakening a gate.
Currentness, residuals and disposition
The second commit changes formatting only; production, test stimulus/oracles, keys/schema and integration basis are unchanged. Required receipts must nevertheless bind the current published head. The branch ref was re-read immediately before this review and still points to the reviewed SHA.
The directory remains best-effort historical observation, not a cross-process atomic snapshot. A genuine miss still requires one whole historical inventory, and this patch does not bound cancellation during that scan. It does not repair or classify the nine historical store failures, introduce semantic-unit/base-proof reuse, establish end-to-end speedup, or qualify a release. Proposed #2766 disposition remains release_optional_pending_decision; #3795/#3796 stay open under their own acceptance.
Disposition: REVIEW_INCOMPLETE. Keep draft; no merge, auto-merge, protection bypass or release action.
Source disposition at
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
Source review from the #3796 small-edit lane — REVIEW_INCOMPLETE, not approval or native proof.
I inspected the full implementation at 4ac95015, the cache lookup/inventory/store owner, and the 43eab94b follow-up (one assertion wrapping change at build.rs:745). The new lazy set is only initialized for a true CacheLoad::Miss; corrupt entries retain their separate path. Initialization is in the lookup phase before same-build stores, so a newly introduced path is not falsely attributed as a previously cached path. All later misses share the same snapshot. I did not find a source-level semantic regression in that bounded change.
The correct claim remains narrower than incremental diff efficiency: one genuine edit still scans/reads/decodes the historical cache directory, and cancellation during that scan is not newly bounded. This is not a blocker to the declared all-hit optimization, but must remain visible in #3796 and performance interpretation.
To avoid a competing implementation, I opened test-only child #3863 using this private explicit-cache seam. It adds actual parser-entry counts and uncached facts/derived-finding parity across production edits/reverts, assertion edits, newly related tests, test addition/deletion, and a manifest edit in a 70-file physical fixture. Its current head is ce8877bda19526ad6c52af6b784e14ecee8e2f61; it is also draft and native execution is not yet proven. It does not expand this PR's acceptance claim.
Do not merge the child into this active parent branch. After this parent is accepted/merged normally, the child should be retargeted to main and qualified against its real integration base. Missing native tests/negative controls/exact-head gates still prevent my review from becoming terminal.
EffortlessSteven
left a comment
There was a problem hiding this comment.
reviewed_head_sha: 43eab94
branch_basis: dc66cec
current_main_compatibility_basis: ed4b160; analysis/facts/build.rs remains original blob ff17c677ee8f6b6af7f7d59051a81f81f54ae0a4 on current main
claim_boundary: defer the expensive historical file-fact envelope inventory until the first genuine cache miss, initialize it once before any same-build store, and preserve existing hit/miss/corruption/invalidation/fact semantics
changed_surfaces_and_semantic_owners_inspected:
- complete one-file patch in
crates/ripr/src/analysis/facts/build.rs - lookup → parse → store phase ordering and cancellation checkpoints
RepoFileFactCache::{load_file_facts,known_file_paths,store_file_facts}semanticsFileFactCacheStatshit/miss/corrupt/store/invalidation and #3837 store-failure flow- issue #3846 controls and retained broader builder tests
- current protected-main #3839 change, which touches a separate test-grip evidence subsystem
blocking_source_findings: none
correctness review:
- only
CacheLoad::Missconsults historical paths before and after this patch.Hitnever used the set;CorruptIgnoredremains a distinct recompute path withcorrupt_ignored += 1, no miss or invalidation attribution. - every lookup still completes before phase-2 parsing and phase-3 storage. The first miss therefore captures one pre-store snapshot; later misses reuse it, and a newly introduced path cannot become historically invalidated through this build's own writes.
- exact-key reads, input-order pending entries, parallel parse ordering, first-error behavior, store/failure rows, index insertion, include resolution and workspace/package authority are unchanged.
- an already-cancelled invocation now reaches the existing first-loop checkpoint before any directory scan. Empty, all-hit and corrupt-only builds never invoke the loader.
- the injected loader is private and production binds it to the same
RepoFileFactCache; it does not add public DTO, environment state, cache identity, output or schema surface. - the cache directory remains a best-effort cross-process observation. Delaying the snapshot can widen the external-writer race window, but does not create a false fact hit or alter same-process currentness; only invalidation telemetry can reflect a concurrently completed valid historical envelope.
oracle challenge:
- the warm fixture retains both old and current content generations, then proves zero inventory calls and current file/function/test parity.
- the mixed fixture forces three misses plus one hit, asserts one loader call, proves the snapshot precedes stores, marks only the two historical changed paths invalidated and excludes the new path.
- the corrupt fixture damages the exact envelope, proves corrupt-not-miss accounting, zero inventory, fact recovery and a subsequent valid hit.
- empty and pre-cancelled fixtures prove the shortcut is not hidden behind later parsing.
- eager initialization fails the zero-call controls; per-miss initialization fails the one-call control; a post-store snapshot fails the explicit new-path assertion. The test seam therefore distinguishes the material wrong implementations without timing thresholds.
- the new simple warm fixture has no nonempty test facts, but the complete retained builder suite still owns multi-file/function/test ordering and parity; hosted execution must cover it.
proof_observed_at_this_head:
- Security: success
- PR Plan: success
- formatting preflight: success
- current routed Rust job is executing Required Rust gates
proof_pending:
- terminal current-head Required Rust gates and PR evidence
- current
ub-reviewand Droid review - a current-main synthetic merge/check after main advanced to ed4b160
- negative-control mutations are designed but not reported as executed
- no installed CLI work/latency receipt or native Windows result is established
residual_assumptions_and_non_claims:
- genuine misses still pay one full historical inventory and cancellation during that scan is not bounded
- no semantic-unit reuse, exact-base proof, cache-store failure diagnosis, or end-to-end speedup is claimed
- branch remains draft and release-optional pending the governing controller
disposition: SOURCE_REVIEW_COMPLETE__KEEP_DRAFT_PENDING_CURRENT_MAIN_AND_HOSTED_PROOF
…3863) * test(cache): replay real small edits against uncached facts and findings Refs #3796. Add five test-only edit controls over an isolated 70-file workspace using #3855's explicit-cache builder seam. Count primary parser calls; preserve fresh uncached facts and derived finding parity. No production behavior change relative to #3855. Native Rust proof remains NOT_PROVEN in this connector environment. * style(cache): apply hosted formatter corrections to edit replay tests Apply the five whitespace-only rustfmt hunks from run 35689636923, job 106623729286. Required Rust tests were skipped at the failed formatting preflight; native execution is still NOT_PROVEN. Refs #3863, #3796.
04b70cf to
d6b9780
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- artifact-verifier sensor failed (exit 2); cargo-test sensor receipt absent at gate time. PR body marks REVIEW_INCOMPLETE and explicitly states Rust unit tests, negative controls, cargo fmt --check at new head, and required hosted gates did not run. Trust-affecting missing execution evidence blocks merge-readiness independent of test design quality.
- crates/ripr/src/analysis/facts/build.rs:293 — Test
cache_inventory_skips_empty_buildpasses an empty files slice but still constructs adapter/fallback closures that count inventory. Acceptable as written; however the assertion that empty builds must skip inventory holds only because no Miss arm fires. Document this invariant at the test site to prevent future refactors that introduce a default inventory.
Verification questions
- Confirm negative-control mutations (eager init, per-miss inventory, post-store snapshot) declared in PR body have not been retained; PR body notes 'these mutations have not been executed here'. All three must fail on the new code; without retention the lazy claim is under-evidenced.
- Confirm incremental_edit_tests.rs asserts 'used_lexical_fallback' is false on all owner facts, which would fail under a regression where the primary RaRustSyntaxAdapter path silently falls back; the control couples test oracle to adapter behavior.
- Confirm new incremental_edit_tests.rs duplicates fixture/RAII/manifest patterns from build.rs and uses a second warm build as oracle in a comment-only line; reviewer must confirm no test actually calls build_index twice for parity.
- Confirm sibling-path coverage for cache.known_file_paths was checked only inside the two changed files; a crate-wide grep was not executed by this lane, so the 'no other call site exists' claim is local. Acceptable because the change is private, but reviewers should verify with
rg known_file_paths crates/riprbefore merge.
Refuted
- Lazy inventory causes a second inventory call when the first miss triggers a parse failure before store, because the Option is re-initialized.; refuted because: Option::get_or_insert_with memoizes via the captured &mut Option; once initialized it stays Some across all subsequent Miss arms and all hit arms. Inventory closure is FnMut and called at most once per build.
Parked follow-ups
- Test-only child referenced as #3863 in seeded thread is not in this PR; seam here is the public-but-private helper signature, which is duplicated-by-design for the bounded seam and is not exported outside the module.
Evidence gaps
- cargo-test evidence is receipt-absent (scheduled-late) and artifact-verifier failed (exit 2). Required Rust native test execution for the five new builder tests and incremental_edit_tests is unproven in this packet; PR body explicitly flags REVIEW_INCOMPLETE.
- PR body lists negative-control mutations (eager Some(load_known_file_paths()), per-miss, post-store) that have not been executed; existing tests alone cannot prove the assertions would fail under those mutations.
- Model proof intent was rejected by deterministic validation.
Review — head d6b9780 (rebuilt on current main)Surfaces. What this PR does. Skips historical cache scans when a file-fact build is already all-hit — removes a cold-path O(historical) scan from the hot CLI path (#3846). Stimulus/oracle. Perf tests pin the all-hit path issues no historical scan (instrumented counter), and the partial/miss path still scans so facts stay complete. Validation. Ripr Rust Small Result: SUCCESS on d6b9780. Disposition: REVIEW_READY. |
Goal and scope
Refs #3846. Bounded CLI-efficiency follow-up under #3794; preserves #1424 /
docs/specs/RIPR-SPEC-0123-targeted-rerun.mdinvalidation semantics.Draft —
REVIEW_INCOMPLETE; native Rust test execution isNOT_PROVEN.Proposed release disposition:
release_optional_pending_decisionunder #2766. This is not a replacement controller or a new mandatory blocker. It does not close #3795 or #3796.Exact candidate
Only
crates/ripr/src/analysis/facts/build.rschanges: 278 insertions / 3 deletions, primarily five regression tests and an isolated-cache fixture. The second commit applies the exact single-assertion formatting correction printed by hosted rustfmt; production and test semantics are unchanged from implementation commit4ac95015cb038ba22121e2747c46f9118c79385f.Production behavior
Previously every cached build called
RepoFileFactCache::known_file_pathsbefore the first cancellation checkpoint. That walks the historical cache directory and reads/decodes every eligible envelope, even though only actualCacheLoad::Misscases use the path set.The candidate initializes that set on the first real miss and reuses it for later misses. Initialization remains in the lookup phase, before this build parses or stores any facts. All-hit, corrupt-only, empty and already-cancelled builds avoid this inventory. Exact-key cache reads, corruption handling, stats, parse/store order and #3837 store-failure rows remain on the existing path.
Single acceptance criterion: eliminate historical inventory work when no real miss needs attribution, without changing cached facts or miss/invalidation meaning.
Evidence delta and oracle challenge
Five new actual-builder tests use real isolated file-fact caches and Rust syntax adapters:
The loader is private and production always binds it to the same cache instance. Counting observes real builder control flow, not source-text matches or machine-specific timing. Fixture cleanup is RAII-owned and does not mutate process environment or ambient
RIPR_CACHE_DIR. The existing nonempty multi-file/function/test parity and ordering fixtures are preserved.Negative-control execution remains required: temporarily initialize the optional inventory eagerly with
Some(load_known_file_paths())on a review-owned tree; the zero-inventory controls must fail. A per-miss inventory must fail the one-snapshot control; a post-store snapshot must not pass the new-path/pre-store checks. These mutations have not been executed here.Validation provenance
Observed locally: the reconstructed original file hashes to the original blob above; the published corrected candidate blob equals the locally inspected candidate;
git diff --checkpassed in a review-owned source-only tree; one-file scope and all existing tests are retained.Observed hosted failure and repair: run 35688765624, job 106621131773, checked synthetic merge
aca6f6991afa374f27a94b84e87ec1e0d8f330f8(implementation head4ac95015into basedc66cecc). Rust 1.95.0 setup succeeded;cargo fmt --checkfailed solely on assertion wrapping atbuild.rs:745. Required Rust gates and PR evidence did not run. Commit43eab94bapplies that exact correction, without rerunning a known-bad head or changing a gate. New-head checks must supply the terminal result; this is not yet a formatting-pass claim.Not run / not established: Rust compilation, Clippy, unit tests, eager/per-miss/post-store negative controls, precommit, goldens/dogfood, required hosted-gate completion, installed CLI replay, Windows/Linux runtime proof and end-to-end latency. This local runtime has no Cargo/rustc/rustfmt and direct GitHub checkout fails DNS resolution. Source/diff inspection and hosted toolchain setup are not native product-test evidence.
Focused next proof:
Then existing cache/rerun tests and
cargo xtask precommit, applicablegoldens check/dogfood, and normal routed Rust gates. Use the existing consolidated rail rather than repeatedly rebuilding an uncoordinated command inventory. Keep this draft until exact-head proof and substantive published-head review are terminal.Candidate source review
Inspected the complete changed blob and source diff, cache lookup/inventory/store owner, retained corruption and failure-row flow, original warm/invalidation/parity/order tests, SPEC-0123 and repository review rules. The source keeps initialization before same-build stores, requires exact-key hits and preserves corruption as a separate outcome. Test counters are scoped to the test callback; no telemetry or public DTO is added.
Missing execution proof and rendered CLI/runtime review prevent
REVIEW_READY. This inspection does not assert a clean integrated or released artifact.Non-claims and rollback
No cache-key/schema, output-contract, analyzer-classification, dependency, workflow, process-owner, threshold, source-sync, tag, publication or protection change. No absolute-root identity or secret exposure is added.
This only removes one category of redundant file-fact cache work. Runs with real misses still take one historical inventory. In particular, the historical warm run with nine store failures is not fixed or causally classified by this PR. Semantic-unit reuse, exact base proofs and whole-repository evidence costs remain #3795/#3796 work. No wall-clock speedup or release readiness is claimed. Cancellation during a genuine historical scan is not newly bounded.
Rollback: revert this focused optimization; the preceding eager inventory and existing cache semantics return. No data migration is needed.