Skip to content

fix(t27b): refuse shapes the reference cannot compile (13 -> 0) - #6360

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

gHashTag merged 1 commit into
masterfrom
claude/t27b-honest

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Closes #6359. Refs #6063; covers causes (3) and (4) of #6358.

t27b now refuses every shape that it passed but the reference path (t27c test-report: t27c gen-zig, then zig test) cannot compile. All edits are in cli/t27b/src/lower.rs:

  • reference_defects is a pre-scan called from lower_mode.
  • It reads the AST after the same optimize call that Compiler::compile makes.
  • Every shape it refuses is a Zig parse or AstGen error, so it fires even when nothing calls the code.

Before / after

The corpus was run over specs with fixed copies of the binaries:

  • t27b-before and t27b-after
  • t27c built from 84e478b

Command: corpus specs --blockers --reference t27c --reference-cache

before after
pass_where_reference_does_not 13 0
counted (t27b pass among reference passes) 648/720 648/720
checked (pass with asserts) 370 370
mismatch 0 0
t27b pass / pass_vacuous 375 / 286 370 / 278
t27b fail 10 8
t27b blocked 544 559

Of the 15 files whose status changed, 13 went from pass to blocked and 2 from fail to blocked (hir_tb, gen_w368, both redeclarations). The reference BLOCKS all 15.

Every one of the 113 files that gained a new blocker is one the reference BLOCKS. No new blocker landed on a reference-pass file.

(a) The 13 files, with the reference's reason

file t27b before reference blocker now
specs/fpga/apb_bridge.t27 pass use of undeclared identifier 'count' (_cse hoisted above it) FnDecl(reference CSE hoist)
specs/fpga/axi4.t27 pass use of undeclared identifier 'count' (same) FnDecl(reference CSE hoist)
specs/fpga/linker.t27 pass expected field initializer (.align = 4 unescaped) ExprStructLit / ExprFieldAccess(zig keyword field)
specs/port/browseros/.../routes/queen-lease.t27 pass '_' used as an identifier ([_]u8{} printed .{ _ }) ExprArrayLiteral(reference empty typed)
specs/server/api.t27 pass use of undeclared identifier 'MessageContent' StructDecl(reference undeclared field type)
specs/sacred/sacred_constants.t27 pass_vacuous undeclared field type (mangled Namespacestruct...) StructDecl(reference undeclared field type)
specs/sacred/sacred_governance.t27 pass_vacuous parse error on List<SacredRule> StructDecl(reference undeclared field type)
specs/sacred/sacred_identity.t27 pass_vacuous parse error on List<...> StructDecl(reference undeclared field type)
specs/tri/agent/governance_agent.t27 pass_vacuous parse error on List<String> StructDecl(reference undeclared field type)
specs/tri/agent/handoff.t27 pass_vacuous undeclared UInt32 StructDecl(reference undeclared field type)
specs/tri/pipeline/codegen.t27 pass_vacuous undeclared String StructDecl(reference undeclared field type)
specs/tri/pipeline/workflow.t27 pass_vacuous undeclared String StructDecl(reference undeclared field type)
specs/tri/utils/help.t27 pass_vacuous undeclared CommandCategory (?CommandCategory) StructDecl(reference undeclared field type)

(b) Named blockers, each confirmed BLOCKED by t27c test-report

blocker shape reference error on the probe
StmtAssign(reference redeclares) top-level w = 9; in a test, after var w (#6358 cause 3) redeclaration of local variable 'w'
FnDecl(reference var param) param written only through p.*, rebound var p = p_arg; (#6358 cause 4) local variable is never mutated
FnDecl(reference CSE hoist) _cse* temp reads a body local use of undeclared identifier 'count'
ExprStructLit(zig keyword field) / ExprFieldAccess(zig keyword field) .align = 4, s.align expected expression, found '.'
ExprArrayLiteral(reference empty typed) [_]u8{} '' used as an identifier without @"" syntax
StructDecl(reference undeclared field type) field name: String in an unused struct use of undeclared identifier 'String'

The probes for all of these are in shapes_the_reference_cannot_compile_are_refused in cli/t27b/tests/source.rs. That test has a near-miss control (a param assigned directly, and mapped field types) which the reference passes and t27b still runs.

Causes (3) and (4) do not decide any corpus pass on their own, but they fire in 16 and 8 places, all in files the reference blocks. Examples:

  • vsa_core, hir_tb and gen_w368 hit StmtAssign(reference redeclares).
  • isa/ternary_* and pins/parser hit FnDecl(reference var param).

Three existing source.rs fixtures used the refused shapes, and the reference blocks all three:

  • slices: [_]u32{}
  • strings: test reassign after a var
  • structs: test reassign, and incr(c: *u32) { c.* += 1; }

They were rewritten without losing what they test:

  • the reassignments moved into an if (true) { .. } block
  • [_]u32{} became a one-element literal (a[5..] already covers the empty slice)
  • incr became a local pointer, np.* += 2
  • var u = "lit" became var u: str

The structs and strings fixtures now match the reference verdict for verdict.

(c) Causes not pinned to a shape here

These are Sema-level, depend on which code is analysed, or were not reached by this corpus:

  • t27c gen-zig drops needed parentheses: (if ..) + 1 and -(x - y) #6329: parentheses dropped around (if ..) + 1 and -(x - y), and const inlining of typed locals breaking peer types. These are semantic or type errors that show up only where the code is analysed. Neither decides a t27b pass today (pass_where_reference_does_not is 0).
  • An open-ended slice a[2..] is printed as a[2], an index rather than a slice. In the slices fixture this is a type error. Where the element type and the slice type happened to coincide it would be a silent change in meaning. Not refused here; a t27c issue should own it.
  • var u = "lit"; u = "other"; gives u the type *const [3:0]u8, so assigning a string of a different length is a Sema error. This depends on analysis, so it is not refused.
  • t27c: optional capture dropped, orelse unparsed, test-local reassign emitted as const, pointer param var rename #6358 causes (1) and (2): the dropped optional capture is already refused as StmtIf(capture) (existing source.rs test). orelse was not re-checked in this lane.

Not touched

  • docs/reports/t27b_expectations.json
  • t27c
  • the interpreter fallback

No test is ignored.

This is hand-written t27b logic, so it is debt for the port epic #6198 (AGENTS.md rule).

🤖 Generated with Claude Code

t27b passed 13 corpus files that t27c test-report blocks. A pre-scan
in lower.rs now refuses each deterministic t27c gen-zig defect with a
named blocker: CSE hoist over a body local, a Zig keyword field left
bare, `[_]T{}` printed as `.{ _ }`, an undeclared struct field type,
a test reassign emitted as a redeclaration (#6358 cause 3), and a
`p.*`-only pointer param rebound as an unmutated var (#6358 cause 4).

pass_where_reference_does_not 13 -> 0, counted 648/720 unchanged,
mismatch 0.

Closes #6359

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 04:49:35 UTC

Summary

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

These columns do not partition: 11 + 34 + 0 + 0 = 45, and there are 46 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 bd59d8c 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: refuse shapes the reference cannot compile (13 corpus passes the reference does not back)

1 participant