Skip to content

gen-zig: an open-ended slice a[lo..] lowers to a Zig slice, not an index (Closes #8200) - #10319

Merged
gHashTag merged 2 commits into
masterfrom
claude/vigilant-heyrovsky-8b0c4c
Oct 18, 2026
Merged

gHashTag merged 2 commits into
masterfrom
claude/vigilant-heyrovsky-8b0c4c

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

What

t27c gen (Zig backend) lowered an open-ended slice a[lo..] to the index a[lo]. The parser marks the open slice as ExprIndex with extra_op = "slice_open" and no end child. The gen-zig emitter only recognised the bounded "slice" form, so the open form fell through to plain indexing and the range was dropped without any error.

Effect on real code: std.debug.print("{s}", .{row[0..]}) reached Zig as .{ row[0] }. zig 0.16 rejects that with invalid format string 's' for type 'u8'. This was found while streaming raw RGB frames from specs/t27f/reel_particles.t27 (#10308). A typed local like var t : []const u8 = a[2..]; silently became one element.

Fix

  • bootstrap/src/compiler.rs, gen-zig ExprIndex: every extra_op that starts with slice now lowers to base[lo..], and also emits the end when there is a third child (base[lo..hi]). The diff is net zero lines (+3 / -3), inside the shrink-only foreign budget. The Verilog ExprIndex sites are unchanged.
  • bootstrap/stage0/FROZEN_HASH: 0f8c66b9... -> c485c8bd3372a8c391d5b2cd0c904dfe08155750b2d5a3e0319fbbbe62555c43.
  • New conformance spec specs/compiler/zig_open_slice.t27 with three tests: open slice length and first element, bounded slice sum, and the exact {s} repro on a [12]u8 row.
  • Reseal: 26 specs that use a[lo..] produce different (now correct) Zig, so their seals are refreshed with tri seals drift --fix (52 files). The new spec is sealed too: .trinity/seals/compiler_ZigOpenSlice.json.
  • docs/reports/t27b_expectations.json: the new spec calls std.debug.print, which t27b does not lower yet (ExprCall(std.*)). It is listed as blocked and max_not_pass goes from 76 to 77.

Evidence (Railway lab, zig 0.16 at /opt/zig)

master t27c this branch
a[2..] in a typed local a[2] a[2..]
.{row[from..]} .{ row[from] }, BLOCKED: invalid format string 's' for type 'u8' .{ row[from..] }
literal repro row[0..] .{ row[0] }, BLOCKED .{ row[0..] }, passes
test-report specs/compiler/zig_open_slice.t27 BLOCKED 3 tests, FAIL 0, 0 vacuous
python3 tools/check_seal_coverage.py - OK: 2736 seals, 2614 hold, 122 known-broken (baseline)

All builds and tests ran on the lab, none on the Mac.

Closes #8200
Refs #6250 (the open-slice half), #10308

🤖 Generated with Claude Code

gHashTag and others added 2 commits October 18, 2026 15:24
…_slice (refs #8200)

The open-slice fix changes generated Zig for 26 specs that use a[lo..];
their seals are refreshed with tri seals drift --fix on the Railway lab.
zig_open_slice.t27 calls std.debug.print, which t27b does not lower yet,
so it is listed as blocked and max_not_pass moves from 76 to 77.

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 08:46:24 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)=c485c8bd3372 != 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 enabled auto-merge (squash) October 18, 2026 08:49
@gHashTag
gHashTag merged commit 7912660 into master Oct 18, 2026
39 of 41 checks passed
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.

t27c gen: open-ended slice a[2..] is emitted as a[2]

1 participant