Skip to content

Grounding G2 Phase 2 float primitive rows - #2570

Merged
briansrls merged 8 commits into
mainfrom
session/proud-raven-495
May 10, 2026
Merged

briansrls merged 8 commits into
mainfrom
session/proud-raven-495

Conversation

@briansrls

@briansrls briansrls commented May 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • consumes the S8 ApproximateField<F> float shape in Grounding G2 for Rust f32/f64 primitive rows
  • validates the loaded rust_pilot_primitives list against the pilot mirror across all rows, including floats
  • keeps R3 ledger text unchanged pending manager-side substrate grep verification; broader Real emission demonstrations remain S9/Shape-A follow-ons

Out of scope

  • The v3-grounding-coercion-fold LiteralBits::Int compile mismatch is separate G7 Coercion-Fold scratch-retirement scope and is not fixed here.

Validation

  • cargo test -p v3-grounding-pilot
  • cargo test -p v3-grounding-engine
  • cargo test -p v3-compiler extdeps_rust_primitives_loader_test --test integration

@briansrls
briansrls force-pushed the session/proud-raven-495 branch from d0fff44 to d72da90 Compare May 10, 2026 05:13
@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current PR head d72da901475e8f66a2b76cef51a5d9105ab0af13: this finding is already addressed by the post-review rebase/update. The PR no longer changes docs/r3-program-plan.md, docs/r3-structure.md, or docs/r3-design-schedule-2026-05-06.md (git diff origin/main...HEAD -- docs/... is empty).

The current ledger text remains conservative: numeric_reframe_no_parallel_authority is still DECLARED, and both docs/r3-program-plan.md and docs/r3-structure.md still explicitly call out type Float = Float64 as the unresolved Float-arm alias. I also updated the PR body to state that R3 ledger text remains pending manager-side substrate grep verification. No code change is needed for this review item.

— sent from proud-raven-495

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: d72da901 · Trigger: manual
  • Comparison: main @ b71148d0 ... session/proud-raven-495 @ d72da901
  • Conversation: View conversation

1. Story of the diff

This PR widens the Rust grounding pilot from integer/bool/unit rows to include f32 and f64. The .dag authority adds ApproximateFieldAlgebra to NonIntegerAlgebra and then declares f32/f64 as NonIntegerPrimitive rows over Word32Carrier/Word64Carrier in dsl/extdeps/languages/rust/primitives.dag:121-122 and dsl/extdeps/languages/rust/primitives.dag:291-295. The generated bootstrap mirrors are regenerated to carry that extra enum variant and the two new list elements, while grounding_pilot mirrors the pilot facts by adding DagType::Float32/Float64, routing them through ApproximateField + Word32/Word64, and testing that they ground to the expected Rust primitive names.

The other load-bearing change is that grounding_engine no longer validates only the first row of rust_pilot_primitives; it now length-checks the loaded list against the mirror and walks every row positionally via validate_rust_pilot_rows_match_mirror() at src/v3/grounding_engine/src/lib.rs:244-288. That makes the float rows part of the fail-closed structural receipt rather than just an appended table entry.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation). — Compliant.

This touches a target-spec substrate authority loaded into the bootstrap Dag, not core dag.rs; the new float rows are modeled as algebra/carrier facts (ApproximateFieldAlgebra plus Word32Carrier/Word64Carrier) rather than as a target-name-only shortcut at dsl/extdeps/languages/rust/primitives.dag:284-295.

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

Fail-closed and facts-flow-forward are handled: the engine rejects row-count mismatch before zipping (src/v3/grounding_engine/src/lib.rs:277-282) and then checks every lowered row against the mirror (src/v3/grounding_engine/src/lib.rs:285-287), matching the grounding-completeness direction that primitive grounding is structural rather than name-keyed. chatgpt-review-def77475-0eb7-49…

  1. CODING.md. — Compliant.

The new validator is a free function returning StructureResult<()>, and malformed structure produces StructureMismatch rather than a panic or silent default, e.g. src/v3/grounding_engine/src/lib.rs:244-288 and the helper boundary at src/v3/grounding_engine/src/lib.rs:297-303.

  1. TESTING.md. — Compliant.

The diff updates the loader assertion from 12 to 14 pilot rows (src/v3/compiler/tests/integration/extdeps_rust_primitives_loader_test.rs:119-124), adds an explicit grounding-pilot float routing test (src/v3/grounding_pilot/src/lib.rs:587-603), and adds an engine test for all ordered rows including floats (src/v3/grounding_engine/src/lib.rs:988-991). This is appropriate Rust-side coverage for the current migration state, where Rust tests are still allowed when cleanest. chatgpt-review-795247cd-13fd-4a…

  1. LOCKED DESIGN DECISIONS. — N/A.

The diff does not edit or reinterpret a locked design document; it extends the existing grounding pilot while preserving the .dag authority plus generated/mirror validation pattern.

  1. TRACKED vs UNTRACKED DEBT. — Finding, NON-BLOCKING.

Principle: Progress Is Dissolution / scaffold boundaries. The PR introduces a compatibility bridge but does not name its dissolution trigger:

src/v3/grounding_engine/src/lib.rs:291: /// Compatibility entry point for callers that still name the original Phase 2src/v3/grounding_engine/src/lib.rs:292: /// first-row check. It now runs the full row walk.src/v3/grounding_engine/src/lib.rs:293: pub fn validate_first_rust_pilot_row_matches_mirror() -> StructureResult<()> {src/v3/grounding_engine/src/lib.rs:294:     validate_rust_pilot_rows_match_mirror()

This is well-bounded as a thin wrapper, but it is explicitly temporary/compatibility-shaped and lacks the required “when this dissolves” condition. The P5 rule requires scaffolds and intermediate representations to have explicit dissolution paths. chatgpt-review-b35d209d-bb07-4b…

A minimal fix would be either deleting/migrating remaining callers now or adding a concrete trigger such as “remove after all callers switch to validate_rust_pilot_rows_match_mirror.”

2.5. Top-down PM intent review

Compliant. The highest-level intent here is grounding completeness: target primitive types should be modeled from target-language facts with structural algebra inhabitance, and unsupported grounding should fail closed rather than falling back to string lookup. The PR preserves that intent by adding float primitives as .dag authority rows with ApproximateFieldAlgebra and machine-width carriers (dsl/extdeps/languages/rust/primitives.dag:284-295) and by strengthening the engine from first-row parity to full ordered-row parity (src/v3/grounding_engine/src/lib.rs:242-288). The remaining Rust mirror is still a pilot bridge, but this diff does not semantic-dilute the plan because the mirror is checked against the .dag authority and the check now covers every row, including f32/f64.

3. Verdict

APPROVE_WITH_COMMENTS. The float primitive rows are structurally grounded, regenerated into the bootstrap mirrors, and covered by full-row fail-closed validation plus targeted tests. The only issue I would call out is the small compatibility wrapper that needs a named dissolution trigger or removal.

@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed the cursor review nit in bd5e963ecc20355ccf62e9fa39a39121e56cb9d4: removed the redundant first_enumerated_pilot_row_matches_mirror_i8 test, leaving the direct all_enumerated_pilot_rows_match_mirror_including_floats full-list assertion as the single structural claim.

Validation after the cleanup:

  • cargo test -p v3-grounding-engine (7 passed)

— sent from proud-raven-495

@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed the openai-pro compatibility-wrapper finding in 0f10743df: removed validate_first_rust_pilot_row_matches_mirror() entirely because there are no remaining callers, and updated the stale mismatch diagnostic locations to validate_rust_pilot_rows_match_mirror.

Validation after the wrapper removal:

  • cargo test -p v3-grounding-engine (7 passed)

— sent from proud-raven-495

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-thinking
  • Commit: 6c6601cd · Trigger: manual
  • Comparison: main @ 1a4b16d2 ... session/proud-raven-495 @ 6c6601cd
  • Conversation: View conversation

1. Story of the diff

This PR extends the Rust grounding pilot from integer/bool/unit rows to include Rust float primitives. The substrate-side authority is dsl/extdeps/languages/rust/primitives.dag, which adds ApproximateFieldAlgebra to NonIntegerAlgebra and then declares f32/f64 as NonIntegerPrimitive rows over Word32Carrier/Word64Carrier at dsl/extdeps/languages/rust/primitives.dag:121 and dsl/extdeps/languages/rust/primitives.dag:291-295. The generated bootstrap snapshots are regenerated to carry that new declaration and list payload, while the Rust pilot mirror is updated to include DagType::Float32/DagType::Float64, route them through ApproximateField, and assert the expected target names at src/v3/grounding_pilot/src/lib.rs:337-355, src/v3/grounding_pilot/src/lib.rs:407-414, and src/v3/grounding_pilot/src/lib.rs:587-631.

The grounding engine also tightens its parity receipt: it no longer checks only the first lowered pilot row, but validates every lowered row against the mirror in order, with an explicit fail-closed length check before zipping at src/v3/grounding_engine/src/lib.rs:277-287. That makes the float addition more than a table-size bump: the PR broadens the primitive set and improves the validation surface so future row drift is caught across the full pilot list.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation). Compliant — this touches substrate-facing target-spec data, not just file-local Rust: NonIntegerAlgebra gains ApproximateFieldAlgebra at dsl/extdeps/languages/rust/primitives.dag:121, and the concrete target rows use the existing NonIntegerPrimitive shape rather than adding a new Dag connective or behavior at dsl/extdeps/languages/rust/primitives.dag:291-295.
  2. INVARIANTS.md + modeling-discipline.md. Compliant — Modeling Faithfulness / facts-flow-forward are handled by naming the external and substrate authority inline: the float rows cite Rust Reference floating-point types and dsl/std/float.dag’s Compose<Ieee754Float, MachineWidth<Word32|Word64>> authority at dsl/extdeps/languages/rust/primitives.dag:284-289. The downstream Rust pilot then carries the same algebra/carrier facts forward in dag_type_facts at src/v3/grounding_pilot/src/lib.rs:407-414, rather than reconstructing float width from target-name strings.
  3. CODING.md. Compliant — the grounding-engine change keeps behavior in free functions with structured StructureResult<()> failure carriers. The renamed API validate_rust_pilot_rows_match_mirror at src/v3/grounding_engine/src/lib.rs:244 delegates row comparison to assert_rust_pilot_row_matches_mirror at src/v3/grounding_engine/src/lib.rs:291-297, which is a small function over explicit inputs rather than hidden state or a method-heavy object shape.
  4. TESTING.md. Compliant — the diff adds behavior-level coverage for the new float routing: stratum_b_float_widths_route_correctly checks both Float32 -> f32 and Float64 -> f64, including the ApproximateField algebra and word carrier, at src/v3/grounding_pilot/src/lib.rs:587-601. It also upgrades the engine parity test from first-row-only to all rows at src/v3/grounding_engine/src/lib.rs:977-979, and updates the loader list cardinality to 14 at src/v3/compiler/tests/integration/extdeps_rust_primitives_loader_test.rs:119-124. The Rust tests remain acceptable here because they exercise current Rust-side pilot/engine surfaces while the project is still in the migration window described by the testing authority. chatgpt-review-3251aa4f-6b1d-46…
  5. LOCKED DESIGN DECISIONS. Compliant — the PR does not dilute the locked grounding direction. The thesis requires target primitives to be structurally modeled from target-language references and grounded by algebra inhabitance rather than name-keyed lookup; this PR adds the float rows through ApproximateFieldAlgebra plus machine-width carriers, not a special-case emitter branch. chatgpt-review-ca02a79a-e68a-46…
  6. TRACKED vs UNTRACKED DEBT. Compliant — I see no new TODO, shim, compatibility adapter, or unbounded scaffold in the diff. The existing Rust mirror is extended, but the PR simultaneously strengthens mirror parity by checking row count and every ordered row at src/v3/grounding_engine/src/lib.rs:277-287, so this does not introduce a new untracked bridge; it tightens the current pilot bridge’s guardrails.

2.5. Top-down PM intent review

Compliant — the high-level intent is preserved. The work advances grounding completeness for Rust primitives by adding float rows as declared target-spec data and validating them structurally; it does not turn a must-have grounding target into an optional/postponed item, and it does not add a new compiler/emitter path. The most PM-relevant line is the target-spec declaration itself: f32/f64 enter through NonIntegerPrimitive { target_name: ..., algebra: ApproximateFieldAlgebra, carrier: Word32Carrier/Word64Carrier } at dsl/extdeps/languages/rust/primitives.dag:291-295, while the pilot’s routing test proves width-distinct float behavior at src/v3/grounding_pilot/src/lib.rs:587-601.

3. Verdict

APPROVE — I did not find a diff-cited invariant violation. The PR adds float primitive rows through the existing structural target-spec mechanism, regenerates the bootstrap artifacts coherently, and improves the grounding-engine parity check from first-row coverage to all-row coverage.

@briansrls
briansrls merged commit b96a51a into main May 10, 2026
4 checks passed
@briansrls
briansrls deleted the session/proud-raven-495 branch May 10, 2026 05:48
briansrls added a commit that referenced this pull request May 10, 2026
…iation per §1.8

Three valid cell-level findings from codex schedule review on sha 1d95e61.
All caught the same root issue: §3 cells didn't reconcile against §1.8
ledger + r3-structure.md canonical authority before landing.

#2 — T-Numeric-Construction blocker (line 424):
   Cell said "Float migration + Real/base-carrier convention HELD on
   proud-raven-495 G2 Phase 2 Substrate S8 ApproximateField<F>" but
   §1.8 #18 + #24 explicitly say "CONSUMER_LANDED + PASSING for
   Grounding G2 primitive rows (2026-05-10, PR #2570 squash b96a51a)"
   — the work landed. Updated cell to: PR #2570 closes the prior HELD;
   remaining blocker is broader Real<N> emission demonstrations under
   S9/Shape-A follow-ons per §1.8 #18 close-criterion.

#3 — T-Bridge-Retirement count (line 427):
   Cell said 3 remaining sub-bridges including mark_bootstrap_secret_
   nominal_opacity, but §1.8 #32 PASSING + §2.3 explicitly says that
   bridge is closed. Corrected count: 3/5 sub-bridges retired (gate #32
   prior-cycle Secret nominal-opacity + gate #33 this cycle canonical
   lens + include_str this cycle), 2 remaining (SourceSpan.file
   participation + patch_lower_helpers residual).

#4 — T-Free-Consequences-Demonstration over-attribution (line 430):
   Cell credited gates #10/#33/#37/#40/#72 to T-Free, but §1.8 assigns
   those to other lanes:
   - #10 → T-V-L4-L7-Direct
   - #33 → T-Bridge-Retirement
   - #37 + #40 → T-CostLens-Composition
   - #72 → T-E-P-Producer-Broadening
   T-Free's canonical demo gate range is #43-#52. Only #43
   (auto_parallelism_independent_binds_emit_parallel) MERGED this cycle
   for T-Free. Updated cell + compile-note to credit each landing only
   to its canonical-lane row.

Compile-note also reconciled per the same §1.8 single-authority pass:
T-CostLens-Composition + T-E-P-Producer-Broadening now credited their
own gates instead of attributing them to T-Free.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 10, 2026
…2583)

* docs(r3): §3 lane-status weekly compile (2026-05-11 Monday cadence)

PM-derived compile per §9.1 weekly cadence. Updates Status / Current
dispatch / Blocker / ETA-to-close columns based on observable PR merge
data + worker session activity + silent-ram-834 status report at
gunbc#828 c#4414611117.

Lanes with substantial movement this cycle:
- T-LensProducer-Retirement: gate #5 lens_apply.rs in flight (valiant-otter-715)
- T-Numeric-Construction: u128 mirror sync MERGED #2526; gates #17 + #20 active
- T-Free-Consequences-Demonstration: 6 gates merged (#10/#33/#37/#40/#43/#72)
- T-Bridge-Retirement: 2/5 sub-bridges retired (PR #2459 + #2449)
- T-Lens-Behavioral-Parity: #73 + #78 active under Substrate Mgr
- T-Debt-Paydown (standing): Mgr re-spawn (gentle-newt-665 → silent-ram-834);
  Phase 3 fleet 8/10 closed/absorbed; orphan PR #2503 closed
- T-Omni-Shape-B: gate #25 salvage path under PB Mgr; #26/#27 mis-parented

Lanes with no observable change this cycle:
- T-V-L4, T-V-L5-Corpus, T-FixedPoint, T-Anthropic-Wire, T-V2-Retirement,
  T-Tests-As-Data-Completeness — substrate work continues but no clear
  gate-level deltas surfaced

Mgr canvas refreshes remain formal authority per §3 framing; lane-owning
Mgrs may correct/override any PM-derived cell.

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

* docs(r3): address codex BLOCKING findings on PR #2583 §3 compile

3 valid findings from codex review:

1. T-Lens-Behavioral-Parity status was "RED→YELLOW (PM-derived; Mgr
   ratification welcome)" — created parallel-representation hedge in a
   single-authority cell (INVARIANTS P2 violation; per
   feedback_parallel_representation_debt). Resolved: commit fully to
   YELLOW as the PM-compiled value (the §3 disclaimer note covers Mgr
   override authority). The hedge in the cell was worst-of-both-worlds.

2. PM compile note said T-Tests-As-Data-Completeness had "no observable
   change this cycle" but the table cell records PR #2287 (Verification
   V1 TC1 first slice) MERGED 2026-05-10. Self-contradicting. Resolved:
   moved T-Tests-As-Data-Completeness to "lanes with substantial
   movement" list. Also added T-Anthropic-Wire (PR #2506), T-V2-Retirement
   (PR #2334), T-V-L7 (gate #10 / PR #2394), T-Tier3-Dissolution
   (clever-bear-180 active), T-Lens-Application-Surface (crisp-raven-202
   active) to the movement list — all had cell-level deltas in the table
   that the compile note had missed.

3. PR #2394 merge date inconsistency: T-V-L7 cell said "2026-05-09",
   T-Free-Consequences cell said "2026-05-10". Verified merge timestamp
   2026-05-10T00:26:42Z UTC; corrected T-V-L7 cell to 2026-05-10.

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

* docs(r3): fix T-LensProducer-Retirement blocker (codex BLOCKING #2 on PR #2583)

Pre-existing error in §3 cell that prior PM compile preserved instead of
correcting. The original cell named "T-FixedPoint + R2-Evaluator" as
T-LensProducer-Retirement's blocker, but per the canonical sequence:

- r3-structure.md:357: critical path is `R2-Evaluator → T-LensProducer-
  Retirement → T-FixedPoint → T-V2-Retirement`
- r3-program-plan.md:360-363: "T-LensProducer-Retirement comes BEFORE
  T-FixedPoint, not after; T-FixedPoint depends on SG-0 zero from
  T-LensProducer"

T-LensProducer-Retirement coming AFTER T-FixedPoint creates a circular
dependency in the weekly snapshot. Corrected to use the canonical
R2-close-dependency from r3-structure.md §"Lane structure":
R2-Evaluator (interpreter-as-data; LANDED) + PB-1 generated bin-shim
pattern + R2-T-Ground-Lifetime-Analyzer a/b/c basic cases.

Also added warm-crab-600's gate #7 work-in-flight signal (regen_lens.rs
retirement; the 3rd sub-gate of T-LensProducer-Retirement) per latest
subtree status digest. All 3 sub-gates now in flight: #5 valiant-otter-
715, #6 same-cascade, #7 warm-crab-600.

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

* docs(r3): address codex BLOCKING #2/#3/#4 — single-authority reconciliation per §1.8

Three valid cell-level findings from codex schedule review on sha 1d95e61.
All caught the same root issue: §3 cells didn't reconcile against §1.8
ledger + r3-structure.md canonical authority before landing.

#2 — T-Numeric-Construction blocker (line 424):
   Cell said "Float migration + Real/base-carrier convention HELD on
   proud-raven-495 G2 Phase 2 Substrate S8 ApproximateField<F>" but
   §1.8 #18 + #24 explicitly say "CONSUMER_LANDED + PASSING for
   Grounding G2 primitive rows (2026-05-10, PR #2570 squash b96a51a)"
   — the work landed. Updated cell to: PR #2570 closes the prior HELD;
   remaining blocker is broader Real<N> emission demonstrations under
   S9/Shape-A follow-ons per §1.8 #18 close-criterion.

#3 — T-Bridge-Retirement count (line 427):
   Cell said 3 remaining sub-bridges including mark_bootstrap_secret_
   nominal_opacity, but §1.8 #32 PASSING + §2.3 explicitly says that
   bridge is closed. Corrected count: 3/5 sub-bridges retired (gate #32
   prior-cycle Secret nominal-opacity + gate #33 this cycle canonical
   lens + include_str this cycle), 2 remaining (SourceSpan.file
   participation + patch_lower_helpers residual).

#4 — T-Free-Consequences-Demonstration over-attribution (line 430):
   Cell credited gates #10/#33/#37/#40/#72 to T-Free, but §1.8 assigns
   those to other lanes:
   - #10 → T-V-L4-L7-Direct
   - #33 → T-Bridge-Retirement
   - #37 + #40 → T-CostLens-Composition
   - #72 → T-E-P-Producer-Broadening
   T-Free's canonical demo gate range is #43-#52. Only #43
   (auto_parallelism_independent_binds_emit_parallel) MERGED this cycle
   for T-Free. Updated cell + compile-note to credit each landing only
   to its canonical-lane row.

Compile-note also reconciled per the same §1.8 single-authority pass:
T-CostLens-Composition + T-E-P-Producer-Broadening now credited their
own gates instead of attributing them to T-Free.

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

* docs(r3): address codex BLOCKING #5/#6 — PR-merge evidence ≠ gate-PASSING

Two valid findings from codex schedule review on sha f6a3a13 (review
id 4259176210):

#5 — T-Bridge-Retirement count conflated PR-merge with gate-PASSING:
   Cell said "3/5 retired" but §1.8 truth: #32 PASSING, #33 DECLARED,
   #34 DECLARED, #35 PASSING. PR #2449 + PR #2459 ARE merged but the
   gates haven't been promoted from DECLARED → PASSING (separate status
   drift sweep step, e.g., per PR #2399 cadence). Reframed cell to
   distinguish PR-merge evidence from canonical §1.8 status: 2/5
   gate-PASSING (#32 + #35), 2/5 PR-merged-pending-promotion (#33 + #34),
   plus SourceSpan.file participation (Substrate-owned hand-Rust audit
   sites; not in numbered §1.8) + residual semantic patching
   (`bridge_exact_string_semantic_patching_residual` Open per #35
   close-criterion).

#6 — T-Free-Consequences over-claim on PR-merge:
   Cell said "gate #43 MERGED" but §1.8 #43 still DECLARED (PR #2495 is
   evidence toward promotion, not the promotion event). Same fix:
   reframe as PR-merge evidence accruing toward §1.8 gate promotion;
   canonical status authoritative.

Compile-note also reframed: explicitly distinguishes PR-merge evidence
from §1.8 gate-PASSING promotion. PR-merge events are listed as evidence
accruing toward promotion; canonical gate status varies per §1.8.

Common root: future Monday compiles must mechanically reconcile each
"landed/retired" claim against §1.8 status, NOT PR-merge events.
Discipline recorded in feedback_pm_compile_audits_pre_existing_errors
(updated to include PR-merge-vs-gate-promotion distinction).

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.

1 participant