Repository navigation
String == is the emitter's job: two string names compare with std.mem.eql (Closes #5162) - #5444
Merged
Merged
Conversation
….eql Zig has no == for []const u8. The Zig backend already lowered a comparison to std.mem.eql(u8, a, b) when one side was a string literal, a str param or a str struct field. It missed the shape the automation specs write -- two module-level string constants, or a str param against one -- so `t27c test-report` reported ball-board and mail-push BLOCKED and ran none of their tests. Which names are strings is read off DECLARATIONS only, never inferred: - a module const declared `: str`, or untyped and initialised by a string literal; - a local declared `str` (or literal-initialised) in the fn/test that declares it, removed again when that fn/test ends; - a call to a fn this spec declares `-> str`. Numeric comparisons keep their plain operators. test-report, before -> after: - specs/automation/ball-board.t27 (master, v5): BLOCKED -> 17/17 - specs/automation/mail-push.t27: BLOCKED -> 11/11 - specs/port/tools/run_conformance_vvp.t27: BLOCKED -> 6/6 - specs/trinity/compiler_matrix.t27: BLOCKED -> 6/6 Corpus: Zig output changes for 10 of 1124 specs; under zig test --test-no-exec 4 of them go FAIL -> OK, the other 6 keep their same unrelated first error, and no new error appears. Ratchet (W628) verdict is identical before and after (ledger 151/152, 67 unexpected failures, 57 unexpected passes; master is already red there). Seal: compiler.rs changed, so bootstrap/stage0/FROZEN_HASH moves to its new digest (FROZEN.md section 5, step 5; `t27c frozen-digest`), as in #3962, #3973 and #4114. Four spec seals now record the old, invalid Zig: AccountAuth (x2, specs/account/auth.t27) and e2e_full_flow (x2, specs/github/tests/e2e_full_flow.t27) -- in both, a literal-initialised local is now compared with std.mem.eql. check_seal_currency goes 592 -> 596 stale (already red on master); not resealed here. Regression guard: bootstrap/tests/string_eq_zig.rs -- literal, const, param, local and `-> str` call cases, a numeric control, a no-leak case, and an end-to-end test-report run (6/6). Closes #5162 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
This was referenced Oct 1, 2026
The emitter change in this PR made four spec seals stale: their Zig output changed. In both specs, a local initialised by a string literal is now compared with std.mem.eql instead of ==, so the old seals recorded Zig that does not compile: - AccountAuth.json and account_AccountAuth.json (specs/account/auth.t27); - github::tests::e2e_full_flow.json and tests_github::tests::e2e_full_flow.json (specs/github/tests/e2e_full_flow.t27). Resealed with the t27c built from this branch through the repo's own path, `t27c seal <spec> --save`, which also refreshes the second seal file that names the same spec. No other seal is touched. check_seal_currency: 596 -> 592 stale and 646 -> 650 current, the same counts as master. The gate is already red on master for the remaining 592. - auth.t27: only gen_hash_zig and sealed_at change. - e2e_full_flow.t27: spec_hash also changes, because the spec was edited after its 2026-08-28 seal. One of its two files also moves sealed_by from 0.2.0 to 0.4.0. Closes #5162 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR DashboardGenerated at: 2026-10-01 15:01:03 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
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 #5162
What
Zig has no
==for[]const u8. The Zig backend already lowered a comparison tostd.mem.eql(u8, a, b)when one side was a string literal, astrparam or astrstruct field. It missed what the automation specs write: two module-level string constants, or astrparam against one (if source == SOURCE_MEETING,assert(DIGEST_DOOR != TOOL)). Sot27c test-reportreported those specs BLOCKED and ran none of their tests.Which names are strings is read off declarations only. Nothing is inferred and no type checker is involved:
: str, or untyped and initialised by a string literal (a new arm in thegen_zigprepass);str, or literal-initialised, in the fn/test that declares it (collect_string_locals). It is removed again when that fn/test ends, so a numericwantin the next fn keeps its plain==;-> str(declared_fn_returns).Numeric comparisons do not change. All of this lives in
bootstrap/src/compiler.rs(+68 lines).Measured
t27c test-report, base (a3472e383) -> this branch:spec.zig:218==on[]const u8)feat/ball-board-v2spec.zig:197)spec.zig:134!=)t27c genoutput changes for 10 of 1124 specs. Underzig test --test-no-exec:t27c suite --ratchet --corpus-onlygives an identical verdict on base and fix: ledger 151/152, observed 161, 67 unexpected failures, 57 unexpected passes, discard worsened 7. Master is already red there, for parse, typecheck and Verilog reasons this change does not touch. In the suite JSON, onlyseal-verifymoves (354 -> 353), because of auth.t27 (see Seal).cargo test --release --offline -p t27c --no-fail-fastacross 113 integration targets: 1017 passed, 1 failed.icarus_lowerable::corpus_classifier_matches_lean_completeness(nn_phi_rope and nn_sacred_attention). It is Verilog lowerability, andt27c icarus-lowerablegives the identical verdict with the base binary, so it is a pre-existing gap in the master baseline.tests/corpus_unresolved.rs(E0716) and thet27cbin unit-test target (axum/tokio/AppState). Neither is touched here.Seal
compiler.rschanged, sobootstrap/stage0/FROZEN_HASHmoves tot27c frozen-digest(FROZEN.md section 5, step 5), as in #3962, #3973 and #4114.Four spec seals now record the old, invalid Zig:
AccountAuth.jsonandaccount_AccountAuth.json(specs/account/auth.t27), and the twoe2e_full_flowseals (specs/github/tests/e2e_full_flow.t27). In both specs a literal-initialised local is now compared withstd.mem.eql, for examplelisted_issue.title == issue_titlebecomesstd.mem.eql(u8, listed_issue.title, issue_title).These four are resealed in
11313bf89(approved by the owner), using this branch's t27c andt27c seal <spec> --save. That command also refreshes the second seal file naming the same spec. No other seal is touched.check_seal_currencygoes 596 -> 592 stale and 646 -> 650 current, the same counts as master (the gate is already red there). On e2e_full_flow,spec_hashalso moves: the spec was edited after its 2026-08-28 seal.Regression guard
bootstrap/tests/string_eq_zig.rs(4 tests):==and!=), and an untyped literal const;strparam vs a const, astrlocal, and a-> strcall;n == LIMIT,n != LIMIT,LIMIT == 3stay plain);strlocal does not turn the next fn's numeric param into a string);test-report(6/6; skipped when nozigis on PATH).On the base binary,
test-reporton this spec is BLOCKED.🤖 Generated with Claude Code