Skip to content

test(evidence): repair main's lib-test compile after #5062 + #5109 - #5237

Closed
EffortlessSteven wants to merge 1 commit into
mainfrom
claude/pr-sweep-pr6jvr
Closed

EffortlessSteven wants to merge 1 commit into
mainfrom
claude/pr-sweep-pr6jvr

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Before: ripr lib tests on main (a5499a612) fail to compile. #5062 added retained_import_lines_preserve_unbounded_affinity_and_owner_matching, which builds RustIndex { tests, functions, .. } and calls index.files.insert / index.tests.first_mut(). #5109 turned those fields into generation-owned arenas behind accessors. Each PR was green on its own base; the combined tree fails with E0560/E0615/E0616 at related_tests/context.rs:578-595. Every PR's CI on the current base (for example #5137's Rust-only lane) now fails the same way.

After: the fixture is built through the arena API (extend_tests, extend_functions, insert_file_only), and the flat test body is rewritten through test_at_mut(0). The flat facts remain occurrences separate from the file copy, as in the original fixture, so the test's stimulus and assertions are unchanged.

Swarm / Source Boundary

  • Ordinary analyzer development in ripr-swarm; test-only.

Source-of-truth Links

Combined-tree interaction of #5062 (da7f8f70a) and #5109 (42944cc5b).

Candidate Relationships

