Repository navigation
perf(analysis): release review source corpus before evidence - #5132
Conversation
Preserve independent ordered flat and per-file memberships, occurrence identity, role divergences, cache wire shape and borrowed generation lifetimes. Add ownership, equality, compaction and cancellation discriminators while migrating readers and test fixtures. Focused diagnostic proof passes 67 selected controls, including intended checkpoint-removal and shared-role-overwrite failures followed by restored green. Full pinned native qualification and matched optimized workload measurements remain required.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (54)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
REVIEW_INCOMPLETE — suitable for draft publication; no actionable source or oracle findings. Independent review is bound to head d9a324e, tree d2ed838b6f06f5a4c386f6b35ff357e4d84cdd3b, parent 4253.
All required selections, counts, cache identity and index facts own their data before the early drop. Neither streamed nor non-streamed consumers use state afterward. The test observes actual construction and destruction, preserves Send/Sync, reaches real evidence construction, and checks complete fallible ordinal/classification serialization plus cold/warm cache counts.
Exact-commit execution passed both affected controls. Deleting only the drop failed with 2,097,272 bytes retained, after cold/warm output comparisons; exact restoration passed both controls again. Twelve matched production runs and six full-output pairs establish 4.9% and 4.3% median RSS reductions on the two exact historical subjects. Small median elapsed increases are disclosed; no speedup is claimed.
The completed Rust-only hosted lane ran on merge checkout 391218f, whose tree equals the reviewed d2ed838b tree. It passed 7,044 tests with 2 ignored across 31 summaries; the library had 6,500 passed and 1 ignored. The completed default hosted lane passed 10,923 tests with 2 skipped across 34 binaries, strict workspace/all-target Clippy, required preflight, doctests (2 passed, 1 ignored), goldens, fixture contracts and PR evidence. Fresh JUnit artifact 11264872023 is bound to that same merge checkout/tree. All-feature proof remains incomplete.
This is partial #4996, not bounded per-file ingestion or release qualification. Frozen #5109 and separately owned #5062 remain unchanged. The author records COMMENT because this disposition is not approval or merge readiness.
Automatic UB review run 37095936343 completed in advisory mode: analysis_result=limited and terminal_status=needs-reviewer-attention, with no validated inline findings and artifact-only publication. Its RIPR sensor refused an 854-file scope above the configured 800-file cap, and its cargo-test sensor timed out after 900s. Artifact 11264019500 retains the actual disposition; workflow success is not full review qualification. The separate Droid review still awaits a self-hosted runner.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Verdict: sound.
Verified:
- The only production delta is one
drop(state)ininventory_diff_scoped_classified_seams_innerafter the index build; everything the rest of the function touches (workspace_cache_key,total_rust_files,production_files,cached, file sets) is extracted before the drop, and post-dropstateuse would be a compile error, so no reachable path can observe the early release. - The corpus release sits upstream of both the streamed and non-streamed classification branches, so both evidence paths get it; the test exercises the streamed path on cold and warm cache with exact count/cache-key/serialization parity.
- The lifetime control is a genuine behavioral discriminator: the PR body records a removal experiment where deleting only
drop(state)failed with raw bytes still live at evidence construction (behavioral, not compile, failure). - Test-only probe is
#[cfg(test)]with a thread-local observer and lease underflow assertion; no production surface, schema, or output change. Required checks green.
Residuals:
observe_evidence_boundaryis only wired into the streamed classifier; the non-streamed path gets no live-bytes observation point (control coverage asymmetry only, not a correctness gap).- Governing issue #4996 remains partial per the body; the bounded key pass and miss-only fact pass are out of scope here, so this should not close #4996.
Resolve conflicts with main's property-macro quarantine (#5051) and parser-backed classifier test fixtures: - thread FileFacts::unresolved_property_macros through the generation-owned FileData, its expanded serialization and owned_file round trip so the new field keeps its wire shape; - port main's owner_pin, oracles and classifier test helper to the borrowed files()/insert_file authority; - union both sides of .ripr/traceability.toml. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y
The merged #5051 field travels through the hand-written FileFactsView serializer, which a compiler cannot force to stay complete. Add a parser-backed control that the view, whole-index wire, decoded index and owned_file round trip all preserve unresolved_property_macros. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y
…e-4996 Carry the #5109 merge with origin/main (property-macro witness threading and its control) into this stacked successor. No conflicts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y
EffortlessSteven
left a comment
There was a problem hiding this comment.
Review of exact head d9a324eb42e5775197690076c7c9d8c9fa894a1b (self-authored PR, COMMENT only).
Findings
No blocking source or oracle defect found.
- Non-blocking: coverage of the shared-path claim. The production change is one
drop(state)ininventory_diff_scoped_classified_seams_inner. The body says it covers both streamed and non-streamed classification. The new teststreamed_review_releases_raw_source_before_evidence_on_cold_and_warm_cacheonly enters throughinventory_diff_scoped_streamed_seams_at_with_config. The non-streamed consumer of the same producer is not observed. Consider also observing it, or narrowing the claim. - Non-blocking: probe scope.
source_lifetime_probeis thread-local and the evidence boundary hook is called once, atclassify_scoped_seams_streamedentry. That proves the raw buffers are gone when evidence starts, as the PR claims. It does not show that nothing else (cache key, index) re-retains the corpus later. The body states this limit. - Stack dependency. The PR is stacked on #5109, which is currently
CONFLICTINGwith main (see that PR). This head cannot merge until #5109 is resolved and this branch is retargeted or restacked.
Surfaces inspected
analysis/seam_inventory.rs: the drop(state) placement relative to the cache key and index use, OwnedWorkspaceState, the cfg(test) lease and observer, and the new test.
Oracle challenge:
- Removing
drop(state)makes live bytes at the evidence boundary equal the 2 MiB of source, so theall(|b| *b == 0)assertion fails. The body records that experiment (2,097,272 bytes live). I take the claim as plausible from the diff and did not re-run it. - Fixture quality: nonempty seams and related tests, exact file and cache counts, and serialized cold/warm parity.
Validation observed
All completed checks at this head are SUCCESS or SKIPPED, including Routed Rust Small and Rust-only. droid-review is still QUEUED (from 2026-10-03T04:15Z, so apparently stuck). The memory delta is 4–5% RSS with no speedup claimed, and the body says so honestly.
Missing evidence
Droid review, all-feature qualification (the body marks it NOT_ESTABLISHED), and the prerequisite's own readiness.
Disposition
REVIEW_INCOMPLETE: the substantive review is clean, but the draft is stacked on unready #5109 and the automated review has not completed. Nothing merged, pushed, or resolved.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Confirmed findings
- Non-streamed
inventory_diff_scoped_classified_seams_innerconsumer is not covered by the new probe; shared producer gives high confidence but the claim is not directly observed. Already disclosed by author. - Two Mutex locks in source_lifetime_probe use .unwrap_or_else(PoisonError::into_inner), which silently masks a poisoned mutex from a panicking prior test. Within this test no panic occurs between locks, but across-suite reuse could let one failing test silently corrupt another's counts. Advisory only; not a blocker for this PR.
- Probe coverage is asymmetric: production delta covers both streamed and non-streamed branches via shared producer, but the live-bytes observer is only wired into the streamed branch. The PR body's 'shared by streamed and non-streamed' claim is true at the source level and unverified at the observation level.
- Lease::drop underflows assert
state.live_bytes >= *bytesbut does not assert it equals 0 at evidence boundary; the live-bytes==0 invariant is only checked via evidence_boundaries, which is sound but couples two assertions.
Verification questions
- Confirm non-streamed consumer of inventory_diff_scoped_classified_seams_inner not directly observed by new test.
- Confirm probe scope is single-shot at classify_scoped_seams_streamed entry; non-streamed consumer of the same producer is not observed. This is a coverage gap on the active-view invariant for the non-streamed path, not an active-view bug.
- Confirm observe_evidence_boundary is wired only into classify_scoped_seams_streamed; the non-streamed consumer of the same producer is not observed, so the PR's 'shared by streamed and non-streamed classification' claim is structurally unobserved.
- Confirm non-streamed classification branch shares the producer but the new test only exercises the streamed entry point; the body claims shared-path coverage that the test does not observe on the non-streamed side.
- Confirm cold/warm loop runs back-to-back over the same tempdir without resetting the on-disk file-fact cache between iterations, so the warm-iteration assertions rest on whatever state the cold run persisted; a focused cache reset or distinct roots would tighten the proof.
Refuted
- The early drop(state) is unsafe because post-drop code could still read state fields.; refuted because: All needed values (workspace_cache_key, total_rust_files, production_files, file sets, harness_registrations, cached.file_fact_cache) are extracted into owned locals before drop. Build_index takes &state and finishes before drop; trace_latency_phase, file_fact_cache access, and selection logic after drop take only owned locals. Post-drop use of state is unreachable in a clean compile. Removal experiment in PR body (drop-only deletion → 2,097,272 bytes live) confirms the change is a behavioral discriminator, not a no-op.
- Lease attachment via #[cfg(test)] field on OwnedWorkspaceState changes the struct layout and could leak into public API or serde.; refuted because: The field is gated by #[cfg(test)] so it does not exist in non-test builds; serde derives on the struct are not touched in this diff and the type has no Serialize impl referenced here; PR body explicitly states no public schema, output format, golden, dependency, process or network surface changes.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Published-head review for b02c8710887f5718ac96c35ea2a67e869b37303e. This is a clean merge of the updated #5109 head b8f1b6e9, which includes origin/main. There were no conflicts in seam_inventory.rs.
I re-checked the production delta, a single drop(state) in inventory_diff_scoped_classified_seams_inner, against current main's version of the function. Nothing after the drop reads state; a later read would not compile anyway. The test lease field is declared last in OwnedWorkspaceState, so it is destroyed after the files buffers. That means the live-bytes observation stays a real discriminator.
Hosted on this head: Routed Rust Small / Rust gates passed, as did Ripr Rust Small Result, the Rust-only feature lane, the wheel/Python journeys and cargo-deny. No review threads. The Perl/all-feature lane is label-gated and was skipped. I could not run the local streamed_ controls to completion: the compile timed out on a shared, overloaded host, which is an infrastructure limit. The hosted runs execute them.
The non-blocking residual from earlier review still stands: the evidence boundary probe covers only the streamed path. #4996 remains partial, so this PR should not close it.
Disposition: no blocking findings. Ready once #5109 merges; the PR will then retarget to main.
Generated by Claude Code
Resolves add/add conflicts left by the squash merges of #5109 and #5132: main's index.rs, index_tests.rs and RIPR-SPEC-0153 equal the #5132 head, so the branch side applies. traceability.toml takes main and re-applies this PR's two RIPR-SPEC-0153 mappings. Net delta against main equals b02c871..bc9a480. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y
…#4996) Main moved under this PR (bounded batches #5029, corpus-warning accounting #4888, non-UTF-8 disclosure, index finalize/memberships, #5132 source lifetime probe), so the streaming path no longer compiled. - The streaming builder now reuses main's batch loop and finalization instead of a private copy: `insert_cached_file_batches` takes an iterator of batches, fed from the loaded corpus or from on-demand per-batch reads. Corrupt-entry warnings, non-UTF-8 sources, cancellation checkpoints and workspace authority stay identical on both paths. - Post-parse phases are shared (`post_process_cached_index`), so the loaded and streaming builders cannot drift. - The streaming oracle test compares the whole serialized index against the loaded build, not counts. - The #5132 lifetime probe charges the folded byte total for the state's lifetime, so it still proves the state is gone before evidence. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y
The streaming inventory hashes every file in one read and builds file facts from a second read. A file edited between the two reads stored classified, compact and count entries under the first read's key with facts from the second read's bytes. - RepoFileFactCacheKey::content_hash exposes the per-file digest, and FilesContentHashBuilder::push_digest folds it with output identical to push(path, bytes). - insert_cached_file_batches folds (file, digest) in input order and CachedRustIndex carries the result as files_content_hash. - OwnedWorkspaceState::build_index, now used by all five inventory callers (full, compact, review scope, targeted rerun, grip counts), refuses a build whose folded hash differs from the state's hash, so nothing is stored or returned as complete. - StreamedBatch owns each streamed read. Test builds charge its bytes to a thread-local live/high-water counter and to the #5132 source lifetime probe, which now measures real raw-source lifetime instead of a byte total charged to a state that owns no bytes. - The streaming fixture gains ~2 MiB of padding spread over 200 files and a non-UTF-8 source. New tests pin the one-batch live-byte bound, digest-fold equivalence, and refusal of a between-pass edit on every caller, with an unmoved control. - hash_str/hash_bytes are private again; the streaming builder doc no longer claims identical checkpoint granularity. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y
…ct builds (#4996) (#5220) * perf(analysis): stream workspace source bytes through bounded file-fact builds (#4996) Replace the retained Vec<(PathBuf, Vec<u8>)> corpus with sorted paths plus an incrementally folded files_content_hash, and build file facts from 64-file on-demand read batches. Peak live source bytes now scale with one batch plus owned facts instead of the whole corpus, while hash, cache keys, stats, same-phase error precedence, and cancellation granularity stay identical. One disclosed delta: the loaded path reads every file before parsing any, so a later-file read error beats an earlier-file parse error; here an earlier chunk resolves fully before a later chunk is read. Both orders fail closed; no consumer branches on which error wins. Tests pin the streaming path to the legacy oracle: hash/key equality, order independence, cold-miss/warm-hit sharing, identical seam identities, and fail-closed unreadable input. * fix(analysis): port streaming file-fact builds onto main's batch loop (#4996) Main moved under this PR (bounded batches #5029, corpus-warning accounting #4888, non-UTF-8 disclosure, index finalize/memberships, #5132 source lifetime probe), so the streaming path no longer compiled. - The streaming builder now reuses main's batch loop and finalization instead of a private copy: `insert_cached_file_batches` takes an iterator of batches, fed from the loaded corpus or from on-demand per-batch reads. Corrupt-entry warnings, non-UTF-8 sources, cancellation checkpoints and workspace authority stay identical on both paths. - Post-parse phases are shared (`post_process_cached_index`), so the loaded and streaming builders cannot drift. - The streaming oracle test compares the whole serialized index against the loaded build, not counts. - The #5132 lifetime probe charges the folded byte total for the state's lifetime, so it still proves the state is gone before evidence. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y * fix(analysis): refuse moved input between hash and index reads (#4996) The streaming inventory hashes every file in one read and builds file facts from a second read. A file edited between the two reads stored classified, compact and count entries under the first read's key with facts from the second read's bytes. - RepoFileFactCacheKey::content_hash exposes the per-file digest, and FilesContentHashBuilder::push_digest folds it with output identical to push(path, bytes). - insert_cached_file_batches folds (file, digest) in input order and CachedRustIndex carries the result as files_content_hash. - OwnedWorkspaceState::build_index, now used by all five inventory callers (full, compact, review scope, targeted rerun, grip counts), refuses a build whose folded hash differs from the state's hash, so nothing is stored or returned as complete. - StreamedBatch owns each streamed read. Test builds charge its bytes to a thread-local live/high-water counter and to the #5132 source lifetime probe, which now measures real raw-source lifetime instead of a byte total charged to a state that owns no bytes. - The streaming fixture gains ~2 MiB of padding spread over 200 files and a non-UTF-8 source. New tests pin the one-batch live-byte bound, digest-fold equivalence, and refusal of a between-pass edit on every caller, with an unmoved control. - hash_str/hash_bytes are private again; the streaming builder doc no longer claims identical checkpoint granularity. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y --------- Co-authored-by: Muse Code <muse@example.com> Co-authored-by: Claude <noreply@anthropic.com>
Summary
Diff-scoped review analysis retains the complete raw source corpus after the owned Rust index has been built. Release that corpus before seam inventory and evidence preparation. The index, cache identity, selections and counts already own their required data.
Swarm / Source Boundary
Ordinary analyzer development in
EffortlessMetrics/ripr-swarm; no release, credential, workflow or packaging changes.Source-of-truth Links
Governing issue: #4996, partial delivery. Its bounded key pass and miss-only fact pass remain outstanding.
Acceptance delta: the review producer destroys its raw corpus before downstream evidence construction on cold and warm file-fact paths.
Candidate Relationships
Candidate branch:
perf/release-review-source-4996.Exact head:
d9a324eb42e5775197690076c7c9d8c9fa894a1b; treed2ed838b6f06f5a4c386f6b35ff357e4d84cdd3b.Stack prerequisite: #5109 at frozen
4253c7456eb570940b54adf5834a9aed2eb208d8.This is a follow-on, with no proposed replacement of #5109 or #5030. It does not alter #5062. It is outside the current frozen release qualification boundary.
Scope Classification
Production delta: one early
drop(state)in the common diff-scoped review producer, shared by streamed and non-streamed classification. Cancellation checkpoints, index authority, cache keys, ordering, selection and omission accounting retain their existing behavior.Evidence delta: a test-only constructor/destructor lease and invocation-scoped observer exercise the real producer. The lease preserves test-build
Send/Syncand records destruction after the actual raw buffers have dropped. The control requires nonempty seams and related-test evidence, exact file/cache/count expectations, and fallible complete(ordinal, ClassifiedSeam)serialization parity across cold/warm runs.Non-goals: bounded source ingestion during indexing; canonical bounded seam collection; function/test-body sharing or string interning; context import-line filtering; completing #4996; release membership or integration.
Support-tier Impact / Policy Impact
No public schema, output format, golden, dependency, process or network surface changes.
Proof
Pinned Rust
1.95.0, Linux/WSL, exact committed source:cargo test --locked -p ripr --lib --no-default-features --features lang-rust analysis::seam_inventory::tests::streamed_ -- --nocapture cargo xtask check-fastdrop(state): the lifetime control failed with 2,097,272 raw bytes live at evidence construction, after both cold/warm semantic comparisons completed. This was a behavioral failure, not a compile failure.check-fastpassed all 13 selected gates, including strictcargo clippy --workspace --all-targets -- -D warnings; fixture contracts were explicitly skipped by the selector. Independent selector inspection succeeded. The selector usesorigin/mainand includes the prerequisite changes; the incremental parent-to-head delta is one source file.Matching production release build completed with Rust1.95, the lockfile, default shipped language features and the same release profile/flags as frozen4253. The executable reports exact head
d9a324eb42e5775197690076c7c9d8c9fa894a1b; SHA2564b98d96b4e9f3ebc54dd997b42e15afc751c9cfeeb1fea0277ebf0847a7ad95d. Reference4253 binary SHA256 is1d966022db903ff80fddb921ae7e30cff6238f9aa1c7eb73fefd52bb7a58fa18.Twelve cold runs completed: three interleaved pairs per exact historical workload, same host/toolchain/profile/lock/environment. Fixed base
6823f7f698053621b5330526d3c162d7a381e352; original subject998bbbd4bc9cf6fbe31730f22c53a7337b3332d0, later subject3a6a363a05fc0625aa07d64b9ab7d6e9dea680ef.All six successor runs used less peak RSS than their paired reference. All twelve receipts are complete and atomically committed with no observer intervention; each has zero cache hits and 4,333 misses, zero corrupt entries/store errors, 1,481 production files, 52,692 indexed test facts (not executed tests), 578 considered seams, and 229,752 unevaluated seams. Each exact subject retained its own changed-line/owner counts. Every paired Markdown is byte-identical; complete JSON comparisons differ only at
/run_receipt/completed_artifacts/{0,1}, the two output destinations. Index cap4342, inner timeout120000ms, outer130s/3GiB RSS/1GiB host-availability guards were unchanged.This establishes an incremental memory improvement on these workloads. Median elapsed increased slightly; no speedup is claimed. Three pairs per workload do not establish universal scaling or a latency regression bound.
Hosted default qualification completed successfully in run
37095936550: repository preflight, workspace/all-target check, strict Clippy, normal nextest 10,923 passed, 2 skipped across34 binaries, doctests 2 passed, 1 ignored, goldens, fixtures and PR evidence. Fresh nextest artifact 11264872023 includes JUnit SHA25642340d5e9d464887ab3de67e82843e66aa206aa395a0c64a94ba6a8effd81b94and run-context; native exit0 and nonzero counts were verified. The two skipped nextest tests are excluded from the JUnit executed-test count.Rust-only run
37095936255also completed successfully: 7,044 passed, 2 ignored across31 summaries, with 6,500 passed and1 ignored in the library. Both routes actually checked out CI merge391218fb51937c2822dbeed02c3b55957592eb7a, parents4253 andd9a324eb, whose tree is exactlyd2ed838b6f06f5a4c386f6b35ff357e4d84cdd3b. Features and counts are bound to that execution, not imported from the prerequisite's older CI merge.All-feature qualification remains NOT_ESTABLISHED; the automatic Perl/release lane is explicitly skipped. The prerequisite's separately owned all-feature qualification remains incomplete. This follow-on remains draft and outside the frozen release boundary.
Claim Boundary
The test observes this container's raw-source ownership lifetime before streamed evidence construction. It does not measure every escaped allocation or allocator capacity. The historical corpus contains 88,916,856 selected raw source bytes; the separate production experiments measure the RSS improvement above. Remaining peak is about1.6GiB, and representation-level attribution remains under investigation.
The complete corpus is still read and retained during index construction. #4996 remains open; its bounded per-file ingestion, warm classified-cache and between-pass movement controls are not supplied here.
Rollback
Revert this single successor commit while retaining #5109. No cache/schema migration or output promotion is required.
Spec-Test-Code Traceability
streamed_review_releases_raw_source_before_evidence_on_cold_and_warm_cacheand existing streamed-window cancellation/evidence control.analysis/seam_inventory.rs, common diff-scoped inventory producer.Static Language Check / CI Economics / Engineering Check
Gates
Passed locally: formatting, static language, command catalog, no-panic family, allow attributes, file policy, strict workspace/all-target Clippy, covered-by, process policy, network policy, generated, generated-clean and lint policy; focused controls as detailed above.
Full workspace tests, docs, package and fixture/golden qualification await the actual dispatched remote route. This draft must not merge on the local checks alone.