Skip to content

feat(t27b): module constants of a struct with str fields - #6324

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

gHashTag merged 1 commit into
masterfrom
claude/t27b-strfield

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #6323
Refs #6063

What

ConstDecl(str field) was first in the reference-backed greedy order (tri t27b next): sole blocker on 5 specs the reference passes. Shape: const PIN_CLK: PinAssignment = PinAssignment{ .port_name = "clk", .bank = 35, ... }; -- a module constant of a struct with str fields. t27b kept struct constants as read-only data images, which cannot hold a string's address.

Now such a constant (and any array/struct constant with a str at a leaf) is a compile-time aggregate (Val::A, one element per field: string literal, nested aggregate, read-only image of a str-free aggregate, or constant scalar/enum), written into a frame temporary where memory is needed -- the path constant arrays of strings already took. holds_str now looks through struct fields; store_const writes struct fields too; coerce_to accepts it where a struct is wanted. A module var of such a type stays refused as VarDecl(module, pointer/str/slice) (writable data would need relocations).

Test: struct_constants_with_str_fields (fields, defaults, enum and nested struct fields, alias, by-value and by-pointer params, copy-then-mutate, arrays of such structs, runtime index, for, a failing assert with its line). Same source through t27c test-report: 3 pass, 1 fail -- same verdicts.

Corpus (t27b corpus specs --blockers --reference <t27c master e8513e0b5>, 1257 files, reference passes 720)

before after
pass (checked) 321 326
pass_vacuous 283 283
fail 6 6
rejected (blocked) 604 599
front-end error 40 40
mismatch 0 0
timeout 3 3
counted pass (t27b passes where reference passes) / 720 592 597

Gain: +5 counted (checked 317 -> 322): specs/boards/arty_a7.t27, specs/boards/xc7a100t_full.t27, specs/fpga/boards/arty_a7_integration.t27, specs/fpga/boards/qmtech_a100t_integration.t27, specs/port/trios/crates/trios-cli/src/metrics.t27. The sixth reference-passing file, specs/boards/xc7a100t_minimal.t27, is now blocked by VarDecl(module, pointer/str/slice) (module var all_pins: [12]PinAssignment) -- not small, left for a later lane.

Reference-backed top 5 after: ExprLiteral(char literal) +4, ExprIf +5, StmtExpr +4, StmtFor +4, ExprArrayLiteral +4.

Load average during the runs: 5-60. docs/reports/t27b_expectations.json untouched (the steward blesses it from the lab).

🤖 Generated with Claude Code

A module constant whose struct (or array) type holds a str at a leaf is
lowered as a compile-time aggregate (Val::A, one element per field) and
written into a frame temporary where memory is needed, as a constant
array of strings already was. A module var of such a type stays refused
as VarDecl(module, pointer/str/slice).

Reference-backed corpus: counted pass 592 -> 597 of 720, mismatch 0.

Closes #6323

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 01:17:01 UTC

Summary

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

These columns do not partition: 11 + 33 + 0 + 0 = 44, and there are 45 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 a82d61d into master Oct 5, 2026
29 of 31 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: module constants of a struct type with str fields (ConstDecl(str field))

1 participant