Skip to content

fix(compiler): M5 — module var arrays writable, qualified calls skip namesake check - #5615

Merged
dmitrii-f-t27 merged 3 commits into
masterfrom
fix/m5-module-var-and-qualified-calls
Oct 2, 2026
Merged

dmitrii-f-t27 merged 3 commits into
masterfrom
fix/m5-module-var-and-qualified-calls

Conversation

@dmitrii-f-t27

@dmitrii-f-t27 dmitrii-f-t27 commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

[GOLD-RING] — M5 freeze ceremony for bootstrap/src/compiler.rs (FROZEN.md §5).

Closes #5573
Closes #5574
Refs #5497

What

Two of the corpus-ratchet unexpected failures, both in the frozen compiler core:

  1. A module-level var array is typechecked as const: W456 rejects every write into it #5573 — a module-level var array parsed to ConstDecl with extra_mutable set, but the typechecker registered every ConstDecl as is_mutable: false, is_const: true, so W456's ROM rule rejected every element write (disjoint_set.t27, and the same defect under specs/fpga/bridge.t27). The registration now reads extra_mutable. Two tests pin the split: a module var array is writable, a module const array stays ROM.
  2. A qualified call module::f is typechecked against the local f of the same name #5574 — use_resolve flattened multi_head_attn::forward(...) to the bare forward, binding the call to the LOCAL forward of a different arity and reporting a false "expects 2 args, got 3" (mha_block.t27). A qualified CALL whose local namesake disagrees with every imported declaration of that name (normalised text) now keeps its qualifier, so the call binds to no local function and the arity check is skipped by non-match. Faithful inline copies (dataset.t27) still flatten; non-call spellings keep the old flattening.

Four suite_expectations entries are removed — mha_block.t27, disjoint_set.t27 (the two targeted), plus specs/fpga/bridge.t27 and specs/port/fpga/vivado/matmul_serial_hw.t27, which the same fixes resolved and the ratchet flagged as unexpected passes.

Ceremony

  • Seal: t27c frozen-digest → b45a356c2eb651059e73d93e913558131b303d003e80f5d6642d3ddab7dd3526 bootstrap/src/compiler.rs (stage0/FROZEN_HASH updated).
  • cargo build --release -p t27c passes with the new seal.
  • cargo test --release -p t27c --bin t27c: 1750 passed, 0 failed, 2 ignored (pre-existing).
  • t27c typecheck specs/ml/transformer/mha_block.t27 → OK (was 2 errors); specs/tri/graph/disjoint_set.t27 → OK (was 1 error); specs/igla/coder/dataset.t27 → OK (no regression).

Boundaries

  • The compiler core is frozen; this PR is the deliberate M5 move, not a silent edit.
  • Imports remain unimplemented: a qualified call that keeps its qualifier is typecheck-clean but its generated code still cannot resolve the module, exactly as before the arity check became a hard error.
  • Inherited reds observed on master (not introduced here): Bootstrap Test Ratchet (same 25 failures on the master run), untrusted-input (corpus size 1151 vs the 1146 re-take), Seal Coverage (parallel unsealed specs), emit-bitexact (sadd disagrees in Zig: a shift by a negative count, and as u32 means two things #5506).

…he namesake check

Two corpus-ratchet unexpected failures, one M5 freeze move (FROZEN.md 5):

Closes #5573: a module-level `var` array parses to ConstDecl with
extra_mutable set, but the typechecker registered every ConstDecl as
is_mutable: false, is_const: true, so W456's ROM rule rejected every
element write into a module var. The registration now reads
extra_mutable; two tests pin the writable-var / ROM-const split.

Closes #5574: use_resolve flattened a qualified call such as
multi_head_attn::forward(...) to the bare name, binding it to the LOCAL
forward of a different arity and reporting a false arity error. A
qualified CALL whose local namesake disagrees with every imported
declaration of that name (normalised text) now keeps its qualifier, so
the call binds to no local function and the arity check is skipped by
non-match; faithful inline copies (dataset.t27) still flatten, and
non-call spellings keep the old flattening.

The two suite_expectations entries for these specs are removed: both
mha_block.t27 and disjoint_set.t27 now pass typecheck.

Seal: frozen-digest -> b45a356c2eb651059e73d93e913558131b303d003e80f5d6642d3ddab7dd3526
(ceremony step 3); cargo build --release passes with the new seal;
1750 tests pass (cargo test --release -p t27c --bin t27c).
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-02 17:40:48 UTC

Summary

Status Count
Total Open PRs 40
PRs with Failing Checks 39
PRs with All Checks Green 1
READY 1
FAILING 39
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b45a356c2eb6 != 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).

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-02 17:44:30 UTC

Summary

Status Count
Total Open PRs 40
PRs with Failing Checks 37
PRs with All Checks Green 3
READY 1
FAILING 37
PENDING 0
NO CHECKS YET 0

These columns do not partition: 1 + 37 + 0 + 0 = 38, and there are 40 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b45a356c2eb6 != 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).

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant