Repository navigation
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
Closed
gunbai-bot[bot] wants to merge 3 commits into
gunbai-bot[bot] wants to merge 3 commits into
Conversation
…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
Contributor
Author
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.
Auto-opened by session-dashboard for session
cool-heron-752.Pushing to
session/cool-heron-752-verify9461advances this PR.Worker attestation
Before flipping this PR to ready for review, confirm each item:
npm test,cargo test) and the result.Closes #Ndirective.Summary
TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.
Test plan