fix(t27c): read a dotted module name and use path whole - #6102
Merged
Merged
Conversation
This was referenced Oct 4, 2026
6 tasks
This was referenced Oct 4, 2026
This was referenced Oct 4, 2026
Merged
Merged
`module sandbox.health;` parsed as the module `sandbox` plus a stray top-level `.health` expression with line 0, and `use std.testing;` as the import `std` plus `.testing`. Twelve specs hit it (t27b corpus run). - parser: the module header keeps the dotted name verbatim (the string extract_module_name already gave the seal tool); a dotted use path is stored as the `::` path, named for its last segment - C include guard, HIR Verilog module line and gen-testbench DUT sanitize the name; AST gen-verilog no longer emits `always @(*) begin health; end` - use_resolve splits a dotted use path like a `::` one - Zig: a use whose name is bound as a parameter or local is not imported (orphan_detection.t27's `session` parameter shadowed the new `session` import) - 20 seal files resealed for 14 specs; suite unchanged (662/662) Closes #5978. Part of #5905. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
force-pushed
the
claude/parse-dotted-module
branch
from
October 4, 2026 16:20
f39af24 to
d6d1783
Compare
This was referenced Oct 4, 2026
Merged
This was referenced Oct 5, 2026
This was referenced Oct 5, 2026
9 tasks
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.
Summary
module sandbox.health;parsed as the modulesandboxfollowed by a stray top-levelStmtExpr.healthwith line 0, anduse std.testing;as the importstdfollowed by.testing. Twelve specs were affected. The t27b corpus run found it.Parser (
Parser::parse, the module-header skip and use-path loop inparse_module_body):sandbox.health,port::trinity.src.tri.gen_image). That is the same stringextract_module_namealready gave the seal tool.::path (sandbox::session_timeout), named after its last segment..counts as part of the name only when an identifier follows it. A.inside a body is untouched.Names that become identifiers are sanitized:
gen_c)AstToHir::convert)main.rsrun_gen_testbench)The AST Verilog path already sanitized the name.
use_resolve::use_targetsnow splits a dotted path the same way it splits a::path.Zig: a use whose name is also bound as a parameter or local is no longer imported. This is needed because of the fix itself: once
use sandbox.session;is namedsession, it collides with thesessionparameter inorphan_detection.t27, and Zig rejects a local that shadows a container@import.Before / after (the 12 specs)
// Generated from t27 spec: sandbox; uses namedsandbox/stdsandbox.health; uses namedsession_timeout/testing; no shadowed@import#ifndef SANDBOX_H#ifndef SANDBOX_HEALTH_Hmodule sandbox (plusalways @(*) begin health; session_timeout; session; end(not Verilog)module sandbox_health (, no stray statementsmodule sandbox (module sandbox_health (sandboxsandbox_healtht27c gen specs/sandbox/health.t27(the path route, through use_resolve) now pullsSession,SessionStatusandTimestampfromsession_timeout.t27. Before, it looked forspecs/sandbox.session_timeout.t27and pulled nothing.orphan_detection.t27Zig passeszig test6/6 before and after.Corpus / seal / suite
specs/**.t27and the 113 other.t27files. Hashes changed for exactly 14 files:specs/igla/coder/benchmark.t27andcompiler/cli/gen.t27: the Zig guard drops the same shadowed import (dataset,testgen). Both still failzig teston unrelated undeclared identifiers, as they did before.StmtExprand parse failures:StmtExpr: 15 before, 3 after. The 3 left are unrelated.t27c seal --save, no--force. The fourspecs/portspecs have no seal.tools/check_seal_currency.py: 0 stale.tools/check_seal_coverage.py: OK (1449 seals).t27c suite --repo-root .reports TOTAL FAILURES 662 before and after, PRIMARY corpus 95 and 95, and an identical JSON summary. This was measured on the pre-rebase base.Tests
bootstrap/tests/dotted_module_name.rshas 9 cases, including a field-access negative control and a qualified-call control for the import guard. Run against the unfixed binary, all 8 parser and backend cases fail.cargo test --release -p t27cbefore the rebase: 2816 passed, 0 failed.Not done
The C guard of a
::module name (137 specs) still contains::. Fixing it moves 137 seals, so it belongs in its own change.Closes #5978. Part of #5905.
🤖 Generated with Claude Code