Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scripts/regen_runtime_mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,12 @@ def render_dag_scalar_module(records: dict[str, RecordDef], sums: dict[str, list
output_name="LiteralBits",
variant_name_overrides={"LitInt": "Int", "LitBool": "Bool", "LitString": "String"},
),
render_sum(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: Adding AtomPayload to the mirror generator without committing the regenerated dag_scalar_generated.rs leaves the Rust substrate without an AtomPayload definition after dag.rs deletes the hand-written enum, breaking fail-closed compiler construction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: the finding matched pushed tip 43f79424b (WIP amended locally before regen/bootstrap/manifest were folded in). Current branch tip 42beb0e03 includes the regenerated src/v3/compiler/src/dag_scalar_generated.rs with pub enum AtomPayload { ... } plus bootstrap + parse manifest updates; cargo check -p v3-compiler is clean.

Force-pushed session/sharp-gull-429 so the PR no longer sits on the intermediate WIP without generated output — not stale dismissal, same fix the comment asked for (committed regen artifact).

"AtomPayload",
sums["AtomPayload"],
"#[derive(Debug, Clone)]",
output_name="AtomPayload",
),
Comment on lines +760 to +764

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Regenerate scalar mirror before deleting AtomPayload type

This change wires AtomPayload into the generator, but the generated output file is not updated in the same commit after removing the hand-written enum from src/v3/compiler/src/dag.rs. Because src/v3/compiler/src/dag_scalar_generated.rs still has no AtomPayload definition, the crate no longer compiles (cargo check -p v3-compiler reports unresolved AtomPayload imports/types across many modules). Please regenerate and commit the scalar mirror output (or keep the manual enum until that happens).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on current PR head `42beb0e03` (also `origin/session/sharp-gull-429`):

  • This inline thread is anchored to `43f79424b` (see `commit_id` on the review) — the intermediate WIP that added `render_sum("AtomPayload", …)` and removed the hand enum without committing `dag_scalar_generated.rs`. On that SHA your diagnosis is correct.

  • Tip `42beb0e03` includes `src/v3/compiler/src/dag_scalar_generated.rs` with `pub enum AtomPayload { … }` (after `LiteralBits`), plus bootstrap + parse manifest. `python3 scripts/regen_runtime_mirrors.py --check` is clean; `cargo check -p v3-compiler` is clean.

So the requested fix (regenerate + commit scalar mirror) is already landed; the finding is not applicable to the current commit — not dismissed as stale without checking, see SHAs above.

render_sum(
"CardinalityBound",
sums["CardinalityBound"],
Expand Down
256 changes: 128 additions & 128 deletions src/v3/compiler/src/bootstrap_generated.rs

Large diffs are not rendered by default.

256 changes: 128 additions & 128 deletions src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs

Large diffs are not rendered by default.

71 changes: 0 additions & 71 deletions src/v3/compiler/src/dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,77 +412,6 @@ pub struct Field {
pub ty: DeclarationId,
}

/// Dissolution ledger — **AtomPayload**:
///
/// 🟢 **Terminal at M1(2.6).** Four variants covering the four
/// user-input kinds at the type-atom level:
///
/// - `Literal(LiteralBits)` — a literal bit pattern carried at
/// the type level (e.g., the `3` in `Cardinality::Exact(3)`).
/// - `UnresolvedIdentifier(String)` — a name reference that has
/// not yet been resolved against the declaration table.
/// Produced during lowering and eliminated at
/// `resolve_pending_identifiers` time.
/// - `ResolvedByStructure(DeclarationId)` — a name reference that
/// resolved by structural walk.
/// - `ResolvedByName(DeclarationId)` — a name reference that
/// resolved by name-keyed fallback.
/// - `TypeParam(String)` — a type parameter declaration slot.
/// Shared across references inside a parameterized declaration.
///
/// 4-pattern check:
/// - Pattern 1 (fact placement): fails. Each variant has distinct
/// downstream consumers (literal constant folding, identifier
/// resolution via `declaration_by_name`, SubstStack lookup).
/// - Pattern 2 (variant-is-data): fails. Different payload types
/// per variant.
/// - Pattern 3 (algebraic form): fails. Each variant is a terminal
/// fact from a distinct user-input boundary.
/// - Pattern 4 (dimensional): fails.
///
/// Pre/post-sweep phase is now **structural**. Before M1(2.6)
/// review round 7 the shape was
/// `Identifier { name: String, resolved: Option<DeclarationId> }`
/// which hid a phase coproduct inside the Option. The split into
/// `UnresolvedIdentifier`, `ResolvedByStructure`, and
/// `ResolvedByName` makes that distinction visible to the type
/// system: unresolved stubs, structural references, and
/// name-fallback references are on separate variants rather than
/// hidden behind `Some`/`None`.
///
/// Verdict: terminal. Future extensions (Span-backed metadata
/// atoms for diagnostic-only uses, Char / Float literals) go
/// through §8.10's substrate-extension audit.
#[derive(Debug, Clone)]
pub enum AtomPayload {
/// A literal bit pattern carried at the type level.
/// Computation-side literals live in ValueNode.data, not here.
Literal(LiteralBits),
/// An unresolved identifier. Produced during lowering when a
/// name reference can't be resolved against the current symbol
/// table (forward references, pending cross-file imports, the
/// bootstrap's dangling refs to types in un-loaded std/ modules).
/// `resolve_pending_identifiers` either converts to
/// `ResolvedByStructure` / `ResolvedByName` or emits a
/// fail-closed diagnostic.
UnresolvedIdentifier(String),
/// A resolved identifier reached by structural walk.
/// Produced when lowering wires a known structural edge
/// directly into the declaration graph.
ResolvedByStructure(DeclarationId),
/// A resolved identifier reached by name-keyed fallback.
/// Produced by `resolve_pending_identifiers` when an
/// unresolved stub is repaired via `declaration_by_name`.
ResolvedByName(DeclarationId),
/// A type parameter declaration slot. Declared at the top of a
/// parameterized declaration (via `Declaration.type_params`);
/// referenced from inside the body by resolved identifier atoms
/// that resolve to this slot's DeclarationId. A single TypeParam
/// Atom is shared across all references to it — the substrate
/// is a DAG of declarations, not a tree.
TypeParam(String),
}

impl AtomPayload {
pub fn resolved_id(&self) -> Option<DeclarationId> {
match self {
Expand Down
9 changes: 9 additions & 0 deletions src/v3/compiler/src/dag_scalar_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ pub enum LiteralBits {
String(String),
}

#[derive(Debug, Clone)]
pub enum AtomPayload {
Literal(LiteralBits),
UnresolvedIdentifier(String),
ResolvedByStructure(DeclarationId),
ResolvedByName(DeclarationId),
TypeParam(String),
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CardinalityBound {
Exact(u32),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ src/v3/std/list.dag 19 40269 8c648d4a4fd05c21
src/v3/std/lookup.dag 5 4734 f97d4e536b675b1b
src/v3/std/parse_surface.dag 17 94961 9b9d42b7673f21d3
src/v3/std/resources.dag 5 3632 5303e31e96b01ee5
src/v3/std/substrate.dag 50 109763 b929d532a7ea6060
src/v3/std/substrate.dag 50 109842 f69596b21c7867d2
src/v3/std/substrate_minimal.dag 8 5372 feeb314c735f4672
src/v3/std/termination.dag 18 36478 d010232f0373dc99
src/v3/std/tokenize.dag 8 38819 2e158a74f33c18cc
Expand Down
35 changes: 35 additions & 0 deletions src/v3/std/substrate.dag
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,41 @@ type LiteralBits
| LitBool(Bool)
| LitString(String)

// Dissolution ledger — AtomPayload (substrate authority; was dag.rs hand-Rust).
//
// 🟢 TERMINAL at M1(2.6). Five variants covering the user-input kinds at the
// type-atom level:
//
// - Literal(LiteralBits) — a literal bit pattern carried at the type level
// (e.g. the `3` in Cardinality::Exact(3)).
// - UnresolvedIdentifier(String) — a name reference not yet resolved against
// the declaration table. Produced during lowering; eliminated at
// resolve_pending_identifiers time.
// - ResolvedByStructure(DeclarationId) — resolved by structural walk.
// - ResolvedByName(DeclarationId) — resolved by name-keyed fallback.
// - TypeParam(String) — a type parameter declaration slot, shared across
// references inside a parameterized declaration.
//
// 4-pattern check:
// - Pattern 1 (fact placement): fails. Each variant has distinct downstream
// consumers (literal constant folding, identifier resolution via
// declaration_by_name, SubstStack lookup).
// - Pattern 2 (variant-is-data): fails. Different payload types per variant.
// - Pattern 3 (algebraic form): fails. Each variant is a terminal fact from a
// distinct user-input boundary.
// - Pattern 4 (dimensional): fails.
//
// Pre/post-sweep phase is structural. Before M1(2.6) review round 7 the shape
// was Identifier { name: String, resolved: Option<DeclarationId> }, which hid a
// phase coproduct inside the Option. The split into UnresolvedIdentifier,
// ResolvedByStructure, and ResolvedByName makes that distinction visible to the
// type system: unresolved stubs, structural references, and name-fallback
// references are separate variants rather than hidden behind Some/None.
//
// Verdict: terminal. Future extensions (Span-backed metadata atoms for
// diagnostic-only uses, Char / Float literals) go through §8.10's
// substrate-extension audit.
//
// 🟢 TERMINAL at current substrate scope. This is the durable atom
// connective surface the lowered declaration graph carries.
type AtomPayload
Expand Down
Loading