Repository navigation
fix(rust): a boolean assert! in a dead context no longer credits a return-value finding (#10389) - #10445
Conversation
…turn-value finding (#10389) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
…e reworded repair-route line (combined-tree drift on main) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
|
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 13 minutes. View limit details
Comment |
|
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
…son macros in plain #[test] tests (#10389) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
… cache scans; update SPEC-0197 (#10389) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
…e of the name exists (#10389) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
…check passes on main (#10444 and #10426 crossed) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
…edit (#10389) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
|
Review of record for head cc78c4e (diff since the first review: 4 commits). Angles, each by an independent reviewer agent plus my own checks:
Open bot threads: graphite unary-not, devin spec, devin perf (fixed, replied); devin fixture-compilability (not changed, replied). Ceiling unchanged. Merging after required CI is green on this head. Generated by Claude Code |
… to its use (#10389) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes
There was a problem hiding this comment.
Confirmed findings
- The import parser accepts any tree beginning with the crate path and containing the macro name, so a valid grouped import is rejected while a path such as float_cmp::approx_eq::other may be accepted.
Verification questions
- Confirm the integration matrix discriminates dead versus live assertion contexts, but it does not exercise a cfg-gated import of an otherwise known comparison macro.
- Confirm the integration fixture imports float_cmp::approx_eq without declaring float-cmp, so the positive path is analyzer-only and cannot prove the macro import or invocation is valid Rust.
- Confirm the macro-provenance oracle treats any same-named
macro_rules!in the workspace as disqualifying, without testing that an unrelated macro in another file withholds credit as intended.
Refuted
- The change introduces an unsafe worker handoff or JavaScript-backed lifetime crossing that requires detach/GC analysis.; refuted because: The diff contains no JavaScript runtime, worker handoff, GC-managed handle, native pointer, detach operation, or transfer boundary; it only updates Rust source-analysis state.
- A stale backing-store view could make a cached macro import or definition set disagree with the source currently being classified.; refuted because: The changed values are memoized immutable BTreeSet snapshots scoped to a file or index; there is no mutable backing buffer, resize operation, detach, or transfer that could invalidate them.
- The changed corpus rows indicate that the fix broadly grants return-value credit.; refuted because: The rows instead move to limited/static_unknown classifications, consistent with withholding credit where rstest matrices or seeded loops are not established as running.
- The active-view lane found no changed ArrayBuffer, TypedArray, slice, allocation, or ownership-transfer surface relevant to resizable buffers.
- The seeded review already established that the focused tests and corpus checks passed, so no oracle review is needed.; refuted because: Rejected as a permission to skip review, not as proof of oracle quality: the prior review addresses false credit and performance objections but does not close the uncovered import-provenance variants.
Evidence gaps
- Final runtime verification is pending because the ripr sensor failed and the scheduled cargo-test receipt was not included in the supplied packet.
- The two moved corpus rows are recorded as changed_since_labeling and one is abstained, so corpus consistency does not independently establish unchanged false-verdict behavior.
- Model proof intent was rejected by deterministic validation.
Summary
Before: a boolean
assert!/debug_assert!in a context that never runs (afterreturn, uncalled fn or closure,if false, impossible match arm,cfg!(any())) still credited a return-value finding. #10404 left that cell as a skip in the 264-row matrix.After: the return family takes the same execution admission as the equality family for
assert/debug_assert, and the matrix no longer skips the cell.Why #10389 saw 6 corpus rows move:
assert!(approx_eq!(f64, ..))nests a macro in its operand, which the admission reads asMacroOperandExit("may leave the test"). That refusal is an unresolved macro, not a dead context. The gate keeps the old return-family credit for that refusal only when all of these hold: the test carries only a plain#[test]attribute; the operand holds no exit token (return,break,continue,yield,?); and every nested macro is a known pure comparison (approx_eq!fromfloat_cmp;relative_eq!,abs_diff_eq!,ulps_eq!fromapprox), imported by name from its crate in the test file, with no localmacro_rules!of that name. Every other refusal, and every other nested macro, withholds the credit. A second review found the first version of the carve-out let a localmacro_rules!that returns, and non-#[test]attributes, slip through; both are now covered by tests.Source-of-truth Links
Governing issue or accepted claim: #10389 (residual of #8983)
Acceptance delta (one sentence): Dead-context boolean assertions no longer credit return-value findings, and the matrix cell is no longer skipped.
Scope
classify/owner_pin.rs: addReturnValueto theassert/debug_assertarm; the nested-macro carve-out (operand_holds_exit_token,nested_macros_are_known_comparisons).tests/dead_context_assertion_admission.rs: drop the skip; add a test for live/exit/dead/local-macro/attribute nested-macro operands.missed_credit_ceilingis unchanged (both rows arepartially_discriminated), so this does not enter the ceiling queue.Moved rows (Rust corpus)
lib-rstest-values-matrix-relationalweakly_exposed)#[rstest]with a#[values]matrix is not established as running (the equality family already refuses it;rstest_runs_bodydocuments it)idiom-seeded-loop-relational-boundweakly_exposed)Both are within the case's acceptable verdicts (
gap,limited); Rust false verdicts stay 3 (3/675 after main's new cases).Proof
Claim Boundary
May claim: a boolean
assert!/debug_assert!in a context ripr shows is dead (or otherwise not established) no longer credits a return-value finding, and a nested macro keeps credit only when it is a known pure comparison macro in a plain#[test]. Must not claim: that other nested macros (unknown, unresolved, user-defined) are proven to run; they now withhold credit. Module-levelcfggating around such tests is not separately tested. Establishing arbitrary macros (the issue's fuller fix) is left open.Rollback
Revert the squash commit; two corpus rows return to their previous blessed state.
Spec-Test-Code Traceability
crates/ripr/tests/dead_context_assertion_admission.rscrates/ripr/src/analysis/classify/owner_pin.rs🤖 Generated with Claude Code
https://claude.ai/code/session_01Fp8NXWwUjH6mmCimsKAPes