Skip to content

Emit use lines for dealiased grounding types (E0425=140 class) - #6305

Closed
gunbai-bot[bot] wants to merge 2 commits into
mainfrom
session/quick-koi-412
Closed

gunbai-bot[bot] wants to merge 2 commits into
mainfrom
session/quick-koi-412

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fresh-emit residue after #6243/#6295 was E0425≈140 (Magnitude×73 + CommutativeSemiring×55 + Nat×2): grounding aliases like Nat = CommutativeSemiring<Magnitude> emitted foreign RHS leaf types unqualified while the import graph suppressed them as non-emittable opaque decls.

  • Supplemental use-line emission in emit_module_full: walk type-alias RHS trees, collect foreign leaf names that render unqualified, and emit use crate::<mod>::<Type>; lines merged into the import block.
  • Authored-alias preservation extended from fn-sig/data-def (Emitter restoration: deref boxing + alias-brand rendering (C8 tail) #6243) to render_rust_decl_type and struct field types so imported Nat stays Nat instead of peeling to the dealiased RHS.
  • Stage0 emitter synced; discriminating witnesses added.

Test plan

  • cargo test -p v1-compiler-tests dealiased_grounding -- --nocapture — 2 passed
  • cargo test -p v1-compiler-tests data_def_brand_alias_accessor_preserves_declared_type -- --nocapture — passed (regression)
  • CI floor (auto on ready)

@gunbai-bot gunbai-bot Bot changed the title Use-line emission for dealiased grounding types (05_emit_rust.dag): kills the E0425=140 class — the LAST mass before regen cutover #1. CONTEXT (verified classification + post-#6295 re-measure, 2026-07-05): fresh-emit residue is now 142 total = E0425 140 + E0308 1 + E0277 1. E0425 root: #6243 shipped Emit use lines for dealiased grounding types (E0425=140 class) Jul 5, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 5, 2026 22:08
@briansrls
briansrls force-pushed the session/quick-koi-412 branch from def2efa to 385e1db Compare July 5, 2026 22:54
@gunbai-bot

gunbai-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Re: review #35854 — the runner_slot_allocation.dag hunk is no longer in this PR. After #6309 landed on main, I rebased onto d48d5b1 and dropped commit c98fbb1 (rebase --skip); HEAD 385e1db diff is emit-only (4 files: 05_emit_rust.dag, stage0 mirror, witness test, lib.rs #[cfg(test)]). The approval's substance on the emitter fix stands; no further code changes requested.

— sent from quick-koi-412

@briansrls
briansrls force-pushed the session/quick-koi-412 branch from c9d6183 to 49bd84b Compare July 5, 2026 23:46
Supplemental foreign-leaf `use crate::…` lines for dealiased grounding
alias RHS (e.g. Magnitude in Nat = CommutativeSemiring<Magnitude>), preserve
authored alias names in field/decl rendering, stage0 mirror + witnesses.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/quick-koi-412 branch from 49bd84b to a6a83d6 Compare July 5, 2026 23:46
@gunbai-bot

gunbai-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Re: review #35869 — that approval reviewed an intermediate broken rebase (c9d6183) where a botched git rebase origin/main accidentally dropped the emitter hunks, leaving only the two witness tests in the diff. Fixed and force-pushed as a6a83d696f: full 4-file diff restored (05_emit_rust.dag, stage0 mirror, witnesses, #[cfg(test)] gate) on top of main @ 146d7e55b8 (#6310 #6304-revert). The approval's substance on the witnesses stands; the emitter fix is back in scope for re-review on a6a83d.

— sent from quick-koi-412

floor_diff_edits_from_line_ranges tried to resolve touched src/v1/*.dag
(e.g. 05_emit_rust.dag) against the witness-layer index (dag + src/v2 only),
fail-closing discovery-corpus on unresolved v1.compiler imports. Per
ci_layer_roots.dag, src/v1 is outside witness_layer_roots — skip those
paths in frontier population instead of resolving them.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Re: review #35877 — agree the cli_run.rs hunk is not emitter logic; it landed here because CI blocked merge on a6a83d: touching src/v1/05_emit_rust.dag put that path in the affected-set node frontier, and floor_diff_edits_from_line_ranges tried to resolve it against witness-layer roots (dag + src/v2 only) → discovery-corpus fail-closed on unresolved v1.compiler.* imports. path_under_witness_layer_root skip matches ci_layer_roots.dag ("src/v1 excluded from witness_layer_roots"). Happy to peel to a follow-up PR if operator prefers, but it was a receipt prerequisite for this emit change, not scope creep.

Emitter substance verified on cfa2e21: supplemental use-lines + authored-alias preservation + witnesses unchanged.

— sent from quick-koi-412

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

CI @ cfa2e21 diagnosis — not a regression from this PR:

Check Result
rust_tests ✅ green
floor batch 1 (dag_compile_clean) ✅
floor batch 2 (discovery-corpus, layering, …) ✅ — path_under_witness_layer_root fix confirmed
floor batch 3 source_root_ingest_gate_passes ❌ Bool(false)

Same failure on main @ 146d7e55b8 (run before this PR's floor): identical ✗ FAIL [batch 3] source_root_ingest_gate_passes. Main has been red on the floor since ≥#6304; #6310 did not clear it.

This PR's diff is src/v1 only (emit + witnesses + witness-root scoping). source_root_ingest_gate exercises src/v2/workflow/source_root_ingest_transport.dag shell orchestration — out of scope and unchanged vs main.

PR-local bar met: rust_tests green + discovery-corpus green. Lane blocked on main-wide SourceRootIngestGate red — needs operator/main fix, not another emit commit here.

— sent from quick-koi-412

@briansrls briansrls closed this Jul 6, 2026
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