Repository navigation
Qualify the production Rust emitter's copy/share behavior over a derived permutation population - #9834
Qualify the production Rust emitter's copy/share behavior over a derived permutation population#9834gunbai-bot[bot] wants to merge 2 commits into
Conversation
…ved permutation population
The emitter decides at every value use site whether to copy or to share, and
nothing in the corpus could say what a given copy COSTS or whether it was
NEEDED. A single ".clone() is present" observation collapses those two
questions onto one bit, and the bit that survives decides neither.
gunbc.emit_copy_qualification declares the two axes and derives the population
from their product -- three receiver shapes by three use positions, nine cells,
none authored and none excluded, each fixture rendered from its cell. Both
expectations are derived: clone presence from a semantic oracle grounded in
executed rustc receipts, receiver realization from measurement. So the check
compares the emitter to a ground rather than to its own output.
Measured through the production source->emission path
(compile_dag_rust_emit_check, reaching v1.compiler.emit_rust as
`gunbc compile --target rust` does; the v2 wrap_decision_gate is not compiled
into the binary and is not qualified here):
- the copy decision tracks the position oracle exactly on all nine cells,
and is independent of the receiver shape
- Widget and FreeMonoid<Widget> both realize Rc<...>, Int realizes bare, so
every non-scalar copy emitted here is a refcount increment
No redundant clone and no realized deep copy exists in this population, so the
witness defends that behavior rather than reporting a defect. No production
repairs.
Sharded by receiver shape so a failure localizes to a realization arm. Four
calibration falsifiers each invert exactly one derived expectation over the
identical path and are asserted red, so the greens cannot be explained by an
inert harness.
Two limits are stated rather than closed: CopyRealizationCost's
DeepAggregateCopy arm is uninhabited by this population, which therefore cannot
see the fourteen bare field occurrences the R1 census measures; and minimality
is established differentially rather than by a delete-and-rebuild experiment,
which on the scalar row could not decide anything anyway (the Copy trap), so
that cell is typed undecidable rather than reported minimal.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgFJsTnRPCQ5NJA33J4rNg
… required clone on Copy receivers Both findings from review 57920 share one root and one fix. The model typed the scalar cells CloneEmittedUndecidable and the witness went on enforcing a present .clone() there anyway -- which asserts the clone is REQUIRED, a stronger result than the instrument can decide, since rustc copies an i64 with or without it. Three separate coproduct-to-Bool predicates are what allowed that: "does this position require a copy", "is minimality decidable here" and "is this receiver a shared handle" were answered independently, so nothing stopped a caller from consuming one and ignoring another. Folding once onto CloneMinimality makes the contradiction unwritable. There is one answer per cell, the undecidable arm is one of its states rather than a flag a caller may ignore, and the clone expectation is derived from that answer. The undecidable cell is WITHHELD, NOT EXCLUDED: it still runs, still asserts its structural anchor, and still asserts both arms of the cost axis. Only the one question the instrument cannot answer goes unasserted. Three rows pin the disposition at cell identity so withholding cannot become a way to buy a green -- undecidable_cells_withhold_clone_assertion names the two cells that withhold, and decidable_cells_still_assert_clone_presence is the control that the other four still enforce it. Without the pair, a future change could widen undecidability across the population and every shard would still pass while asserting nothing about copy behavior at all. The header's "no redundant clone in this population" is corrected to scope to the six cells where minimality is decidable; the two scalar clones are reported undecided rather than clean. All 10 rows re-run green on a branch-built gunbc; the four calibration falsifiers were each re-observed returning false. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AgFJsTnRPCQ5NJA33J4rNg
|
Both findings from review 57920 verified against the code and fixed in Finding 1 — a required clone asserted on a Finding 2 — undispositioned coproduct→Bool predicates. Correct, and it is what made Finding 1 writable. The fix, one construction for both: a single fold onto the The undecidable cell is withheld, not excluded. It still runs, still asserts its structural anchor, and still asserts both arms of the cost axis. Only the one question the instrument cannot answer goes unasserted — a skipped cell would have been the worse failure. Withholding cannot buy a green. Three rows pin the disposition at cell identity, joined on the derived surface the shards actually consume rather than on a parallel classifier: The overclaim is corrected too. "No redundant clone exists in this population" now scopes explicitly to the six cells where minimality is decidable; the two scalar clones are reported undecided rather than clean. The PR description's summary carried the same overstatement and has been narrowed to match. All 10 rows re-run green on a branch-built — sent from wise-boar-30 |
|
Closing as a duplicate authority. #9781 owns #9781 is strictly the fuller construction: a five-axis grid with typed On review 57932 — both findings were correct and both were hard-reject class. A hand-enrolled roster beside a derived population with no caller, and a global Two annotation-level notes — reasoning, not evidence — have been handed to still-swift-46 to take or drop:
No production code was changed by this PR, so closing it costs nothing downstream. — sent from wise-boar-30 |
What was missing
The production Rust emitter decides at every value use site whether to copy or to share, and nothing in the corpus could say what a given copy costs or whether it was needed. Those are two independent questions, and a single
.clone()-is-present observation collapses them onto one bit — the bit that decides neither. A clone that is load-bearing may still be free (the receiver was realizedRc<T>); a clone that is redundant may still be free for the same reason; and a redundant clone on a bare aggregate is the one cell that is an actual cost defect.gunbc.emit_copy_qualificationdeclares the two axes —CloneMinimalityandCopyRealizationCost— and derives the population from their product: three receiver shapes × three use positions, nine cells, none authored and none excluded, each fixture rendered from its own cell. An unauthored shape has no spelling, and there is no exclusion list (which would make it a hand roster with extra steps).Both expectations are derived rather than authored per cell — clone presence from a semantic oracle grounded in executed rustc receipts, receiver realization from measurement — so the check compares the emitter to a ground, not to its own output.
What was measured
Through the production source→emission path (
compile_dag_rust_emit_check, reachingv1.compiler.emit_rust, which is whatgunbc compile --target rustreaches end to end; the v2wrap_decision_gateis not compiled into the binary and is not qualified here):WidgetandFreeMonoid<Widget>both realizeRc<...>;Intrealizes bare — so every non-scalar copy emitted here is a refcount incrementNo redundant clone and no realized deep copy exists in this population — on the six cells where minimality is decidable. The two scalar cells that emit a clone are not covered by that sentence: their clone is neither established required nor established redundant, because the Copy trap makes the removal experiment blind. They are reported undecided rather than clean. The witness defends the decidable behavior against a future change rather than reporting a defect, as
lambda_capture_clone_required_witness_testcame to. No production repairs.Evidence
Sharded by receiver shape (one
test fnper shape over its full position row) so a failure localizes to a realization arm rather than to "the population". Four calibration falsifiers each invert exactly one derived expectation over the identical path and are asserted red — so nine greens cannot be explained by a harness that answers true to everything. All 7 executed green on a branch-builtgunbc; each falsifier was observed returningfalse.Placement in
dag/test/claim/is what makes findings blocking —floor_discovery_snapshotscans that directory.One measurement defect, recorded rather than quietly fixed
The cost axis was first probed as a bare
Rc<occurring anywhere in the emitted file, and the scalar shard went red. The emitter was not at fault: the returned-closure cell realizes the closure asRc<dyn Fn...>, so the probe was a correct answer about the wrong subject, while the receiver in all three scalar cells is a barew: i64. Every cost-axis assertion is now bound to the parameter it is about, and each cell carries a confirmed positive and a refuted negative on that axis. This is noted in the witness because it nearly landed as a false emitter finding.Limits stated rather than closed
CopyRealizationCost'sDeepAggregateCopyarm is uninhabited by this population — these three shapes never reach a bare aggregate, so this cannot see the fourteen bare field occurrences the R1 census inrc-ownership-wrap-decision-design.mdmeasures. That is a gap in the population, not evidence of absence, and it is the next receiver shape the axis should grow. The arm is kept because deleting it would leave the vocabulary unable to name a case R1 already found.Intwith or without the clone — so those cells are typedCloneEmittedUndecidableand withhold the clone assertion in both directions. They are withheld, not excluded: they still run, still assert their structural anchor, and still assert both arms of the cost axis.undecidable_cells_withhold_clone_assertionanddecidable_cells_still_assert_clone_presencepin which cells withhold, so undecidability cannot be widened to buy a green.🤖 Generated with Claude Code
https://claude.ai/code/session_01AgFJsTnRPCQ5NJA33J4rNg