Skip to content

t27b: an untyped list local that the code indexes lowers as a tuple, from a t27 plan (Closes #8050) - #8055

Merged
gHashTag merged 13 commits into
masterfrom
t27b-tuple-local-8050
Oct 9, 2026
Merged

gHashTag merged 13 commits into
masterfrom
t27b-tuple-local-8050

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #8050. Part of #6063 (t27b coverage, item C10 of #6488).

Net hand-written lines under cli/t27b/: -18 (+79 -97), per the owner rule of 2026-10-09: "t27b must be generated entirely from .t27 specs". The glue for the untyped list local is paid for by porting the tuple rules of cli/t27b/src/lower/tuple.rs into the same plan, specs/tri/t27b/tuple_local_plan.t27, and deleting the hand code.

Decision

const vals = [_]i32{ ... }; with no annotation is printed by t27c gen as const vals = .{ ... };. That is a Zig tuple whose fields have the element values' types, and they are comptime fields where the values are compile-time known. Measured in the reference:

  • A constant index works anywhere.
  • A run-time index works only where the code runs at compile time: an invariant, which is printed as a comptime {} block.
  • In run-time code a run-time index does not compile ("unable to resolve comptime value"). That holds for typed consts, literals, struct elements, and inside a fn.

t27b now lowers such a local the same way, from specs/tri/t27b/tuple_local_plan.t27:

  • Taken: a literal that names its element type T, whose every element is a struct literal of T or a module const declared as T.
  • Where it lives: read-only data, where a constant-index read folds as a comptime field does. Where T holds a str, it is a constant aggregate instead.
  • Refused by name as ExprIndex(tuple): a run-time index outside an invariant, a bench or a fn no test reaches.
  • Left alone: everything else keeps the old refusal, "array literal with no result type".

ternary_gates' second blocker, @setEvalBranchQuota, was already gone on master (see #7410 and #7459).

The port

Moved from cli/t27b/src/lower/tuple.rs into the plan (gen-rust module tl):

  • is_tuple, split and key decide when a return type is a tuple. Its elements are split on every comma and trimmed, as the reference splits them. Each name and type comes back as a byte range. The names are all present or all absent. key gives the text the struct is interned by.
  • assigns: (a, b) = init is taken only at the top of a test, and only as =.
  • what(r) and why(r): the construct and the words of each tuple refusal. Each why has a {} hole for every value the glue fills in, and gives the old message byte for byte.
  • The module doc of tuple.rs (what the reference does with tuples) moves into the plan's header.

The reference prints !(a or b) as !a or b (filed as #8228), so the plan names that condition as a fn (is_name_byte).

Evidence

All on the t27c Railway lab (zig 0.16.0, t27c built from the branch's master); t27b runs under qemu-aarch64, with the JIT and the interpreter agreeing.

  • The port changes nothing. I ran the whole spec corpus (1716 files) under this lane's t27b before the port and after it, on the same tree. No file differs in verdict, first refusal, blockers list, or test, invariant and assert counts. tuples_rejections and tuples_as_the_reference_lowers_them, which check the tuple refusals' words, still pass. On the five corpus files refused at a tuple type, the full --blockers output is identical (same md5).

  • Reference: t27c test-report passes tuple_local_plan.t27 12/12 and conformance/tuple_local_index.t27 2/2 (6 runtime asserts; its invariant compiles). Both have 0 vacuous passes.

  • t27b (t27b test --check):

    spec result
    tuple_local_plan.t27 12/12
    conformance/tuple_local_index.t27 2/2 and the invariant
    isa/ternary_gates.t27 12/12
    ultra_engine_v70_ultimate.t27 3/3
  • Mutants: 31 of 31 for the plan (11 for the local, 20 for the ported rules) and 8 of 8 for the conformance spec, killed by the reference and by t27b.

  • Seals: both specs are sealed (seal --save, then --verify: all hashes MATCH).

  • Corpus, master's t27b against this branch's (before the port): exactly ternary_gates, ultra_engine_v70_ultimate and the conformance spec move from ExprArrayLiteral to pass.

  • Tests: cargo test --release -p t27b gives 138 passed and 0 failed, on the port head and on the merge with afc601f.

Lines by file

Against master afc601f; the counted files are the hand-written ones under cli/t27b/.

kind file lines
hand-written Rust cli/t27b/src/lower/tuple.rs +28 -97 (the port)
hand-written Rust cli/t27b/src/lower/arraylit.rs +28 (tuple_array_local)
hand-written Rust cli/t27b/src/lower.rs +13 (the mount, the name set, the call in the local, the check in index)
hand-written Rust test cli/t27b/tests/arraylit.rs +10
generated gen/rust/tri/t27b/tuple_local_plan.rs +237
.t27 specs/tri/t27b/tuple_local_plan.t27 +370
.t27 specs/tri/t27b/conformance/tuple_local_index.t27 +60
data 2 seals under .trinity/seals/ +47
data docs/reports/t27b_expectations.json +5 -3
prose AGENTS.md +5 -1

Hand-written: +79 -97, net -18 (budget 80 added, at most 40 per file). Master's check_budget() and check_all() from gen/c/policy/own_language.c both exit 0. wc -l over master afc601f: cli/t27b/src/*.rs 15261 -> 15274, cli/t27b/src/*/*.rs 1263 -> 1222, cli/t27b/tests/*.rs 8274 -> 8284.

Ledger

Only the rows that move: ternary_gates.t27 and ultra_engine_v70_ultimate.t27 go from blocked to pass, and the two new specs are new rows that pass. On master afc601f's ledger, max_not_pass 21 -> 19.

Receipt

Signed lane receipts from the t27b lab (#7686), compared on the lab from /work/t27 with /work/t27c-master corpus-receipt compare BASE HEAD --challenge-head <mine>:

  • Before the port: head 6c9cf6b (this branch merged with master a97cb9e) against base a97cb9e gave IMPROVED_ONLY, exit 3. lane improved for ternary_gates.t27, ultra_engine_v70_ultimate.t27, tuple_local_index.t27 and tuple_local_plan.t27; no other file changed. The head run had 0 mismatches, 0 reference disagreements and no ratchet findings on these files.
  • The port: head 004890e (the port, net -18 hand lines, on the merge with master 0fca4bd) against base 0fca4bd (the lab's own master run, which carries no nonce) gave IMPROVED_ONLY, exit 3. lane improved for the same four files: ternary_gates.t27, ultra_engine_v70_ultimate.t27, tuple_local_index.t27 and tuple_local_plan.t27; no other file changed.

Master was merged in from master's side several times. Each conflict was in the ledger, the AGENTS.md remainder line, or a test appended at the same place in tests/arraylit.rs. Each merge was re-checked on the t27c lab.

Generated with Claude Code

claude and others added 3 commits October 9, 2026 14:19
…g tuple (Closes #8050)

specs/tri/t27b/conformance/tuple_local_index.t27 pins what the reference does
with the shapes of ternary_gates.t27 and ultra_engine_v70_ultimate.t27: a
`[_]i32{ ... }` of typed module consts and a `[]T{ ... }` of struct literals
with a str field, read at constant indices with calls reading them, and an
invariant that indexes in a loop. gen-zig prints `.{ ... }`, a tuple, and
Zig 0.16 takes a run-time index into one only at compile time (measured:
in a test it does not compile, "unable to resolve comptime value").

t27c test-report (zig 0.16.0, t27c lab): 2/2 pass, 0 vacuous, 6 runtime
asserts; the invariant compiles. 8 of 8 mutants are killed by the reference
and by t27b. Sealed (seal --save, then --verify: all hashes MATCH).

Part of #6063.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from a t27 plan (Closes #8050)

The decisions are specs/tri/t27b/tuple_local_plan.t27, mounted through
t27c gen-rust (gen/rust/tri/t27b/tuple_local_plan.rs):

- A local `const x = [_]T{ ... }` with no annotation, whose literal names T
  and whose every element is a struct literal of T or a module const
  declared as T, is taken: read-only data, so that a constant-index read
  folds as Zig's comptime field does, or a constant aggregate where T holds
  a str. Anything else keeps "array literal with no result type".
- An index into it is refused as ExprIndex(tuple) when it is not a constant
  and the code is neither an invariant (a comptime block in the reference)
  nor a body Zig never analyzes (a bench, a fn no test reaches).

Plan: 6/6 pass under t27c test-report, 0 vacuous; 11 of 11 plan mutants
killed. gen-rust output is what the lab's t27c prints; sealed (seal
--verify: all hashes MATCH).

Glue: lower/arraylit.rs +31 (tuple_array_local), lower.rs +14 (the mount,
the name set, the call in the local, the check in index). Tests:
cli/t27b/tests/arraylit.rs +17 runs the conformance spec and checks the
refusal of a run-time index in a test.

Corpus (t27c lab, qemu-aarch64, master 6b6386e's t27b against this
branch's over the same tree): ternary_gates.t27, ultra_engine_v70_ultimate.t27
and the conformance spec move from ExprArrayLiteral to pass; nothing else
changes. ternary_gates' @setEvalBranchQuota was already gone (see #7410).

Part of #6063.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cs pass; AGENTS.md remainder (Closes #8050)

docs/reports/t27b_expectations.json: `tri t27b ratchet --bless --accept-new`
over the t27b lab run of master 7a07828 with this branch's t27b verdicts
for the files it changes (t27c lab corpus, master binary against branch
binary), composed onto master's ledger with only these rows:

- ternary_gates.t27, ultra_engine_v70_ultimate.t27: blocked
  (ExprArrayLiteral) -> pass
- conformance/tuple_local_index.t27, tuple_local_plan.t27: new, pass

max_not_pass 30 -> 28, as bless sets the cap.

AGENTS.md: `wc -l` over master 6b6386e: cli/t27b/src/*.rs 15271 -> 15285,
src/*/*.rs 1233 -> 1264, cli/t27b/tests/*.rs 8191 -> 8208.

Part of #6063.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From master's side (#7924's float_as plan, and others). docs/reports/t27b_expectations.json:
master's ledger plus this branch's four rows, recomposed: max_not_pass 29 -> 27.
AGENTS.md: master's remainder plus this branch's clause, re-measured with
`wc -l` over master 09ffc2f: src/*.rs 15271 -> 15285, src/*/*.rs 1239 -> 1270,
tests/*.rs 8205 -> 8222.

Merged-tree checks on the t27c lab: cargo test --release -p t27b 134
passed, 0 failed; under `t27b test --check` tuple_local_index.t27,
tuple_local_plan.t27, ternary_gates.t27, ultra_engine_v70_ultimate.t27 and
master's float_call_cast.t27 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 08:01:37 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 37
PRs with All Checks Green 13
READY 0
FAILING 37
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 37 + 0 + 0 = 37, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=3c0ade9e73e4 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 15:23:29 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 48
PRs with All Checks Green 2
READY 0
FAILING 48
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 48 + 0 + 0 = 48, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=557cd271f4e3 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Merged from master's side. Only the ledger conflicted; the t27b remainder
line is re-measured with wc -l on master e3b8c51. The ledger is
master's with only this lane's four rows composed on top (max_not_pass
20 -> 18).

Lab check on the merge: the four lane specs pass under t27b --check (2/2,
12/12, 12/12, 3/3), and cargo test -p t27b gives 138 passed and 0 failed.

Closes #8050

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 15:32:04 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 48
PRs with All Checks Green 2
READY 0
FAILING 48
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 48 + 0 + 0 = 48, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=557cd271f4e3 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Merged from master's side. Only AGENTS.md conflicted; the t27b remainder
line is re-measured with wc -l on master 0fca4bd. The ledger is
master's with only this lane's four rows composed on top (max_not_pass
20 -> 18).

Lab check on the merge: the four lane specs pass under t27b --check (2/2,
12/12, 12/12, 3/3), and cargo test -p t27b gives 138 passed and 0 failed.

Closes #8050

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 16:21:22 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=557cd271f4e3 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Merged from master's side. Only AGENTS.md conflicted; the t27b remainder
line is re-measured with wc -l on master d2b5fc1. The ledger is
master's with only this lane's four rows composed on top (max_not_pass
20 -> 18).

Lab check on the merge: the four lane specs pass under t27b --check (2/2,
12/12, 12/12, 3/3), string_slice_literal passes 6/6, and cargo test -p
t27b gives 138 passed and 0 failed.

Closes #8050

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) October 9, 2026 17:43
@gHashTag
gHashTag merged commit b9e6216 into master Oct 9, 2026
34 of 36 checks passed
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 17:50:02 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 44
PRs with All Checks Green 6
READY 0
FAILING 44
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 44 + 0 + 0 = 44, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=557cd271f4e3 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t27b: an untyped list local that the code indexes is a Zig tuple: constant indices, and run-time ones only at compile time

2 participants