Repository navigation
t27b: a module constant nothing analyzed reaches is lazy like an unreached body; a local of an undeclared type keeps its refusal (Closes #10899, #10903, #11053) - #11046
Merged
Conversation
Contributor
gHashTag
force-pushed
the
t27b/lazy-consts-10899
branch
from
October 19, 2026 13:36
adf58d0 to
0de485b
Compare
Contributor
PR DashboardGenerated at: 2026-10-19 13:37:02 UTC
Summary
Seal Status
|
This was referenced Oct 19, 2026
9 of 12 tasks
This was referenced Oct 19, 2026
Merged
Contributor
PR DashboardGenerated at: 2026-10-19 14:55:59 UTC
Summary
Seal Status
|
This was referenced Oct 19, 2026
Contributor
PR DashboardGenerated at: 2026-10-19 15:30:51 UTC
Summary
Seal Status
|
…ached body -- ConstDecl and ConstDecl(slice) refusals are withdrawn (Closes #10899, Closes #10903) WIP checkpoint. ast_shape.t27 analyzed marks the constants a root or a reached fn or constant mentions (constants are no longer roots); lazy_sig_plan.t27 const_plan decides which refusals of an unreached constant are Sema's (the body rule, but an annotation Zig cannot read keeps the refusal); the glue eager_const withdraws them into the same held list restore_held returns when AstGen refuses the file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e subsumed by the constant reach -- hand lines net 0 (Closes #10899, Closes #10903) unreferenced_tuple_const skipped an untyped list constant nothing names, and the hw set skipped the constants only the hardware reads. The reach of ast_shape.t27 analyzed now says which constants an analyzed root can name, and eager_const withdraws the Sema-level refusals of the rest, so both are gone. The hw rule moves into the reach: a hardware-only constant is never reached, whoever names it, exactly as before (without that guard ddr3_head_bandwidth, ddr3_ternary_matvec and eth_top_ax7203 turned from pass to FnDecl(reference not yet implemented)). The repository corpus (2,438 specs) has identical per-test verdicts with the base binary except the three files that newly decide: lsp/schema.t27 (blocked -> pass), port/scripts/gen_w683.t27 (blocked -> two failing tests t27c also fails), and the new lazy_const fixture. The Rust test and the glue are written in fewer lines. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… test reaches (Closes #11053) AstGen resolves every name in a body, reached or not, so fn f() { var x : Missing = 0; } is "use of undeclared identifier 'Missing'" whether or not a test calls f (t27c test-report: BLOCKED). Since #10999 body_plan withdrew its refusal (type (undeclared)) as a Sema-level one and t27b passed the spec. body_plan now keeps it, which also keeps it for a constant (const_plan). Negative control: the plan spec's test, and a mutant of conformance/lazy_signature.t27 in cli/t27b/tests/tail.rs (refused by t27b, BLOCKED by t27c). The hand lines stay net <= 0: a comment line of arraylit.rs about the removed tuple-const skip goes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The constant rule of this PR lets specs/lsp/schema.t27 pass under t27b (the ratchet read UNEXPECTED PASS for it, "ledger blocked (type mismatch), now pass"). The row and the cap are recounted from the current file: 127 not-pass rows, cap 127. Same shape as #10862 and #10999. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
gHashTag
force-pushed
the
t27b/lazy-consts-10899
branch
from
October 19, 2026 16:00
0fe198d to
45d89cf
Compare
Contributor
PR DashboardGenerated at: 2026-10-19 16:03:49 UTC
Summary
Seal Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10899
Closes #10903
Closes #11053
Part of epic #10879 (t27b for t27o). Three commits and a ledger commit, built on #10999.
What
Zig resolves a module-level constant only when something analyzed names it. A constant nothing analyzed reaches (
pub const ALLOWED : [][]const u8 = ["gfternary"];,pub const REGION_BRAM : MemRegion = MemRegion_new(..);) compiles even though Zig would refuse it the moment a test read it. t27b resolved every constant eagerly and refused those two asConstDecl(slice)andConstDecl. This PR withdraws that refusal the way #10999 withdraws the refusals of an unreached fn body.The rule, in .t27
specs/tri/t27b/ast_shape.t27,analyzed(+reach_named, newmentioned_in): the reach now covers constants. Roots are tests, invariants and declarations that are neither a fn nor a const; a fn or a const is reached when a root or a reached fn or const names it. A hardware-only constant is never reached (a guard; without itddr3_head_bandwidth,ddr3_ternary_matvecandeth_top_ax7203went from pass to blocked). Theis_hw_constexemption and theunreferenced_tuple_constglue are deleted, subsumed by the reach.specs/tri/t27b/lazy_sig_plan.t27,const_plan(construct, detail, spelled): for a constant nothing reaches, the refusals are judged bybody_plan, except that an annotation Zig cannot read in the file and a constant with no value keep the refusal. They come back throughwithdrawn_come_backwhen AstGen refuses the file anyway.eager_const(cli/t27b/src/lower/unanalyzed.rs), called by the eager constant loop inlower.rs.body_plannow keepstype (undeclared), sofn f() { var x : Missing = 0; }in an unreached fn is refused by t27b as t27c refuses it (BLOCKED). A mutant of thelazy_signaturefixture intail.rscovers it.specs/tri/t27b/conformance/lazy_const.t27(typeLazyRegion, a name unique in specs/), Rust testa_constant_zig_never_resolveswith the negative controls.Measured (t27b built from this branch,
--jobs 1; master build before)13 specs gained, none lost, no per-test verdict changed.
--reference t27cover the 13: t27c compiles and passes every one, 0 disagreements.specs/lsp/schema.t27(newly passes) andgen_w683.t27(newly decided, 2 failing tests, the same two t27c fails): 0 disagreements. Repository corpus (2,438 specs), master build against the build before the #11053 fix: 4 files differ (theschemaandgen_w683flips, the new fixture,ast_shape's own test count); everything touched by the deletions is identical per test.Negative controls (against
t27c test-report): a test naming the slice, directly or through a fn: t27c BLOCKED, t27bConstDecl(slice); a test naming a call-initialised struct: t27c passes, t27bConstDecl(the counted remainder); a type, a fn or a name declared nowhere: t27c BLOCKED, t27b refuses.Gates
cargo test --release -p t27b: all test binaries pass. dupe_scan: the merge base's 15 findings, no new one (run at the first commit).check_devhome_pathsandtri types ratchet: clean.specs/lsp/schema.t27ispassnow (the ratchet read UNEXPECTED PASS for it), cap 128 -> 127, recounted from the current file. The 13 UNLISTED rows, includinglazy_const.t27, are the steward's; the STALEtrain_hslmis master's.Not run
The repository-corpus comparison on the final head (it ran on the build before the #11053 fix); dupe_scan, devhome and types ratchet were last run before the final two commits and are covered by CI.
🤖 Generated with Claude Code