Skip to content

R3 gate #67: numeric_construction_demonstration (T-Numeric-Construction) - #3115

Merged
briansrls merged 10 commits into
mainfrom
session/nimble-pike-34
May 15, 2026
Merged

briansrls merged 10 commits into
mainfrom
session/nimble-pike-34

Conversation

@briansrls

@briansrls briansrls commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session nimble-pike-34.
Pushing to session/nimble-pike-34 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 (below).
  • Tests run: name the command and the result (below).
  • If this closes a work item, the body contains a Closes #N directive. (none linked)
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

R3 gate #67 — numeric_construction_demonstration (T-Numeric-Construction): end-to-end v3 program using construction syntax Int<32> + Real<64> (lowers to anonymous Compose<…, MachineWidth<…>>) so the demo matches docs/r3-structure.md / docs/r3-program-plan.md §1.8 wording — parses → infers → emits Rust → runs under rustc.

  • rust.dag: TypeRealization rows rust_f32 / rust_f64 targeting named Real32 / Real64 (alias targets for the same compose expansion); import std.float { Real32, Real64 }.
  • int_literal_ranges.rs + infer.rs: allow lossless integral literal seeding for fixed-width real ports when float lexemes are absent (int_literal_allowed_integral_seed_for_real_decl); structural matcher accepts gate Implement Lane 5 remaining tool capabilities (WF19-WF22) #60 Compose<Real, MachineWidth<…>> with literal Nat width (not only Word32/Word64).
  • emit/rust_target.rs: canonicalizes anonymous gate-Implement Lane 5 remaining tool capabilities (WF19-WF22) #60 Compose<Algebra, MachineWidth<N>> to std fixed-width names (Int32, Real64, …) then reads Rust carriers from rust.dag TypeRealization (RealizationIndexes::types) — no parallel width→Rust string table; when the port’s Rust type is f32/f64 but the v3 literal is still LiteralBits::Int, emit a float-shaped literal (e.g. 0.0) so rustc accepts assignment (E0308 fix).
  • regen_bootstrap: refreshed bootstrap_generated*.rs after .dag change (regen_bootstrap --verify clean).
  • Tests: m1_3_emit_rust_test.rs — numeric_construction_demonstration_* pins Int<32>/Real<64> + rustc round-trip.

INVARIANTS §P5 Dispatch — Mechanism (b) checkable receipt

Exactly one receipt — explicit deferral (lane + concrete ROADMAP.md row):

SG-0: No new path is added to EXPECTED_HAND_AUTHORED_TEST — m1_3_emit_rust_test.rs was already census-listed; this PR only extends that file.

Dissolution (interim ratchet framing): Narrow infer/emit mirrors + boundary harness here track docs/r3-program-plan.md §1.8 gate #67 until the same obligations can be carried by .dag TestClaim / generated coverage without this hand-Rust expansion (standard T-PB-B posture).

Test plan

  • cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap -- --verify — pass
  • cargo clippy -p v3-compiler --all-targets -- -D warnings — pass (local)
  • cargo test -p v3-compiler numeric_construction_demonstration — pass (local); CI fmt + ci jobs green on latest push (full v3 workflow per rollup)

@briansrls
briansrls marked this pull request as ready for review May 14, 2026 17:49
@briansrls
briansrls force-pushed the session/nimble-pike-34 branch from 805ed81 to 0d283d6 Compare May 14, 2026 18:00
@briansrls

Copy link
Copy Markdown
Contributor Author

P5 Mechanism (b) — addressed: the PR description now states a single explicit deferral (lane T-Numeric-Construction) with a concrete ROADMAP.md anchor — § Post-merge debt (2026-05-01 paired exploratory + reflective analyses) → D. Reflective integration patterns (cross-PR) → Pattern D — numeric work changed philosophy mid-window. Also filled Summary + Test plan + SG-0 note (no new EXPECTED_HAND_AUTHORED_TEST path; m1_3_emit_rust_test.rs was already census-listed).

On the exploratory note re int_literal_float_coercion_target name-list vs structural composer: agree it is worth a follow-up pass to see if the explicit Real64/Float64/Real32/Float32 arms are redundant now that structural_compose_real_machine_width covers the sugar chain — not blocking this slice.

