Repository navigation
t27b: emit_kit -- one home for the writers' shared helpers (Refs #9994) - #10065
Merged
Merged
Conversation
#10047 merged at its head before this fix reached the branch, and master's duplicate-bodies gate went red: ts_emit.t27 repeats 18 helper bodies of verilog_emit.t27 word for word (byte writers, to_front, line_near, the scope and name resolver, the symbol encoding, the test-tree builders). They now live once, in specs/tri/t27b/emit_kit.t27, with tests of their own, and both writers `use` it by name. A whole-module `use` of verilog_emit from ts_emit does not work: the splice counts words inside string literals as references, so ts_emit's "export function" pulls verilog_emit's fn `function`, and the generated Rust typecheck refuses it against ts_emit's own param_type and stmts. The ledger also loses its ternary_matmul row: that group is gone on master and the gate refuses a ceiling left above the real count. Measured on the Railway lab, on top of master 896d87b: test-report emit_kit 4/4, ts_emit 4/4, verilog_emit 7/7, 0 vacuous; dupe_scan ok after the bless; t27b ts and t27b verilog print byte-identical output and exit codes before and after on all 2095 specs (4190 of 4190). Generated writers and the three records regenerated there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
gHashTag
enabled auto-merge (squash)
October 17, 2026 18:04
dmitrii-f-t27
added a commit
to dmitrii-f-t27/t27
that referenced
this pull request
Oct 17, 2026
Conflict only in .trinity/seals/t27b_T27bVerilogEmit.json. verilog_emit.t27 merged cleanly
(master moved the shared writer helpers to emit_kit.t27, used by verilog_emit; the pin
declaration code stays). gen/rust/tri/t27b/verilog_{emit,plan}.rs equal this tree's t27c
gen-rust; the seal is re-saved with it.
Checks with this tree: seals of verilog_emit, verilog_plan, eth_top_ax7203 and
xc7_primitives verify; t27c test-report and t27b test 8/8, 15/15, 2/2 (and 2/2); t27b
verilog writes the board top with its 22 pin attributes, synthesizable part unchanged.
5 tasks done
This was referenced Oct 17, 2026
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.
Master's
duplicate-bodiesgate is red after #10047. That PR merged at its head before its duplicate-bodies fix was pushed, sospecs/tri/t27b/ts_emit.t27still repeats 18 helper bodies ofverilog_emit.t27word for word. This PR lands that fix on top of master.What changes
specs/tri/t27b/emit_kit.t27. The shared helpers now live once, in this module, with four tests of their own:put_bytes,put_dec,put_ind,dec_len);to_frontandline_near;resolve,in_scope,parent_of,child_holding,param_index,param_name_lo,param_name_hi);sym_of,sym_at);tnode,tmeta,holds).use tri::t27b::emit_kitby name. Their generated Rust and their seals are regenerated.ternary_matmulrow leavestools/duplicate_bodies_baseline.txt. That duplicate group is already gone on master, and the gate refuses a ceiling left above the real count. Blessing only lowers the ledger and adds no slack.emit_kitgoes intodocs/reports/t27b_expectations.json, and the t27b README gets one line about the module.Why not import the other writer whole
A whole-module
useofverilog_emitfromts_emitdoes not work. The use splicer counts words inside string literals as references. So the string"export function"ints_emitpulls inverilog_emit'sfn function, and the generated-Rust typecheck then refuses it againstts_emit's ownparam_typeandstmts.Measured on the Railway lab, on top of master 896d87b
emit_kit4/4,ts_emit4/4,verilog_emit7/7, with 0 vacuous passes.t27b tsandt27b verilog: byte-identical output and exit codes before and after, on all 2095 specs (4190 of 4190 runs).Refs #9994
🤖 Generated with Claude Code