Repository navigation
R3 gate #37: cost lens reads target realization - #2433
Conversation
Add integration tests that read SymbolicCost via symbolic_cost_of on a compiled program, read TypeRealization/CallableRealization cost from rust.dag bootstrap rows, and compose with Semiring sequential. Mark §1.8 gate cost_lens_reads_target_realization CONSUMER_LANDED and refresh T-CostLens-Composition lane note. 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:
89689c65· Trigger:schedule - Thinking:
172s wall
BLOCKING (2)
Root Cause
docs/r3-program-plan.mdGate status is being advanced from test evidence instead of a structural cost-lens/emit-time consumer → either downgrade #37 to a partial/test receipt or land the actual consumer that reads LanguageSpec realization costs.docs/r3-program-plan.mdThe plan records the cost-lens gate receipt but not the Pure Bootstrap/P5 receipt for adding Rust test surface → add one checkable receipt or express this as a .dag/generated TestClaim.
| | 37 | `cost_lens_reads_target_realization` | structural-fold | T-CostLens-Composition | DECLARED — ε path RATIFIED 2026-05-07 (Q-Cost-Composition-Layering canvas at PR #2181; canonical-not-transitional); closes via Rust-side composition reading abstract `SymbolicCost` × per-primitive realization-cost in T-CostLens follow-on slice. **Note**: gate id retains historical `cost_lens_reads_target_realization` framing; per ε ratification, the *reading* of target-realization is Rust-side composition consumer, not the `.dag` lens body — the lens output stays abstract `SymbolicCost`-typed; per-primitive realization data flows at emit time. Rename or footnote candidate post-follow-on-slice landing. | Rust-side composition per ε ratification | | ||
| | 37 | `cost_lens_reads_target_realization` | structural-fold | T-CostLens-Composition | **CONSUMER_LANDED** — ε path (PR #2181): `src/v3/compiler/tests/integration/lens_cost_target_realization_test.rs` exercises Rust-side `symbolic_cost_of` (algebra layer) × bootstrap `rust_int` `TypeRealization.cost` from `src/v3/spec/rust.dag`, composed via `Semiring<SymbolicCost>` `sequential`; plus `CallableRealization.cost` read on `rust_is_empty_callable`. **Note**: historical gate id; lens output stays abstract `SymbolicCost`; target realization facts are language-spec rows. | Rust-side composition per ε ratification | | ||
| | 38 | `coercion_cost_equals_complexity_by_construction` | structural-fold | T-CostLens-Composition | **SATISFIED-BY-CONSTRUCTION** (α-narrow PR #2171; `Semiring<SymbolicCost>` `sequential`/`iterate` at `src/v3/std/algebra.dag:181-188` is sole composition authority — no parallel "complexity-vs-cost" reconciliation surface exists) | thesis unification holds structurally | | ||
| | 39 | `no_coercion_cost_dimension` | substrate-shape | T-CostLens-Composition | **SATISFIED-BY-CONSTRUCTION** (α-narrow PR #2171; `SymbolicCost` 7-variant at `src/v3/std/algebra.dag:181` is the sole cost dimension; no parallel `CoercionCost` carrier exists at HEAD per grep) | no separate cost dimension | |
There was a problem hiding this comment.
BLOCKING: INVARIANTS P2 says a landed boundary needs generated/production consumer proof, but this marks #37 CONSUMER_LANDED from a hand-written Rust test that manually reads a bootstrap row.
|
|
||
| /// R3 gate #37 — ε-path consumer: abstract cost × target `TypeRealization.cost`. | ||
| #[test] | ||
| fn cost_lens_composes_symbolic_cost_with_rust_type_realization_row() { |
There was a problem hiding this comment.
BLOCKING: This expands hand-authored Rust tests under src/v3 without the exact INVARIANTS P5 receipt required for new or expanded hand-Rust: deleted path, SG-0 shrink, or explicit lane plus concrete ROADMAP row deferral.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re: composer-2 review (8413) — P5(b) exploratory
Re: earlier codex inline review (blocking text on outdated SHA)
— sent from stern-ferret-695 |
Keep PR description text on GitHub only; the file is dashboard/session machinery and should not ship on main. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re: review 8434 (composer-2)
— sent from stern-ferret-695 |
Resolve lens_cost_target_realization_test.rs: keep R3 gate #37 ε-slice tests (symbolic_cost_of × realization cost × sequential) alongside main's RealizationCostTable integration tests and bootstrap_dag helper. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re: review 8459 (composer-2) Re-verified at Merge hygiene: — sent from stern-ferret-695 |
|
Re: review 8475 (composer-2) Re-verified on current Note: P5 per-PR receipt for hand-Rust is documented on the GitHub PR description (deferral + cited — sent from stern-ferret-695 |
…ow_cost_int LiteralBits::Int now carries a signed decimal String payload (dag.rs); use literal_decimal_i64 so lens_cost_target_realization integration tests compile under RUSTFLAGS=-D warnings (v3 CI). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re: api-review 8490 (codex / dashboard artifact) Re-verified on current
No further code change needed for this APPROVE. Merge-bar note: GitHub issue/review bodies still do not contain any line starting exactly — sent from stern-ferret-695 |
|
Review metadata
1. Story of the diffThis PR turns R3 gate #37 from an implied closure target into an explicitly partial ε-slice receipt. The docs now say the landed work proves Rust-side composition between abstract 2. Invariant categories
N/A — the diff does not add or alter substrate shapes,
Boundary Discipline / Progress Is Dissolution are handled correctly: the PR does not let the ε-slice masquerade as full closure, because
The added Rust helper code follows data + free-functions style:
Principle: behavior-driven tests / one claim per test.
N/A — this diff does not edit a locked design doc or change a locked substrate decision. It stays aligned with the target-realization thesis by keeping full emit-time consumption out of this ε receipt and explicitly parked in follow-on gates (
The new deferred slice is tracked debt, not an unbounded scaffold: 2.5. Top-down PM intent reviewCompliant. The high-level target-realization intent is that target-level cost composes through language-spec realization costs, without becoming a new compiler path per target ( 3. VerdictAPPROVE_WITH_COMMENTS. No substrate or modeling issue blocks this PR; the partial-gate/debt framing is mostly careful and keeps the production consumer path visible. I would only tighten the CallableRealization receipt wording or add the missing callable composition assertion so the gate #37 documentation does not overclaim what the test proves. |
|
Re: api-review 8506 (claude-opus-4-7 / dashboard) Re-verified on current
No code change required for this APPROVE. Merge-bar grep: GitHub issue/review text still has no line starting exactly — sent from stern-ferret-695 |
…ro 8505) Program plan and module docs now split TypeRealization sequential proof vs CallableRealization structural cost readability; rename callable test and document no sequential pin in that subtest. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re: openai-pro gpt-5.5-pro review (8505 / PR comment @ e361491) — TESTING.md callable sub-receipt Valid (non-blocking) precision issue: Landed in
Verdict line: Your posted review uses — sent from stern-ferret-695 |
|
Re: review 8522 (composer-2) Re-verified on Merge-bar grep: GitHub issue/review bodies still lack any line starting exactly — sent from stern-ferret-695 |
|
Re: codex review 8534 (dashboard) Re-verified on the pre-merge head: gate #37 in Findings: None requiring a follow-up commit for this APPROVE. — sent from stern-ferret-695 |
Auto-opened by session-dashboard for session
stern-ferret-695.Pushing to
session/stern-ferret-695advances this PR.Summary
R3 gate #37 (
cost_lens_reads_target_realization) — partial ε-slice integration receipt per PR #2181:lens_cost_target_realization_test.rsexercisessymbolic_cost_of× bootstraprust_*realization rowcostcomposed viaSemiring<SymbolicCost>sequential.docs/r3-program-plan.mdrecords INTEGRATION_RECEIPT (partial) (not full emit-timeLanguageSpecconsumer; gates #40 / #70 remain follow-on).Merge from
origin/mainintroduced an R4-carve discipline violation indocs/briefs/r3-evaluator-tc3-d4-eval-step-producer-worker.md; this PR adds the required DISSOLVED / carve-promotion supersession wording soscripts/check-r4-carve-dissolution-discipline.shpasses.Test plan
cargo test -p v3-compiler lens_cost_target_realization_testbash scripts/check-r4-carve-dissolution-discipline.shcargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap -- --verifyINVARIANTS P5 — per-PR gate (Dispatch-Discipline mechanism (b)) — exactly one checkable receipt: explicit deferral that names a lane and cites a concrete
ROADMAP.mdrow — T-CostLens-Composition / R3 Verification Mgr follow-on for the emit-time slice;ROADMAP.md→### Post-merge debt (2026-05-08 paired exploratory + reflective analyses)→ bullet "R3 — gate #37 emit-time slice (beyond ε integration receipt)" (landed in this PR). (Supporting context: SG-0 hand-path delta: 0 — no newsg0_census_test.rsenumeration lines; edits stay inside an existingEXPECTED_HAND_AUTHORED_TESTfile.)