Skip to content

feat(t27b): array literals typed by their use - #6370

Merged
gHashTag merged 1 commit into
masterfrom
claude/t27b-lane-arraylit
Oct 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/t27b-lane-arraylit

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Closes #6369
Refs #6063

ExprArrayLiteral ("array literal with no result type") was step 1 of the greedy order on master 0757c2f. Four shapes now lower as t27c's Zig backend writes them:

  • an array literal argument where []const u8 is declared (@constCast(&[_]u8{ ... })), and an untyped local passed there (slice_locals, now also for []const u8);
  • an untyped const local whose every mention is an argument to one array type [N]T (const p = .{ ... }, coerced at each call): built once as that array;
  • an empty literal for a slice field of a named struct literal (@constCast(&[_]T{ })): an empty slice;
  • an untyped local of plain literals nothing reads (_ = x; // dead after const-inlining): dropped.

Refused by name: a non-empty literal for a slice field (ExprArrayLiteral(to slice field); the reference points into a constant), and a slice field of an anonymous struct literal (ExprArrayLiteral(to slice); Zig refuses the reference's .{ ... }).

Corpus (my runs, t27b corpus specs --timeout-ms 60000 --jobs 8 --blockers --reference t27c --reference-cache)

before (0757c2f) after
counted (pass + pass_vacuous, reference passes) 653 / 720 658 / 720
checked pass (with tests) 373 377
JIT/interpreter mismatch 0 0
t27b passes where the reference does not 0 0

Newly passing: benchmarks/ternary_vs_binary, fpga/ternary_isa, port/trinity/src/tri/gen_cursor, port/trinity/src/tri/gen_kmeans, sandbox/orphan_detection. automation/wrapup-auto now stops at StmtAssign (then ExprArrayLiteral(to slice field)).

Next in the greedy order: type f32 +3, type undefined +3, ExprCall(std.*) +3, ExprArrayLiteral (remaining shapes) +2.

Tests

  • array_literals_typed_by_their_use and array_literals_typed_by_their_use_rejections in cli/t27b/tests/source.rs; the passing source gives the same 4 pass / 1 fail under t27c test-report, and each rejected shape was run there too: the wrong-length tuple and the anonymous-literal slice field are BLOCKED in the reference; the non-empty slice field and the tuple local also indexed pass there and stay refused here (named blocker, and the unchanged "no result type").
  • cargo test -p t27b: all pass, none ignored.

Reference bugs still in play: #6329, #6358, #6295, #6102.

🤖 Generated with Claude Code

An array literal with no result type was step 1 of the t27b corpus greedy
order. Four shapes are now lowered as t27c's Zig backend writes them:
an argument where `[]const u8` is declared, an untyped const local only
ever passed where one array type `[N]T` is declared, an empty literal for
a slice field of a named struct literal, and an untyped local of plain
literals that nothing reads. A non-empty slice-field literal and a slice
field of an anonymous struct literal are refused by name.

Corpus (master 0757c2f): counted 653 -> 658 of 720, checked pass
373 -> 377, mismatch 0, t27b-only passes 0.

Closes #6369

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

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 05:52:46 UTC

Summary

Status Count
Total Open PRs 47
PRs with Failing Checks 35
PRs with All Checks Green 12
READY 11
FAILING 35
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8597b6ded596 != 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 4258dbc into master Oct 5, 2026
31 of 33 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.

t27b: array literals typed by their use (str args, tuple locals, empty slice fields)

1 participant