— sent from nimble-pike-34

@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: 38226067 · Trigger: schedule
  • Thinking: 411s wall

BLOCKING (1)

Root Cause

  • src/v3/spec/rust.dag The added f32/f64 realizations are keyed to named Real32/Real64 declarations while Real<64> lowers as anonymous Compose<Real, MachineWidth<64>> → add/canonicalize the structural realization and make the gate fixture use Int<32>/Real<64>, or explicitly update the authoritative gate text to aliases.

ROADMAP — Incomplete

  • numeric_construction_demonstration: The PR does not yet verify the docs/r3-structure.md gate wording because the executable demo uses aliases rather than the documented Int<32> + Real<64> construction surface.

⚠️ The gate-closing demo needs to exercise the actual construction surface before this can land.

/// `Real64` while float lexemes are absent (`int_literal_allowed_integral_seed_for_real_decl`).
const NUMERIC_CONSTRUCTION_DEMONSTRATION_V3: &str = "\
import std.integer { Int32 }
import std.float { Real64 }

This comment was marked as resolved.

@briansrls
briansrls force-pushed the session/nimble-pike-34 branch from 4e5c9c9 to 8eb0c3b Compare May 14, 2026 19:07
@briansrls

Copy link
Copy Markdown
Contributor Author

cursor/composer-2 (APPROVE_WITH_COMMENTS) — incorporated on current HEAD:

  1. Single peel authority — peel_decl_head_for_integral_float_seed is pub(crate) in int_literal_ranges.rs with a module doc stating Rust emit shares it; duplicate loop removed from rust_target.rs.

  2. Emit/infer alignment on Compose args — rust_carrier_for_compose_algebra_machine_width no longer assumes algebra = arguments[0]; it classifies each slot with gate60_machine_width_bits vs Int/UInt/Real ids (same detection style as the infer-side structural real path). structural_compose_real_machine_width now uses shared gate60_machine_width_bits for width extraction.

  3. Practice 4 — IntLiteralFloatCoercionTarget documents 🟡 STAGED / dissolution note.

All were non-blocking observations; this commit tightens P2 surface area anyway. Latest change: c5110ea42 on session/nimble-pike-34.

— sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

INVARIANTS §P5 (b) — live PR body: The description includes Mechanism (b) — single explicit deferral (lane T-Numeric-Construction + ** § D “Pattern D — numeric work…”** permalink). SG-0 note is there (no new census path).

Summary refresh: Updated the PR Summary to match current code: the gate #67 fixture is ** + ** + anonymous compose emit/infer path (not / import aliases).

Merge: CI green (fmt / ci / v3 / self_host_ratchet). ****. GitHub REST still shows only legacy COMMENTED state from the codex run — not two formal APPROVE records, so I’m not squash-merging per standing policy; needs fresh api-review approvals on current .

— sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

INVARIANTS §P5 (b) — live PR body: The GitHub PR description includes Mechanism (b): one explicit deferral naming lane T-Numeric-Construction and citing ROADMAP.md § D Reflective integration patterns → Pattern D (numeric work / construction reframe), plus SG-0 census note (no new EXPECTED_HAND_AUTHORED_TEST path).

Summary refresh: PR Summary was edited to match the code: gate #67 uses surface syntax Int angle 32 and Real angle 64 (gate-#60 compose lowering), not Int32/Real64 import aliases.

composer-2 review: No code changes required for this APPROVE; findings none.

Merge readiness: CI is green (fmt, ci, v3, self_host_ratchet). mergeStateStatus is CLEAN and mergeable MERGEABLE. GitHub REST pull reviews still show only an older COMMENTED review, not two distinct APPROVE records on current HEAD — not squash-merging from here per policy.

— sent from nimble-pike-34

@briansrls
briansrls force-pushed the session/nimble-pike-34 branch from 35a9dc7 to cba7cfa Compare May 14, 2026 20:10
@briansrls

Copy link
Copy Markdown
Contributor Author

cursor/composer-2 (APPROVE): Verified — no blocking findings; optional P2 notes (derive emitted primitive strings from rust.dag carrier index; stronger-than-substring tests) accepted as follow-up, not this PR.

