Skip to content

gen-zig: a local declared []T from an array literal lowers to @constCast(&[_]T{...}) (Closes #8602) - #8617

Merged
gHashTag merged 1 commit into
masterfrom
claude/gen-zig-slice-local
Oct 10, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/gen-zig-slice-local

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #8602

A local declared with a slice type and initialized from an array literal lowered to .{...}, which Zig refuses: type '[]T' does not support array initialization syntax. Slice fields (W609) and slice returns (W607) already get @constCast(&[_]T{...}); this gives locals the same lowering.

var xs: []u32 = [_]u32{ 10, 20, 30 };                 // t27
var xs: []u32 = @constCast(&[_]u32{ 10, 20, 30 });    // Zig now (was .{ 10, 20, 30 })

Measured over every tracked .t27

  • Gen output: 28 specs change, each only at such locals (every changed line is the new lowering).
  • Test outcomes: none of the 28 passed before. 2 get past this error (compiler/mod_structure, vsa/ops); the other 26 contain the pattern but stop first at another error. Nothing regresses.
  • Seals: only the 28 specs' seals are refreshed, 56 files with twins: 48 blocked -> blocked, 8 none -> blocked, no collision.
  • Repro: sums to 60 (1/1); on master it is BLOCKED.
  • Checks: Corpus ratchet shows exactly master's 5 inherited failures (master Corpus Ratchet: 5 unexpected failures from 2026-10-10 merges (ingest.t27 apostrophe, a/b_c, optimizer, orchestrator_bench) #8562), none new. Types ratchet CLEAN. Budget: compiler.rs +5 -2, paid for by deleting the dead scripts/gen_w378.py.

🤖 Generated with Claude Code

(&[_]T{...}) (Closes #8602)

A slice-typed local initialized with an array literal lowered to .{...},
which Zig refuses (type '[]T' does not support array initialization
syntax). Slice fields (W609) and returns (W607) already get
@constcast(&[_]T{...}); locals now do. Measured over every tracked .t27:
28 specs change, each only at such locals; none passed before, 2 move past
this error (compiler/mod_structure, vsa/ops). Their seals are refreshed
(48 blocked -> blocked, 8 none -> blocked). Paid for by deleting
scripts/gen_w378.py.

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-10 13:48:39 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)=96f3a5f9cbd0 != 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).

@gHashTag
gHashTag merged commit af4c8b8 into master Oct 10, 2026
29 of 34 checks passed
dmitrii-f-t27 added a commit to dmitrii-f-t27/t27 that referenced this pull request Oct 11, 2026
…s/gen_w389.t27

The merge with master lost the offset this PR had: master already deleted
scripts/gen_w369.py (gHashTag#8856), so compiler.rs's +14 hand-written lines need
another deletion. gen_w389.py (54 lines) is a one-off wave generator whose
decision lives in specs/port/scripts/gen_w389.t27; only a dated docs/now note
names it. Same precedent as gHashTag#8617 and gHashTag#8856.

Refs gHashTag#5649, Refs gHashTag#5651
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.

gen-zig: a local declared []T and initialized with an array literal lowers to .{...}, which is no slice

2 participants