From f09199d5f47fc29b7748911e004f0b14596e9d80 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 22:20:02 +0000 Subject: [PATCH 1/4] =?UTF-8?q?fix(v3):=20main-RED=20partial=20fix-forward?= =?UTF-8?q?=20=E2=80=94=20SG-0=20census=20+=20parse=20manifest=20post-#227?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per Substrate Mgr disposition (a) at gunbc#2068 c#4410044549 — partial mechanical fix-forward to unblock cross-lane PRs blocked on main-green post-PR-#2271 merge (T-LBP complexity-lens substrate completion). This PR addresses 2 of 6 reported failures (the mechanical ones): 1. **SG-0 census** (`sg0_v3_test_hand_authored_subratchet`): added `cementing/complexity_lens_behavioral_completion.rs` to EXPECTED_HAND_AUTHORED_TEST per existing per-cementing-test discipline. Comment cites PR #2271 origin + register-promotion context. 2. **Parse manifest** (`handwritten_parse_snapshot_matches_manifest`): refreshed 4 row hashes for substrate-widening files — `src/v3/spec/rust.dag` (170→173 items), `src/v3/std/algebra.dag` (47→55), `std/computation.dag` (18→20), `std/induction.dag` (56→62). Refresh test couldn't write to my worktree under buildbuddy shim; hand-transcribed from failing-test `left:` payload via python diff extraction. **Out of scope** (per Mgr disposition (a) — investigated separately): - Item 1 (m1_substrate stack overflow) — substantive investigation - Item 3 (r1_canonical lens bytes) — worker-call on shape post-widening - Item 4 (m2_lens_cost_migration end-to-end) — same shape - Item 6 (slow-test ratchet) — new tests measured at <2s each, not exemption-required at HEAD Refs: #2074 c#4409948664 (PB Mgr signal); gunbc#2068 c#4410044549 (Mgr disposition); PR #2271 (T-LBP origin). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../compiler/tests/integration/parse_corpus_manifest.txt | 8 ++++---- src/v3/compiler/tests/integration/sg0_census_test.rs | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/v3/compiler/tests/integration/parse_corpus_manifest.txt b/src/v3/compiler/tests/integration/parse_corpus_manifest.txt index 6e128f123bc..ee88bd4c66f 100644 --- a/src/v3/compiler/tests/integration/parse_corpus_manifest.txt +++ b/src/v3/compiler/tests/integration/parse_corpus_manifest.txt @@ -23,9 +23,9 @@ src/v3/compiler/tests/four_fixture_pressure/wrap.v3 4 5189 ac633b042c944480 src/v3/compiler/tokenize.dag 30 64719 286ece4c5bb39038 src/v3/spec/go.dag 131 1170580 2ddf8468392612ee src/v3/spec/python.dag 93 602105 4ec88ac58c60fe63 -src/v3/spec/rust.dag 170 1357476 3577c9d1c7b90d75 +src/v3/spec/rust.dag 173 1362962 64a65693efe959ef src/v3/spec/v3_l1.dag 8 2246 57294d687b4753f4 -src/v3/std/algebra.dag 47 339773 40b62a1381f56e84 +src/v3/std/algebra.dag 55 441449 1883ff29ff2c041d src/v3/std/anthropic_messages.dag 5 6056 25140dcf6faa8e6b src/v3/std/anthropic_operations.dag 6 3404 a729e7662be9af5f src/v3/std/anthropic_schema.dag 13 69184 3115dc7ce99d10ff @@ -34,7 +34,7 @@ src/v3/std/bin_shim.dag 4 2544 9ac96f1b3feafe47 src/v3/std/bootstrap_authority.dag 4 69569 c27eb2482c2067a9 src/v3/std/bridge_ledger.dag 7 31662 ec3b4ea8c0455eb7 src/v3/std/clean_emission.dag 15 23867 e7bc1e6145f4781e -src/v3/std/computation.dag 18 36754 8023f388c3fb0918 +src/v3/std/computation.dag 20 39025 b0f1580c4f7bfadd src/v3/std/computation_model.dag 14 22953 20e458fe097d175a src/v3/std/coproduct_projection.dag 7 7380 afb0d131b9ff2fa4 src/v3/std/cross_target_coverage.dag 10 373515 814a9a617f609ad3 @@ -45,7 +45,7 @@ src/v3/std/emission_provenance.dag 6 4966 ac93c5c74cb4f9f9 src/v3/std/emit_model.dag 44 83040 71640f0720ab903a src/v3/std/extdeps_bootstrap_fixtures.dag 4 16839 22cffc76152e82dd src/v3/std/go_method_template_contracts.dag 14 133273 43ccd439b5e388ea -src/v3/std/induction.dag 56 88794 e405e1549cf2fe08 +src/v3/std/induction.dag 62 116143 4cb9b51af2e9ca44 src/v3/std/integer_diagnostic_order.dag 6 8124 5d7b31594a5b3d5c src/v3/std/lens.dag 6 9852 28d5539a5b28716e src/v3/std/lens_application.dag 10 15962 5aa2ac2fadfba5bc diff --git a/src/v3/compiler/tests/integration/sg0_census_test.rs b/src/v3/compiler/tests/integration/sg0_census_test.rs index b04ed7b7025..9d05e8d9af6 100644 --- a/src/v3/compiler/tests/integration/sg0_census_test.rs +++ b/src/v3/compiler/tests/integration/sg0_census_test.rs @@ -325,6 +325,12 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[ // until then, this hand-Rust ratchet IS the slice's structural gate. "src/v3/compiler/tests/integration/canonical_lens_bridge_ratchet_test.rs", "src/v3/compiler/tests/integration/cementing/cementing_lens_registry_dispatch_test.rs", + // T-LBP complexity-lens behavioral-completion cementing dispatch (PR #2271): + // frozen-oracle cementing per `complexity_lens_behavioral_completion` + // promoted in `docs/v3-lens-capability-register.md`. SG-0 census entry + // tracks the new cementing module per existing per-cementing-test + // EXPECTED_HAND_AUTHORED_TEST discipline. + "src/v3/compiler/tests/integration/cementing/complexity_lens_behavioral_completion.rs", "src/v3/compiler/tests/integration/common/budgeted.rs", "src/v3/compiler/tests/integration/common/cached_compile.rs", "src/v3/compiler/tests/integration/common/determinism_fixtures.rs", From 0d477e52bf922c154523dfc4883a0448736fc95a Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 18:33:54 -0400 Subject: [PATCH 2/4] =?UTF-8?q?WIP:=20Substrate=20T-CostLens-Composition?= =?UTF-8?q?=20behavioral=20completion=20(=CE=B3-ratified)=20=E2=80=94=20re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/integration/m1_substrate_test.rs | 4 ++-- .../compiler/tests/integration/test_runner_test.rs | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/v3/compiler/tests/integration/m1_substrate_test.rs b/src/v3/compiler/tests/integration/m1_substrate_test.rs index cc7353e14aa..a6fbcae1bf6 100644 --- a/src/v3/compiler/tests/integration/m1_substrate_test.rs +++ b/src/v3/compiler/tests/integration/m1_substrate_test.rs @@ -3321,8 +3321,8 @@ fn substrate_accessor_rust_binding_invariants() { checked += 1; } assert_eq!( - checked, 7, - "expected 7 substrate accessor bindings (port, node, resolve_producer, lane2_workflow_at, declaration_by_id, workflow_root_port, declaration_by_name)" + checked, 8, + "expected 8 substrate accessor bindings (port, node, resolve_producer, lane2_workflow_at, declaration_by_id, workflow_root_port, declaration_by_name, per_call_pattern_at)" ); let missing: Vec<_> = universe.difference(&rust_covered).copied().collect(); assert!( diff --git a/src/v3/compiler/tests/integration/test_runner_test.rs b/src/v3/compiler/tests/integration/test_runner_test.rs index 2c7881a2045..d6b60cefaa7 100644 --- a/src/v3/compiler/tests/integration/test_runner_test.rs +++ b/src/v3/compiler/tests/integration/test_runner_test.rs @@ -879,13 +879,19 @@ data suite: TestSuite = { #[test] fn r1_canonical_complexity_lens_bytes_include_cost_of() { let bytes = v3_compiler::test_runner::R1_CANONICAL_COMPLEXITY_LENS; + // Post-PR #2271 widening: `cost_of` (int-depth adapter) renamed/widened + // to `complexity_of` returning `Lookup` per + // `docs/v3-lens-capability-register.md` complexity.dag row promotion. + // The legacy `cost_of` Rust adapter still exists per the register row, + // but the canonical lens-bytes (`.dag` source) now declare + // `complexity_of` directly. assert!( - bytes.contains("fn cost_of"), - "canonical lens should declare cost_of" + bytes.contains("fn complexity_of"), + "canonical lens should declare complexity_of (post-PR #2271 BEHAVIORALLY COMPLETE widening)" ); assert!( - bytes.contains("fn compute_costs") && bytes.contains("fn seed_bind_params"), - "canonical `complexity.dag` bytes should include the forward-fold spine, not just the `cost_of` signature" + bytes.contains("fn compute_summaries") && bytes.contains("fn seed_bind_params"), + "canonical `complexity.dag` bytes should include the forward-fold spine, not just the `complexity_of` signature" ); } From 7fdb2ad515e7d4d2f49fe96e71f16af305187d16 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 22:49:44 +0000 Subject: [PATCH 3/4] fix(v3): post-#2271 main-RED items 1+3+4 + test-name freshness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three substantive items deferred initially per Mgr disposition (a) at gunbc#2068 c#4410044549 — turned out simpler than feared once the substrate-widening shape was clear: 1. **m1_substrate_test::substrate_accessor_rust_binding_invariants** (item 1): expected count 7→8 + name list adds `per_call_pattern_at` (new substrate accessor at `src/v3/std/computation.dag:67-69` introduced by PR #2271). 2. **r1_canonical_complexity_lens_bytes_*** (item 3): canonical lens bytes assertion + test name updated from `cost_of`/`compute_costs` → `complexity_of`/`compute_summaries` reflecting PR #2271's BEHAVIORALLY COMPLETE widening per `docs/v3-lens-capability-register.md:40` row promotion. Test renamed `..._include_cost_of` → `..._declare_complexity_of` per gpt-5-5-pro APPROVE_WITH_COMMENTS (sha 0d477e52) test-naming discipline. 3. **m2_lens_cost_migration::complexity_dag_runs_end_to_end** (item 4): harness-source format changed `emitted::cost_of` → `v3_compiler::lens_cost::cost_of`. The legacy `cost_of` adapter still exists at `src/v3/compiler/src/lib.rs:3362` (per register row "Rust surface exports complexity_of plus a legacy cost_of int-depth adapter") but lives at the top-level `lens_cost` module path, not inside the regen-emitted `mod emitted` block. CI not re-runnable locally on buildbuddy shim (parallel-test SIGABRT); counting on PR CI for verification. Refs: #2074 c#4409948664; gunbc#2068 c#4410044549; PR #2271. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../compiler/tests/integration/m2_lens_cost_migration_test.rs | 2 +- src/v3/compiler/tests/integration/test_runner_test.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v3/compiler/tests/integration/m2_lens_cost_migration_test.rs b/src/v3/compiler/tests/integration/m2_lens_cost_migration_test.rs index 5d20e5b9cb9..91eeb877b97 100644 --- a/src/v3/compiler/tests/integration/m2_lens_cost_migration_test.rs +++ b/src/v3/compiler/tests/integration/m2_lens_cost_migration_test.rs @@ -95,7 +95,7 @@ fn build_roundtrip_harness(module_source: &str) -> PathBuf { v3_compiler::dag::Behavior::Bind(bind) if bind.name == bind_name => Some(bind.clone()), \ _ => None \ }}).expect(\"bind\"); \ - match emitted::cost_of(&dag, &bind.value) {{ \ + match v3_compiler::lens_cost::cost_of(&dag, &bind.value) {{ \ v3_compiler::dag::Lookup::Hit(cost) => println!(\"{{}}\", cost), \ v3_compiler::dag::Lookup::Miss => panic!(\"complexity lens returned Miss for bind `{{}}` — malformed DAG\", bind.name), \ }} \ diff --git a/src/v3/compiler/tests/integration/test_runner_test.rs b/src/v3/compiler/tests/integration/test_runner_test.rs index d6b60cefaa7..8c4c9c775dd 100644 --- a/src/v3/compiler/tests/integration/test_runner_test.rs +++ b/src/v3/compiler/tests/integration/test_runner_test.rs @@ -877,7 +877,7 @@ data suite: TestSuite = { } #[test] -fn r1_canonical_complexity_lens_bytes_include_cost_of() { +fn r1_canonical_complexity_lens_bytes_declare_complexity_of() { let bytes = v3_compiler::test_runner::R1_CANONICAL_COMPLEXITY_LENS; // Post-PR #2271 widening: `cost_of` (int-depth adapter) renamed/widened // to `complexity_of` returning `Lookup` per From 9597dd3e9cfcf384961574142200c7f414d6d09d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 23:23:25 +0000 Subject: [PATCH 4/4] merge: resolve conflicts with main (m2 harness uses emitted::complexity_of; sg0 + test_runner takes main wording) --- .../tests/integration/m2_lens_cost_migration_test.rs | 5 ----- src/v3/compiler/tests/integration/sg0_census_test.rs | 8 -------- src/v3/compiler/tests/integration/test_runner_test.rs | 4 ---- 3 files changed, 17 deletions(-) diff --git a/src/v3/compiler/tests/integration/m2_lens_cost_migration_test.rs b/src/v3/compiler/tests/integration/m2_lens_cost_migration_test.rs index 328bee38670..fd7bb7833d9 100644 --- a/src/v3/compiler/tests/integration/m2_lens_cost_migration_test.rs +++ b/src/v3/compiler/tests/integration/m2_lens_cost_migration_test.rs @@ -95,13 +95,8 @@ fn build_roundtrip_harness(module_source: &str) -> PathBuf { v3_compiler::dag::Behavior::Bind(bind) if bind.name == bind_name => Some(bind.clone()), \ _ => None \ }}).expect(\"bind\"); \ -<<<<<<< HEAD - match v3_compiler::lens_cost::cost_of(&dag, &bind.value) {{ \ - v3_compiler::dag::Lookup::Hit(cost) => println!(\"{{}}\", cost), \ -======= match emitted::complexity_of(&dag, &bind.value) {{ \ v3_compiler::dag::Lookup::Hit(summary) => println!(\"{{}}\", if matches!(summary.work, v3_compiler::dag::SymbolicCost::ConstantCost {{ _0: 0 }}) {{ 0 }} else {{ 1 }}), \ ->>>>>>> origin/main v3_compiler::dag::Lookup::Miss => panic!(\"complexity lens returned Miss for bind `{{}}` — malformed DAG\", bind.name), \ }} \ }}" diff --git a/src/v3/compiler/tests/integration/sg0_census_test.rs b/src/v3/compiler/tests/integration/sg0_census_test.rs index 6c15bdc2c75..21aa8a99a88 100644 --- a/src/v3/compiler/tests/integration/sg0_census_test.rs +++ b/src/v3/compiler/tests/integration/sg0_census_test.rs @@ -325,17 +325,9 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[ // until then, this hand-Rust ratchet IS the slice's structural gate. "src/v3/compiler/tests/integration/canonical_lens_bridge_ratchet_test.rs", "src/v3/compiler/tests/integration/cementing/cementing_lens_registry_dispatch_test.rs", -<<<<<<< HEAD - // T-LBP complexity-lens behavioral-completion cementing dispatch (PR #2271): - // frozen-oracle cementing per `complexity_lens_behavioral_completion` - // promoted in `docs/v3-lens-capability-register.md`. SG-0 census entry - // tracks the new cementing module per existing per-cementing-test - // EXPECTED_HAND_AUTHORED_TEST discipline. -======= // R3 T-Lens-Behavioral-Parity: Band-C cementing receipt for the complexity lens // COMPLETE promotion against frozen v2-oracle values. Dissolves when `.dag` // TestClaims can execute the same complexity summary assertions directly. ->>>>>>> origin/main "src/v3/compiler/tests/integration/cementing/complexity_lens_behavioral_completion.rs", "src/v3/compiler/tests/integration/common/budgeted.rs", "src/v3/compiler/tests/integration/common/cached_compile.rs", diff --git a/src/v3/compiler/tests/integration/test_runner_test.rs b/src/v3/compiler/tests/integration/test_runner_test.rs index 88c5fd9eef4..4d0541f78e7 100644 --- a/src/v3/compiler/tests/integration/test_runner_test.rs +++ b/src/v3/compiler/tests/integration/test_runner_test.rs @@ -887,11 +887,7 @@ fn r1_canonical_complexity_lens_bytes_declare_complexity_of() { // `complexity_of` directly. assert!( bytes.contains("fn complexity_of"), -<<<<<<< HEAD - "canonical lens should declare complexity_of (post-PR #2271 BEHAVIORALLY COMPLETE widening)" -======= "canonical lens should declare complexity_of" ->>>>>>> origin/main ); assert!( bytes.contains("fn compute_summaries") && bytes.contains("fn seed_bind_params"),