Rebase: Branch was merge-DIRTY vs main; rebased onto latest origin/main, resolved bootstrap_generated.rs via regen_bootstrap --verify, squashed to single commit cba7cfa and force-pushed (fresh review HEAD).

Merge: Not merging from here: GitHub pull review API still lacks two formal APPROVE states on this SHA; policy wants distinct api-review approvals on current head after force-push.

— sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

cursor/composer-2 (APPROVE): Agree — no diff-grounded blocking findings. Exploratory note on dual carrier mapping (hardcoded primitives in rust_carrier_for_compose_algebra_machine_width vs rust.dag rows) is fair future P2 consolidation; tables and gate-#67 tests currently align.

P5 (b): GitHub PR description still has section INVARIANTS §P5 Dispatch — Mechanism (b) with ROADMAP Pattern D deferral + SG-0 note (not visible in git diff per rubric).

Merge: mergeStateStatus CLEAN, mergeable MERGEABLE, CI green (fmt/ci/v3/self_host_ratchet on latest push). GitHub pull /reviews API still shows only one legacy COMMENTED review on an old commit — no two APPROVE records on head 20e29a1. Not running gh pr merge from here until native review state matches policy (or operator overrides).

— sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

cursor/composer-2 (APPROVE): Confirmed — no diff-grounded findings; scope matches gate #67 (Int angle 32 / Real angle 64, lossless integral seeding, Compose to Rust carriers, float literal fragment emit, rust.dag realizations, boundary rustc roundtrip). bootstrap_generated churn is mechanical.

INVARIANTS §P5 (b): Human-confirm satisfied: live PR #3115 body includes section INVARIANTS §P5 Dispatch — Mechanism (b) with explicit ROADMAP Pattern D deferral + SG-0 census note (outside git diff per rubric).

Exploratory: Two focused tests (emit shape vs rustc roundtrip) are consistent with boundary vs executable split; peel loop cap 32 noted as future diagnostic hardening if deep alias chains appear.

Merge readiness: After this message, CI is green (fmt, ci, v3, self_host_ratchet), mergeStateStatus CLEAN, mergeable MERGEABLE. GitHub pull /reviews still shows only one legacy COMMENTED review (old commit), not two APPROVE records on head 18d531d — not running gh pr merge from this agent until native review state matches policy (dashboard api-review artifacts do not appear as GitHub APPROVE in the API).

— sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

claude-opus-4-7 (APPROVE): Acknowledged — rust.dag TypeRealization rows, shared peel + gate60 width decode, P5 body receipt (T-Numeric-Construction / ROADMAP Pattern D / SG-0 unchanged), and boundary tests shape all match current HEAD.

Exploratory (single decompose helper): Agreed as follow-up when/if UInt/Int integral-seed parity expands — not implementing in this PR; emit path needs full algebra→Rust carrier map today while infer Real path stays float-seed specific.

Merge: CI green on 63c2886 (fmt, ci, v3, self_host_ratchet), mergeStateStatus CLEAN, mergeable MERGEABLE. GitHub /pulls/3115/reviews still shows only legacy COMMENTED on old SHA, not two APPROVE records — not running gh pr merge from here per approval policy.

— sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

claude-opus-4-7 — P5 / “bridge” finding: Partially invalid as stated for Mechanism (b).

  • The required one checkable receipt is not in git diff or the commit message by design; it lives in the GitHub PR description (per rubric / your own note on dashboard-only artifacts).
  • Live PR R3 gate #67: numeric_construction_demonstration (T-Numeric-Construction) #3115 body already includes INVARIANTS §P5 Dispatch — Mechanism (b) with:
    • Explicit deferral naming lane T-Numeric-Construction and a concrete ROADMAP.md anchor (Post-merge debt 2026-05-01 → § D Reflective integration patterns → Pattern D — numeric work…) with permalink.
    • SG-0 posture: no new EXPECTED_HAND_AUTHORED_TEST path — existing m1_3_emit_rust_test.rs line only extended.
    • Dissolution / ratchet framing tied to r3-program-plan §1.8 gate Consolidate hardcoded metadata lists into compact helper macros #67 and TestClaim / generated coverage future.
  • The integral-literal seeding path is interim and labeled STAGED with a dissolution trigger in code; paired with the ROADMAP-cited deferral in the PR body, this is the intended P5 Mechanism (b) package for expanded hand-Rust, not an orphan bridge.

Allowlist drift (structural_compose_real_machine_width vs rust_carrier_for_compose_algebra_machine_width): Acknowledged non-blocking; shared peel + gate60_machine_width_bits already reduce drift; full decompose_compose_algebra_width consolidation is follow-on if Int/UInt seeding parity grows.

Merge: CI green on cadf8d2; mergeStateStatus CLEAN; mergeable MERGEABLE. GitHub /pulls/3115/reviews still shows only legacy COMMENTED on an old SHA — not two APPROVE records on current head; not running gh pr merge from here.

— sent from nimble-pike-34

@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: 63c28869 · Trigger: schedule
  • Thinking: 393s wall

BLOCKING (1)

Root Cause

  • src/v3/compiler/src/emit/rust_target.rs anonymous Compose<concept, MachineWidth> declarations cannot currently reuse declared TypeRealization/interaction facts → canonicalize structural Compose to a declared/generated .dag realization consumer instead of adding a target-specific Rust lookup table.

ROADMAP — Verified

  • numeric_construction_demonstration: The executable fixture now uses the documented Int<32> plus Real<64> construction surface.

⚠️ The gate fixture is corrected, but the implementation closes the gap with a duplicate Rust authority that should be dissolved before landing.

Comment thread src/v3/compiler/src/emit/rust_target.rs Outdated
}
let algebra = algebra?;
let bits = bits?;
if algebra == int_id {

This comment was marked as resolved.

@briansrls
briansrls force-pushed the session/nimble-pike-34 branch from c6bf9cd to abf7257 Compare May 14, 2026 21:31
@briansrls

Copy link
Copy Markdown
Contributor Author

Codex BLOCKING (63c2886) — duplicate Rust carrier authority: Addressed on current head.

Emit no longer maps width → hard-coded "i32" / "f64" strings. Flow:

  1. gate60_anonymous_compose_algebra_bits — peel + Compose slots (unchanged shape).
  2. std_fixed_width_alias_name_for_algebra_bits — maps to substrate names declared in dsl/std/integer.dag / float.dag (Int32, Real64, …), not Rust spellings.
  3. declaration_by_name + RealizationIndexes.types — carrier comes only from rust.dag TypeRealization rows (MissingTypeRealization if a named alias lacks a row).

This removes the parallel Rust lookup table the review flagged; Q-MC interaction facts stay authored in .dag, Rust target names stay single-sourced in rust.dag.

Commit: abf7257 (force-pushed; re-review on this SHA).

— sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

cursor/composer-2 (APPROVE_WITH_COMMENTS): Acknowledged — no diff-grounded violations.

P5 Mechanism (b) / merge hygiene: Confirmed on the live GitHub PR body: section INVARIANTS §P5 Dispatch — Mechanism (b) with explicit ROADMAP Pattern D deferral + SG-0 census note + gate #67 dissolution framing. (Diff-only reviews cannot see this; it is present in the description.)

Summary refresh: Updated the emit bullet to match head abf7257 — anonymous Compose resolves via std fixed-width names then TypeRealization / RealizationIndexes, not a hand-maintained width→Rust table.

Merge readiness: mergeStateStatus CLEAN, mergeable MERGEABLE, CI green on latest run. GitHub /pulls/3115/reviews still shows COMMENTED-only entries, not two APPROVE on abf7257 — not running gh pr merge from here.

— sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

cursor/composer-2 (APPROVE): Confirmed — diff story matches gate #67 (STAGED enum + lossless IEEE bounds, Ok(None) range path, TypeRealization carriers via rust_f32/rust_f64, anonymous Compose → std alias → RealizationIndexes).

P5 (b) note: Receipt is in the GitHub PR description (§P5 Mechanism (b) + ROADMAP Pattern D + SG-0), not provable from git diff — satisfies merge-hygiene ask for humans reviewing the PR tab.

Merge: HEAD d52431f, CI green, mergeStateStatus CLEAN. GitHub /pulls/3115/reviews has no two APPROVE rows on this SHA — not merging from here.

— sent from nimble-pike-34

briansrls added a commit that referenced this pull request May 14, 2026
Apply int_literal_allowed_integral_seed_for_real_decl alongside
int_literal_fits_expected_type in Decision::Set reunion, magnitude
narrow merge, decide_transform call arguments, and implicit callable
binding tolerance (P2 facts flow forward; codex #3115).

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls and others added 3 commits May 14, 2026 22:34
End-to-end Int<32> + Real<64>: infer lossless integral seeds for fixed-width
reals, shared peel + gate60 width bits, structural Compose to Rust carriers,
float literal emit, rust.dag Real32/64 realizations + regen_bootstrap, tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Canonicalize anonymous Compose<Algebra, MachineWidth<N>> to std fixed-width
alias declarations (Int32, Real64, …) and read rust.dag carrier strings
from RealizationIndexes — removes parallel width-to-Rust string table (P2).

Co-authored-by: Cursor <cursoragent@cursor.com>
Apply int_literal_allowed_integral_seed_for_real_decl alongside
int_literal_fits_expected_type in Decision::Set reunion, magnitude
narrow merge, decide_transform call arguments, and implicit callable
binding tolerance (P2 facts flow forward; codex #3115).

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/nimble-pike-34 branch from 8668d41 to 65bbbc5 Compare May 14, 2026 22:35

@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: 634536c3 · Trigger: schedule
  • Thinking: 280s wall

⚠️ No new blocking findings; the existing duplicate-authority blocker from the prior review still controls the verdict.

briansrls and others added 2 commits May 14, 2026 18:40
Remove the hand-written algebra×bits→std-name table (api-review blocker:
P2/P5 duplicate authority). Anonymous Compose carriers now find the
unique named alias with the same compose spine and a TypeRealization
row; MachineWidth slots equate through gate60_machine_width_bits so
fresh literal-nat width ids still match dsl/std aliases.

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

Copy link
Copy Markdown
Contributor Author

Resolved the blocking rust_target.rs review (hand-written Int/UInt/Real×width → alias table): 7a6cbf398 removes that mirror and resolves the anonymous Compose<…, MachineWidth<…>> id to the unique named substrate alias that (a) shares the same compose spine—algebra by DeclarationId, width slot by gate60_machine_width_bits so per-use literal-nat MachineWidth ids still match dsl/std—and (b) owns the TypeRealization row. Carriers still come only from RealizationIndexes::types.

Non-blocking codex notes (enum doc / oracle consolidation): no code change required for merge; happy to tighten the Practice-4 dissolution receipt in a follow-up if you want a specific ROADMAP row cited in-file.

@briansrls

Copy link
Copy Markdown
Contributor Author

This thread is a dashboard relay of the prior resolution note for commit 7a6cbf398 (duplicate-authority / rust_target peer resolution). No additional code change is implied—current session/nimble-pike-34 still uses gate60_realized_named_compose_peer + width facts, not the removed name table.

Merge gate: GitHub /pulls/3115/reviews still shows only COMMENTED artifacts on older SHAs (no APPROVE), and CI was still running when checked; I am not merging until those satisfy the session policy. — sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

Dashboard echo²: this item is relaying the reply that already said the prior item was a relay—there is still no new review finding and no code to change.

Re-checked (2026-05-14): GitHub checks for the PR run sampled above are green (fmt, ci, v3, self_host_ratchet all pass). mergeable is MERGEABLE.

Merge (session policy): Native GitHub /_PULLS/3115/reviews still has no APPROVED rows (only older COMMENTED codex artifacts). Until two distinct api-review APPROVE / APPROVE_WITH_COMMENTS (or equivalent) show up in the dashboard API and there is no open REQUEST_CHANGES, I am not running gh pr merge.

If the dashboard keeps feeding assistant replies back into the queue, consider tagging or filtering strings like — sent from nimble-pike-34 so they are not re-issued as operator work. — sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

1) Claude opus / dashboard review (APPROVE, non-blocking) — verified on 7a6cbf398:

  • gate60_realized_named_compose_peer (~3358): still linear over dag.declarations() with a uniqueness check; correct observation. No change: not hot today; a future (algebra, width_bits) → named peer index (built from the same DAG facts) would be the honest optimization if this shows up in profiles.
  • render_value_with_port_rust_type (~3711): still gates integral decimal rendering with rust_ty == "f32" || rust_ty == "f64" after rust_type_name_for_port; the carrier still comes from TypeRealization—this branch only fixes rustc’s float literal syntax for gate-Consolidate hardcoded metadata lists into compact helper macros #67. Agreement: dissolve when float lexeme / width substrate makes the int-literal→float-shaped seam unnecessary, not merely hide the string compare.

No commit: findings explicitly non-blocking.

2) Prior “Dashboard echo²” thread — this queue item is again assistant/meta text, not a reviewer delta; nothing to implement.

Merge readiness: fmt / ci / v3 / self_host_ratchet are green on the last run checked; mergeable is MERGEABLE; GitHub /pulls/3115/reviews still has no APPROVED rows (only older COMMENTED SHAs). Session rule asks two api-review APPROVE / APPROVE_WITH_COMMENTS (openai-pro weighted); one Claude dashboard APPROVE is not enough to gh pr merge under that policy. — sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

Stop-loss (relay⁴): This item only quotes the prior consolidated reply (already marked — sent from nimble-pike-34). No reviewer delta → no code, no further merge analysis text (avoids infinite dashboard churn).

Gates (re-sampled): checks fmt / ci / v3 / self_host_ratchet pass; mergeable MERGEABLE; GitHub reviews API: still no APPROVED / REQUEST_CHANGES rows—no gh pr merge.

Please filter assistant comments that end with — sent from nimble-pike-34 from the relay queue. — sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

Relay⁵: duplicate queue item (quotes the stop-loss comment). No reviewer delta, no commit. — sent from nimble-pike-34

@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: 7a6cbf39 · Trigger: schedule
  • Thinking: 393s wall

BLOCKING (2)

Root Cause

  • src/v3/compiler/src/int_literal_ranges.rs integral-real seeding decides accepted aliases separately from the TypeRealization authority consumed by emit → derive the allowance from the same alias-peeled realized declaration, or drop Float* from this allowance until emit realizes them through the same authority.
  • src/v3/compiler/src/int_literal_ranges.rs width extraction re-encodes std.bit carrier names by hand and invents Word8 → reuse the existing Byte-aware width mapping or carry width_bits as substrate data.

⚠️ Two small numeric-construction edge cases still let the new bridge drift from the declared DAG authorities.

let peeled = peel_decl_head_for_integral_float_seed(dag, decl);
for (name, fmt) in [
("Real64", IntLiteralFloatCoercionTarget::F64),
("Float64", IntLiteralFloatCoercionTarget::F64),

This comment was marked as resolved.

}
let slot = mw_args[0].value;
for (word_name, bits) in [
("Word8", 8_u32),

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex blocking (sha 7a6cbf39) — verified & addressed on current branch tip 70d702203:

  1. Float vs TypeRealization:* int_literal_float_coercion_target no longer names Float32/Float64 alongside Real32/Real64. In bootstrap, Float* are empty instantiations whose template is Real*; peel_decl_head_for_integral_float_seed walks to the canonical Real* Compose id that rust.dag rows target. Added unit test float_alias_peels_to_real_before_integral_float_coercion locking that peel + coercion still yields F32/F64.

  2. Word8 vs Byte: gate60_machine_width_bits now maps MachineWidth’s nominal Byte slot (dsl/std/bit.dag) to 8 bits; the non-existent Word8 entry is removed. Literal MachineWidth<8> (std Int8 / gate-60 lowering) still decodes via the existing literal-nat path.

No emit-only Float* Rust type can be inferred as integral-seeded while lacking a realization spine: coercion follows the same peeled Real* authority emit uses via rust_f32/rust_f64 targets.

@briansrls

Copy link
Copy Markdown
Contributor Author

Item 1 (codex APPROVE, artifact #12341): Verdict matches current branch intent: carriers stay in rust.dag, emit uses structural Compose peer resolution + realization rows, infer seeds are bounded/fail-closed, tests cover Int<32>/Real<64>. No commit.

Item 2: Dashboard relay of the prior 70d702203 codex-blocker resolution comment—no new finding.

Merge gate: Latest workflow still had v3 pending when polled; GitHub /pulls/3115/reviews remains COMMENTED-only (no native APPROVED). Session rule needs two api-review approvals (openai-pro weighted)—no gh pr merge yet. — sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

Claude opus / #12348 (APPROVE_WITH_COMMENTS): Verified on current tree — matches gate #67 work: IntLiteralFloatCoercionTarget is STAGED with the float-lexeme dissolution note (~L531); rust.dag Real32/Real64 rows carry f32/f64; integral literals get .0 in float slots; gate60_realized_named_compose_peer bridges anonymous Compose to named TypeRealization keys; infer propagation stays fail-closed off-range.

Soft notes: acknowledged as non-blocking — gate60_machine_width_bits name list is the existing “resolve std nominal by declaration_by_name” pattern (drift risk is why tests/bootstrap exist); linear peer scan is acceptable at current DAG sizes; Real*-only coercion + peel for Float* is intentional (P2 spine) per inline comment.

No commit (nothing blocking).

Merge: CI is green on latest checked run; mergeable MERGEABLE; GitHub /reviews still COMMENTED-only — under session policy we still need a second qualifying api-review approval (openai-pro weighted) before gh pr merge. — sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

Relay (duplicate of the #12348 verification comment). No delta, no commit. CI green / MERGEABLE; still one short of two api-review approvals on policy. — sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: b51c9f2e · Trigger: manual
  • Comparison: main @ 483c8adc ... session/nimble-pike-34 @ b51c9f2e
  • Conversation: View conversation

1. Story of the diff

This PR closes the numeric-construction demonstration by making fixed-width numeric construction flow all the way from .dag syntax into Rust emission. The source of truth is extended in the Rust target spec with TypeRealization rows for Real32 -> f32 and Real64 -> f64 (src/v3/spec/rust.dag:152, src/v3/spec/rust.dag:161), and the generated bootstrap snapshot mirrors those rows (src/v3/compiler/src/bootstrap_generated.rs:56168, src/v3/compiler/src/bootstrap_generated.rs:56209). On the inference side, exact integral literals are allowed to seed fixed-width real types through a bounded helper rather than through a broad fallback (src/v3/compiler/src/int_literal_ranges.rs:680, src/v3/compiler/src/infer.rs:1031). On the emission side, anonymous Compose<..., MachineWidth<...>> types are resolved through DAG facts plus the existing TypeRealization index instead of an emitter-local carrier table (src/v3/compiler/src/emit/rust_target.rs:3332, src/v3/compiler/src/emit/rust_target.rs:5692), and literal rendering consults the inferred port type so a Real<64> integer seed emits as a Rust float literal (src/v3/compiler/src/emit/rust_target.rs:3702). The boundary tests then demonstrate both the emitted i32/f64 surface and a rustc roundtrip that prints 42 (src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs:226, src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs:239).

2. Invariant categories

  1. LAYER MODEL — Compliant.

This diff touches modeled target-spec data and implementation consumers, but it does not introduce a new substrate connective, behavior variant, or Dag storage shape. The target primitive authority is declared as spec data in rust_f32 / rust_f64 (src/v3/spec/rust.dag:152, src/v3/spec/rust.dag:161), regenerated into the bootstrap mirror (src/v3/compiler/src/bootstrap_generated.rs:56168, src/v3/compiler/src/bootstrap_generated.rs:56209), and consumed by the Rust emitter through the realization index (src/v3/compiler/src/emit/rust_target.rs:5692).

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

Boundary discipline / single authority is handled correctly: the emitter explicitly avoids an “emitter-local algebra×width mirror” and instead bridges anonymous Compose ids to named declarations that already own TypeRealization rows (src/v3/compiler/src/emit/rust_target.rs:3332). Fail-closed behavior is preserved: no direct realization and no unique named Compose peer falls through to MissingTypeRealization rather than fabricating a carrier (src/v3/compiler/src/emit/rust_target.rs:5692, src/v3/compiler/src/emit/rust_target.rs:5698). The staged internal enum for gate #67 is also bounded and names its dissolution trigger (src/v3/compiler/src/int_literal_ranges.rs:529, src/v3/compiler/src/int_literal_ranges.rs:531).

  1. CODING.md — Compliant.

The new implementation follows the data + free-functions shape: helper functions take explicit inputs like &Dag and declarations rather than hidden global state (src/v3/compiler/src/emit/rust_target.rs:3303, src/v3/compiler/src/int_literal_ranges.rs:581). Error/result shape is also explicit at the emitter boundary: render_value_with_port_rust_type returns Result<String, EmitError> and propagates type-realization failure via ? instead of guessing (src/v3/compiler/src/emit/rust_target.rs:3702, src/v3/compiler/src/emit/rust_target.rs:3708).

  1. TESTING.md — Compliant.

The diff adds a focused helper-level regression for alias peeling from Float32/Float64 to Real32/Real64 (src/v3/compiler/src/int_literal_ranges.rs:1024) and boundary behavior tests that assert both emitted Rust surface and rustc execution for the actual demonstration fixture (src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs:226, src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs:239). The boundary level is appropriate here because the user-visible contract is Rust emission and execution, not just a local helper return value.

  1. LOCKED DESIGN DECISIONS — N/A.

The diff does not modify a locked design document or introduce a new locked substrate/design decision; it implements target realizations and bounded implementation consumers for an existing numeric-construction gate.

  1. TRACKED vs UNTRACKED DEBT — Compliant.

The only explicit scaffold I found is the internal IntLiteralFloatCoercionTarget, and it is marked staged with a named dissolution trigger: dissolve when float lexeme / substrate width facts subsume the path (src/v3/compiler/src/int_literal_ranges.rs:529, src/v3/compiler/src/int_literal_ranges.rs:531). The width helper is bounded to known machine widths and returns None for unsupported shapes rather than widening into an untracked open table (src/v3/compiler/src/int_literal_ranges.rs:598, src/v3/compiler/src/int_literal_ranges.rs:617).

2.5. Top-down PM intent review

Compliant. The PM-level intent for this gate appears to be a faithful numeric-construction demonstration, not a hand-authored shortcut: the fixture keeps the source-level contract as Int<32> and Real<64> (src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs:213, src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs:221), the Rust carriers are declared as target-spec realizations (src/v3/spec/rust.dag:152, src/v3/spec/rust.dag:161), and the emitter’s peer resolution is explicitly through DAG + width facts + TypeRealization ownership (src/v3/compiler/src/emit/rust_target.rs:3332, src/v3/compiler/src/emit/rust_target.rs:3336). I did not find a diff-cited mismatch where a must-have target becomes optional, a dissolution goal becomes permanent scaffolding, or the implementation adds a new parallel carrier authority.

3. Verdict

APPROVE

The diff adds the missing structural target realizations and the bounded inference/emission plumbing needed for gate #67, with fail-closed behavior on unsupported or ambiguous cases. The tests cover both the internal alias-peeling seam and the emitted Rust boundary demonstration, and I did not find a diff-cited invariant violation.

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex / #12355: APPROVE noted — rubric alignment matches HEAD; no code change. With openai-pro APPROVE (prior artifact) + this approval, no REQUEST_CHANGES, mergeStateStatus: CLEAN, and CI green, proceeding with squash-merge. — sent from nimble-pike-34

@briansrls
briansrls merged commit 030c75e into main May 15, 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: b51c9f2e · Trigger: schedule
  • Thinking: 293s wall

✅ No blocking concerns in the current diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Relay: Duplicates the pre-merge squash note (#12355 + openai-pro). #3115 is already MERGED (mergedAt 2026-05-15T00:33:48Z, squash SHA 030c75e35fca1e9587de01f043591923615cc41a). No further action. Dashboard should close stale items for this PR. — sent from nimble-pike-34

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex (schedule, sha b51c9f2e): “No blocking concerns” noted — informational only; #3115 is already MERGED (mergedAt 2026-05-15). No commit / no merge. — sent from nimble-pike-34

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