From dd6a1aaf3073c46e84a22f8548ae0d4b4b1e85df Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 5 May 2026 04:27:23 -0400 Subject: [PATCH 01/11] WIP: R3 Evaluator --- ...6-g0d-constructor-runtime-execution-worker.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md b/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md index 96f5d09106e..bb87505c0fc 100644 --- a/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md +++ b/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md @@ -23,7 +23,7 @@ E6-G0c made `TransformTarget::Callable(decl)` executable only when `decl` resolves to an Arrow with a `UserDefined` body. The current evaluator branch fails closed on every non-Arrow callable target: -- `src/v3/compiler/src/lib.rs:579-585` reads +- `src/v3/compiler/src/lib.rs:579-584` reads `dag.declaration(callee_decl).connective`, accepts only `TypeConnective::Arrow { body, .. }`, and otherwise returns `BadTransformOperands { reason: "Callable target declaration is not an Arrow type" }`. @@ -49,32 +49,32 @@ Two lowered constructor families reach `TransformTarget::Callable(target)`: `Conj`, orders inputs by the declaration's `children` labels, lowers each field expression against its field type, then calls `lower_constructor_invocation(dag, target_decl, inputs, span)` at - `src/v3/compiler/src/lower.rs:6442-6534`. + `src/v3/compiler/src/lower.rs:7214-7306`. - `lower_constructor_invocation` emits `Behavior::Transform(TransformNode { target: TransformTarget::Callable(target), inputs, ... })` at - `src/v3/compiler/src/lower.rs:6331-6347`. + `src/v3/compiler/src/lower.rs:7103-7117`. - The `target_decl` here is the record / Conj declaration, not an Arrow. 2. **Variant constructors.** - Nullary variants can enter through `SurfaceExpr::Var` when the expected type is a sum: `resolve_expected_variant_constructor(...)` followed by `lower_constructor_invocation(..., Vec::new(), ...)` at - `src/v3/compiler/src/lower.rs:5846-5852`. + `src/v3/compiler/src/lower.rs:6574-6579`. - Named variant-record constructors enter through `lower_variant_record_expr`: the lowerer resolves the variant declaration, reads payload field labels/types via `variant_payload_fields_for_lowering`, orders payload inputs by those declared labels, and calls `lower_constructor_invocation(dag, variant_decl, inputs, ...)` at - `src/v3/compiler/src/lower.rs:6537-6614`. + `src/v3/compiler/src/lower.rs:7309-7404`. - `variant_payload_fields_for_lowering` gets the payload fields by walking the variant declaration to a `Conj` and preserving child labels at - `src/v3/compiler/src/lower.rs:5761-5779`. + `src/v3/compiler/src/lower.rs:6325-6347`. - Variant membership is not inferred from "walks to `Conj`" alone. The lowerer resolves constructor identity through `resolve_expected_variant_constructor`, which checks the parent - `TypeConnective::Disj { variants }` list (`src/v3/compiler/src/lower.rs:6703+`). + `TypeConnective::Disj { variants }` list (`src/v3/compiler/src/lower.rs:7493+`). For generic sums, that resolver may materialize an `Instantiation { template: variant_decl, arguments }`; E6-G0d must preserve that instantiation instead of checking only the outer @@ -87,7 +87,7 @@ accepted by the lowerer, evaluate it into the existing runtime `Value` carrier. ## Runtime Output Contract -Use only the live evaluator carriers in `src/v3/compiler/src/lib.rs:71-87`: +Use only the live evaluator carriers in `src/v3/compiler/src/lib.rs:72-87`: ```rust Value::RecordValue(Vec) From 757e084eea48274a2ef5f96bce1bebeb0ceedf62 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 5 May 2026 04:48:29 -0400 Subject: [PATCH 02/11] WIP: R3 Evaluator --- src/v3/compiler/tests/integration.rs | 35 ++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 14301b9a78d..873a8924b7f 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -241,8 +241,39 @@ mod t_demo_fixture_test { #[test] fn t_demo_canonical_suites_are_runner_visible() { - let source = fixture_source(); - let dag = compile_fixture(&source); + let dag = compile_fixture( + r#" +module v3.compiler.tests.t_demo.runner_visibility + +import std.verification { Compiles, TestClaim, TestSuite } + +data compiler_nerd_smoke: TestClaim = { + name: "fixture_compiler_nerd_canonical.smoke", + source: "let compiler_nerd_smoke: Int = 1", + file_name: "fixture_compiler_nerd_canonical_smoke.v3", + predicate: Compiles, + requires: [] +} + +data integration_smoke: TestClaim = { + name: "fixture_integration_canonical.smoke", + source: "let integration_smoke: Int = 1", + file_name: "fixture_integration_canonical_smoke.v3", + predicate: Compiles, + requires: [] +} + +data fixture_compiler_nerd_canonical: TestSuite = { + name: "fixture_compiler_nerd_canonical", + claims: [compiler_nerd_smoke] +} + +data fixture_integration_canonical: TestSuite = { + name: "fixture_integration_canonical", + claims: [integration_smoke] +} +"#, + ); for suite_name in [ "fixture_compiler_nerd_canonical", From b62b9e1d6b9b4422ca3cc766ed1a8249d14c73c7 Mon Sep 17 00:00:00 2001 From: Brian Searls <11205878+briansrls@users.noreply.github.com> Date: Tue, 5 May 2026 09:11:37 +0000 Subject: [PATCH 03/11] test(v3): keep T-Demo suite visibility coverage fast --- src/v3/compiler/tests/integration.rs | 62 +++++++--------------------- 1 file changed, 15 insertions(+), 47 deletions(-) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 873a8924b7f..769004632d1 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -207,7 +207,7 @@ mod t_demo_fixture_test { use std::path::PathBuf; use v3_compiler::compile_to_dag; - use v3_compiler::dag::Dag; + use v3_compiler::dag::{Dag, FieldValue, ValueBody}; use v3_compiler::test_runner::{ClaimResult, TestRunner}; use v3_compiler::CompileError; @@ -237,58 +237,26 @@ mod t_demo_fixture_test { "T-Demo fixture skeleton should compile without diagnostics: {:?}", dag.diagnostics() ); - } - - #[test] - fn t_demo_canonical_suites_are_runner_visible() { - let dag = compile_fixture( - r#" -module v3.compiler.tests.t_demo.runner_visibility - -import std.verification { Compiles, TestClaim, TestSuite } - -data compiler_nerd_smoke: TestClaim = { - name: "fixture_compiler_nerd_canonical.smoke", - source: "let compiler_nerd_smoke: Int = 1", - file_name: "fixture_compiler_nerd_canonical_smoke.v3", - predicate: Compiles, - requires: [] -} - -data integration_smoke: TestClaim = { - name: "fixture_integration_canonical.smoke", - source: "let integration_smoke: Int = 1", - file_name: "fixture_integration_canonical_smoke.v3", - predicate: Compiles, - requires: [] -} - -data fixture_compiler_nerd_canonical: TestSuite = { - name: "fixture_compiler_nerd_canonical", - claims: [compiler_nerd_smoke] -} - -data fixture_integration_canonical: TestSuite = { - name: "fixture_integration_canonical", - claims: [integration_smoke] -} -"#, - ); for suite_name in [ "fixture_compiler_nerd_canonical", "fixture_integration_canonical", ] { - let results = TestRunner::new(&dag).run_suite(suite_name); - assert!( - !results.is_empty(), - "T-Demo suite `{suite_name}` should contain Day-1 Compiles claims" - ); + let suite = dag + .declaration_by_name(suite_name) + .unwrap_or_else(|| panic!("T-Demo suite `{suite_name}` should be declared")); + let Some(ValueBody::Structural { fields }) = &suite.value_body else { + panic!("T-Demo suite `{suite_name}` should lower as structural data"); + }; + let claims = fields + .iter() + .find_map(|(label, value)| (label == "claims").then_some(value)); + let Some(FieldValue::List(claims)) = claims else { + panic!("T-Demo suite `{suite_name}` should carry a structural claims list"); + }; assert!( - results - .iter() - .all(|result| result.result == ClaimResult::Pass), - "T-Demo suite `{suite_name}` should pass Day-1 Compiles claims, got {results:?}" + claims.iter().all(|claim| matches!(claim, FieldValue::Reference(_))), + "T-Demo suite `{suite_name}` claim entries should be declaration references: {claims:?}" ); } } From 1ca6d179ca8878b6f66d208312360e06caac7a77 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 5 May 2026 05:13:56 -0400 Subject: [PATCH 04/11] WIP: R3 Evaluator --- src/v3/compiler/tests/integration.rs | 62 +++++++--------------------- 1 file changed, 15 insertions(+), 47 deletions(-) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 873a8924b7f..769004632d1 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -207,7 +207,7 @@ mod t_demo_fixture_test { use std::path::PathBuf; use v3_compiler::compile_to_dag; - use v3_compiler::dag::Dag; + use v3_compiler::dag::{Dag, FieldValue, ValueBody}; use v3_compiler::test_runner::{ClaimResult, TestRunner}; use v3_compiler::CompileError; @@ -237,58 +237,26 @@ mod t_demo_fixture_test { "T-Demo fixture skeleton should compile without diagnostics: {:?}", dag.diagnostics() ); - } - - #[test] - fn t_demo_canonical_suites_are_runner_visible() { - let dag = compile_fixture( - r#" -module v3.compiler.tests.t_demo.runner_visibility - -import std.verification { Compiles, TestClaim, TestSuite } - -data compiler_nerd_smoke: TestClaim = { - name: "fixture_compiler_nerd_canonical.smoke", - source: "let compiler_nerd_smoke: Int = 1", - file_name: "fixture_compiler_nerd_canonical_smoke.v3", - predicate: Compiles, - requires: [] -} - -data integration_smoke: TestClaim = { - name: "fixture_integration_canonical.smoke", - source: "let integration_smoke: Int = 1", - file_name: "fixture_integration_canonical_smoke.v3", - predicate: Compiles, - requires: [] -} - -data fixture_compiler_nerd_canonical: TestSuite = { - name: "fixture_compiler_nerd_canonical", - claims: [compiler_nerd_smoke] -} - -data fixture_integration_canonical: TestSuite = { - name: "fixture_integration_canonical", - claims: [integration_smoke] -} -"#, - ); for suite_name in [ "fixture_compiler_nerd_canonical", "fixture_integration_canonical", ] { - let results = TestRunner::new(&dag).run_suite(suite_name); - assert!( - !results.is_empty(), - "T-Demo suite `{suite_name}` should contain Day-1 Compiles claims" - ); + let suite = dag + .declaration_by_name(suite_name) + .unwrap_or_else(|| panic!("T-Demo suite `{suite_name}` should be declared")); + let Some(ValueBody::Structural { fields }) = &suite.value_body else { + panic!("T-Demo suite `{suite_name}` should lower as structural data"); + }; + let claims = fields + .iter() + .find_map(|(label, value)| (label == "claims").then_some(value)); + let Some(FieldValue::List(claims)) = claims else { + panic!("T-Demo suite `{suite_name}` should carry a structural claims list"); + }; assert!( - results - .iter() - .all(|result| result.result == ClaimResult::Pass), - "T-Demo suite `{suite_name}` should pass Day-1 Compiles claims, got {results:?}" + claims.iter().all(|claim| matches!(claim, FieldValue::Reference(_))), + "T-Demo suite `{suite_name}` claim entries should be declaration references: {claims:?}" ); } } From 3db50b9e17e213f149b56702d57982f7c72ce228 Mon Sep 17 00:00:00 2001 From: Brian Searls <11205878+briansrls@users.noreply.github.com> Date: Tue, 5 May 2026 09:36:50 +0000 Subject: [PATCH 05/11] test(v3): require non-empty T-Demo suite claims --- src/v3/compiler/tests/integration.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 769004632d1..d0360958176 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -238,6 +238,9 @@ mod t_demo_fixture_test { dag.diagnostics() ); + // This compile-smoke test pins the real T-Demo fixture's lowered + // suite shape without re-running every suite claim. Runner execution + // for T-Demo claims is covered by the focused suite tests below. for suite_name in [ "fixture_compiler_nerd_canonical", "fixture_integration_canonical", @@ -254,6 +257,10 @@ mod t_demo_fixture_test { let Some(FieldValue::List(claims)) = claims else { panic!("T-Demo suite `{suite_name}` should carry a structural claims list"); }; + assert!( + !claims.is_empty(), + "T-Demo suite `{suite_name}` should contain at least one claim" + ); assert!( claims.iter().all(|claim| matches!(claim, FieldValue::Reference(_))), "T-Demo suite `{suite_name}` claim entries should be declaration references: {claims:?}" From 0d571e0d1e6723a6842cbf42f5fdb77115b6b467 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 5 May 2026 05:37:57 -0400 Subject: [PATCH 06/11] WIP: R3 Evaluator --- src/v3/compiler/tests/integration.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 769004632d1..d0360958176 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -238,6 +238,9 @@ mod t_demo_fixture_test { dag.diagnostics() ); + // This compile-smoke test pins the real T-Demo fixture's lowered + // suite shape without re-running every suite claim. Runner execution + // for T-Demo claims is covered by the focused suite tests below. for suite_name in [ "fixture_compiler_nerd_canonical", "fixture_integration_canonical", @@ -254,6 +257,10 @@ mod t_demo_fixture_test { let Some(FieldValue::List(claims)) = claims else { panic!("T-Demo suite `{suite_name}` should carry a structural claims list"); }; + assert!( + !claims.is_empty(), + "T-Demo suite `{suite_name}` should contain at least one claim" + ); assert!( claims.iter().all(|claim| matches!(claim, FieldValue::Reference(_))), "T-Demo suite `{suite_name}` claim entries should be declaration references: {claims:?}" From 216c7c5ad56e3e72927414af001010b835887daa Mon Sep 17 00:00:00 2001 From: Brian Searls <11205878+briansrls@users.noreply.github.com> Date: Tue, 5 May 2026 09:40:53 +0000 Subject: [PATCH 07/11] test(v3): sample T-Demo canonical suite runner execution --- src/v3/compiler/tests/integration.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index d0360958176..7a1421c1846 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -208,7 +208,7 @@ mod t_demo_fixture_test { use v3_compiler::compile_to_dag; use v3_compiler::dag::{Dag, FieldValue, ValueBody}; - use v3_compiler::test_runner::{ClaimResult, TestRunner}; + use v3_compiler::test_runner::{ClaimResult, TestClaimValue, TestRunner}; use v3_compiler::CompileError; const FIXTURE: &str = "src/v3/compiler/tests/t_demo/t_demo_fixtures.dag"; @@ -239,8 +239,10 @@ mod t_demo_fixture_test { ); // This compile-smoke test pins the real T-Demo fixture's lowered - // suite shape without re-running every suite claim. Runner execution - // for T-Demo claims is covered by the focused suite tests below. + // suite shape and runs one real claim from each canonical suite. + // Running every canonical-suite claim here duplicates focused + // runner tests below and exceeds the 2s per-test ratchet on CI. + let runner = TestRunner::new(&dag); for suite_name in [ "fixture_compiler_nerd_canonical", "fixture_integration_canonical", @@ -265,6 +267,19 @@ mod t_demo_fixture_test { claims.iter().all(|claim| matches!(claim, FieldValue::Reference(_))), "T-Demo suite `{suite_name}` claim entries should be declaration references: {claims:?}" ); + let FieldValue::Reference(first_claim) = &claims[0] else { + unreachable!("all claim entries were verified as declaration references"); + }; + let claim = TestClaimValue::from_declaration(dag.declaration(*first_claim)) + .unwrap_or_else(|reason| { + panic!("T-Demo suite `{suite_name}` first claim should parse: {reason}") + }); + let result = runner.run_claim(&claim); + assert_eq!( + result.result, + ClaimResult::Pass, + "T-Demo suite `{suite_name}` first claim should pass through TestRunner" + ); } } From 1ef451f16e6dd7824052b5db99b59afe5994a755 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 5 May 2026 05:41:02 -0400 Subject: [PATCH 08/11] WIP: R3 Evaluator --- src/v3/compiler/tests/integration.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index d0360958176..7a1421c1846 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -208,7 +208,7 @@ mod t_demo_fixture_test { use v3_compiler::compile_to_dag; use v3_compiler::dag::{Dag, FieldValue, ValueBody}; - use v3_compiler::test_runner::{ClaimResult, TestRunner}; + use v3_compiler::test_runner::{ClaimResult, TestClaimValue, TestRunner}; use v3_compiler::CompileError; const FIXTURE: &str = "src/v3/compiler/tests/t_demo/t_demo_fixtures.dag"; @@ -239,8 +239,10 @@ mod t_demo_fixture_test { ); // This compile-smoke test pins the real T-Demo fixture's lowered - // suite shape without re-running every suite claim. Runner execution - // for T-Demo claims is covered by the focused suite tests below. + // suite shape and runs one real claim from each canonical suite. + // Running every canonical-suite claim here duplicates focused + // runner tests below and exceeds the 2s per-test ratchet on CI. + let runner = TestRunner::new(&dag); for suite_name in [ "fixture_compiler_nerd_canonical", "fixture_integration_canonical", @@ -265,6 +267,19 @@ mod t_demo_fixture_test { claims.iter().all(|claim| matches!(claim, FieldValue::Reference(_))), "T-Demo suite `{suite_name}` claim entries should be declaration references: {claims:?}" ); + let FieldValue::Reference(first_claim) = &claims[0] else { + unreachable!("all claim entries were verified as declaration references"); + }; + let claim = TestClaimValue::from_declaration(dag.declaration(*first_claim)) + .unwrap_or_else(|reason| { + panic!("T-Demo suite `{suite_name}` first claim should parse: {reason}") + }); + let result = runner.run_claim(&claim); + assert_eq!( + result.result, + ClaimResult::Pass, + "T-Demo suite `{suite_name}` first claim should pass through TestRunner" + ); } } From 5c98a0cbff7ebb3dcda4640b6bf5758ea1fae478 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 5 May 2026 22:22:38 +0000 Subject: [PATCH 09/11] docs: use symbol anchors in G0d brief --- ...0d-constructor-runtime-execution-worker.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md b/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md index bb87505c0fc..be4cb372e71 100644 --- a/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md +++ b/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md @@ -23,7 +23,7 @@ E6-G0c made `TransformTarget::Callable(decl)` executable only when `decl` resolves to an Arrow with a `UserDefined` body. The current evaluator branch fails closed on every non-Arrow callable target: -- `src/v3/compiler/src/lib.rs:579-584` reads +- `src/v3/compiler/src/lib.rs` `eval_transform_node` reads `dag.declaration(callee_decl).connective`, accepts only `TypeConnective::Arrow { body, .. }`, and otherwise returns `BadTransformOperands { reason: "Callable target declaration is not an Arrow type" }`. @@ -48,33 +48,33 @@ Two lowered constructor families reach `TransformTarget::Callable(target)`: - `lower_record_literal_expr` resolves the expected record type to a `Conj`, orders inputs by the declaration's `children` labels, lowers each field expression against its field type, then calls - `lower_constructor_invocation(dag, target_decl, inputs, span)` at - `src/v3/compiler/src/lower.rs:7214-7306`. + `lower_constructor_invocation(dag, target_decl, inputs, span)` in + `src/v3/compiler/src/lower.rs` `lower_record_literal_expr`. - `lower_constructor_invocation` emits `Behavior::Transform(TransformNode { target: - TransformTarget::Callable(target), inputs, ... })` at - `src/v3/compiler/src/lower.rs:7103-7117`. + TransformTarget::Callable(target), inputs, ... })` in + `src/v3/compiler/src/lower.rs` `lower_constructor_invocation`. - The `target_decl` here is the record / Conj declaration, not an Arrow. 2. **Variant constructors.** - Nullary variants can enter through `SurfaceExpr::Var` when the expected type is a sum: `resolve_expected_variant_constructor(...)` followed by - `lower_constructor_invocation(..., Vec::new(), ...)` at - `src/v3/compiler/src/lower.rs:6574-6579`. + `lower_constructor_invocation(..., Vec::new(), ...)` in + `src/v3/compiler/src/lower.rs` `lower_expr_inner`. - Named variant-record constructors enter through `lower_variant_record_expr`: the lowerer resolves the variant declaration, reads payload field labels/types via `variant_payload_fields_for_lowering`, orders payload inputs by those declared labels, and calls `lower_constructor_invocation(dag, - variant_decl, inputs, ...)` at - `src/v3/compiler/src/lower.rs:7309-7404`. + variant_decl, inputs, ...)` in + `src/v3/compiler/src/lower.rs` `lower_variant_record_expr`. - `variant_payload_fields_for_lowering` gets the payload fields by walking - the variant declaration to a `Conj` and preserving child labels at - `src/v3/compiler/src/lower.rs:6325-6347`. + the variant declaration to a `Conj` and preserving child labels in + `src/v3/compiler/src/lower.rs` `variant_payload_fields_for_lowering`. - Variant membership is not inferred from "walks to `Conj`" alone. The lowerer resolves constructor identity through `resolve_expected_variant_constructor`, which checks the parent - `TypeConnective::Disj { variants }` list (`src/v3/compiler/src/lower.rs:7493+`). + `TypeConnective::Disj { variants }` list in `src/v3/compiler/src/lower.rs`. For generic sums, that resolver may materialize an `Instantiation { template: variant_decl, arguments }`; E6-G0d must preserve that instantiation instead of checking only the outer @@ -87,7 +87,7 @@ accepted by the lowerer, evaluate it into the existing runtime `Value` carrier. ## Runtime Output Contract -Use only the live evaluator carriers in `src/v3/compiler/src/lib.rs:72-87`: +Use only the live evaluator carriers in `src/v3/compiler/src/lib.rs`: ```rust Value::RecordValue(Vec) From 69c1b853abd87c546388d685b6ceb96c585be1c9 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 5 May 2026 18:28:47 -0400 Subject: [PATCH 10/11] WIP: R3 Evaluator --- src/v3/compiler/tests/integration.rs | 51 ++++++++-------------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 77a61a00a4d..1aa5bea3c20 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -207,8 +207,8 @@ mod t_demo_fixture_test { use std::path::PathBuf; use v3_compiler::compile_to_dag; - use v3_compiler::dag::{Dag, FieldValue, ValueBody}; - use v3_compiler::test_runner::{ClaimResult, TestClaimValue, TestRunner}; + use v3_compiler::dag::Dag; + use v3_compiler::test_runner::{ClaimResult, TestRunner}; use v3_compiler::CompileError; const FIXTURE: &str = "src/v3/compiler/tests/t_demo/t_demo_fixtures.dag"; @@ -237,48 +237,27 @@ mod t_demo_fixture_test { "T-Demo fixture skeleton should compile without diagnostics: {:?}", dag.diagnostics() ); + } + + #[test] + fn t_demo_canonical_suites_are_runner_visible() { + let source = fixture_source(); + let dag = compile_fixture(&source); - // This compile-smoke test pins the real T-Demo fixture's lowered - // suite shape and runs one real claim from each canonical suite. - // Running every canonical-suite claim here duplicates focused - // runner tests below and exceeds the 2s per-test ratchet on CI. - let runner = TestRunner::new(&dag); for suite_name in [ "fixture_compiler_nerd_canonical", "fixture_integration_canonical", ] { - let suite = dag - .declaration_by_name(suite_name) - .unwrap_or_else(|| panic!("T-Demo suite `{suite_name}` should be declared")); - let Some(ValueBody::Structural { fields }) = &suite.value_body else { - panic!("T-Demo suite `{suite_name}` should lower as structural data"); - }; - let claims = fields - .iter() - .find_map(|(label, value)| (label == "claims").then_some(value)); - let Some(FieldValue::List(claims)) = claims else { - panic!("T-Demo suite `{suite_name}` should carry a structural claims list"); - }; + let results = TestRunner::new(&dag).run_suite(suite_name); assert!( - !claims.is_empty(), - "T-Demo suite `{suite_name}` should contain at least one claim" + !results.is_empty(), + "T-Demo suite `{suite_name}` should contain Day-1 Compiles claims" ); assert!( - claims.iter().all(|claim| matches!(claim, FieldValue::Reference(_))), - "T-Demo suite `{suite_name}` claim entries should be declaration references: {claims:?}" - ); - let FieldValue::Reference(first_claim) = &claims[0] else { - unreachable!("all claim entries were verified as declaration references"); - }; - let claim = TestClaimValue::from_declaration(dag.declaration(*first_claim)) - .unwrap_or_else(|reason| { - panic!("T-Demo suite `{suite_name}` first claim should parse: {reason}") - }); - let result = runner.run_claim(&claim); - assert_eq!( - result.result, - ClaimResult::Pass, - "T-Demo suite `{suite_name}` first claim should pass through TestRunner" + results + .iter() + .all(|result| result.result == ClaimResult::Pass), + "T-Demo suite `{suite_name}` should pass Day-1 Compiles claims, got {results:?}" ); } } From 407da8a069df11f50efe7764dbff1f2f5f853300 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 5 May 2026 22:54:18 +0000 Subject: [PATCH 11/11] docs: fix nullary variant lowerer anchor --- .../briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md b/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md index be4cb372e71..a2c23016361 100644 --- a/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md +++ b/docs/briefs/r3-pr-e6-g0d-constructor-runtime-execution-worker.md @@ -60,7 +60,7 @@ Two lowered constructor families reach `TransformTarget::Callable(target)`: - Nullary variants can enter through `SurfaceExpr::Var` when the expected type is a sum: `resolve_expected_variant_constructor(...)` followed by `lower_constructor_invocation(..., Vec::new(), ...)` in - `src/v3/compiler/src/lower.rs` `lower_expr_inner`. + `src/v3/compiler/src/lower.rs` `lower_expr`. - Named variant-record constructors enter through `lower_variant_record_expr`: the lowerer resolves the variant declaration, reads payload field labels/types via