Repository navigation
t27b: _ = e; with e not a bare name is deleted where the reference deletes it and run everywhere else (Closes #7810) - #7853
Merged
Merged
Conversation
…letes it and run everywhere else (Closes #7810) The reference's `optimize` runs before gen-zig with keep_call_discards on: its dead-store pass deletes each `_ = e;` at the top level of a fn body whose e holds no call, and keeps the rest. Elsewhere t27c prints `_ = e;` as written, and Zig evaluates e, with its effects and traps, and drops the value. t27b refused every such statement as StmtAssign(undeclared), which blocked specs/port/bootstrap/src/compiler/collect_type_decls.t27. The decisions are in specs/tri/t27b/discard_plan.t27 (4 tests), generated with `t27c gen-rust` to gen/rust/tri/t27b/discard_plan.rs and mounted in cli/t27b/src/lower.rs. DELETED: an e with no call at the top level of a fn body. EVALUATE: anything else is evaluated and dropped. NOT_MINE: a bare name (the parameter-discard path) and a test's top level (the test-binding path, which the reference blocks), both unchanged. The conformance spec is specs/tri/t27b/conformance/discard_value.t27: `t27c test-report` 5/5, 0 vacuous. Glue: lower.rs +29, tests/tail.rs +15. Ledger: collect_type_decls.t27 now passes; the two new specs are new rows. Part of #6063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Oct 8, 2026
Merged
Merged
lower.rs and tests/tail.rs keep both sides. The ledger takes master's and re-applies this branch's three rows; counts recomputed from the entries: pass 918, not_pass 36. AGENTS.md records #7447's step, which left the line as it was (15129 plus 1202 and 8075), then this branch's: 15158 plus 1202 and 8090, on master 14e1c7b. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR DashboardGenerated at: 2026-10-08 17:19:38 UTC
Summary
Seal Status
|
This was referenced Oct 8, 2026
Contributor
PR DashboardGenerated at: 2026-10-08 17:59:06 UTC
Summary
Seal Status
|
This was referenced Oct 8, 2026
Merged
This was referenced Oct 8, 2026
tests/tail.rs keeps both sides. AGENTS.md takes master's steps and adds this branch's: 15220 plus 1202 and 8134, on master 1083135's 15191 plus 1202 and 8119. The ledger takes master's and re-applies this branch's rows: pass 924, not_pass 35. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 8, 2026
gHashTag
enabled auto-merge (squash)
October 8, 2026 19:55
This was referenced Oct 8, 2026
AGENTS.md takes master's and adds this branch's step: 15224 plus 1202 and 8149, on master 3d16be1's 15195 plus 1202 and 8134. The ledger takes master's and re-applies this branch's rows: pass 926, not_pass 34. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR DashboardGenerated at: 2026-10-08 20:20:48 UTC
Summary
Seal Status
|
Contributor
PR DashboardGenerated at: 2026-10-08 20:45:16 UTC
Summary
Seal Status
|
gHashTag
pushed a commit
that referenced
this pull request
Oct 8, 2026
lower.rs and tests/tail.rs merge cleanly. AGENTS.md takes master's and adds this branch's step: 15227 plus 1202 and 8164, on master 824c82d's 15224 plus 1202 and 8149. The ledger takes master's and re-applies this branch's rows: pass 931, not_pass 33. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
pushed a commit
that referenced
this pull request
Oct 9, 2026
…27b-const-div (Closes #7812) lower.rs and tests/tail.rs keep both sides. AGENTS.md takes master's and adds this branch's step: 15235 plus 1233 and 8200, on master 4270760's 15232 plus 1233 and 8183. The ledger takes master's (no stored counts since #7862) and re-applies this branch's rows; max_not_pass 31 -> 30. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7810. Part of #6063 (t27b coverage), which is item C10 of #6488.
What the reference does
specs/port/bootstrap/src/compiler/collect_type_decls.t27passes the reference 8/8. t27b refused it at 17 lines withStmtAssign(undeclared)(assignment to undeclared '_'). Each of those lines is a_ = e;whoseeis not a bare name. t27b only took_ = p;for a parameterp.The reference's
Compiler::compilerunsoptimizebefore gen-zig, withkeep_call_discards: true. Its dead-store pass (dead_store_elim_with) walks the top-level statements of every fn body. There, a_ = e;whoseeholds a call (expr_has_call) stays, and any other_ = e;is deleted. Nested blocks, and tests, are not touched.Measured on the t27c lab (
t27c genandt27c test-report, zig 0.16.0, x86_64 Debug):t27c gen_ = dv_void(n); _ = dv_value(n);at the top of a fn_ = "literal"; _ = n + 1;at the top of a fn_ = a + b;(u8 200 + 100) at the top of a fn_ = a + b;inside anif_ = "literal"; _ = dv_value(n);inside anif/elsemodule x { ... }_ = dv_value(4);at the top of a testconst _ = dv_value(4);ifin a testDecision, with the evidence
The decisions are a t27 plan,
specs/tri/t27b/discard_plan.t27, with 4 tests.t27c gen-rustturns it intogen/rust/tri/t27b/discard_plan.rs, andlower.rsmounts that file with#[path].ewith no call is not lowered at all, as the reference deletes it. A pure overflow there cannot trap.eis lowered and evaluated, and its value is dropped:eis evaluated with its traps._ = p;), whose path models Zig's pointless-discard rule;_ = e;at the top level of a test, invariant or bench, which is t27b's test-binding path. The reference blocks that shape. Refusing it here would move t27b verdicts on files the reference blocks, and that is not this lane's to change.The glue in
assignreads three facts, anddiscard_valuebuilds the EVALUATE answer:eis a bare name;eholds a call (calls_in, which isexpr_has_call's walk).Conformance spec first
specs/tri/t27b/conformance/discard_value.t27has 5 tests, each with the shapes above:collect_type_decls.t27's void call at the top of a body, with literals in the arms of anifand after it. Effects are counted per branch.+ 1, and a struct result. Each runs exactly once._ = a + b;at the top level that would overflow. It is deleted, so it does not trap.t27c test-reportseal --save, then--verify: all hashes MATCH)StmtAssign(undeclared)t27b test --check)t27c test-report4/4, 0 vacuous; sealed. All 6 plan mutants are caught by its tests.tail.rschecks. The nested overflow fails in t27b with anOverflowtrap, as the reference fails. The top-level one passes.Corpus
t27b corpus specs --blockers, master against this branch, on the t27c lab (1654 files on f53a734; repeated on 14e1c7b, 1662 files, with the same result):collect_type_decls.t27and the conformance spec loseStmtAssign(undeclared), their only blocker.ternary_memory,prove,knowledge_graph,ternary_deque,formula_embed,forward_pass,pins/parser,SR-00/lib,relay_observer,bigint,hybrid_bigintandsequence_hdc.Lines (
git diff --numstat --no-renames origin/master...HEAD)cli/t27b/src/lower.rscli/t27b/tests/tail.rsgen/rust/tri/t27b/discard_plan.rst27c gen-rust, not hand-editedspecs/tri/t27b/discard_plan.t27specs/tri/t27b/conformance/discard_value.t27.trinity/seals/*.json(2)t27c seal --savedocs/reports/t27b_expectations.jsonAGENTS.mdHand-written foreign code: 44 added lines, 0 deleted (29 in
lower.rs, 15 intests/tail.rs). That is under the #7371 cap of 40 per file and 80 per PR. Both files are on master'stools/policy/foreign-exceptions.txt. This PR does not change that file and needs no label.AGENTS.md, re-measured with
wc -l:cli/t27b/src/*.rsgoes from 15195 to 15224, plus 1202 insrc/*/*.rs, andcli/t27b/tests/*.rsfrom 8134 to 8149, on master 3d16be1.Ledger:
collect_type_decls.t27: blocked -> pass.Gates
Both gates ran on the t27c lab, using master 1083135's
gen/c/policy/own_language.candlefthook.yml's one-line C main.check_budget()overgit diff --numstat --no-renames origin/master...HEAD: exit 0.check_all()withorigin/master:tools/policy/foreign-exceptions.txt,--andgit diff --name-status origin/master...HEAD: exit 0.cargo test --release -p t27bon the t27c lab (x86_64, interpreter only), on master 3d16be1 plus this branch: 128 passed, 0 failed. That includes the newa_discarded_value_runs_unless_the_reference_deletes_it.Run with
t27b test --check(aarch64 under qemu), on the same tree:collect_type_decls.t27: 8/8;undefined_arg.t27: 7/7 (before the merge with master 14e1c7b).t27b lab: signed receipts (#7686)
Head 4e7a07a against its merge-base, master f53a734. Head 4e7a07a is this branch as first pushed: the plan, the glue, the specs and the ledger rows on master f53a734. Both are signed runs of the deployed t27b lab. The head run was requested with a fresh 32-byte challenge, and the base by an explicit request, since the lab had not run that master commit.
/work/t27c-master corpus-receipt compare BASE HEAD --challenge-head <mine>, run on the t27b lab from/work/t27:Exit 3, IMPROVED_ONLY. (The
input,verdictandoutputlines name the same three files and are left out here.)cargo test --release -p t27b(aarch64, qemu)collect_type_decls.t27passes with 11 runtime asserts, the conformance spec with 10 and the plan with 12.What changed after the receipted head. Master moved by #7818, #7447, #7808, #7744, #7863 and #7870 while the queue waited, and each touched the ledger,
AGENTS.mdortests/tail.rs. The final head, d9591f3, is 4e7a07a merged with master 3d16be1. Those merges resolved only:lower.rs's plan mounts, all kept;tests/tail.rs's sections, all kept;AGENTS.mdline;Head 852a23a was dropped from the lab queue without running: the branch moved on before the lab reached it. On the final tree, on the t27c lab:
cargo test --release -p t27bpassed 128, failed 0;collect_type_decls.t27and the conformance spec lower with no blocker;check_budget()andcheck_all()exit 0.gen-rust gaps
None. The plan is decisions over
boolandu8.🤖 Generated with Claude Code