Skip to content

feat(t27b): array literals by address, empty slice returns, unused tuple constants - #6580

Merged
gHashTag merged 4 commits into
masterfrom
claude/t27b-tail-arraylit
Oct 5, 2026
Merged

gHashTag merged 4 commits into
masterfrom
claude/t27b-tail-arraylit

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #6550
Refs #6063

What

  • const xs = &[_]T{ ... } (the reference's &.{ ... }) is lowered when every use is xs.len or an argument where the callee declares []const E, with one E for all uses. It becomes an [N]E built once. Indexing such a local is still refused, because its elements are comptime values in the reference.
  • return []; and return []T{}; in a fn returning a slice give an empty slice. A non-empty literal returned as a slice is still refused, because it points at a constant in the reference.
  • An untyped module constant bound to a list that no other node names is skipped, as Zig's lazy analysis skips it.
  • Code is in the new submodule cli/t27b/src/lower/arraylit.rs, with three hooks in lower.rs.
  • Conformance spec first: specs/tri/t27b/conformance/array_literal.t27 passes t27c test-report (6 pass) and t27b (6 pass).

Owner exception

Allowed by the owner 2026-10-05; debt to be replaced via #6198.

The local only-t27 hook (#6511) read an uncommitted line in tools/policy/foreign-exceptions.txt naming cli/t27b/src/lower.rs, cli/t27b/src/lower/arraylit.rs and cli/t27b/tests/arraylit.rs. That line is not in this PR. CI's own-language check honours the owner-approved-foreign label.

Ledger bless (Q53)

docs/reports/t27b_expectations.json is re-blessed in this PR. It also absorbs the master findings of lab run 35f0e71.

  • Run used: the lab's master run 35f0e71, with this branch's t27b verdicts (local corpus --blockers) swapped in for the 7 specs it moves, plus the new conformance spec. With that run, tri t27b ratchet is green.
  • Up (6):
    • queen-report.t27, catalog.t27 and gen_linear_regression.t27: blocked to pass (this PR);
    • check_duplicate_declarations.t27: blocked to pass_vacuous (this PR);
    • gf_competitive.t27 and selection_sort.t27: blocked to pass (feat(t27b): x.len() and len(x) as the .len field #6571, found by the master run).
  • New entries (7, all pass):
    • specs/benchmarks/kernel_{collatz,f64loop,fib,matmul,sieve,ternary}.t27 (master run);
    • array_literal.t27 (this PR).
  • Blocker moved (3, still blocked):
    • gen_cross_entropy now blocks on ExprCall(@log);
    • transport.t27 now blocks on ExprArrayLiteral(repeat);
    • smoke_m1.t27 now blocks on ExprArrayLiteral.
  • Down: 0. The cap goes from 49 to 43.

Files

File Class
specs/tri/t27b/conformance/array_literal.t27 .t27
docs/reports/t27b_expectations.json generated (tri t27b ratchet --bless)
cli/t27b/src/lower.rs (three hooks, mod arraylit;) hand-written Rust (owner exception)
cli/t27b/src/lower/arraylit.rs hand-written Rust (owner exception)
cli/t27b/tests/arraylit.rs hand-written Rust tests (owner exception)
docs/now/2026-10-05-t27b-addr-array-literal.md prose (NOW entry)

Tests

  • cargo test -p t27b: all green.
  • In tests/arraylit.rs, every source was run under t27c test-report first.

Corpus (t27b corpus specs --blockers --reference <t27c> --reference-cache, jobs 8, after merging master eb5358b)

counted (t27b pass where reference passes) checked pass where reference fails mismatch
lab master 35f0e71 698 / 745 416 1 (eternal_monitor, older than this lane) 0
this branch (local) 704 / 751 421 1 (same) 0

The new passes are queen-report, catalog, check_duplicate_declarations (vacuous), gen_linear_regression and array_literal.t27. Two files that the reference does not pass now get further in t27b, so they are not counted:

  • gen_mse: both t27b and the reference fail.
  • verify_multitarget: t27b fails. The reference refuses Zig's signed % on an untyped local; that is a separate follow-up.

🤖 Generated with Claude Code

gHashTag and others added 4 commits October 5, 2026 23:23
…ple constants

Conformance spec specs/tri/t27b/conformance/array_literal.t27 first
(6 pass under t27c test-report and t27b).

Closes #6550
Refs #6063

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lab run 35f0e71 plus this branch's verdicts for 8 specs; 6 up, 3
blocker moves, 7 new pass entries, 0 down, cap 49 -> 43.

Closes #6550
Refs #6063

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag gHashTag added the owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 17:54:52 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 41
PRs with All Checks Green 9
READY 8
FAILING 41
PENDING 0
NO CHECKS YET 0

These columns do not partition: 8 + 41 + 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)=9f2c8a4829f6 != 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

owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t27b: array literals taken by address, empty slice returns, unused tuple constants (ExprArrayLiteral)

1 participant