Repository navigation
perf(rust): build the oracle declaration table once per file - #10469
Conversation
The table cache compared the whole file against its stored copy for every assertion, so a very large test file cost quadratic time (4 MB cold: 35 s). Callers now build the table once per file and pass it in. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
|
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 reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 19 minutes. View limit details
Comment |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
Review of record, head 17b9971Two independent read-only agent reviewers on the diff against main, each from a different angle. CodeRabbit and Gemini are out of quota, so there is no provider review on this head. Correctness and verdict neutrality: no findings. For each call site the new table is built from the same string the old code passed as Tests and performance: one finding, resolved. The replacement test checked verdicts only, so a per-function or per-assertion rebuild would have passed CI. I had hit exactly that regression in an earlier draft of this branch: the 1 MB cold run took 40 s. Resolved in 17b9971: a test-only counter on Noted, not changed: the table is now built for every Rust file, including files with no assertions, where the old code built it lazily. It is one linear pass. The per-function re-parse build is bounded by the function text. Evidence:
Not run locally: the full workspace tests and hosted qualification. Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…n that needs it (#10363) A file without assertions no longer pays the masking pass. Adapter tests now also pin that assertions read the file's own enum and that an assertion-free file builds no table. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
|
Required run 40237228303 on 17b9971 failed in I am about to push a follow-up commit that answers two Devin findings (lazy table construction, and classification assertions in the adapter tests). That push starts a fresh required run, so I am not re-dispatching this one. Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the displayed patch differs from the reviewed head described in the seeded thread, which already says LazyDecls and classification assertions landed in fadca31.
- Confirm the seeded thread reports a required Rust gate failure in an unrelated TypeScript timing test and says the remaining 16,640 nextest cases did not run.
Refuted
- The parser's function-local reparse path should reuse the whole-file declaration table, but this would broaden scope incorrectly.; refuted because: The uncached reparse path represents a function-only source and intentionally constructs a separate function-scoped table; this preserves prior scope semantics.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- The performance claim is supported by source-route mechanics, but independent executable proof is still pending after the ripr sensor failure.
- The local sensor packet does not contain a completed cargo-test receipt, so the stated verdict-neutrality and adapter regressions are not independently witnessed in this review.
Review of record, head d96d6d4 (supersedes the 17b9971 review)Since 17b9971: Exact-head evidence: Merging under merge authority. Generated by Claude Code |
Summary
A very large Rust test file made
ripr checkcost quadratic time. The assertion classifier cached its declaration table by comparing the whole file against a stored copy on every assertion, so each assertion paid a full-file memcmp. Ten of ten cold gdb samples on a 4 MB file sat in that comparison. The parser and lexical paths now build the table once per file and pass it in;classify_assertion_inis test-only.Release build, cold
ripr checkon generated single-file crates: 1 MB 39.8 s before (this branch's first attempt, which rebuilt per function) and now 2.6 s; 2 MB 5.5 s; 4 MB 34.9 s before and now 10.8 s. Scaling is linear. The remaining cost is the cold fact build and is not addressed here.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: none
Spec: none; verdict-neutral performance change
ADR: none
Plan item: experience tracker #9278
Governing issue or accepted claim: #10363
Acceptance delta (one sentence): Cold analysis of a very large single test file scales linearly instead of quadratically, with identical verdicts.
Candidate Relationships
Candidate branch: claude/rust-test-file-release-10363
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): single candidate
Scope
LocalDecls; callers insyntax/ra.rs,syntax/lexical.rsandoracles/scan.rsbuild it per file.Proof
cargo test -p ripr --lib -- oracles syntax: 496 passed.cargo xtask precommit: exit 0.Generated by Claude Code