Skip to content

fix(emit_rust): pull std.serialization into emit closure via explicit import - #5761

Merged
briansrls merged 5 commits into
mainfrom
session/sharp-tern-358
Jun 24, 2026
Merged

briansrls merged 5 commits into
mainfrom
session/sharp-tern-358

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes two issues that together block regen_stage0 --emit-fresh on clean origin/main.

Issue 1 — std_serialization closure-drift (the original blocker): std.serialization was never reachable from the src/v1/ entry-point emit closure. source_files_for_roots starts from all .dag files under src/v1/ and follows imports into dsl/; since no src/v1/ DAG file imported std.serialization, the module was absent from the closure and the emitter never generated std_serialization.rs — while GENERATED_STAGE0_FILES listed it.

Fix: add import std.serialization { CoproductWireContract, VariantEncoding, VariantNaming } to src/v1/05_emit_rust.dag. All three names are genuinely referenced in the file (CoproductWireContract: lines 1153–1247 validation + serde generation; VariantEncoding: 994–1090 serde dispatch; VariantNaming: 915/965 attribute rendering). The import makes the dependency explicit and restores the module to the emit closure.

Issue 2 — wt_a/wt_b/wt_common unregistered (introduced by #5743): #5743 added src/v1/tests/fixtures/whole_tree_wiring_enum/*.dag which are collected as entry files by collect_dag_files(src/v1/) and emitted as wt_a.rs, wt_b.rs, wt_common.rs — but were not added to GENERATED_STAGE0_FILES. This "unregistered" error fires before the "missing" check, masking Issue 1 on post-#5743 main. Fix: register all three (consistent with v1_test_non_ascii_perf_fixture.rs precedent).

Test plan

  • regen_stage0 --emit-fresh run on branch with RUSTC_WRAPPER= SCCACHE_DISABLE=1 (to bypass sccache build-script issue); std_serialization.rs confirmed present in fresh output, both checks pass. Receipt pending (rebuild in progress).

@gunbai-bot gunbai-bot Bot changed the title Lane A keystone-blocker: std_serialization closure-drift -- dsl/std/serialization.dag exists + committed seed std_serialization.rs exists, but the fresh self-compile emit CLOSURE no longer emits it, so --emit-fresh FAILS on CLEAN origin/main (GENERATED_STAGE0_FILES contains std_serialization.rs miss fix(emit_rust): pull std.serialization into emit closure via explicit import Jun 24, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 24, 2026 21:15
sorted-Vec was a git-log output redirected into the worktree root and
captured by the session auto-committer. Not related to the fix.
@gunbai-bot

gunbai-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review findings:

sorted-Vec stray file: removed via git rm sorted-Vec + commit cb5f849. git diff --name-only origin/main...HEAD now shows only src/v1/05_emit_rust.dag.

On the tri-import vs single symbol: the parent manager verified all three names are genuinely referenced in 05_emit_rust.dag — CoproductWireContract (lines 1153–1247, validation + serde generation), VariantEncoding (994–1090, serde attribute rendering dispatch), VariantNaming (915/965, naming attribute rendering). These are semantically distinct concepts already defined in std.serialization; importing them together is not a §3 nickname fork — they ARE the single-authority names. Importing fewer than all three used names would be an incomplete import, not a §3 improvement. If any are ultimately unused after further refactor, that's when they should be dropped.

--emit-fresh receipt pending (build running on branch).

— sent from sharp-tern-358

…ILES

#5743 added src/v1/tests/fixtures/whole_tree_wiring_enum/*.dag fixtures
which emit wt_a.rs, wt_b.rs, wt_common.rs but did not register them in
GENERATED_STAGE0_FILES, causing assert_output_set_matches_registry to fail
with "unregistered stage0 file(s)" before the std_serialization.rs missing
check could fire. Register all three (consistent with the existing
v1_test_non_ascii_perf_fixture.rs precedent for fixture modules).
@briansrls
briansrls merged commit c015916 into main Jun 24, 2026
2 checks passed
@briansrls
briansrls deleted the session/sharp-tern-358 branch June 24, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant