Skip to content

t27core: nested arrays and list initializers, byte-identical to gen-c (Closes #7361) - #7374

Merged
gHashTag merged 2 commits into
masterfrom
self-host-p1-slice3
Oct 7, 2026
Merged

gHashTag merged 2 commits into
masterfrom
self-host-p1-slice3

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Closes #7361
Part of #5980

P1 slice 3 of the self-hosted core: nested arrays and list initializers. defer stays refused, because gen-c drops the deferred call (#7352).

What the core learns

  • A 1-D array global takes a list initializer [_]T{ e, ... } with a trailing comma allowed. The elements are any expressions in the subset: names, constants, _-separated and hex numbers, operators.
  • A 2-D global [N][M]T takes rows: [_][M]T{ [_]T{ e, ... }, ... }. The core writes T a[N][M] = { { e, ... }, ... };, which is the bytes t27c gen-c writes.
  • a[i][j] reads, stores and op= work in functions and in tests.

What the core refuses

Fixture Code Why
e9_nested_repeat, e9_nested_repeated_row E_ARRAY gen-c nests C comments, or zeroes the repeated rows (#7353)
e9_list_too_short, e9_row_count_short E_ARRAY gen-c pads with zeros; Zig refuses
e9_list_too_long, e9_row_too_long E_ARRAY gen-c hands C the excess, which C drops
e9_named_dimension_list E_ARRAY the item count cannot be checked against a name
e9_separator_in_inner_dimension E_ARRAY gen-c writes a[1][1_0] (#7318)
e9_inner_dimension_mismatch, e9_row_type_mismatch E_ARRAY the row type disagrees with the array
e9_row_used_as_value, e9_nested_array_as_value E_ARRAY C reads a row where a scalar goes
e3_three_dimensions E_TYPE only one or two dimensions are in the subset
e2_defer_call E_SYNTAX gen-c writes defer as a comment, so the call never runs (#7352)

Size

The core is at its source buffer. SRC_MAX is 65536, which is t27b's repeat-initializer cap. To fit, node-array reads go through seven one-line accessors (na(n) for nd_a[n as usize], and so on), two dead text functions are removed, and comments are tightened. S is 65341 bytes. The next slice needs the cap raised, or the buffers split.

Other changes

  • No Rust or compiler.rs change, so no foreign label is needed. for and switch are untouched.
  • t27core_ddc.t27 is repinned:
    • S is 65341 bytes, sha256 41a73cd5...;
    • E is 62437 bytes, sha256 4e6424a4....
      Decoding its data reproduces both files byte for byte.

Checked on the t27c lab

  • The core's 16 tests pass, two of them new.
  • Fixpoint: core(core.t27) == gen-c(core.t27).
  • accept/nested_arrays.t27 is byte-identical with gen-c, and its test binary (-std=c99 -DT27_TEST_MAIN) exits 0.
  • All 29 refusal fixtures give their codes.
  • The corpus differential accepts 61 files (previously 60), with no mismatch.
  • cargo test --release -p t27c --test core_selfhost passes, and so do specs-parse and specs-generate.

🤖 Generated with Claude Code

…Closes #7361)

P1 slice 3 of the self-hosted core (Part of #5980).

- A 1-D array global takes a list `[_]T{ e, ... }`, and a 2-D global
  `[N][M]T` takes rows `[_][M]T{ [_]T{ e, ... }, ... }`; the core writes
  `T a[N][M] = { { e, ... }, ... };` as gen-c does. a[i][j] reads, stores
  and op= work in functions and tests.
- Refused with E_ARRAY, since gen-c lowers them with loss or Zig refuses
  them: the nested repeat and a repeated row (#7353), a list or row whose
  item count is not its dimension, a named dimension with a list, a `_`
  in an inner dimension, a mismatched inner dimension or row type, a row
  or whole array used as a scalar. Three dimensions stay refused.
- `defer` stays refused: gen-c writes it as a comment and the call never
  runs (#7352). Fixture e2_defer_call.
- The core sits at its 64 KiB source buffer (t27b's repeat cap). Node
  array reads go through accessors and comments are tightened to fit:
  S is 65341 bytes.
- t27core_ddc.t27 repinned to S (65341 bytes) and E (62437 bytes).

Checked on the t27c lab: 16 core tests pass, fixpoint holds, the three
accept fixtures are byte-identical and run, 29 refusals give their codes,
corpus differential 61 files with no mismatch.

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

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 08:41:45 UTC

Summary

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

These columns do not partition: 2 + 42 + 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)=1aa228450491 != 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 e54d02d into master Oct 7, 2026
28 of 33 checks passed
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 08:51:19 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 45
PRs with All Checks Green 5
READY 3
FAILING 45
PENDING 0
NO CHECKS YET 0

These columns do not partition: 3 + 45 + 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)=1aa228450491 != 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 added a commit that referenced this pull request Oct 7, 2026
…counter (Refs #7307)

After the second master merge (#7374, #7360, #7365), these three specs'
gen-c differs under this branch's compiler only by `for (int ` ->
`for (size_t `, so the Railway t27c lab resealed them (6 files with twins).

Lab check on the merge tree f4edb20 vs master fe1c866:
- gen-c corpus: 132 of 1538 specs change, all counter-type only; no exit-code change
- seal-currency stale list after reseal = master's 13 (all ledgered in tools/seal_baseline.txt)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Self-host P1 slice 3: nested arrays and list initializers; defer stays refused

1 participant