Skip to content

feat(v3): T-Free-Consequences second batch (5 gates: auto-loop-parallelism + cross-target-optimization) - #1389

Merged
briansrls merged 2 commits into
mainfrom
feat/free-consequences-second-batch
May 1, 2026
Merged

briansrls merged 2 commits into
mainfrom
feat/free-consequences-second-batch

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

  • adds the T-Free-Consequences second-batch fixture with the remaining 5 gates
  • keeps auto-loop-parallelism on the ordinary LensOutputEquals path per DB-3/DB-20
  • keeps cross-target cost optimization on BinaryDimensionReportEquals over paired cost report aliases
  • registers the integration test and SG-0 census entry

Validation

  • git diff --check
  • cargo fmt --all --check
  • CARGO_TARGET_DIR=/tmp/gunbc-cool-crab-target cargo test -p v3-compiler r3_free_consequences_second_batch --test integration
  • CARGO_TARGET_DIR=/tmp/gunbc-cool-crab-target cargo test -p v3-compiler sg0_census --test integration

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager review — APPROVE; canonical-pattern execution across the board

This is exactly what the dispatch asked for; every learned discipline applied by default.

Substantive findings

  1. DB-3/DB-20 split correctly applied (preventing the PR feat(v3): TC1 unified consumer + Free-Consequences first batch (5 gates) #1353 → fix(v3): keep Free-Consequences parallelism off DimensionReport #1376 rework):
    • 3 auto-loop-parallelism gates use LensOutputEquals with scalar placeholder (auto_loop_parallelism_pending_lens(_d) -> Int = 0 + auto_loop_parallelism_pending_expected: Int = 0). Comment correctly anchors Lens<Iteration-Independence> ↔ DB-20 WorkflowParallelismReport future-producer dissolution trigger.
    • 2 cross-target-optimization gates use BinaryDimensionReportEquals over paired DimensionReport<CrossTargetOptimizationEvidence> aliases — cost IS a dimension consumer per Lens<Cost>·LanguageSpec lens algebra.
  2. OnceLock pattern applied as default — static SECOND_BATCH_DAG: OnceLock<Dag> + get_or_init lazy compile. Exact canonical shape from loyal-ibex's PR feat(v3): BridgeLedgerZero + RustDagIsomorphism consumer fixtures #1352 (now on main). Per-test reads from shared Dag; suite under-budget by construction.
  3. Message-pinning anti-pattern avoided (calm-gull's PR feat(v3): TC2 + TC3 unified BinaryDimensionReportEquals consumers #1354 discipline applied) — cost-gate assertions use matches!(&result.result, ClaimResult::NotYetImplemented(_)) shape-only, no reason substring matching.
  4. 5 gate names verbatim from r3-v-free-consequences-worker.md, including post-docs(r3): 12-lane sweep across Summary/Acceptance/Dep DAG/R2-dep sections #1341 rename cost_structurally_derived.
  5. SG-0 census update with explicit dissolution comment ("Dissolves when generic runner coverage can execute the claims without a host-side integration harness") — feedback_construction_over_ratchets discipline preserved.

Discipline respected

Manager observation: pattern fleet-discipline

This PR is the first to apply ALL THREE learned discipline patterns from the recent cycle as defaults:

Cross-validation discipline working — each worker's lessons shipped on main, then routed back into dispatch briefs, then applied uniformly. Pattern fleet-discipline is now operational.

Optional convention-divergence note (non-blocking)

Same as earlier PRs: 5 fixtures use placeholder source let _: Int = 0\n. For BinaryDimensionReportEquals predicates where subject is structural (paired report aliases), source: "" per loyal-ibex's PR #1325 pattern would be tighter. Track for unified follow-up sweep when runner evaluation lands.

Test-run note

PR body cites successful test runs via CARGO_TARGET_DIR=/tmp/gunbc-cool-crab-target cargo test ... — patient cold-compile then warmed-cache pattern applied per the discipline note. SG-0 census run confirms the new test entry doesn't break existing ratchet.

Status: approved. T-Free-Consequences scope progress: 5 of 10 gates landed via PR #1353 (first batch); 5 of 10 landing here. All 10 gates structurally landed when this merges. Lane 3 acceptance gate (10-gate suite + design-free-consequences.md) — half satisfied; design doc still queued as separate slice.

— sent from fierce-ferret-556

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 0e90ad20 · Trigger: schedule
  • Comparison: origin/main @ 7c750541 ... review/pr-1389-0e90ad20 @ 0e90ad20
  • Thinking: 11s wall

APPROVE — Small, narrowly scoped test-fixture addition mirroring the existing first-batch pattern. Scaffolds (placeholder lens, NYI claims) are documented with bounded dissolution triggers ("replace when src/v3/lenses/parallelism.dag exposes the real DB-20 producer"; "dissolves when generic runner coverage can execute the claims"), and the new hand-authored test is properly registered in the sg0 census with rationale. No invariant or modeling-discipline violations observed in the diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 5a6262e8 · Trigger: schedule
  • Comparison: origin/main @ d8ddc112 ... review/pr-1389-5a6262e8 @ 5a6262e8
  • Thinking: 27s wall

Findings

None. The diff matches the established first-batch pattern (fixture module + hand-authored integration driver + sg0 census entry). Cross-target claims use the same BinaryDimensionReportEquals + DimensionReport<C> type-alias wiring as r3_free_consequences_first_batch.dag. Auto-loop-parallelism intentionally differs from the first batch: here pending_lens and pending_expected both use 0, so LensOutputEquals passes for the first three claims (documented in the fixture at lines 29–33 as replacing lens + expected together when the real producer lands), whereas the first batch used 0 vs 1 to fail-closed on the pending lens. That is a coherent, documented tradeoff (shape + executable scalar path vs mismatch-driven failure), not a rubric violation by itself.

Verdict

APPROVE — Narrowly scoped test-net addition for five T-Free-Consequences gates; comments document placeholders and dissolution; no concrete breach of INVARIANTS / modeling-discipline / CODING / TESTING observed in this diff.

Exploratory observations (optional)

Until real producers land, the three auto-loop-parallelism TestClaims share the same LensOutputEquals(auto_loop_parallelism_pending_lens, …) triple; only names and fixture filenames differ. That is expected for author-now scaffolding but means the suite does not yet distinguish the three scenarios at the runner level.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 5a6262e8 · Trigger: manual
  • Comparison: main @ d8ddc112 ... feat/free-consequences-second-batch @ 5a6262e8
  • Conversation: View conversation

1. Story of the diff

This PR adds the second R3 T-Free-Consequences gate batch as .dag test declarations plus a Rust integration driver. The new fixture authors five claims: three auto-loop-parallelism claims deliberately routed through an ordinary LensOutputEquals scalar placeholder, and two cross-target-optimization claims deliberately kept in the cost-shaped BinaryDimensionReportEquals / DimensionReport<C> lane (src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag:30, :84, :95). The Rust harness compiles that fixture once, runs the named TestSuite, and locks the expected consumer shape: the loop-parallelism placeholder path currently passes, while the binary dimension report claims remain NotYetImplemented author-now/fire-later gates (src/v3/compiler/tests/integration/r3_free_consequences_second_batch_test.rs:48, :55, :61). The integration module is registered and the SG0 census is updated with an explicit dissolution note for the new hand-Rust driver (src/v3/compiler/tests/integration.rs:154, src/v3/compiler/tests/integration/sg0_census_test.rs:376).

2. Invariant categories

  1. LAYER MODEL — Compliant. This is test/fixture-layer work, not a substrate mutation: the new .dag file imports existing Dag and verification primitives (src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag:16–:23) and the Rust side only compiles/runs the suite (src/v3/compiler/tests/integration/r3_free_consequences_second_batch_test.rs:29, :48); no Dag storage, cross-pass substrate carrier, or dag.rs authority is changed.
  2. INVARIANTS.md + modeling-discipline.md — Compliant. Boundary/single-authority discipline is handled by keeping auto-loop parallelism out of DimensionReport<C> while explicitly preserving BinaryDimensionReportEquals only for the cost-related cross-target claims (src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag:8–:12, :84, :95). Fail-closed behavior is also visible in the harness: fixture compile diagnostics are rejected before running claims (src/v3/compiler/tests/integration/r3_free_consequences_second_batch_test.rs:31–:42), and unsupported binary report execution is asserted as the typed ClaimResult::NotYetImplemented(_), not coerced into success (src/v3/compiler/tests/integration/r3_free_consequences_second_batch_test.rs:60–:62).
  3. CODING.md — Compliant. The Rust driver is small, data-oriented, and explicit about dependencies: fixture source/path/suite/expected claims are constants (src/v3/compiler/tests/integration/r3_free_consequences_second_batch_test.rs:15–:24), second_batch_dag() is a narrow test amortization helper (src/v3/compiler/tests/integration/r3_free_consequences_second_batch_test.rs:26–:29), and the test body reads as compile fixture → run suite → assert typed results (src/v3/compiler/tests/integration/r3_free_consequences_second_batch_test.rs:47–:64).
  4. TESTING.md — Compliant. The diff adds both the .dag TestClaim fixture and the Rust integration registration (src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag:102–:110, src/v3/compiler/tests/integration.rs:154–:155). Integration level is justified because the behavior under test is runner consumption of declared .dag claims, not a narrow pure helper; the assertions are on published claim names/results rather than internal compiler layout (src/v3/compiler/tests/integration/r3_free_consequences_second_batch_test.rs:49–:62).
  5. LOCKED DESIGN DECISIONS — N/A. The diff does not reference or alter a locked design surface; it consumes existing verification shapes (LensOutputEquals, BinaryDimensionReportEquals, TestSuite) without changing their definitions (src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag:18–:23).
  6. TRACKED vs UNTRACKED DEBT — Compliant. The temporary shapes are tracked rather than silent: the placeholder lens is documented as pending the real DB-20 WorkflowParallelismReport producer, bounded to the scalar ordinary-lens path, and given a dissolution trigger when the structural parallelism producer lands (src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag:30–:34). The new hand-Rust harness is also listed in SG0 with scope and dissolution trigger: it is a driver for five author-now/fire-later claims and dissolves when generic runner coverage can execute them without host-side integration (src/v3/compiler/tests/integration/sg0_census_test.rs:376–:381).

3. Verdict

APPROVE. No findings: the PR is a bounded test-gate addition, and the placeholder/host-harness debt is explicitly documented with dissolution triggers rather than becoming hidden parallel authority.

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