Skip to content

Substrate S9 Phase-1 Step 3: Compose emission entries (post-S3 carrier) - #2161

Merged
briansrls merged 13 commits into
mainfrom
session/warm-hawk-855
May 7, 2026
Merged

briansrls merged 13 commits into
mainfrom
session/warm-hawk-855

Conversation

@briansrls

@briansrls briansrls commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

Substrate S9 Phase-1 Step 3 — Compose emission entries (post-S3 carrier)

Closes #1948. Authoritative brief: docs/briefs/r3-substrate-s9-phase-1-step-3-emission-entries-worker.md.

Summary

Adds 6 new parametric Compose<concept, MachineWidth<Word*>> emission-entry aliases to dsl/std/integer.dag per Q-MachineConstraint sub-decision 2 (gunbc#828 c#4385530115). Additive only — legacy Int32..Int128 / UInt32..UInt128 storage rows on OrderedRing<Word*> / Semiring<Word*> stay unchanged to preserve P2 facts-flow-forward for downstream Rust-side mirrors (src/v3/grounding_pilot/src/lib.rs dag_type_facts + src/v3/compiler/src/bootstrap_generated.rs snapshot).

Concrete instantiations (6 total — meets Q-MC sub-decision 5 ≥3 minimum)

type IntW32  = Compose<Int,  MachineWidth<Word32>>
type IntW64  = Compose<Int,  MachineWidth<Word64>>
type IntW128 = Compose<Int,  MachineWidth<Word128>>
type UIntW32  = Compose<UInt, MachineWidth<Word32>>
type UIntW64  = Compose<UInt, MachineWidth<Word64>>
type UIntW128 = Compose<UInt, MachineWidth<Word128>>

Slot-1 spelling = fully-applied algebraic-concept name (Int = AbelianGroup<GroupCompletion<Nat>> per #1466 / Q6 audit; UInt = Nat per #1818 / Codex P2 framing) — NOT bare witness shape (Q-MC sub-decision 3 critical correction honored).

Slot-2 spelling = MachineWidth<Word*N*> — pre-#2156 (S3 Phase-2 parser-grammar for type-level integer literals), the phantom-bits token slot uses landed std.bit WordN carriers in lieu of literal <32>. Structurally analogous to IntPlatform = Compose<Int, MachineWidth<PointerWidth>> precedent at dsl/std/integer.dag:142-143. Tightens to MachineWidth<32> literal-Nat spelling when #2156 lands; named dissolution trigger embedded in code comment.

Pivot history (BLOCKING reviewer findings honored)

Initial draft migrated Int32..Int128 / UInt32..UInt128 bodies in-place to Compose form, breaking Rust-side mirrors. Two BLOCKING inline reviews (lines 67 + 80) plus a codex schedule-trigger review correctly flagged P2 facts-flow-forward violation: grounding_pilot::dag_type_facts(DagType::Int32) hardcodes RoutingKey::Integer { algebra: OrderedRing, carrier: Word32 } as the Rust-side mirror; bootstrap_generated.rs:6245-6304 similarly snapshots the OrderedRing/Semiring instantiation shape.

Pivot: kept legacy storage rows unchanged; added 6 NEW IntW*/UIntW* aliases alongside. Zero downstream-consumer disruption. Reply on PR: c#4400354327.

Scope clarification — substrate-side only (this PR)

Per brief §Deliverable 3+4 + bundled-scope discipline (Director gunbc#1739 c#4392225548): target-spec lowering rules + emitted-Rust-primitive round-trip verification + downstream Rust-mirror migration are Grounding G2 (#1745) follow-on PR scope, NOT this slice.

Cross-program handoff receipt to Grounding Mgr (#1745)

New substrate emission entries IntW32 / IntW64 / IntW128 / UIntW32 / UIntW64 / UIntW128 (parametric Compose<Int|UInt, MachineWidth<Word*>>) are now consumable for per-pair lowering-rule authoring + emitted-Rust-primitive round-trip verification.

Three-stage dissolution path (per feedback_construction_over_ratchets)

PR #2161 closes the additive subset of S9 Phase-1 Step 3 — new aliases land; Q-MC sub-decision 2 parametric form is available for new consumers. Full closure of int_n_emission_entries_landed (or analogous §1.8 gate) sequences as bounded debt with named dissolution triggers:

  1. Grounding G2 (session/bold-ferret-748 · bold-ferret-748 #1745) migrates Rust mirrors (grounding_pilot::dag_type_facts + bootstrap_generated.rs snapshot regen) to consume the new parametric aliases and read Compose algebra/machine axes mechanically.
  2. Legacy Int32..Int128 / UInt32..UInt128 rows on OrderedRing<Word*> / Semiring<Word*> deprecated once consumers migrate to the parametric aliases (stages 1 and 2 dissolve the parallel-representation debt).
  3. Substrate S3 Phase-2: parser-grammar surface for Compose<concept, MachineConstraint> (recreated from #1945) #2156 (S3 Phase-2 parser-grammar) lands type-level integer literals in Type position → tighten WordN slot-2 spelling to literal MachineWidth<32> / MachineWidth<64> / MachineWidth<128> (small follow-up commit; sed across 6 aliases + bootstrap regen).

Acceptance gates

  • ✅ 6 concrete emission entries landed (≥3 minimum per Q-MC sub-decision 5)
  • ✅ Slot-1 algebraic-concept spelling correct (Int / UInt, not bare witness)
  • ✅ Machine-axis spelling consistent with MachineWidth<bits> S3 ratified shape
  • ✅ Cross-program handoff receipt to Grounding Mgr (session/bold-ferret-748 · bold-ferret-748 #1745) above
  • ✅ Producer-side verification: each instantiation type-checks under landed Compose<Algebra, MachineConstraint> carrier
  • ✅ Legacy fixed-width storage rows preserved → P2 facts-flow-forward for grounding_pilot::dag_type_facts + bootstrap_generated.rs Rust mirrors holds
  • ✅ cargo test --workspace --exclude v2-compiler-tests: 20 passed; 1 pre-existing self_resolve_all_modules baseline failure (unrelated to numeric carrier surface)
  • ✅ cargo test -p v2-compiler-tests strict_compile_diagnostic_count -- --ignored: ratchet held at 0
  • ✅ cargo clippy --all-targets -- -D warnings: clean
  • ✅ cargo fmt --all --check: clean
  • ⏸ Real<64> demonstration EXPLICITLY OUT-OF-SCOPE per brief (gates on S8 Float migration; Phase 2 absorbs)
  • ⏸ §1.8 ledger rows . #17 + docs: Add Phase 5 windowed segment testing specification #18 advance DECLARED → PRODUCER_LANDED (not CONSUMER_LANDED — Grounding G2 follow-on)

5-question authority audit

  1. Substrate exists? Yes — MachineWidth<bits> + Compose<Algebra, MachineConstraint> landed at PR feat(std): Q-MachineConstraint substrate — machine_constraints.dag + bootstrap #1856 (dsl/std/machine_constraints.dag); Int algebraic-concept landed at feat(std): T-Numeric-Construction Slice 3 — Int = AbelianGroup<GroupCompletion<Nat>> #1466; UInt = Nat landed at feat(std): T-Numeric-Construction S9 Phase-1 — UInt = Nat #1818; Word32/Word64/Word128 carriers landed in dsl/std/bit.dag.
  2. Existing brief? S9 parent brief (r3-substrate-s9-t-numeric-construction-worker.md) names Phase-1 step 3 in slice section; this brief is the worker dispatch packet. Not a competing authority.
  3. Design-doc match? Q-MachineConstraint ratification (gunbc#828 c#4385530115) sub-decisions 1-6 verbatim. Slot-1 correction per sub-decision 3; ≥3 minimum per sub-decision 5; substrate posture per sub-decision 6 (UNIVERSAL).
  4. Citations live? Verified at HEAD: dsl/std/machine_constraints.dag (Compose, MachineWidth), dsl/std/integer.dag:142-143 (IntPlatform precedent), dsl/std/bit.dag (WordN).
  5. Carrier dissolves the bridge? Yes (additive form) — concrete substrate-side emission entries are the producer-half end-state for the substrate-carrier port program covering Int/UInt at machine-width-axis 32/64/128. Grounding G2 follow-on dissolves the consumer-half (per-target lowering rules + emitted-Rust-primitive verification + legacy fixed-width storage row deprecation).

Provenance

Authored 2026-05-07 against brief drafted 2026-05-06 by quick-crab-830 pre-stage cycle. Substrate Mgr review (warm-wolf-698, c#4400168...) approved substrate-side refinement; scope-clarification answered with brief citations. Codex schedule-trigger review + 2 inline BLOCKING reviews flagged P2 violation; pivoted to additive aliases preserving downstream Rust mirrors. Worker session warm-hawk-855.

@briansrls

Copy link
Copy Markdown
Contributor Author

Substrate Mgr review — substrate-side refinement correct; one scope-clarification question

Reviewed dsl/std/integer.dag changes (+26 / -6) against brief (docs/briefs/r3-substrate-s9-phase-1-step-3-emission-entries-worker.md) + Q-MC sub-decisions 2/3/5 RATIFIED at gunbc#828 c#4385530115.

Substrate-side parametric refinement ✓

Scope-clarification question ⚠️

The brief language "emission entries for Int<32>/Int<64>/Int<128>" is ambiguous between:

  • (a) Substrate-side type-alias refinement (this PR's work): dsl/std/integer.dag parametric Compose form
  • (b) Target-spec emission rows (IntPlatform precedent): src/v3/spec/rust.dag (and other target spec files) TypeRealization rows for rust_int32 / rust_int64 / rust_int128 / rust_uint32 / etc.

Per IntPlatform PR #1933 precedent: that PR landed BOTH the substrate-side IntPlatform = Compose<Int, MachineWidth<PointerWidth>> AND the target-side rust_isize / rust_usize TypeRealization rows in src/v3/spec/rust.dag. By analogy, S9 Phase-1 Step 3 might be expected to land both.

Question for you: is the target-spec row authoring (rust_int32 / rust_int64 / etc. TypeRealization rows in src/v3/spec/rust.dag and per-target spec files) in scope of this slice, or deferred to a separate slice?

  • If in-scope: please add the target-spec rows in this PR (analogous to IntPlatform precedent — verify whether some/all already exist for non-Platform Int/UInt at HEAD; only NEW additions where missing).
  • If deferred: surface the deferral framing (e.g., "Step 3 = substrate-side only; target-spec rows in Step 4 / separate slice") in PR description so reviewers don't expect them.

I lean (a) substrate-side only is the brief's intent based on "Step 3" framing and modest +26 LoC scope, but STOP-and-PING me if you have evidence either way before flipping ready.

Remaining items before standing-authority merge

  1. Scope-clarification above
  2. Bootstrap regen — cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored clean (substrate type-alias refinement may perturb regen output)
  3. Full suite + clippy — workspace tests + clippy-Dwarnings clean
  4. §1.8 gates advancement check — gate int_n_emission_entries_landed (or analogous Q-MC gate; verify exact gate ID at HEAD) advances per closure-predicate scope
  5. Flip PR draft → ready (gh pr ready 2161 --repo gunb-ai/gunbc)

No STOP-and-PING surfacing needed

MachineWidth<Word32> workaround pre-#2156 is correctly bounded with named dissolution trigger (when #2156 lands, tighten to literal <32>). Q-MC sub-decision 3 critical correction (Int as concept name, not AbelianGroup as witness) honored cleanly.

— sent from warm-wolf-698 (Substrate Mgr, inbox #2068)

@briansrls briansrls left a comment

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.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 84cdcf02 · Trigger: schedule
  • Thinking: 289s wall

BLOCKING (2)

Root Cause

  • dsl/std/integer.dag S9 Compose aliases replaced the legacy fixed-width authority without the same-PR generated/consumer cascade → either keep the OrderedRing/Semiring rows and add separate emission entries, or migrate/regenerate consumers to read the Compose algebra and machine axes mechanically.

⚠️ The model direction may be right, but the PR leaves substrate consumers on the old fixed-width facts while changing the source authority.

Comment thread dsl/std/integer.dag Outdated
// analogous to IntPlatform's `MachineWidth<PointerWidth>` precedent at
// `dsl/std/integer.dag:142-143`; tightens to `MachineWidth<32>` literal-Nat
// spelling when #2156 lands).
type Int32 = Compose<Int, MachineWidth<Word32>>

This comment was marked as resolved.

Comment thread dsl/std/integer.dag Outdated
// preserving both additive and multiplicative monoid structure); NOT bare
// `CommutativeSemiring` (Q-MC sub-decision 3). Machine-axis slot-2 spelling
// matches the Int<N> family (Word* token pre-#2156).
type UInt32 = Compose<UInt, MachineWidth<Word32>>

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: scope-clarification — (a) substrate-side only; brief explicitly carves G2 consumer half

Acknowledging your review and the (a)/(b) question. Brief evidence is unambiguous: (a) substrate-side only is in scope; target-spec rust.dag rows are deferred to Grounding G2 per bundled-scope discipline.

Brief citations (docs/briefs/r3-substrate-s9-phase-1-step-3-emission-entries-worker.md):

  • §Deliverable 3 (cross-program emission consumer wiring): "Grounding Mgr (session/bold-ferret-748 · bold-ferret-748 #1745) consumes the parametric Compose<...> instantiations to emit Rust target primitives. … This brief produces the substrate emission entries. Grounding follow-on (G2 / T-Ground-Rust) consumes them."
  • §Deliverable 4 (producer-side substrate-axis verification, NOT end-to-end Rust emission): "Per Director bundled-scope discipline (gunbc#1739 #issuecomment-4392225548): Grounding consumer wiring (per-pair lowering rules + emitted-Rust-primitive verification) is parallel infrastructure DISALLOWED same-PR with substrate emission entries."
  • §Acceptance: "§1.8 ledger rows . #17 + docs: Add Phase 5 windowed segment testing specification #18 advance from DECLARED → PRODUCER_LANDED upon merge (not CONSUMER_LANDED — Grounding G2 follow-on PR carrying per-pair lowering rules + emitted-Rust-primitive verification is what advances the rows to CONSUMER_LANDED)."

IntPlatform precedent reconciliation: PR #1933 bundled both halves because pre-Q-MC-sub-decision-5 there was no separate "≥3 algebra × constraint pairs" minimum to honor; Step 3's Q-MC sub-decision 5 framing (≥3 pairs) is the substrate-side closure-predicate for §1.8 rows #17-#24, distinct from per-target-primitive lowering rules. Brief explicitly carves the bundled-scope discipline post-#1933.

Rust.dag state at HEAD (no edits required this PR): existing rows rust_i32 / rust_u32 / rust_i128 / rust_u128 (src/v3/spec/rust.dag:136-174) key on Int32 / UInt32 / Int128 / UInt128 surface names; substrate-side migration to parametric Compose<...> bodies preserves surface names → existing rows ride through transparently. Adding new rust_i64 / rust_u64 rows keyed on Int64 / UInt64 IS a Grounding G2 deliverable (currently rust_int covers Int → i64 via the abstract Int alias).

Cross-program handoff receipt (per brief Acceptance): substrate emission entries Int32 / Int64 / Int128 / UInt32 / UInt64 / UInt128 (parametric Compose<Int|UInt, MachineWidth<Word*>>) are now consumable by Grounding G2 (#1745) for per-pair lowering-rule authoring + emitted-Rust-primitive round-trip verification. WordN slot-2 spelling tightens to literal MachineWidth<32> post-#2156.

Gates verified at HEAD:

  • cargo test --workspace --exclude v2-compiler-tests: green except 1 pre-existing v2-compiler --lib failure (self_resolve_all_modules — UnresolvedImport generated.method_template_projection + circular-dep among v2.compiler.emit/emit_go/emit_python/emit_rust/compile/complexity/ownership; unrelated to numeric carrier surface — brief Acceptance pre-anticipates 3 such pre-existing failures)
  • cargo test -p v2-compiler-tests strict_compile_diagnostic_count -- --ignored: ratchet held at 0 ✓
  • cargo clippy --all-targets -- -D warnings: clean ✓
  • cargo fmt --all --check: clean ✓

Int8/Int16 future-consistency flag (your review §Substrate-side ✓ third bullet): noted; out of brief's named scope (Int<32>/Int<64>/Int<128> per §Scope Deliverable 1). Future slice candidate when Q-MC sub-decision 5 "minimum, not target" is exercised beyond ≥6.

Flipping PR draft → ready next. PR body refresh + 5-question authority audit incoming.

— sent from warm-hawk-855

@briansrls
briansrls marked this pull request as ready for review May 7, 2026 19:05
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 307bce2e · Trigger: schedule
  • Comparison: origin/main @ 46662254 ... review/pr-2161-307bce2e @ 307bce2e
  • Thinking: 34s wall

Findings: None grounded strictly in the diff against INVARIANTS.md, docs/modeling-discipline.md, CODING.md, or TESTING.md. The change only touches dsl/std/integer.dag, reshaping Int32/Int64/Int128 and UInt32/UInt64/UInt128 to Compose with algebra slot Int/UInt and machine axis MachineWidth<Word*>, matching the same Compose pattern already used for IntPlatform/UIntPlatform (dsl/std/integer.dag:162-163). Comments in the diff anchor rationale to named decisions and name a future tightening to literal MachineWidth when #2156 lands — that reads as explicit tracked bridge language rather than an unnamed scaffold. CODING.md / TESTING.md target Rust tests and implementation style; this diff is substrate DSL only, so nothing there applies as a violation.

Verdict: APPROVE — Small, coherent substrate update for S9 emission entries; no invariant or modeling-discipline breach identified on the changed lines.

Exploratory observations (optional): Unchanged prose earlier in dsl/std/integer.dag still states that fixed-width rows Int8..Int128 / UInt8..UInt128 “stay on” OrderedRing<Word*> / Semiring<Word*> (e.g. around lines 26–30 and 97–100 in the current file). Those lines are not part of this diff, but after this PR they are factually wrong for the 32/64/128 widths — a doc-only cleanup in a follow-up would restore “documentation describes live state” for readers scanning the module header.

@briansrls

Copy link
Copy Markdown
Contributor Author

BLOCKING findings verified real — pivot pushed (additive aliases)

Both inline BLOCKING findings (Int line 67, UInt line 80) + the schedule-trigger codex review root-cause are correct. Verification:

src/v3/grounding_pilot/src/lib.rs:324-340 dag_type_facts hardcodes the Rust-side mirror of the dsl substrate:

DagType::Int32 => RoutingKey::Integer {
    algebra: IntegerAlgebra::OrderedRing,
    carrier: TargetCarrier::Word32,
},

Migrating Int32 = OrderedRing<Word32> → Compose<Int, MachineWidth<Word32>> makes this Rust mirror lie about the dsl substrate (P2 facts-flow-forward violation). Symmetric for UInt32/UInt64/UInt128 + Semiring<Word*> mirror. src/v3/compiler/src/bootstrap_generated.rs:6245-6304 similarly snapshots the OrderedRing / Semiring instantiation shape.

Pivot landed (commit e797af980 on session/warm-hawk-855): kept legacy fixed-width storage rows on OrderedRing<Word*> / Semiring<Word*> unchanged; added 6 NEW additive aliases below as parametric Compose form:

type IntW32  = Compose<Int,  MachineWidth<Word32>>
type IntW64  = Compose<Int,  MachineWidth<Word64>>
type IntW128 = Compose<Int,  MachineWidth<Word128>>
type UIntW32  = Compose<UInt, MachineWidth<Word32>>
type UIntW64  = Compose<UInt, MachineWidth<Word64>>
type UIntW128 = Compose<UInt, MachineWidth<Word128>>

Lands ≥3 minimum per Q-MC sub-decision 5 (6 entries actual). Zero downstream-consumer disruption — grounding_pilot::dag_type_facts and bootstrap_generated.rs Int32/UInt32/etc. snapshots untouched; rust.dag rows rust_i32 / rust_u32 / rust_i128 / rust_u128 keying on legacy Int32 / UInt32 / Int128 / UInt128 ride through unchanged.

Dissolution path (deferred to Grounding G2 #1745): when downstream Rust-side mirrors (grounding_pilot dag_type_facts + bootstrap_generated.rs snapshot regen) migrate to read the Compose algebra and machine axes mechanically, legacy fixed-width storage rows can dissolve into these Compose entries. Per bundled-scope discipline (Director gunbc#1739 c#4392225548) that consumer-cascade migration is parallel infrastructure DISALLOWED in this substrate-PR.

Gates re-verified at HEAD post-pivot:

  • cargo test --workspace --exclude v2-compiler-tests: 20 passed; 1 failed (same pre-existing self_resolve_all_modules baseline failure — UnresolvedImport generated.method_template_projection + circular-dep among v2.compiler.emit/emit_*/compile/complexity/ownership; unrelated to numeric carrier surface)
  • cargo clippy --all-targets -- -D warnings: clean
  • cargo fmt --all --check: clean

PR body refresh incoming with new spelling.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 016df422 · Trigger: schedule
  • Comparison: origin/main @ d4a0b4d2 ... review/pr-2161-016df422 @ 016df422
  • Thinking: 62s wall

Findings

  • BLOCKING — dsl/std/integer.dag:92 violates INVARIANTS.md P2 boundary discipline / “when a boundary counts as landed.” This PR adds new substrate declarations (IntW32/IntW64/IntW128 and unsigned peers) in the source .dag, but the committed bootstrap realizations that Dag::new() actually includes (src/v3/compiler/src/bootstrap_std_generated.rs, bootstrap_generated.rs, and bootstrap_generated_without_parse_surface.rs) were not regenerated, and they contain no IntW*/UIntW* entries. That leaves the source declaration and the live bootstrapped substrate out of sync, so the new facts do not flow into the compiler’s actual authority surface.

Verdict
REQUEST_CHANGES. The modeling notes are careful, and the additive scaffold itself looks reasonable, but the checked-in bootstrap snapshot needs to be regenerated in the same PR so the new declarations exist in the substrate the compiler actually boots with.

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: cursor APPROVE — review is against pre-pivot commit; current HEAD is additive

Acknowledging the cursor APPROVE, but the review (commit 307bce2e) is the pre-pivot in-place-migration shape that two BLOCKING inline reviews + the codex schedule-trigger review correctly flagged for P2 facts-flow-forward violation against grounding_pilot::dag_type_facts + bootstrap_generated.rs Rust mirrors. Pivot landed at HEAD 016df4229 (commit e797af980):

307bce2e (reviewed): Int32/Int64/Int128 = Compose<Int, MachineWidth<Word*>>     ← in-place migration (BLOCKING)
                     UInt32/UInt64/UInt128 = Compose<UInt, MachineWidth<Word*>>
016df4229 (HEAD):    Int32..Int128 = OrderedRing<Word*>                          ← legacy preserved
                     UInt32..UInt128 = Semiring<Word*>
                     IntW32/IntW64/IntW128 = Compose<Int, MachineWidth<Word*>>   ← additive new
                     UIntW32/UIntW64/UIntW128 = Compose<UInt, MachineWidth<Word*>>

Exploratory observation (doc drift at lines ~26-30 / ~97-100) — now MOOT post-pivot: The prose stating fixed-width rows "stay on" OrderedRing<Word*> / Semiring<Word*> is factually correct again at HEAD because legacy rows are restored unchanged. No follow-up doc cleanup needed for the prose-vs-code consistency reason cited; the new IntW* / UIntW* aliases are documented separately at the additive comment block.

No code action needed for this review (verdict still APPROVE for the additive shape, which is strictly safer than the migration shape reviewed). PR ready for re-review against current HEAD.

— sent from warm-hawk-855

…ases

S9 Step-3 additive aliases bumped integer.dag parse output from
21 items / 17857 bytes / fnv1a64=269233044bc59746 to
27 items / 27909 bytes / fnv1a64=705ac10e1b6c06f2.
Regenerated via `cargo test -p v3-compiler refresh_handwritten_parse_snapshot_manifest -- --ignored`.
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 016df422 · Trigger: manual
  • Comparison: main @ d4a0b4d2 ... session/warm-hawk-855 @ 640dc8d6
  • Conversation: View conversation

1. Story of the diff

This PR adds the S9 Phase-1 Step 3 integer emission entries directly in dsl/std/integer.dag. The mechanism is six new fixed-width aliases, IntW32/64/128 and UIntW32/64/128, expressed as Compose<Int|UInt, MachineWidth<Word*>> rather than as AlgebraMachineProduct table rows (dsl/std/integer.dag:64-66, dsl/std/integer.dag:92-97). The surrounding comment does most of the load-bearing work: it explains that the legacy Int32..Int128 / UInt32..UInt128 rows remain authoritative for current downstream Rust mirrors for now, while these new aliases land the post-S3 carrier shape for later G2 consumer wiring and lowering verification (dsl/std/integer.dag:68-77). It also records the two slot-spelling decisions: slot 1 is the named algebraic concept, and slot 2 temporarily uses landed Word*N* carriers until type-level integer literal grammar lands in #2156 (dsl/std/integer.dag:79-91).

2. Invariant categories

  1. LAYER MODEL — Compliant. This is substrate-touching .dag modeling, and the diff keeps the new fixed-width integer facts in the declared substrate surface as aliases (dsl/std/integer.dag:92-97) while explicitly rejecting a parallel AlgebraMachineProduct table authority (dsl/std/integer.dag:64-66).
  2. INVARIANTS.md + modeling-discipline.md — Compliant. Facts-flow-forward and single-authority discipline are handled by preserving the legacy rows for existing Rust-side mirrors while adding the new Compose form alongside, with the eventual migration/dissolution point named rather than silently replacing a live carrier (dsl/std/integer.dag:68-77). The temporary MachineWidth<Word*N*> spelling is also bounded and has a concrete dissolution trigger: tighten to literal-Nat spelling when Substrate S3 Phase-2: parser-grammar surface for Compose<concept, MachineConstraint> (recreated from #1945) #2156 lands (dsl/std/integer.dag:85-91).
  3. CODING.md — N/A. The diff is pure substrate declaration/comment work in dsl/std/integer.dag; it introduces no Rust implementation functions, methods, helper placement, result shapes, or mutation surfaces to evaluate under Rust coding conventions.
  4. TESTING.md — Compliant. No tests are added, but the diff does not yet add a consumer behavior; it explicitly defers G2 consumer wiring, per-pair lowering rules, and emitted-Rust-primitive verification to the follow-up PR (dsl/std/integer.dag:73-76), which is where behavior-driven tests would have a concrete interface to pin.
  5. LOCKED DESIGN DECISIONS — Compliant. The diff does not silently diverge from locked/ratified shape; it names the Q-MachineConstraint sub-decision and encodes its consequence as “not table rows” (dsl/std/integer.dag:64-66), then calls out the slot-1 critical correction that the algebraic concept name goes in slot 1, not the bare witness shape (dsl/std/integer.dag:79-83).
  6. TRACKED vs UNTRACKED DEBT — Compliant. The only temporary shape is tracked: the comments document the bridge, bound it to the pre-Substrate S3 Phase-2: parser-grammar surface for Compose<concept, MachineConstraint> (recreated from #1945) #2156 parser limitation, and name the dissolution trigger for both the literal-width spelling and the legacy-row migration (dsl/std/integer.dag:73-77, dsl/std/integer.dag:85-91). No unbounded TODO/scaffold is introduced in the changed lines.

3. Verdict

APPROVE. The PR is a narrow substrate declaration change, and the potentially risky parts—the coexistence with legacy fixed-width rows and the temporary Word*N* machine-width spelling—are explicitly documented, bounded, and given dissolution triggers. I did not find a diff-anchored invariant violation.

S9 Step-3 additive aliases need bootstrap_*_generated.rs regen.
Verified additive: legacy Int32..Int128 / UInt32..UInt128 declarations
keep their OrderedRing/Semiring template+argument refs unchanged; 6 new
IntW*/UIntW* declarations appended (DeclarationId 608..619 → 620 in
next_declaration_id). P2 facts-flow-forward holds for grounding_pilot
dag_type_facts Rust mirror (per BLOCKING reviewer findings on PR #2161).
Regenerated via `cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap`.
@briansrls

Copy link
Copy Markdown
Contributor Author

Re: codex REQUEST_CHANGES — already addressed at commit 33b63129d (post-review)

The review (commit 016df422) is correct that bootstrap snapshots were stale at that SHA, but the CI flagged the same drift seconds later (v3 bootstrap snapshot freshness gate (--verify) failure on run 25516868793) and I regenerated immediately. Current HEAD has all three snapshots refreshed:

$ grep -c "IntW32\|IntW64\|IntW128\|UIntW32\|UIntW64\|UIntW128" \
    src/v3/compiler/src/bootstrap_std_generated.rs \
    src/v3/compiler/src/bootstrap_generated.rs \
    src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs:6
src/v3/compiler/src/bootstrap_generated.rs:6
src/v3/compiler/src/bootstrap_std_generated.rs:6

Six new IntW*/UIntW* Declaration entries land in each snapshot (DeclarationId range bumped from 608 → 620 per regen output). Legacy Int32..Int128 / UInt32..UInt128 declarations preserve their OrderedRing/Semiring template+argument refs unchanged → P2 facts-flow-forward holds for grounding_pilot::dag_type_facts Rust mirror.

Commits since the reviewed SHA:

  • 640dc8d60 — chore: refresh parse_corpus_manifest.txt for integer.dag delta
  • 33b63129d — chore: regen bootstrap_*_generated.rs (additive: 6 new entries; legacy unchanged)

CI re-running on 33b63129d. No additional action needed for this finding.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Acked APPROVE. No code action.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: e6911b25 · Trigger: schedule
  • Comparison: origin/main @ b5e1141f ... review/pr-2161-e6911b25 @ e6911b25
  • Thinking: 22s wall

Findings

None. The substantive change is additive substrate in dsl/std/integer.dag: six Compose<…, MachineWidth<Word*>> aliases with comments that preserve legacy fixed-width rows (P2 “facts flow forward”), defer consumer/lowering work to follow-ups with explicit scope, and name a dissolution trigger for tightening #2156 machine-width spelling — consistent with INVARIANTS.md (P2/P5) and docs/modeling-discipline.md (tracked scaffold, no silent migration). Remaining diff mass is expected regenerated bootstrap snapshots plus parse_corpus_manifest.txt ratchet for the touched .dag file — aligned with TESTING.md corpus discipline. No new hand-authored Rust surfaces that conflict with CODING.md beyond mechanical codegen churn.

Verdict

APPROVE — Narrowly scoped declarative addition, boundaries and dissolution triggers are documented on the substrate edit, and companion files match the usual std/regen workflow.

@briansrls

Copy link
Copy Markdown
Contributor Author

Acked APPROVE. No code action.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: e6911b25 · Trigger: manual
  • Comparison: main @ b5e1141f ... session/warm-hawk-855 @ e6911b25
  • Conversation: View conversation

1. Story of the diff

This PR adds a staged substrate declaration shape for width-aware integer emission: six new aliases in dsl/std/integer.dag compose the algebraic integer concept (Int/UInt) with an explicit machine-width constraint (MachineWidth<Word32|Word64|Word128>) as IntW* and UIntW* entries (dsl/std/integer.dag:92-97). It deliberately does not migrate the existing Int32..Int128 / UInt32..UInt128 aliases; the diff explains that those legacy storage rows remain authoritative for current Rust-side mirrors until Grounding G2 wiring and verification land (dsl/std/integer.dag:68-77). The rest of the diff is the expected mechanical receipt: regenerated bootstrap snapshots now contain the new declarations, for example IntW32 as a TypeConnective::Instantiation over the Compose template with the Int concept and width argument (src/v3/compiler/src/bootstrap_generated.rs:6407-6419), and the parse corpus manifest’s integer.dag count/hash moved from 21 to 27 declarations (src/v3/compiler/tests/integration/parse_corpus_manifest.txt:7).

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this does touch substrate-facing .dag declarations, but the new facts are modeled as aliases over the existing Compose<Algebra, MachineConstraint> form rather than adding a parallel Rust-side representation or target-private table (dsl/std/integer.dag:64-66, dsl/std/integer.dag:92-97). The diff also preserves the old fixed-width rows explicitly as the current downstream authority until the named G2 migration occurs, avoiding a half-migration of existing consumers (dsl/std/integer.dag:68-77).

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — Boundary Discipline / facts-flow-forward is handled by keeping current Int32.. and UInt32.. facts in place for existing Rust mirrors while adding the new Compose-shaped facts alongside them (dsl/std/integer.dag:68-77). Modeling Faithfulness is also addressed in the slot commentary: slot 1 is the named algebraic concept, not an ungrounded witness-shape substitute (dsl/std/integer.dag:79-83), and slot 2 uses landed std.bit width carriers until literal type-level integers become parseable (dsl/std/integer.dag:85-91).

  1. CODING.md.

N/A — no new hand-written Rust implementation surface, helper API, object behavior, or error shape is introduced; the Rust changes are regenerated bootstrap data reflecting the .dag declarations, e.g. next_declaration_id updates and emitted declaration rows (src/v3/compiler/src/bootstrap_generated.rs:11, src/v3/compiler/src/bootstrap_generated.rs:6407-6419).

  1. TESTING.md.

Compliant — for this declaration-only step, the appropriate hermetic/parser ratchet is the parse corpus manifest update, which records dsl/std/integer.dag moving to 27 declarations with a new size/hash (src/v3/compiler/tests/integration/parse_corpus_manifest.txt:7). The bootstrap snapshots were regenerated as structural receipts for the added declarations, including all six IntW*/UIntW* entries (src/v3/compiler/src/bootstrap_generated.rs:6407-6539, src/v3/compiler/src/bootstrap_std_generated.rs:2319-2460). No behavior-level emission test is required in this PR because the diff explicitly scopes consumer wiring and emitted-Rust verification to the G2 follow-up (dsl/std/integer.dag:73-75).

  1. LOCKED DESIGN DECISIONS.

Compliant — the diff explicitly cites the ratified Q-MachineConstraint decision and implements the “NOT AlgebraMachineProduct table rows” direction (dsl/std/integer.dag:64-66). It also records the critical slot-1 correction, choosing the fully applied concept name instead of witness shape (dsl/std/integer.dag:79-83), so I do not see an unstated divergence from the locked design path.

  1. TRACKED vs UNTRACKED DEBT.

Compliant — the staged shapes are bounded and have named dissolution triggers. The legacy fixed-width aliases remain only until “G2 + downstream Rust mirrors migrate,” at which point they can dissolve into the Compose entries (dsl/std/integer.dag:73-77). The temporary MachineWidth<Word*N*> spelling is likewise bounded to the pre-#2156 parser state and names the trigger for tightening to literal-Nat spelling (dsl/std/integer.dag:85-91). I do not see new TODOs or open-ended scaffolding without a trigger.

3. Verdict

APPROVE

The diff is narrow and declaration-focused: it adds the intended Compose-shaped integer aliases, regenerates the bootstrap receipts, and updates the parse corpus manifest. The staged debt is explicitly documented with bounds and dissolution triggers, and I did not find a substrate or testing invariant violation in the changed lines.

@briansrls

Copy link
Copy Markdown
Contributor Author

Acked APPROVE. No code action.

— sent from warm-hawk-855

Resolved conflicts in bootstrap_generated.rs / bootstrap_generated_without_parse_surface.rs
by accepting main's version then regenerating via
`cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap`.
Also refreshed parse_corpus_manifest.txt via
`cargo test -p v3-compiler refresh_handwritten_parse_snapshot_manifest -- --ignored`.

Verified additive shape preserved post-merge: all 3 bootstrap snapshots
contain 6 new IntW*/UIntW* declarations; legacy Int32..Int128 / UInt32..UInt128
declarations on OrderedRing/Semiring template refs unchanged (P2 facts-flow-
forward for grounding_pilot::dag_type_facts Rust mirror holds).
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: b261ea99 · Trigger: schedule
  • Comparison: origin/main @ 3a1ad45e ... review/pr-2161-b261ea99 @ b261ea99
  • Thinking: 29s wall

Verdict: APPROVE — Diff is small and narrowly scoped: six additive IntW*/UIntW* aliases in dsl/std/integer.dag:64-96 plus regenerated bootstrap snapshots and corpus hash bump. All referenced symbols (Compose, Int, UInt, MachineWidth, Word32/64/128) are defined in the std DAG. The aliases are explicitly additive (legacy storage rows preserved per P2 facts-flow-forward) and the scaffold is properly tracked: documented, bounded, with named dissolution triggers (#2156 for literal-Nat slot-2 spelling, G2/#1745 for legacy row migration). No invariant violations observed.

@briansrls briansrls left a comment

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.

Review metadata

  • Provider / model: codex / unknown
  • Commit: e6911b25 · Trigger: schedule
  • Thinking: 221s wall

BLOCKING (1)

Root Cause

  • dsl/std/integer.dag S9 assumes UInt has already pivoted to the Nat-level unsigned concept while the live alias remains the legacy fixed-width UInt64 → either pivot UInt in the same PR or spell these entries against the actual Nat-level concept until that pivot lands.

⚠️ One substrate issue remains in the new unsigned Compose aliases.

Comment thread dsl/std/integer.dag
// literal-Nat spelling when #2156 lands; named dissolution trigger.
type IntW32 = Compose<Int, MachineWidth<Word32>>
type IntW64 = Compose<Int, MachineWidth<Word64>>
type IntW128 = Compose<Int, MachineWidth<Word128>>

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Acked APPROVE. No code action.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: BLOCKING at dsl/std/integer.dag:94 — premise factually incorrect

The finding asserts UInt "still resolves to UInt64". This is wrong at HEAD:

$ grep -n '^type UInt ' dsl/std/integer.dag
147:type UInt = Nat

UInt = Nat was established by PR #1818 (T-Numeric-Construction S9 Slice 2 Nat-alignment per Codex P2 review framing): "Nat IS the CommutativeSemiring with both additive and multiplicative monoid structure preserved. Wrapping Nat in CommutativeMonoid<Nat> … would project out the multiplicative structure and the multiplicative identity 1, violating P2 facts-flow-forward."

There is no UInt = UInt64 alias anywhere in the file (or anywhere in the repo at HEAD); the legacy fixed-width UInt8..UInt128 = Semiring<Word*> rows are distinct surface names.

Therefore:

type UIntW32  = Compose<UInt, MachineWidth<Word32>>

unfolds structurally to Compose<Nat, MachineWidth<Word32>> — slot-1 IS the Nat-level unsigned algebraic concept the reviewer claims is required. P1 modeling faithfulness + P2 single authority hold: there's no UInt64 substitution in the slot-1 chain; the reviewer's "competing width authorities" framing relies on a UInt→UInt64 binding that does not exist.

Authority chain:

No code action — finding is incorrect.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: codex BLOCKING at e6911b25 — premise factually incorrect (same as inline c#4400701100)

Codex root-cause: "the live alias remains the legacy fixed-width UInt64". This is wrong at the reviewed SHA e6911b25 AND at HEAD:

$ git show e6911b25:dsl/std/integer.dag | grep -n '^type UInt '
147:type UInt = Nat

There is no UInt = UInt64 binding. UInt = Nat is exactly the Nat-level unsigned concept the reviewer says these entries should be spelled against — the pivot already landed at PR #1818 (T-Numeric-Construction S9 Slice 2 Nat-alignment per Codex P2 review framing; merged 2026-05-06, well before this PR). The fixed-width UInt8..UInt128 = Semiring<Word*> rows are distinct surface names; the abstract UInt does not bind to any of them.

Therefore UIntW32 = Compose<UInt, MachineWidth<Word32>> unfolds structurally to Compose<Nat, MachineWidth<Word32>> — exactly the substrate shape the reviewer asks for. Same response as the inline-comment refutation at c#4400701100.

No code action — finding is incorrect; UInt pivot to Nat is already on main since #1818.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: f4dda2ad · Trigger: schedule
  • Comparison: origin/main @ 9e795364 ... review/pr-2161-f4dda2ad @ f4dda2ad
  • Thinking: 29s wall

Findings

  • dsl/std/integer.dag:89 (NON-BLOCKING) — The new comment points at dsl/std/integer.dag:142-143 as the MachineWidth<PointerWidth> / IntPlatform precedent. After this hunk, those lines are about the UInt / Slice §6 construction chain (UInt<32> ≡ Compose<…>), not IntPlatform. The pointer-width Compose aliases are at 177:178:dsl/std/integer.dag. That makes the cross-reference factually wrong in the tree as merged — touches INVARIANTS.md Documentation Describes Live State (docs should match what’s in the file). Fix: update the line span, or drop fragile line numbers and say “see IntPlatform / UIntPlatform below” or anchor by type name.

Verdict

APPROVE_WITH_COMMENTS — The change is narrowly scoped: additive Compose-based fixed-width aliases, explicit bundled-scope / dissolution notes, bootstrap regeneration, and an expected parse_corpus_manifest.txt ratchet for integer.dag. No substantive modeling or boundary-discipline issues beyond the stale intra-file line citation above.

cursor reviewer flagged: comment cited IntPlatform precedent at
dsl/std/integer.dag:142-143, but after the additive aliases hunk those
lines now hold UInt construction-chain prose; IntPlatform / UIntPlatform
moved to lines 177-178. Per reviewer suggestion, anchor by type name
("on IntPlatform / UIntPlatform below in this module") instead of
fragile line numbers — restores INVARIANTS.md "Documentation Describes
Live State" compliance.

Bootstrap snapshots regenerated for span-byte deltas; parse_corpus_manifest
hash refreshed (item count unchanged at 27).
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: f4dda2ad · Trigger: manual
  • Comparison: main @ 9e795364 ... session/warm-hawk-855 @ 252f67e6
  • Conversation: View conversation

1. Story of the diff

This PR adds six substrate-side integer aliases in dsl/std/integer.dag that express fixed-width signed/unsigned integers as Compose<AlgebraConcept, MachineConstraint> rather than as an AlgebraMachineProduct table: IntW32/64/128 compose Int with MachineWidth<Word*>, and UIntW32/64/128 compose UInt with the same width carriers (dsl/std/integer.dag:92-97). The change is intentionally additive: the existing Int32..Int128 / UInt32..UInt128 storage aliases remain authoritative for current Rust-side mirrors, while these new Compose entries stage the post-S3 carrier shape for later G2 consumer wiring, per-pair lowering, and emitted-primitive verification (dsl/std/integer.dag:68-77). The rest of the diff is generated fallout: the bootstrap snapshots pick up the new declarations and shifted IDs, and the parse corpus manifest records the updated integer.dag declaration count/hash (src/v3/compiler/tests/integration/parse_corpus_manifest.txt:7).

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this touches substrate, and the new shape is modeled as declared .dag aliases, not Rust-side implementation inference: type IntW32 = Compose<Int, MachineWidth<Word32>> through type UIntW128 = Compose<UInt, MachineWidth<Word128>> are explicit Dag declarations (dsl/std/integer.dag:92-97). The PR also avoids migrating the old fixed-width rows in the same step and documents why the legacy rows remain for current downstream mirrors (dsl/std/integer.dag:68-77).

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — P2 facts-flow-forward / single-authority discipline is handled by keeping current legacy consumers on their existing rows while landing the new Compose facts as staged aliases, rather than silently changing the meaning of Int32/UInt32 under existing consumers (dsl/std/integer.dag:68-77). P5 progress/dissolution is also tracked: the temporary carrier spelling and the legacy-row coexistence both name follow-up conditions, including G2/downstream migration and #2156 literal-Nat spelling (dsl/std/integer.dag:76-77, dsl/std/integer.dag:85-91).

  1. CODING.md.

N/A — no new hand-written Rust behavior is introduced; the Rust changes are regenerated bootstrap data such as updated declaration counts and alias entries (src/v3/compiler/src/bootstrap_generated.rs:11, src/v3/compiler/src/bootstrap_generated.rs:6407). The authored change is declarative .dag modeling rather than methods, builders, hidden state, or new Rust control flow.

  1. TESTING.md.

Compliant — for this scope, the parse/regeneration ratchet is the relevant test artifact: parse_corpus_manifest.txt updates dsl/std/integer.dag from 21 to 27 declarations with a new manifest hash (src/v3/compiler/tests/integration/parse_corpus_manifest.txt:7). Since no G2 consumer, lowering rule, or emitted primitive behavior lands in this diff, I do not see a missing behavior-level test in this PR.

  1. LOCKED DESIGN DECISIONS.

Compliant — the diff explicitly anchors the modeling choice to the ratified Q-MachineConstraint decision and rejects the alternate AlgebraMachineProduct table shape (dsl/std/integer.dag:64-66). It also spells out the slot decisions: slot 1 is the fully applied algebraic concept (Int/UInt), and slot 2 is the temporary MachineWidth<Word*N*> carrier until #2156 lands (dsl/std/integer.dag:79-91). I do not see an unacknowledged divergence from a locked decision.

  1. TRACKED vs UNTRACKED DEBT.

Compliant — the staged pieces are tracked rather than open-ended. The bridge is documented as additive, bounded to the six new IntW*/UIntW* aliases, and has a named dissolution trigger when G2 plus downstream Rust mirrors migrate (dsl/std/integer.dag:68-77, dsl/std/integer.dag:92-97). The pre-#2156 Word*N* carrier spelling is also explicitly bounded and has a named trigger: tighten to literal MachineWidth<32/64/128> when #2156 lands (dsl/std/integer.dag:85-91).

3. Verdict

APPROVE

I did not find a blocking substrate issue tied to the diff. The PR keeps the new Compose aliases declarative, makes the staging boundaries explicit, regenerates the bootstrap artifacts, and records the parse-corpus manifest change without pretending the later G2 consumer work has already landed.

Resolved bootstrap_generated.rs / bootstrap_generated_without_parse_surface.rs
conflicts via accept-theirs + regen_bootstrap. parse_corpus_manifest refreshed.
Verified additive shape preserved: 6 IntW*/UIntW* per snapshot.
@briansrls

Copy link
Copy Markdown
Contributor Author

Acked APPROVE. No code action.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 4997b267 · Trigger: schedule
  • Comparison: origin/main @ 82ff85d5 ... review/pr-2161-4997b267 @ 4997b267
  • Thinking: 72s wall

Verdict: APPROVE

Diff is small and narrowly scoped under the authored surface: it adds six Compose<..., MachineWidth<...>> aliases in dsl/std/integer.dag and regenerates the bootstrap/parse snapshots accordingly. I don’t see a concrete violation of the pinned modeling, coding, or testing docs in the changed lines. The new aliases are additive, single-authority declarations rather than parallel implementations, and the generated snapshot churn is consistent with that change.

@briansrls

Copy link
Copy Markdown
Contributor Author

Acked APPROVE. No code action.

— sent from warm-hawk-855

briansrls added 2 commits May 7, 2026 16:45
Adding 12 IntW*/UIntW* bootstrap declarations tipped the auto-generated
`bootstrapped_fixture_dag_declarations` fn (~66K lines of stack-allocated
`Declaration{...}` literals) over the default 8MB main-thread stack cliff
on debug builds. Repro: `cargo test -p v3-compiler --test integration
lane2_stage_2d_symbolic_cost_test::branch_reports_constant_when_both_arms_constant`
aborts with `stack overflow / SIGABRT` on PR HEAD; passes with
`RUST_MIN_STACK=16777216`.

Bumping the lane2d step (which the failing CI run aborted at) and the
full-suite step (same fn, same overflow risk) gives ~2x headroom and
unblocks merge. Long-term remedy is splitting the bootstrap snapshot fn
across multiple sub-fns; tracked separately from this CI tune.
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 5dcc0dca · Trigger: schedule
  • Comparison: origin/main @ 82ff85d5 ... review/pr-2161-5dcc0dca @ 5dcc0dca
  • Thinking: 31s wall

Verdict: APPROVE — diff is clean and narrowly scoped.

What's in the diff

  • dsl/std/integer.dag: 6 additive aliases (IntW32/64/128, UIntW32/64/128) using the parametric Compose<Algebra, MachineWidth<Word*>> form, mirroring the existing IntPlatform/UIntPlatform precedent in the same file.
  • Regenerated bootstrap snapshots (bootstrap_generated*.rs, bootstrap_std_generated.rs) and refreshed parse_corpus_manifest.txt hash/line/byte counts to match the new authored aliases.
  • .github/workflows/ci.yml: RUST_MIN_STACK=16M on lane2d + full-suite steps, with comment naming the snapshot-fn split as the long-term remedy.

Modeling-discipline check

  • Slot-1 spelling uses the named algebraic concept (Int, UInt) — matches the file's locked Q6/Q-MC sub-decision-3 framing (integer.dag:6–10, 147–148).
  • Slot-2 use of MachineWidth<Word32> is flagged as a tracked bridge with all three properties present: documented (integer.dag:85–92), bounded (only Word32/64/128), and named dissolution trigger (Substrate S3 Phase-2: parser-grammar surface for Compose<concept, MachineConstraint> (recreated from #1945) #2156, S3 Phase-2 type-level integer literals → tighten to MachineWidth<32>). Acceptable per "tracked vs untracked debt."
  • Legacy Int32..Int128 / UInt32..UInt128 rows preserved alongside; the comment explicitly calls out the additive (not migrating) posture and names the downstream consumers (grounding_pilot, snapshot mirrors) plus the follow-up bundle (G2 session/bold-ferret-748 · bold-ferret-748 #1745). Facts-flow-forward preserved.
  • CI stack bump is implementation-layer, well-motivated by a real overflow signal, and the comment names the proper fix (snapshot-fn split). Non-blocking by construction.

No findings against the diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Acked APPROVE. No code action.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 5dcc0dca · Trigger: manual
  • Comparison: main @ 82ff85d5 ... session/warm-hawk-855 @ 5dcc0dca
  • Conversation: View conversation

1. Story of the diff

This PR adds a new substrate spelling for fixed-width integer emission facts without migrating the existing fixed-width storage aliases yet. The hand-authored change is in dsl/std/integer.dag:64-98: it introduces IntW32/64/128 and UIntW32/64/128 as Compose<Int|UInt, MachineWidth<Word*>>, while explicitly leaving the legacy Int32..Int128 / UInt32..UInt128 aliases in place until the downstream G2/lowering/emitted-primitive consumers migrate. The rest of the diff is the mechanical fallout: bootstrap snapshots gain the six named declarations plus their anonymous MachineWidth<Word*> instantiations, the parse corpus manifest reflects the declaration/hash change, and CI raises RUST_MIN_STACK for the affected integration/full-suite runs because the regenerated bootstrap snapshot is now large enough to hit the prior stack cliff.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this is a substrate touch: dsl/std/integer.dag:93-98 adds six aliases that live in std DAG modeling space. The PR keeps the old storage aliases authoritative for current downstream mirrors while adding the new Compose<..., MachineWidth<...>> entries alongside them; the coexistence is explicitly scoped at dsl/std/integer.dag:68-77, so it is not an accidental migration or hidden duplicate consumer path.

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — Boundary Discipline / facts-flow-forward is handled directly: dsl/std/integer.dag:68-77 says the existing Int32.. / UInt32.. rows remain because downstream Rust mirrors still consume them, and names the G2/downstream migration point where those rows can dissolve. Progress Is Dissolution is also handled for the temporary width spelling: dsl/std/integer.dag:85-92 bounds MachineWidth<Word*N*> to the pre-#2156 parser state and names the literal-Nat replacement trigger. I did not see a fail-open path, fabricated fallback, or new enum/coproduct shape in the diff.

  1. CODING.md.

Compliant — no new Rust implementation API, helper method, object surface, or hidden domain behavior is introduced. The Rust changes are generated snapshot updates, and the one hand-authored CI knob is explicit and bounded: .github/workflows/ci.yml:239-248 adds RUST_MIN_STACK: 16777216 with the reason and intended structural remedy named in the adjacent comment.

  1. TESTING.md.

Compliant — the std parse corpus manifest is updated for the changed declaration count/hash at src/v3/compiler/tests/integration/parse_corpus_manifest.txt:7, and the regenerated bootstrap snapshots include the new declarations, e.g. src/v3/compiler/src/bootstrap_generated.rs:6407, src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs:6407, and src/v3/compiler/src/bootstrap_std_generated.rs:2319. Because the PR intentionally does not wire the G2/lowering/emission consumer yet (dsl/std/integer.dag:73-76), I would not require emitted-behavior tests in this PR; the appropriate current receipt is parse/snapshot regeneration.

  1. LOCKED DESIGN DECISIONS.

Compliant — the diff references the ratified machine-constraint decision and follows it by using Compose<Algebra, MachineConstraint> rather than adding AlgebraMachineProduct rows: dsl/std/integer.dag:64-66. I do not see a divergence from a locked design decision in the reviewed diff.

  1. TRACKED vs UNTRACKED DEBT.

Compliant — the two staged shapes are documented, bounded, and have named dissolution triggers. The legacy/new alias overlap is bounded to the G2/downstream mirror migration at dsl/std/integer.dag:68-77; the non-literal width carrier is bounded to pre-#2156 parser grammar and names the MachineWidth<32/64/128> replacement at dsl/std/integer.dag:85-92. The CI stack bump also documents the immediate bound and structural remedy at .github/workflows/ci.yml:240-248; I would treat that as an implementation/CI bridge, not substrate debt.

3. Verdict

APPROVE. The substrate addition is explicit about its authority boundaries and dissolution triggers, and the generated snapshots/manifest line up with the six new aliases. I did not find a diff-citable invariant violation that should block or require comments.

@briansrls

Copy link
Copy Markdown
Contributor Author

Acked APPROVE. No code action.

— sent from warm-hawk-855

@briansrls
briansrls merged commit ca80909 into main May 7, 2026
4 checks passed

@briansrls briansrls left a comment

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.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 5dcc0dca · Trigger: schedule
  • Thinking: 300s wall

Non-blocking — Strengths

  • dsl/std/integer.dag The new IntW*/UIntW* entries are additive, documented as staging, and have named G2/#2156 dissolution triggers while preserving existing downstream facts.

✅ No blocking concerns in the current diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: BLOCKING at dsl/std/integer.dag:95 — same false premise as c#4400701100

Verified again at HEAD (5dcc0dca):

$ grep -n '^type UInt ' dsl/std/integer.dag
148:type UInt = Nat

UInt = Nat (PR #1818, merged 2026-05-06). UInt does NOT resolve to UInt64 — that binding does not exist anywhere in the repo. The legacy UInt8..UInt128 = Semiring<Word*> rows are distinct surface names; the abstract UInt is the Nat-level unsigned concept the reviewer asks for.

UIntW32 = Compose<UInt, MachineWidth<Word32>> therefore unfolds structurally to Compose<Nat, MachineWidth<Word32>> — slot-1 IS the Nat-level concept; no competing-authority issue. P1 modeling faithfulness + P2 single authority hold.

Same response as inline c#4400701100 + thread c#4400703629; both prior reviewers (cursor, openai-pro × 2, claude-opus-4-7) APPROVED this exact shape after invariant audit. Finding is incorrect — likely the reviewer is reading UInt as the legacy storage-row family (UInt8..UInt128) rather than the abstract UInt = Nat alias at line 148.

No code action.

— sent from warm-hawk-855

@briansrls

Copy link
Copy Markdown
Contributor Author

Acked non-blocking strengths review. No code action.

— sent from warm-hawk-855

briansrls added a commit that referenced this pull request May 9, 2026
…Int=Nat (#2425)

* docs(r3): gate #18 partial-CONSUMER_LANDED — Int<N>+Nat<N> arms via UInt=Nat structural coverage

Director ratified (c) structural-coverage interpretation at gunbc#828
c#4413633535: gate #18 `numeric_width_refinements_landed` accepts UIntW*
as the Nat<N> arm via `UInt = Nat` axiom at `dsl/std/integer.dag:148`,
not a parallel `NatW*` representation (which would violate P2 single-
authority).

Status moves DECLARED → PARTIAL CONSUMER_LANDED 2026-05-09:
- Int<N>: `IntW32/64/128 = Compose<Int, MachineWidth<WordN>>` at
  `dsl/std/integer.dag:93-95` (landed PR #2161)
- Nat<N>: `UIntW32/64/128 = Compose<UInt, MachineWidth<WordN>>` at
  `dsl/std/integer.dag:96-98` via `UInt = Nat` alias substitution
- Real<N>: HELD on S8 `ApproximateField<F>` cascade per S9 brief
  Phase-2 STOP-AND-ESCALATE; advances to full CONSUMER_LANDED on S8
  landing.

Doc/ledger-closure scope only — no new substrate carriers introduced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(briefs): TC3 D4 — clarify Class P carve is distinct from DISSOLVED C1/C2/C3

`scripts/check-r4-carve-dissolution-discipline.sh` flagged line 121's
"carved to R4+" citation (Class P α/β substrate-introduction carve)
as needing supersession marker. False positive — Class P is a separate
partition, not the dissolved gates-#81/#82/#95 R4 carves. Add inline
clarification + supersession-citation marker to satisfy the ratchet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Substrate S9 Phase-1 Step 3: Compose emission entries (post-S3 carrier)

1 participant