Repository navigation
feat(rust): credit a loop accumulator whose update adds a called function's value - #10784
Conversation
…it (#9619) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
…tion's value (RIPR-SPEC-0360, #9478) Reads `t += callee(*x)[.await] [op literal]` over a zero-initialized returned local, async owners included, and credits it only when an exact pin's literal run, folded through the evaluated callee, gives the pinned nonzero value and every neighbouring mutation gives a different one. Moves shape-async-await-accumulate from limited to credited; 733 cases, 0 false. Cache 1.114 / 0.121 / file facts 1.49. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
|
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 39 minutes. View limit details
Comment |
…r a call term, tighten the call-term controls (#9478) Review of record found a callee name shadowed by a function-pointer parameter was evaluated as the same-named function (false credit). The callee must now be named once in the owner and be a free function. A call term that is not credited is withheld, never a gap. Controls assert the withheld verdict and add shadowing, signed subtraction, |= coincidence and smoke-call cases. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY
|
Review of record, head 83943c0. Angles: (1) adversarial soundness of the fold and gate, (2) tests, spec and consumer parity. Two independent read-only passes plus the Devin findings. Findings and resolutions:
Not changed, by decision: Evidence on this head: Generated by Claude Code |
…#9836) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMEkYAqTh9LZtLbF2mzCYW
Governing issue or accepted claim: #9619
Acceptance delta (one sentence): The verdict-corpus row
shape-async-await-accumulatemoves from limited to credited, with zero new false verdicts.What changed
RIPR-SPEC-0360 gains the call term:
acc += callee(x)orcallee(*x), with an optional.awaitand one optional+ - * / %with a decimal integer literal (t += double(*x).await * 1). Anasyncowner now has the accumulator shape, but only through a call term. Tracks #9478.The call's value is read by evaluating the callee, never assumed. The pinned run is credited only when:
|=,^=, overwriting (the last element), and for a term with an operator each other of+ - * / %.* 1and/ 1,+ 0and- 0are the same function, so they are equivalent, not a gap.*= /= %= &=stay zero from the zero start, which differs from a nonzero pin.Anything ripr cannot read (a second definition, a statement body, a call, a cast, a different return type, a shadowed name, a fold that misses the pin, a run where a neighbour coincides with the written update such as one element of a
+=) isstatic_unknown. It is never credited. A call term is never reported as a gap, so a smoke call is withheld too.Implementation:
syntax/loop_accumulator.rsreads the term;classify/owner_pin/call_term_fold.rsevaluates it;owner_pin.rsroutes a call term to that evaluator instead of the plain nonzero credit;closure_adaptor::pinned_run_acceptsgeneralises the per-run judgment;pinned_shape.rswithholds an uncredited call term instead of reporting a gap;propagation_witness.rsbinds the update to the returned local by name (a.awaitdot was read as a qualified path, so no async accumulator ever had a complete witness).Proof
crates/ripr/tests/loop_accumulator_call_term.rs: 13 controls. Positives are the async credited twin, a sync twin, a signed-=and a run the operators do not share. Negatives assert the withheld verdict: a total the callee does not give, one element, an empty and a zero pin, eight callee shapes, a duplicated callee, a parameter that shadows the callee (fails with the check removed), a coinciding term operator, a|=coincidence, a smoke call, shapes outside the call term, and an async owner without a call term.shape-async-await-accumulatelimited to credited. Itsmissed-credit.tomlentry is deleted.cargo xtask precommitpasses. The review of record is in the PR comments.Residuals
sum += weigh(w)owners are now areturn_valueprobe where they were an unmappedstatic_unknown; an uncredited one is withheld, never a gap.🤖 Generated with Claude Code
https://claude.ai/code/session_014rDKCvewzinJrP5bh5iuSY