Repository navigation
perf(check): memoize helper-credit closure-callback syntax reads per run (#12947) - #13741
Conversation
…run (#12947) credit_same_file_assertion_helpers re-parsed the same test and helper bodies (passes_call_making_closure, closure_argument_positions, invoked_callback_params) in the second index build of a diff check. Route the three pure reads through the existing run-scoped syntax memo so the main index reuse skips them. Output is byte-identical. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLWvJLNTjPAkUKhsj5V
|
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 50 minutes. View limit details
|
ripr static exposure checkCommit Took 77s. |
…text and helper (#12947) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLWvJLNTjPAkUKhsj5V
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head ed198a4. An independent fresh-reviewer pass on 760e3f6 found no blocking defects. It checked that the memo key is a SHA-256 over the full text plus a length-prefixed helper name with a distinct Product per reader, that the *_uncached bodies are pure in their inputs, that the memo is thread-local and run-scoped with entries cleared at scope exit, and that memory growth is small (digest plus small value). Its one gap, which Devin also raised, was that no scoped test exercised the memo path. ed198a4 adds that test and changes no production code. The local lib-test compile was OOM-killed on the shared box, so hosted CI supplies the run.
Generated by Claude Code
|
|
# Conflicts: # crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs # crates/ripr/src/analysis/syntax/ra/closure_callbacks/tests.rs # crates/ripr/src/analysis/syntax/run_memo.rs
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head 19e6209. This is a merge of main that resolves the conflict with #13729, which memoized passes_call_making_closure upstream. The resolution keeps main's reader and its Product::CallMakingClosure, drops this PR's duplicate PassesCallMakingClosure variant, and keeps the memo wrappers for closure_argument_positions and invoked_callback_params. Both tests are kept: main's parse-count test and this PR's equality test. The merged files parse under rustfmt. The earlier independent review of the two remaining readers (key, purity, scope, memory) is unchanged. The merged tree was not compiled locally because the shared box was out of memory; hosted CI is the proof.
Generated by Claude Code
|
Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head 0fd78d1. This is a clean merge of main that brings in the module_reach_control_qualified fixture-class fix (#13773). The PR's own changes are the same as the reviewed 19e6209, and on that head the new memo test and main's parse-count test passed in the hosted Rust-only lane.
Generated by Claude Code
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head aa304e6. This is a clean merge of main that brings in the CLI reference rebless (#13811), which fixes the cli_reference_matches_the_binary failure on 0fd78d1. That failure came from main and is not in this PR's diff. The PR's own changes are the same as the reviewed heads.
Generated by Claude Code
Resolve against #13768 (process fact memo threaded through the shared batch parse), #13821 (one embed scan per file) and #13741 (closure callback memo products). The embed scan is now memoized whole; the separate directive and shadow memo products are dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLWvJLNTjPAkUKhsj5V
Governing issue or accepted claim: #12947
Acceptance delta (one sentence): The helper-credit pass's
closure_argument_positionsandinvoked_callback_paramssyntax reads are memoized per run, so the overlapping admission-core and main index builds of a diff check stop re-parsing the same test and helper bodies.Change
closure_argument_positionsandinvoked_callback_params(crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs) through the run-scoped syntax memo (run_memo), with newProductvariants. The key is a SHA-256 over the full text plus the length-prefixed helper name.passes_call_making_closure(Product::CallMakingClosure). The conflict was resolved by keeping main's version of that reader and dropping this PR's duplicate variant. This PR now adds only the two remaining readers.memoized_callback_reads_match_uncached_and_key_on_text_and_helper: it enters a memo scope twice and calls the readers repeatedly. It asserts each result equals the uncached function's. Its premises are that a changed helper name, test text or helper text gives a different answer, so a key that ignored any of them would fail.Measurement (before the merge with main, so it includes the now-upstream reader)
Warm
check --base HEAD~1on ripr-swarm, 4 alternating A/B pairs with separate warm caches. Base 0c2d378 had a median of 49.7 s and this branch 48.1 s. Second-build helper credit went from about 3.4 s to about 1.25 s. On top of #13729, the remaining gain from the two readers is smaller and not separately measured.check --format jsonwas byte-identical against base on 3 diffs (at the pre-merge head).Proof
cargo xtask precommitpassed at 760e3f6. 92 focused lib tests passed at 760e3f6.🤖 Generated with Claude Code
https://claude.ai/code/session_01UNUoLWvJLNTjPAkUKhsj5V