Repository navigation
fix(rust): a module-level bool was never in bool_vars (+11) - #3250
Merged
Merged
Conversation
compiler.rs:8322 maps "str" | "string" to []const u8 for Zig and
compiler.rs:18248 maps it to const char* for C. compiler.rs:24426 mapped it to
the owned String for Rust, and String is not constructible in a `const` item,
which is where the corpus mostly uses it:
pub const DEFAULT_NOTEBOOK: String = "t27-QUEEN-BRAIN";
error[E0308]: expected `String`, found `&str`
48 of the 75 specs whose first error was E0308 carried that mismatch.
Measured by name over all 650 corpus specs: rustc accepts 288 -> 314, +26, zero
regressions.
The judgement is stated rather than hidden. `&'static str` is narrower than
String -- a field of that type holds only a string living for the program -- and
that narrowing is what both siblings already chose, neither []const u8 nor
const char* owning its bytes. Zero regressions says nothing in the corpus needed
the owned form.
Also records the boundary my predictor from #3219 was missing. That rule ties a
fix's yield to the stub-bodied share of its class; this class is 3% stub-bodied
and I predicted +2..+8 against a measured +26. The rule holds for a fix repairing
a SIGNATURE while leaving a body, and not for one repairing a COMPLETE
DECLARATION: a const is correct or not on its own.
Seal and 92 drifted seals move in the same commit.
Closes #3239
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ositions (+1) A spec field may be named `type`, `ref` or `match`. Those are Rust keywords and the emitter wrote them bare, so the struct did not parse. `r#type` is the exact spelling and needs no judgement. The name is written in four places -- the field declaration, a field access, a function parameter and a struct literal -- and repairing the first two changed nothing beyond one spec. Repairing all four changed nothing further: the remaining specs of the class carry other defects behind the keyword. Measured by name over 650 specs: 314 -> 315, +1, zero regressions. The honest measure here is closure, not yield: `found keyword `type`` as a first error goes 7 -> 1, and the residue is a different cause (keywords in TYPE position, from #3225's list-valued declaration). crate/self/Self/super are deliberately not escaped: `r#` is invalid for them, so escaping would swap one parse error for another. Also records a measurement flaw that has misled me three times: taking the LAST numbered line of rustc's first error block reads back the SUGGESTION, since suggestions render as numbered lines and come last. It produced a phantom `pub struct ListNode<T>` earlier and made two specs here look already-repaired. Closes #3241 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The mapper has both array branches and the Zig-shaped one throws the size away: `[4]u8` becomes Vec<u8> while `[u8; 4]` becomes `[u8; 4]`. The right answer was already forty lines above in the same function, whose comment records that only the Zig spelling used to be handled. The two swapped places and one was left behind. Measured against a binary pinned at /tmp/t27c-pinned: 315 -> 318, +4, -1. THE TRADE IS STATED RATHER THAN BURIED. The regression is octree.t27, whose field is `children : [8]?OctNode` -- a fixed array of the struct it lives in. As Vec<Option<OctNode>> it compiled because a Vec supplies indirection by accident while discarding the length; as [Option<OctNode>; 8] it is honestly infinitely sized. Neither is right: the correct Rust is [Option<Box<OctNode>>; 8], which needs the enclosing type name inside a static function with 18 call sites. A second regression was caught before shipping: reading everything in the brackets as a size produced `[T; * as usize]` from `[*]T`, the many-item pointer. Guarded -- contents that are not a digit string or a plain identifier keep the unsized lowering. Both regressions came from one omission: I enumerated the branches of the bracket syntax and not the contents of the brackets. Provenance: this cause was surfaced by a fan-out audit whose measurements I then invalidated by rebuilding the compiler underneath it. One agent reported "THE RULER MOVED UNDER ME" and was right; the workflow was stopped and its counts discarded. Everything above is re-derived by hand against the pinned copy. Closes #3246 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A spec may declare `var full : bool = false;` beside its functions rather than inside one. It arrives as a ConstDecl whose type is bool, and `bool_vars` is cleared at the top of every function and refilled from that function's parameters and locals -- so a module-level bool was never in it, and the conditions came out as integer comparisons: `if (full) != 0`, `while ((full) == 0)`, `full = ((full) == 0)`. Isolated on a six-line pair: the same declaration inside a function lowers correctly and only the scope differs. Both sibling backends already emit the condition verbatim. Fifth instance this pass of one shape -- the knowledge exists and is applied in one place and not the other. Measured against a pinned binary: 318 -> 329, +11, zero new regressions. Predicted +6 to +13 from the class size of 13. My own first two probes did not reproduce it, because I put the declaration inside a function both times. Going to the case the evidence named beat reconstructing it. Closes #3249 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
September 5, 2026 04:06
This was referenced Sep 5, 2026
fix(rust): lower Zig's undefined to Default::default() (+2) — NOT auto-merged, needs your call
#3223
Closed
Contributor
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
This was referenced Sep 5, 2026
# Conflicts: # .trinity/seals/ApbBridge.json # .trinity/seals/BoardMinimalXC7A100T.json # .trinity/seals/EmitterXDC.json # .trinity/seals/File.json # .trinity/seals/Git.json # .trinity/seals/GitDiff.json # .trinity/seals/GitOperations.json # .trinity/seals/Hir.json # .trinity/seals/Lexing.json # .trinity/seals/Linking.json # .trinity/seals/MAC_Testbench.json # .trinity/seals/NotebookLM.json # .trinity/seals/PhiRatio.json # .trinity/seals/PhiSplitOptimality.json # .trinity/seals/PhiUniversalAttractor.json # .trinity/seals/PinsIR.json # .trinity/seals/Project.json # .trinity/seals/SacredVerification.json # .trinity/seals/Session.json # .trinity/seals/Stdlib.json # .trinity/seals/TernaryIsa.json # .trinity/seals/Top_Level_Testbench.json # .trinity/seals/UART_Testbench.json # .trinity/seals/VcdConformanceCompare.json # .trinity/seals/Zamolodchikov4DConjecture.json # .trinity/seals/base-ring-32.json # .trinity/seals/base_base-ring-32.json # .trinity/seals/boards_BoardMinimalXC7A100T.json # .trinity/seals/cloud-railway-deploy.json # .trinity/seals/cloud_cloud-railway-deploy.json # .trinity/seals/compiler_Lexing.json # .trinity/seals/compiler_Linking.json # .trinity/seals/compiler_Stdlib.json # .trinity/seals/file_File.json # .trinity/seals/fpga_ApbBridge.json # .trinity/seals/fpga_FpgaStdlib.json # .trinity/seals/fpga_Hir.json # .trinity/seals/fpga_Memory.json # .trinity/seals/fpga_Stdlib.json # .trinity/seals/fpga_TernaryIsa.json # .trinity/seals/fpga_VcdConformanceCompare.json # .trinity/seals/git_Git.json # .trinity/seals/git_GitDiff.json # .trinity/seals/git_GitOperations.json # .trinity/seals/github::comments.json # .trinity/seals/github::issues.json # .trinity/seals/github::prs.json # .trinity/seals/github_github::comments.json # .trinity/seals/github_github::issues.json # .trinity/seals/github_github::prs.json # .trinity/seals/math_PhiSplitOptimality.json # .trinity/seals/math_PhiUniversalAttractor.json # .trinity/seals/memory_NotebookLM.json # .trinity/seals/nn_GatedLinearAttention.json # .trinity/seals/numeric_PhiRatio.json # .trinity/seals/physics_SacredVerification.json # .trinity/seals/physics_Zamolodchikov4DConjecture.json # .trinity/seals/pins_EmitterXDC.json # .trinity/seals/pins_PinsIR.json # .trinity/seals/race_igla-race-formal.json # .trinity/seals/server_Project.json # .trinity/seals/server_Session.json # .trinity/seals/testbench_MAC_Testbench.json # .trinity/seals/testbench_Top_Level_Testbench.json # .trinity/seals/testbench_UART_Testbench.json # bootstrap/stage0/FROZEN_HASH
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-09-05 06:42:59 UTC
Summary
Seal Status
|
# Conflicts: # .trinity/seals/MAC_Testbench.json # .trinity/seals/Top_Level_Testbench.json # .trinity/seals/testbench_MAC_Testbench.json # .trinity/seals/testbench_Top_Level_Testbench.json # bootstrap/stage0/FROZEN_HASH
Contributor
PR DashboardGenerated at: 2026-09-05 07:41:36 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-09-05 08:10:11 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-09-05 08:11:39 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.
A spec may declare a bool beside its functions rather than inside one:
It arrives as a
ConstDeclwhose type isbool. The emitter'sbool_varsset iscleared at the top of every function and refilled from that function's parameters
and locals, so a module-level bool was never in it — and the conditions came out as
integer comparisons:
Isolated on a six-line pair, one variable changed
if (full) != 0 {— wrongif full {— correctOnly the scope differs. The knowledge exists and is applied in one scope and not the
other — the fifth instance of that shape this pass.
Both sibling backends already emit the condition verbatim.
Measured against a pinned binary
Predicted +6 to +13 before measuring, from the class size of 13.
The one regression showing against the 315 baseline is
octree.t27, inherited from#3247 in this stack and already stated there; this change adds none.
Provenance
Surfaced by the re-run of the E0308 fan-out against
/tmp/t27c-pinned, after thefirst run was discarded for measuring against a binary I rebuilt underneath it. Every
control in that run reports 0 occurrences among the 315 passing specs. The agent's
evidence named
specs/fpga/testbench/fifo_tb.t27lines 44 and 66 exactly, which iswhat made the six-line isolation quick — my own first two probes did not reproduce it,
because I put the declaration inside a function both times.
Stacked: this branch sits on #3240 → #3242 → #3247. CI is currently stalled
repo-wide (29 runs queued, none in progress, nothing completing for 13+ minutes), so
none of the stack has landed yet.
Closes #3249