Branch claude/pr-sweep-pr6jvr. No equivalent open PR (this breakage appeared at the #5109 merge, 01:37Z).

Scope

crates/ripr/src/analysis/test_grip_evidence/related_tests/context.rs, one test fixture.

Scope Classification

  • Test-only. Production delta: none.

Support-tier Impact

None.

Policy Impact

None.

Proof

cargo fmt --check -p ripr
cargo test --locked -p ripr --lib --no-default-features --features lang-rust related_tests::context::
  • Before (main + perf(index): consume cached facts in bounded batches (#5029) #5030 merged locally, same config): could not compile ripr (lib test), 4 errors at context.rs:578, 579, 582, 595.
  • After: lib test target compiles; 7 passed, 0 failed, including the repaired test.
  • Default-feature and full hosted gates: pending on this head.

Claim Boundary

Restores compilation and the original fixture semantics. Makes no change to the import-line filter or the arenas.

Rollback

Revert the single commit (main returns to not compiling lib tests).

Spec-Test-Code Traceability

Test name unchanged; existing traceability mappings stay valid.

Static Language Check

  • No output change.

CI Economics

n/a.

Engineering Check

  • No new panic/unwrap/expect; no new process or network surface.

Gates

Hosted routed gates on this head.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y


Generated by Claude Code

#5062 added retained_import_lines_preserve_unbounded_affinity_and_owner_matching,
which constructs RustIndex from its public tests/functions/files fields.
#5109 made those fields generation-owned arenas behind accessors. Each PR
was green on its own base; together, main's ripr lib tests no longer
compile (E0560/E0615/E0616 at related_tests/context.rs:578-595).

Build the fixture with extend_tests/extend_functions plus insert_file_only,
which keeps the flat facts as occurrences separate from the file copy, as
the original fixture had, and rewrite the flat test through test_at_mut.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ae2a6572-55fd-40ce-bf3f-ea3f0456d213
📥 Commits

Reviewing files that changed from the base of the PR and between a5499a6 and e7547c8.

📒 Files selected for processing (1)
  • crates/ripr/src/analysis/test_grip_evidence/related_tests/context.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.


Summary by CodeRabbit

  • Tests
    • Updated test fixture setup to use the index’s supported APIs and verify parsed test access.

Walkthrough

The test fixture now builds and accesses RustIndex data through its methods instead of directly initializing or mutating its collections.

Changes

RustIndex fixture updates

Layer / File(s) Summary
Populate and update fixture test data
crates/ripr/src/analysis/test_grip_evidence/related_tests/context.rs
The fixture uses extend_tests, extend_functions, and insert_file_only to build the index. It checks tests through tests() and updates the first test body through test_at_mut(0).

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to e7547

This test-fixture-only change preserves the intended separation of index facts and updates the test through the index API. No actionable merge risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to e7547

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/ripr/src/analysis/test_grip_evidence/related_tests/context.rs: The fixture replaces direct RustIndex field initialization and file-map insertion with the index’s extension and file-insertion methods; the new comment distinguishes flat test/function facts from the file copy.
  • observed — Modified behavior in crates/ripr/src/analysis/test_grip_evidence/related_tests/context.rs: The fixture now checks index.tests() for an empty test list and replaces the first test body through test_at_mut(0), instead of accessing and mutating the test collection directly.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the test-only compile repair and names the changes that caused the failure.
Description check ✅ Passed The description covers the summary, scope, source-of-truth context, candidate relationship, proof, claim boundary, rollback, and relevant policy impacts. It also reports which checks passed and which …
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the index with care
It adds test facts and functions there
A file goes in, the list is shown
The first test’s body gets its own
Then hops away, the fixture’s done.

Comment @coderabbitai help to get the list of available commands.

EffortlessSteven pushed a commit that referenced this pull request Oct 4, 2026
#5062 added retained_import_lines_preserve_unbounded_affinity_and_owner_matching,
which constructs RustIndex from its public tests/functions/files fields.
#5109 made those fields generation-owned arenas behind accessors. Each PR
was green on its own base; together, main's ripr lib tests no longer
compile (E0560/E0615/E0616 at related_tests/context.rs:578-595).

Build the fixture with extend_tests/extend_functions plus insert_file_only,
which keeps the flat facts as occurrences separate from the file copy, as
the original fixture had, and rewrite the flat test through test_at_mut.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y
EffortlessSteven pushed a commit that referenced this pull request Oct 4, 2026
Main at a5499a6 does not compile the lib tests: #5062's
candidate_index_tests builds RustIndex through fields #5109 made
private. Same change as #5237; it no-ops once main carries it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLvEwsc6Dj9jfN6iLLxSzu
EffortlessSteven pushed a commit that referenced this pull request Oct 4, 2026
main at a5499a6 does not compile lib tests (#5062 + #5109 interaction).
This ports #5237's one-file fixture change unchanged; it no-ops once
main carries #5237.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • crates/ripr/src/analysis/test_grip_evidence/related_tests/context.rs:580 — The empty-tests guard now uses index.tests().is_empty() then unconditionally calls test_at_mut(0). With is_empty() false, index 0 is safe, but the guard duplicates the accessor boundary; consider mirroring via the accessor set rather than re-checking.
  • Pre-merge hosted gates (default-feature and full hosted) are still pending on this head per PR body; the architectural repair is sound but downstream coverage is not yet in receipts.

Verification questions

  • Confirm no non-test sibling RustIndex { tests, functions, .. } struct-literal constructions remain in crates/ripr/src that would re-introduce the same E0560/E0615/E0616 breakage under the post-#5109 arena boundary.
  • Confirm pR body claims default-feature and full hosted gates are pending on this head; the 7-passed-0-failed proof is scoped to --no-default-features --features lang-rust only. Full hosted gate (default features, integration tests) remains unverified in this PR.

Refuted

  • Using test_at_mut(0).body = body.to_string() could panic if the arena is empty after the previous body's processing emptied it, leaving the test unable to be re-mutated across the loop iterations.; refuted because: Loop invariant preserves a parsed test: index.tests().is_empty() guard at top of each iteration returns Err early; otherwise test_at_mut(0) targets the same flat test the loop just rewrote. No panic path introduced.
  • Fix should be larger and patch the arena API or the import-line filter to avoid this kind of breakage.; refuted because: Out of scope; the breakage is a test-fixture interaction of two prior PRs and the stated scope is test-only, one file. Authoring a cross-cutting change would violate smallest-complete-fix and the PR's claim boundary.
  • Rewriting through test_at_mut(0) might mutate the file copy stored via insert_file_only, causing the later full_lines comparison or owner/affinity assertions to see the rewritten body in the file path as well.; refuted because: extend_tests owns the flat occurrence list; insert_file_only stores the file copy in a separate arena slot; test_at_mut returns a mutable reference only to the occurrence entry. The pre-#5109 code also mutated only the occurrence (tests.first_mut()), so the fixture's stimulus (which reads the file copy or the occurrence) is unchanged. The PR body's claim that 'flat facts remain occurrences separate from the file copy' matches the arena contract.

Parked follow-ups

  • ripr sensor failed with exit 2; on a test-only fixture repair the failure is unlikely to be caused by this change but cross-lane impact (correctness/opposition) should confirm the failure predates the PR base.

Evidence gaps

  • Late cargo-test receipt is scheduled and not yet present in this packet; its absence is not a missing-evidence concern per base-packet rules but is a precondition for the '7 passed' claim to be re-verified on the review head.
  • Model proof intent was rejected by deterministic validation.
  • cargo-test receipt is scheduled-late and not yet observed; PR body claims 7 passed, 0 failed, but no sensor evidence is present in this packet beyond tokmd and ast-grep.

EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
Allocate file-local function membership ID vectors at the number of functions instead of reusing the consumed fact-sized buffer.

Also carries #5237's test-fixture repair: #5062's import-line test built RustIndex from fields that #5109 made private, which broke main's ripr lib-test compile.

Copy link
Copy Markdown
Member Author

Closing as delivered elsewhere: the identical change was ported into #5137, whose full CI went green on c7a4f34d3, and it landed on main in 0de79411c. Main's ripr lib tests compile again. This PR's diff would now be empty.


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed_head_sha: e7547c8
integration_basis: Hosted checkout 742639c has parents a5499a6 + reviewed head, and tree 7e33e9d4e25916c74349777897e39aba7d8505e1, identical to the candidate tree. Current main e18ff4a adds only the unrelated CLI capped-child coverage repair; latest composition is source-compatible, not claimed executed by the earlier run.
claim_boundary: Restore compilation and the existing retained-import-line fixture after the #5062/#5109 composition. Production index, import-line filtering and classification semantics are unchanged.

changed_surfaces_and_semantic_owners_inspected:

  • Complete one-file delta in crates/ripr/src/analysis/test_grip_evidence/related_tests/context.rs, including the original fixture and assertions.
  • Generation-owned RustIndex APIs for extend_tests, extend_functions, insert_file_only and test_at_mut.
  • Flat and file-copy occurrences remain independent as in the original fixture; changing the flat test body preserves the intended counterfactual.
  • Existing cardinality and fixture construction make the indexed mutation valid. Current accessor-style suggestion is optional, not a correctness defect.

blocking_findings: none
non_blocking_suggestions: none required for this scope
refuted_or_stale_findings:

  • Panic/alias concerns are refuted by the actual fixture population and index API semantics.
  • The earlier missing hosted proof is now available on this exact subject.
  • The current-main baseline failure is a lib-test API compilation failure, not a newly reproduced profraw corruption. It is retained separately under #4978.

proof_and_ci_observed:

  • Required run 37169009813, attempt 1: worker 111337981142 and aggregate Result 111342973530 are SUCCESS.
  • All-target checking, strict Clippy, full required tests, doctests, goldens, fixture contracts and PR evidence passed. Raw checkout output and artifact run-context bind the exact merge above with Rust/Cargo 1.95.0 and nextest 0.9.146.
  • Artifact 11291395350 independently verified: 298,363 bytes, SHA256 1544e9ba1b3183a84cc8459b6360e237572bed314a003ffb9a316061ba4e7610. JUnit has 11,454 executed passes, zero failures/errors; native nextest separately reports two skipped. Doctests report two passed and one ignored.
  • All seven owning related_tests::context tests executed and passed, including retained_import_lines_preserve_unbounded_affinity_and_owner_matching.
  • The Rust-only lane also completed successfully; the full required artifact supplies the default-workspace proof.
  • The unmodified incoming-main failure is independently observed in coverage job 111341097605: E0560/E0615/E0616 at context.rs lines 578, 579, 582 and 595 before tests. The repair directly addresses those API uses.

proof_or_review_missing: None for this narrow fixture migration. Public docs/settings designate Ripr Rust Small Result as the protected context and Droid as advisory; classic protection remains unreadable to this integration, so normal server enforcement remains authoritative.
residual_assumptions_and_non_claims: No production behavior, performance, coverage-percentage, installed-client or release claim. This fixes the compilation prerequisite; current-main llvm-cov completion remains separately tracked by #4978.
disposition: REVIEW_READY

EffortlessSteven pushed a commit that referenced this pull request Oct 4, 2026
#5109 moved test and function facts into generation-owned arenas.
Helper credit now reads through the index views and writes each stored
test record once with for_each_test_mut, then finalize runs as on main.
Also carries #5237's repair of main's lib-test build (#5062 + #5109),
which no-ops once that PR lands.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cb4RWMP5e2XRNrucJAKi3s
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
…keep ownerless reach weak (#4574, #4601, #4613) (#4715)

Merged under Steven's standing authorization: "We merge on review and convergence by LLM, not on manual meat routing" and "you already have explicit authorization by me".

Exact head fe848cb: all 35 CI checks green or skipped (Rust gates, Rust Small Result, feature lane). An independent exact-head review of 927c106 was ready with no blocking findings. Since then the diff is that review's recommended nested-fn guard (44abf45, CI green) and a main merge that ports helper credit to the #5109 fact arena and carries #5237's lib-test build fix. Local precommit, analysis tests, goldens, fixtures and clippy pass. CodeRabbit had no actionable comments on 927c106 and paused after that. Gemini, Devin and droid review are missing, not clean.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cb4RWMP5e2XRNrucJAKi3s
EffortlessSteven pushed a commit that referenced this pull request Oct 4, 2026
Takes main's related_tests/context.rs, which already carries the
compile repair this branch ported from #5237.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLvEwsc6Dj9jfN6iLLxSzu
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
…ummary with one command (#5236)

* ci(init): install the prebuilt ripr release instead of compiling it

`ripr init --ci github` wrote a workflow that set up a Rust toolchain and
Swatinem/rust-cache, then ran `cargo install ripr` on every pull request.
The install step now downloads the pinned release's prebuilt archive from
EffortlessMetrics/ripr GitHub Releases and checks it against the
release's published SHA-256. A checksum mismatch fails the step; a runner
with no prebuilt archive (Windows) or a failed download falls back to the
same pinned `cargo install`, which `ripr doctor` still reads for version
drift.

The workflow also points RIPR_CACHE_DIR outside the checkout and
restores it with actions/cache, so later pushes to a pull request reuse
the content-keyed facts of unchanged files. The checked-in artifact
cleanup no longer has a cache restore to guard against.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLvEwsc6Dj9jfN6iLLxSzu

* test(grip): port #5237 fix for main's RustIndex test compile break

Main at a5499a6 does not compile the lib tests: #5062's
candidate_index_tests builds RustIndex through fields #5109 made
private. Same change as #5237; it no-ops once main carries it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLvEwsc6Dj9jfN6iLLxSzu

* ci(init): pin the generated workflow's actions/cache to a commit SHA

The job holds a token with write scopes, so the cache action is pinned
to v6.1.0's commit rather than the mutable v6 tag.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLvEwsc6Dj9jfN6iLLxSzu

* Render the CI advisory summary with `ripr reports ci-summary`

The generated workflow's "Add RIPR advisory summary" step was 1,266
lines of inline bash and jq. It is now one `ripr reports ci-summary`
call that reads the same target/ripr and target/ci artifacts and prints
the same Markdown, so the generated workflow drops from 2,407 to 1,154
lines and the summary can be rendered locally.

The renderer models the jq behaviors the bash relied on (failing `//`
operands, per-value input streams, raw pretty-printing) and the bash
path rewriting, and matched the bash byte for byte on the replay corpus
and on fuzzed artifacts apart from object key order inside scalar
fields, which real artifacts do not produce.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLvEwsc6Dj9jfN6iLLxSzu

---------

Co-authored-by: Claude <noreply@anthropic.com>
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
…os (#5230)

* perf(pilot): extend the cold-run deadline instead of restarting

When the default 30s pilot deadline passed, pilot cancelled the analysis
and started a fresh one with a 240s budget. A cancelled attempt leaves
nothing the restart reuses, so every cold run redid its first 30s.
The deadline now extends on the same run; an explicit --timeout-ms is
still a hard limit. The timeout hint scales from the budget actually
spent.

serde cold pilot: 75s -> 44s, identical pilot-summary.json.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* perf(evidence): parse each file once for new-test placement

New-test-target admission ran per seam, and for every inline-unit
candidate it parsed the seam's whole file twice (governed cfg(test)
modules, then the owner's module path) and hashed it once. On files
with hundreds of seams that dominated cold `ripr pilot`: 71% of serde's
cold run was in these parses.

The evidence pass now keeps a per-file layout (governed modules, every
function's production module path by start line, source digest) built
from one parse. Admission answers are unchanged; the pilot artifacts
are byte-identical on serde, ripgrep and regex.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* docs(changelog): record cold pilot speedup

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* fix(lint): name the inline-unit layout and keep checkpoint errors

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* perf(check): scan workspace macro bindings on the rayon pool

Owner-pin admission collects shadowed assertion-macro bindings by
parsing every workspace file once per run. On a warm one-line `ripr
check` of ripr-swarm that scan was 37% of samples. Files are
independent and the answer is a set, so the scan now runs in parallel.

Warm check, ripr-swarm, 4 cores, three runs each: 7.4-7.8s -> 5.5-5.7s;
human and JSON output byte-identical. Peak RSS rises about 130 MB.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* fix(pilot): keep an explicit --timeout-ms 30000 a hard limit

The extension keyed on the timeout value equalling the default, so a
typed `--timeout-ms 30000` still ran for up to 270s. Pilot now records
whether --timeout-ms was given and extends only an omitted default.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* test(evidence): port #5237's lib-test compile repair

main at a5499a6 does not compile lib tests (#5062 + #5109 interaction).
This ports #5237's one-file fixture change unchanged; it no-ops once
main carries #5237.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* perf(owner-pin): stop the macro-binding scan once every trusted name is ambiguous

One foreign glob import, `#[macro_use]` or unparsable file already makes
every trusted macro ambiguous, so the scan reads files that can do that
first and skips the rest once the set is full. The union is unchanged;
a workspace without such a file is still scanned completely. Warm one-line
`ripr check` of ripr-swarm: 7.5s to 4.2s (8.0s to 4.4s on two cores) vs
main, byte-identical output on serde, ripgrep, regex and ripr.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* perf(seams): resolve seam owners with one sorted pass per file

Seam inventory called find_owner_function per probe shape, which scans
every function in the file, so a file with n functions cost O(n^2). On a
generated 200k-function file pilot exhausted its 270s budget inside that
loop, which has no cancellation checkpoint, so a hard deadline waited out
the scan. FileOwnerLookup sorts a file's functions once and walks back
from the last one starting at or before the line, with the same answer
and tie rule as find_owner_function. Pilot on that file now completes in
112s, and --timeout-ms 20000 returns in 21s.

Also qualifies the changelog's byte-identity claim (output path
normalized) and records the timeout-path summary and explicit
--timeout-ms 30000 behavior changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

---------

Co-authored-by: Claude <noreply@anthropic.com>
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
… index (#5331)

* perf(pilot): extend the cold-run deadline instead of restarting

When the default 30s pilot deadline passed, pilot cancelled the analysis
and started a fresh one with a 240s budget. A cancelled attempt leaves
nothing the restart reuses, so every cold run redid its first 30s.
The deadline now extends on the same run; an explicit --timeout-ms is
still a hard limit. The timeout hint scales from the budget actually
spent.

serde cold pilot: 75s -> 44s, identical pilot-summary.json.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* perf(evidence): parse each file once for new-test placement

New-test-target admission ran per seam, and for every inline-unit
candidate it parsed the seam's whole file twice (governed cfg(test)
modules, then the owner's module path) and hashed it once. On files
with hundreds of seams that dominated cold `ripr pilot`: 71% of serde's
cold run was in these parses.

The evidence pass now keeps a per-file layout (governed modules, every
function's production module path by start line, source digest) built
from one parse. Admission answers are unchanged; the pilot artifacts
are byte-identical on serde, ripgrep and regex.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* docs(changelog): record cold pilot speedup

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* fix(lint): name the inline-unit layout and keep checkpoint errors

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* perf(check): scan workspace macro bindings on the rayon pool

Owner-pin admission collects shadowed assertion-macro bindings by
parsing every workspace file once per run. On a warm one-line `ripr
check` of ripr-swarm that scan was 37% of samples. Files are
independent and the answer is a set, so the scan now runs in parallel.

Warm check, ripr-swarm, 4 cores, three runs each: 7.4-7.8s -> 5.5-5.7s;
human and JSON output byte-identical. Peak RSS rises about 130 MB.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* fix(pilot): keep an explicit --timeout-ms 30000 a hard limit

The extension keyed on the timeout value equalling the default, so a
typed `--timeout-ms 30000` still ran for up to 270s. Pilot now records
whether --timeout-ms was given and extends only an omitted default.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* test(evidence): port #5237's lib-test compile repair

main at a5499a6 does not compile lib tests (#5062 + #5109 interaction).
This ports #5237's one-file fixture change unchanged; it no-ops once
main carries #5237.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* perf(owner-pin): stop the macro-binding scan once every trusted name is ambiguous

One foreign glob import, `#[macro_use]` or unparsable file already makes
every trusted macro ambiguous, so the scan reads files that can do that
first and skips the rest once the set is full. The union is unchanged;
a workspace without such a file is still scanned completely. Warm one-line
`ripr check` of ripr-swarm: 7.5s to 4.2s (8.0s to 4.4s on two cores) vs
main, byte-identical output on serde, ripgrep, regex and ripr.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* perf(evidence): parallelize the seam evidence pass and stop re-walking test trees

Cold pilot spent most of its time in EvidencePass::evidence_for on one
thread. Inside it, owner-result inspection re-walked each related test
file's whole syntax tree and rebuilt its line index once per seam and
test, and per-test activation re-derived the seam's owner argument
selection.

- owner_result_binding: ParsedTestFile keeps the parse, line index and
  a (name, fn-token line) lookup per file, built once per window.
- activation: the owner argument selection is resolved once per seam and
  passed to per-test ranking and value collection.
- EvidencePass::evidence_for runs seams on the rayon pool. Workers
  inherit the caller's cancellation token and committed-source overlay.
  CompactGripContext memos move from RefCell to Mutex (and the inline
  unit layout memo from Rc to Arc) so the context is Sync.
- witness::retain_classified_seams runs its per-seam check on the pool.

Output is unchanged: the evidence vector is still sorted by seam id and
every memo is keyed and deterministic.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FSmcn7AKdUDsgSeXmn1VaP

* test(evidence): read memos through the Sync lock helper; return the fixture guard

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FSmcn7AKdUDsgSeXmn1VaP

* style(evidence): use is_multiple_of for the progress chunk check

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FSmcn7AKdUDsgSeXmn1VaP

* perf(index): parse only test files, in parallel, when crediting assertion helpers

credit_same_file_assertion_helpers parsed every indexed file serially to
build module item scopes, but the scopes are only read for files that
hold a test. It was a third of a warm draft-mode check on ripr-swarm.
Only test files are parsed now, on the rayon pool; the scopes for those
files are the same, so crediting is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FSmcn7AKdUDsgSeXmn1VaP

* perf(reach): build the reach graph once per run and sweep backwards from each owner

find_transitive_witness rebuilt the test list and the name-keyed function
index for every no_static_path finding, then ran a forward breadth-first
walk from every non-macro callee of every test. Common callee names fan
out across the whole call graph, so large workspaces spent minutes there.

TransitiveReachIndex now builds the tests, the function index and the
reversed non-macro call edges once per run, on first use. Each finding
runs one reverse walk from its owner, up to the same five hops, and a
test callee reaches the owner exactly when it is in that set. Witness
selection is unchanged (the same sorted 4-tuple).

The macro-reach fallback reuses the shared index and returns early when
no macro_rules! body in the index names the owner, which every macro edge
requires.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FSmcn7AKdUDsgSeXmn1VaP

* perf(seams): resolve seam owners with one sorted pass per file

Seam inventory called find_owner_function per probe shape, which scans
every function in the file, so a file with n functions cost O(n^2). On a
generated 200k-function file pilot exhausted its 270s budget inside that
loop, which has no cancellation checkpoint, so a hard deadline waited out
the scan. FileOwnerLookup sorts a file's functions once and walks back
from the last one starting at or before the line, with the same answer
and tie rule as find_owner_function. Pilot on that file now completes in
112s, and --timeout-ms 20000 returns in 21s.

Also qualifies the changelog's byte-identity claim (output path
normalized) and records the timeout-path summary and explicit
--timeout-ms 30000 behavior changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjYXaPkHZaMptadCHGAnz3

* docs(changelog): record the evidence-pass, helper-credit and reach speedups

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FSmcn7AKdUDsgSeXmn1VaP

* perf(evidence): resolve seam owners and fixture names once per file

Every seam resolved its owner through find_owner_function, which scans
the file's whole function list, several times (evidence, ranking, both
new-test-target admissions), and re-filtered that list for fixture
names. CompactGripContext now keeps #5230's FileOwnerLookup per seam
file and the fixture-name set per owner file. The observed-argument and
boundary-operand helpers take the resolved owner instead of
re-resolving it and comparing names.

Cold pilot on a generated crate with 200,000 functions in src/lib.rs:
415.5s -> 20.0s, artifacts byte-identical. serde, ripgrep and regex
artifacts remain identical.

The cancellation-inheritance test now installs the token on the test
thread, which is not a rayon worker, so every seam runs on a thread
without the thread-local.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FSmcn7AKdUDsgSeXmn1VaP

* test(evidence): build the pass before the cancellation scopes

The cancellation-inheritance test called evidence_for_seams inside the
token scope, so a cancelled token failed the context build and the pass
returned nothing before any worker ran. The test passed even with token
propagation removed. The pass is now built outside both scopes; with
propagation removed the test fails ("cancelled pass evaluated 16 seams
on rayon workers").

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FSmcn7AKdUDsgSeXmn1VaP

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants