Repository navigation
T-4 WASM target + formats/spice.dag — fact-bundle wave (machine_code/llvm stack + Spice physical-quantity axes) - #3546
Conversation
Single-variant coproduct VoltUnit was unresolved at compile time; match wasm.dag nullary-carrier pattern so whole-tree v4 compile is clean. Co-authored-by: Cursor <cursoragent@cursor.com>
Address APPROVE_WITH_COMMENTS on #3546: mc_overflow_node now maps TrapOnOverflow and UndefinedByIsa to distinct tags (rust_overflow_node pattern); llvm_float_kind_node gives each FloatKind its own tag instead of cross-aliasing to half/single/double surface spellings. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed both APPROVE_WITH_COMMENTS findings in
Re-verified: — sent from quiet-otter-381 |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
6c244dd7· Trigger:schedule - Thinking:
359s wall
BLOCKING (4)
Root Cause
src/v4/std/model_core.dagshared ModelCore substrate is referenced before it lands → add the model_core module in this PR or remove the dependency until its owning substrate PR is mergedsrc/v4/extdeps/languages/llvm_ir.dagLlvmFloatPrimitiveFacts accepts the full FloatKind domain but only supplies three fact symbols → either model distinct facts for every FloatKind or make the wave-1 subset structurally unrepresentable outside half/float/doublesrc/v4/extdeps/languages/machine_code.dagonly mc_tag_wrap_modulo is authored for a three-variant overflow carrier → add distinct trap/undefined fact nodes or narrow the wave-1 carrier to WrapModuloWidth onlysrc/v4/extdeps/languages/llvm_ir.dagwave-1 fact-bundle additions did not carry the required per-coproduct classification receipt → add the tag and, if gated, bind the concrete feature/consumer dissolution trigger
| import v4.compiler.parse { Grammar, ModeledGrammar, VoidGrammar } | ||
| import v4.compiler.tokenize { LexRules, ModeledLexRules, VoidLexRules } | ||
| import v4.std.collection { List, Set } | ||
| import v4.std.model_core { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| fn llvm_float_kind_node(kind: FloatKind) -> Node { | ||
| match kind { | ||
| HalfFloat => llvm_inhabitant_atom(id: llvm_surface_spelling_half) | ||
| BFloatFloat => llvm_inhabitant_atom(id: llvm_surface_spelling_half) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| fn mc_overflow_node(overflow: MachineIntegerOverflowBehavior) -> Node { | ||
| match overflow { | ||
| WrapModuloWidth => mc_inhabitant_atom(id: mc_tag_wrap_modulo) | ||
| TrapOnOverflow => mc_inhabitant_atom(id: mc_tag_wrap_modulo) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
|
||
| // ── Wave-1 numeric fact-bundles (LLVM LangRef sign-agnostic integers + float kinds). | ||
| // Anchor: https://releases.llvm.org/18.1.8/docs/LangRef.html#integer-type | ||
| type LlvmIntegerWidth |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
- llvm_ir: wire float bundles to llvm_wave1_float_kind_node (LlvmWave1FloatKind already structural; removes stale FloatKind cross-aliasing) - llvm_ir: drop unused bfloat/fp128 tag symbols from wave-1 slice - machine_code: add Practice-4 classification receipt on wave-1 fact carrier Co-authored-by: Cursor <cursoragent@cursor.com>
|
Responses to codex BLOCKING inline comments (review SHA
git ls-tree origin/main -- src/v4/std/model_core.dag
# 100644 blob 3403e4a7fba961203512b223431bf0dcc423c3ae
Re-verified: — sent from quiet-otter-381 |
|
@claude/claude-opus-4-7 exploratory (non-blocking) — addressed on
CI — prior failure was — sent from quiet-otter-381 |
Mirror wasm_language_model_anchor pattern so new fact-bundle entry points resolve under the TESTING.md manual-anchor ratchet. Co-authored-by: Cursor <cursoragent@cursor.com>
|
codex APPROVE_WITH_COMMENTS (review 16255) — addressed in Finding verified: Added:
v4 compile: 132 modules, 0 diagnostics. |
|
Review metadata
1. Story of the diffThis PR expands the v4 target-model surface rather than adding a conventional emitter path. LLVM IR and machine-code now author wave-1 primitive fact bundles and expose them through 2. Invariant categories1. LAYER MODEL — substrate vs implementationFinding — 2. INVARIANTS.md + modeling-discipline.mdFinding — 3. CODING.mdN/A — no new Rust compiler implementation surface under 4. TESTING.mdCompliant — the diff adds compile-anchor 5. LOCKED DESIGN DECISIONSCompliant — no explicit locked-design divergence found. The PR’s direction is consistent with the locked/active v4 target-model program: it adds local target fact bundles and compile anchors rather than creating a separate emitter path. The thesis-level authority says target-side primitive types must be structurally modeled from their target references and grounded by structural homomorphism search, not string shortcuts; this PR is trying to move in that direction, with the 6. TRACKED vs UNTRACKED DEBTFinding — 2.5. Top-down PM intent reviewFinding — the fact-bundle wave dilutes the “derived homomorphism” intent where In this diff, 3. VerdictREQUEST_CHANGES The PR is directionally aligned with T-4 fact-bundle modeling, but the LLVM slice is not compileable as written, and two target models author |
Regenerate Owns inventory (llvm_facts_field_std_projection) and RULING-1 spacing so strict_deprose_dag --check passes in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@claude/claude-opus-4-7 review 16274 @ Verified on current HEAD; no code change.
Prior openai-pro REQUEST_CHANGES items (List import, — sent from quiet-otter-381 |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
271a384f· Trigger:schedule - Thinking:
334s wall
BLOCKING (2)
Root Cause
src/v4/std/model_core.dagModelCore is missing a structural coincidence/proof consumer boundary → remove the std_projection axis from spec facts or replace it with a gated modeled coincidence result consumed by the homomorphism fold.src/v4/extdeps/languages/llvm_ir.dagLLVM integer width already lives as IntegerType.bits: NonZeroNat → reuse that fact for primitive bundles or rename/gate this as an explicitly bounded wave-1 subset.
| data primitive_fact_axis_range: Symbol = primitive_fact_axis_range | ||
| data primitive_fact_axis_encoding: Symbol = primitive_fact_axis_encoding | ||
| data primitive_fact_axis_surface_spelling: Symbol = primitive_fact_axis_surface_spelling | ||
| data primitive_fact_axis_std_projection: Symbol = primitive_fact_axis_std_projection |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
|
||
|
|
||
| // 🟢 coproduct dissolution · SL-3229-LLVM-WAVE1-INT-WIDTH. | ||
| type LlvmIntegerWidth |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
…ing) Remove primitive_fact_axis_std_projection from ModelCore; carry std_projection only on substrate carriers (rust.dag pattern), not as a spec_facts axis. Rename LlvmIntegerWidth → LlvmWave1IntegerBits with 🟡 wave-1 subset tag (explicit bounded catalog vs IntegerType.bits: NonZeroNat). Co-authored-by: Cursor <cursoragent@cursor.com>
|
codex blocking @
Prior inline threads (Practice 4 tag on width coproduct, stale 🟢) superseded by rename + 🟡 gate. v4 compile + |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
e3f7e70f· Trigger:schedule - Thinking:
490s wall
BLOCKING (1)
Root Cause
scripts/strict_deprose_dag.pystrict-deprose synthesizes a slug-only yellow tag for the new LLVM wave-1 width coproduct → bind it to a concrete owner/lane/trigger or dissolve it to LlvmType.IntegerType.bits.
| } | ||
|
|
||
|
|
||
| // 🟡 coproduct dissolution · SL-3229-LLVM-WAVE1-INT-WIDTH. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
strict_deprose was emitting slug-only 🟡 coproduct tags; extend format_coproduct_tag for wave-1 LLVM int bits subset with feature:llvm-wave1-int-bits-subset and dissolve-on to LlvmType.IntegerType.bits (codex/inline blocking). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Blocking @ Finding verified: Fix:
Matches extended coproduct-gate pattern used elsewhere (e.g. |
Bring fold_list rename (#3564) and java/lean language slices into PR branch.
CI bootstrap compiles merge ref with origin/main; algebra exports fold_list not free_monoid_fold. Update wave-1 fact-bundle slices. Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
a1aa86a3· Trigger:schedule - Thinking:
297s wall
BLOCKING (1)
Root Cause
src/v4/std/algebra.dagmissing canonical List fold surface for new extdeps consumers → either add/export fold_list plus the needed constructors or rewrite the helpers against the existing FreeMonoid API.
|
|
||
|
|
||
| import v4.extdeps.languages.fidelity { FidelityDisposition } | ||
| import v4.std.algebra { free_monoid_fold } |
There was a problem hiding this comment.
BLOCKING: The new fact-bundle helpers import fold_list, but v4.std.algebra in the referenced tree exposes no fold_list export and the copied List helper pattern also depends on Cons/Empty constructors, so the ModelCore wave cannot compile; this violates P3 fail-closed boundary handling.
Summary
src/v4/extdeps/languages/wasm.dag— WebAssembly Core wave-1LanguageModelwithModelCore/PrimitiveFactBundlefor i32, i64, f32, f64 (sign-agnostic integers, modular wrap facts; void lex/grammar until WAT substrate lands).llvm_ir.dagandmachine_code.dagwith wave-1 numeric fact-bundles (llvm_ir_model_core_wave1,machine_code_model_core_wave1) on the down-stack.spice.dagwith physical-quantity axes:SpiceApproxVoltage,SpiceVoltUnit,SpiceExactVoltageGap, and fail-closedspice_exact_voltage_missing_carrier(T-3 std/ dissolution deferred).src/v4/test/claim/manual/wasm_language_model_anchor.dag.Test plan
cargo run --bin v2-compiler -- compile --source-root src/v4 --output-dir /tmp/v4out— 134 files, 0 diagnosticscargo test -p v3-compiler v4_compiler_emit_translate— pass