Repository navigation
perf(check): walk a per-file node list in the macro-binding site scan - #10248
Conversation
…#9794) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QpthemXVhr2eDVUDseqUKd
|
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 17 minutes. View limit details
Comment |
|
Independent exact-head source/runtime receipt for #10248 No actionable source defect found in the per-file node-list slice. This is focused local proof; disposition remains REVIEW_INCOMPLETE for hosted/combined-tree qualification. Subject (re-read unchanged before this receipt):
Inspected: both changed files; collect/scan/helpers; union/singleton queries; caller path attachment and retained-site selection. All reactive kinds are retained in descendant order, including Rename/Module/UseTree for namespace/drop-in shadowing, MacroRules/MacroDef, Attr/Use/ExternCrate/MacroCall, and TokenTree for nested calls. Unknown-parse handling precedes collection and is unchanged. The lists belong to one parse, with no path-keyed sharing. Executed with installed Rust/Cargo 1.95.0, PATH prefix
Proof-only local trees: instrumented Limits/next action: no cold/warm CLI byte-parity, RSS, wall-time, full-suite, hosted checkout, required-gate completeness or current combined-tree qualification is claimed. PR-body timings remain reported observations, and #9794's 2 s target remains unmet. The canonical delivery owner should consume this focused proof, reconcile the current integration subject and existing qualification receipts, and address only any concrete remaining delta before normal qualification. No dispatch, Ready, merge, release or protection action was taken. |
There was a problem hiding this comment.
Verification questions
- Confirm the former full-tree scans are narrowed to site_nodes and call_nodes, so equivalence depends on the new kind allowlist covering every node consumed by macro_binding_sites_in_tree.
- Confirm security-relevant import, rename, extern-crate, macro, and attribute paths remain represented in site_nodes; missing kinds could silently weaken binding analysis.
- Confirm the changelog claims byte-identical findings, but the PR-reported validation is from a separate cargo-pin run rather than a differential test proving equivalence of the selected node lists.
- Confirm the performance claim that findings remain byte-identical depends on preserving source order in both cached lists; the diff collects nodes during one descendants() traversal, which appears order-preserving.
- Confirm the new site_nodes list is manually restricted to EXTERN_CRATE, RENAME, MODULE, USE_TREE, MACRO_RULES, MACRO_DEF, ATTR, USE, and MACRO_CALL, while the old scan considered every descendant and dispatched by AST casts.
- Confirm the new site-node filter may omit extern-crate alias nodes if their AST kind is not among the explicitly matched kinds.
- Confirm the changed implementation has no focused test proving equivalence between the old descendants-based scans and the curated site_nodes/call_nodes traversal.
Refuted
- The failed cargo-test proves this performance refactor breaks existing behavior.; refuted because: The PR identifies the sole failure as environment-dependent and reproducing on main, so it is not evidence that this diff changed behavior; the actual cargo-test receipt remains pending.
- The cached SyntaxNode values may create a worker/async/GC lifetime or ownership hazard.; refuted because: No worker, async, JS, GC, detach, or transfer boundary exists in the changed path. The nodes are owned by BindingFreeFileIndex and consumed synchronously while its source tree remains available.
Evidence gaps
- The ripr sensor failed with exit code 2, and the late cargo-test receipt was not included in the provided packet, leaving executable confirmation of behavior and ordering pending.
- The PR provides only indirect evidence for the behavioral claim: byte-identical findings are reported in the body, while cargo-test evidence is late and one lib test fails for an environment-dependent reason.
- Model proof intent was rejected by deterministic validation.
…9794) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QpthemXVhr2eDVUDseqUKd
|
Review of record, head Angles:
Own proof: Measurement (cargo pin, 4 paired warm runs, shared container): wall 3.8–4.25 s to 3.16–3.67 s, CPU 7.5–8.1 s to 6.05–6.9 s, RSS 133–135 MB to 134–141 MB. The 2 s target is not met by this PR. Gemini and CodeRabbit reported quota limits, so their review is missing, not clean. Marking ready and requesting the required check. 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! |
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm the explicit SyntaxKind allowlist creates a maintenance coupling: adding a new dispatch arm to macro_binding_sites_in_tree without updating BindingFreeFileIndex would silently exclude it.
Refuted
- The per-file node lists may behave like a stale or detached active view after the backing syntax tree changes.; refuted because: Each retained item is an owned SyntaxNode clone collected from the tree being indexed, and this diff introduces no mutation, resizing, detachment, transfer, or cached length operation for those vectors.
- Collecting cloned SyntaxNode values could cross a JS worker handoff or require unsafe/GC ownership handling.; refuted because: The changed surface is Rust syntax analysis only. No worker handoff, JS object, asynchronous capture, GC, detach, or transfer operation is introduced or modified; ordinary Rust clone/drop semantics apply.
- Moving the site scan to a selected node list changes its architectural scope or duplicates the existing uses index.; refuted because: site_nodes is a distinct reactive-node stream; uses remains a specialized UseTree collection used by plain_import_names, with no competing ownership of the binding scan.
- The optimization could create a denial-of-service or unbounded-work regression through repeated AST traversal or hidden state.; refuted because: The change replaces repeated full descendants() scans with per-file vectors populated during one traversal; the lists are bounded by the source tree and are consumed by the existing bounded scans.
Evidence gaps
- The full behavioral oracle remains partially dependent on pending or failed evidence, so the lane cannot independently certify repository-wide equivalence.
- Model proof intent was rejected by deterministic validation.
- The changelog's byte-identical and approximately 13% performance claims are not independently substantiated by the supplied receipts because the ripr sensor failed.
|
CI note on Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QpthemXVhr2eDVUDseqUKd
Summary
The macro-binding site scan walked every syntax node of a file once per queried name set (the union query, then one per looked-up name), plus further full walks for the call fixpoint,
drop_in_shadowedandplain_import_names. Every check in those loops is a node-kind cast, so other nodes are no-ops.BindingFreeFileIndex::collect, which already walks each tree once, now also records the relevant nodes in source order (site_nodes,call_nodes); the scan iterates those lists. Order is preserved, so output is identical by construction.Measurement (cargo pin f3865b2a,
ripr check --base 0c38e943 --mode draft, 4 paired warm runs, shared container)cmp). Not at the 2 s target; hosted nightly numbers follow on perf(check): cargo's pinned commit warm-checks in 3.5 s; 2,813 parses for 873 distinct sources and 1,118 module-tree scans for 765 #9794.Governing issue or accepted claim: #9794 (warm check on cargo's pinned commit toward 2 s)
Acceptance delta (one sentence): Cuts the macro-binding scan's tree walks to one per file, about 13% faster warm check on the cargo pin with identical findings; the 2 s target is still open.
Test plan
cargo test -p ripr --lib: 14154 passed, 1 failed (fallible_literal_full_and_compact_warm_caches_invalidate_changed_inputs, env-dependent, also fails on main).cargo xtask precommitpasses.use foreign::serde_json;inliteral_json_namespace_in_another_source_file_stays_uncredited; droppingUSE_TREEfrom the recorded kinds makes it fail.🤖 Generated with Claude Code
https://claude.ai/code/session_01QpthemXVhr2eDVUDseqUKd