Skip to content

Repair the coproduct-variant-name escape in 05_emit_rust's already-filter: a variant name is in neither already_imported_names nor local_decl_names, so it is synthesised into a fabricated pub use — executed specimen std.algebra Optional/empty_map, fix module-local at 1c grain never via variant_to_en - #9524

Closed
gunbai-bot[bot] wants to merge 3 commits into
mainfrom
session/cool-heron-752-verify9461

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session cool-heron-752.
Pushing to session/cool-heron-752-verify9461 advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

Brian Searls and others added 3 commits August 27, 2026 14:52
…port candidates

reference_derived_use_lines already filters candidates against the names the
module declares, and its own note names the hazard: the bare-name registry is
last-write-wins across the closure, so a homonym in another module steals the
row and a self-colliding `pub use` is synthesized. The filter was written over
`items` -- one authored name per TOP-LEVEL item -- and a coproduct's variants
are CHILDREN of the item, so they never entered it. The guard was at the wrong
grain, not missing.

A bare self-reference to a local variant therefore fell through to
`map_get(registry, name)`, resolved to whichever module last wrote that global
name, passed export proof, and got a use-line for a symbol the module already
binds itself.

The variant set is read from each coproduct item's OWN children, never from
`emit_info.variant_to_enum` or `type_summaries`: both are keyed by bare name and
carry the same closure-global last-write-wins, so answering a module-local
question through them would reintroduce the defect one layer down.

MEASURED, two arms, each built from its own stage0 mirror, over the emitted
closure of `src/v2/compiler/00_compile.dag` (175 files):

  membership delta: exactly one file, `v2_std_node.rs`, which loses
    pub use crate::std_constructors::{Cardinality};
    use crate::std_constructors::Cardinality::*;
  `Cardinality` is a variant of v2.std.node's own `Connective`; the homonym is
  `std.constructors`' `type Cardinality = Required | Optional`. Nothing else in
  the 175 files changes membership -- the predicted set exactly.

  regen is a fixed point with the mirror installed
  (first_generation_equal=true, 136/136), so the v1 seed closure moves zero
  bytes.

  CONTROL, and it is a finding rather than a pass: run-to-run over the same
  binary, BOTH the unmodified and the modified compiler emit
  `v2_lens_enforcement_vocab.rs` and `v2_std_cross_tree_resolution.rs` with
  import blocks in varying ORDER (identical membership). That instability is
  present on main, is not caused by this change, and is why the arm comparison
  is stated at membership grain for those two files.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	src/v1/05_emit_rust.dag
#	src/v1/stage0/src/v1_compiler_emit_rust.rs
@gunbai-bot

gunbai-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Closing this auto-opened verification branch: it contains no implementation commit and duplicates the already-open PR #9461. The exact specimen result was reported on #9461 instead.

@gunbai-bot gunbai-bot Bot closed this Aug 27, 2026
@gunbai-bot
gunbai-bot Bot deleted the session/cool-heron-752-verify9461 branch August 27, 2026 23:01
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.

0 participants