Repository navigation
test(v3): TC1 V1 strict-fire fixture + executable claim (§1.8 #11) #2184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
722b50d
WIP: Verification V1 (TC1 first slice) — re-recreated [Substrate Gate…
briansrls 9b3644b
Merge remote-tracking branch 'origin/main' into session/calm-koi-214
briansrls c13d7c0
ci: nudge SG-0 PR-body check after body update
briansrls eff3d07
docs(r3): bake Director (C-modified) Notes annotations into V1 scaffo…
briansrls e697fde
Merge remote-tracking branch 'origin/main' into session/calm-koi-214
briansrls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_strict_fire.dag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| // std.tc1_substrate_lens_eta_equivalence_strict_fire — TC1 V1 first slice (Pattern-A / E6-G1.a). | ||
| // | ||
| // Authority chain (Director ratifications, current as of 2026-05-07): | ||
| // - Q-PAFS Path A ACCEPTED 2026-05-06 (PR #1824 merge record on `main`). | ||
| // - Q-Reification Option A ratified 2026-05-07 (PR #2096): `Dag` IS the reflected program. | ||
| // - Substrate Mgr Gate A patches MERGED 2026-05-07 (PR #2079, commit 0e8724bc). | ||
| // - V1 dispatch unblocked by Verification Mgr (wise-bear-525, #2075) per Director cascade | ||
| // UNHOLD signal at gunbc#828 #issuecomment-4394467134. | ||
| // | ||
| // Differences vs `tc1_substrate_lens_eta_equivalence_deferred.dag`: | ||
| // - Canonical TestClaim name `tc1_eta_equivalence_executable` per `r3-program-plan.md` §1.8 #11 | ||
| // (deferred fixture's claim name is the R2 research-receipt form, not the §1.8 gate name). | ||
| // - Adds the η-pair callables `eta_subject_f` / `eta_subject_f_eta` at source level — η-equivalent | ||
| // pair `f` and `lambda x. apply(f, [x])` per TC1 statement (`r3-v-tc1-eta-equivalence-deeper- | ||
| // analysis.md` §"What TC1 Asserts"). Both compute the same `Int` value structurally. | ||
| // - Predicate stays `BinaryDimensionReportEquals` (Pattern-A consumer envelope; unified | ||
| // surface ratified at gunbc#828). | ||
| // | ||
| // Runner status today: `BinaryDimensionReportEquals` shape-only — `eval_binary_dimension_report_ | ||
| // equals_shape` (in `src/v3/compiler/src/test_runner.rs`) returns `NotYetImplemented` with the | ||
| // "structural shape is valid for ... runner evaluation waits for generic DimensionReport<C> | ||
| // production/evaluation substrate" reason. Per Director (C-modified) ratification at gunbc#828 | ||
| // 2026-05-07: §1.8 gate #11 status STAYS DECLARED on this scaffold landing — the | ||
| // NotYetImplemented sentinel is fail-closed-by-construction (an actual implementation that runs | ||
| // WILL fail the assertion when Evaluator E3.c lands, forcing fixture upgrade). Status flips | ||
| // DECLARED → CONSUMER_LANDED → PASSING in one move on E3.c (gunbc#1970) merge. | ||
| // | ||
| // Hard bars (E6-G1.a Option 3 caveat #1853): no `lens_apply` / `eval_substrate_reify` / | ||
| // `reflect_behavior` imports. Carrier shape is the ratified Q-Reification Option A `Dag`-as- | ||
| // carrier (Verification consumes; does not introduce). | ||
|
|
||
| module std.tc1_substrate_lens_eta_equivalence_strict_fire | ||
|
|
||
| import std.dimensions { DimensionReport } | ||
| import std.verification { | ||
| BinaryDimensionReportEquals, | ||
| TestClaim, | ||
| TestSuite | ||
| } | ||
|
|
||
| // Carrier for the TC1 eta-equivalence observation. Stays opaque at this slice — the carrier | ||
| // identity is what BinaryDimensionReportEquals normalizes on (left/right must agree). | ||
| type Tc1EtaLensObservation {} | ||
|
|
||
| // η-pair callables — both compute the same `Int` value. `eta_subject_f_eta` is the η-expanded | ||
| // form `lambda x. apply(eta_subject_f, [x])`; the lens-fold-over-`Dag` of either should yield | ||
| // equal `DimensionReport<Tc1EtaLensObservation>` values once Evaluator E3.c lands the | ||
| // substrate-fact projection path. These declarations make the η-pair source-visible (Mgr/ | ||
| // reviewer can read non-vacuity intent off the .dag) even though runtime fold isn't wired | ||
| // at this slice. | ||
| fn eta_subject_f(x: Int) -> Int = x + 1 | ||
| fn eta_subject_f_eta(x: Int) -> Int = eta_subject_f(x) | ||
|
|
||
| // Typed report refs — the unified `BinaryDimensionReportEquals` consumer envelope reads | ||
| // these as `DeclarationRef`s and validates carrier-equivalence today. Fold-output wiring | ||
| // is Evaluator-side per #1970 cross-Mgr split. | ||
| type tc1_subject_f_report = DimensionReport<Tc1EtaLensObservation> | ||
| type tc1_subject_eta_expanded_report = DimensionReport<Tc1EtaLensObservation> | ||
|
|
||
| // §1.8 gate #11 canonical TestClaim name. Predicate uses the unified `BinaryDimensionReport | ||
| // Equals` shape; the eta pair is declared above as `eta_subject_f` / `eta_subject_f_eta` for | ||
| // source-visible η-pair witness — the runtime fold-application is Evaluator-side authority. | ||
| data tc1_eta_equivalence_executable_claim: TestClaim = { | ||
| name: "tc1_eta_equivalence_executable", | ||
| source: "// TC1 V1 strict-fire — eta-equivalent .dag programs declared in fixture module;\n// runtime lens-fold-over-Dag gated on Evaluator E3.c (gunbc#1970).\nlet _: Int = 0\n", | ||
| file_name: "tc1_eta_equivalence_executable.v3", | ||
| predicate: BinaryDimensionReportEquals( | ||
| tc1_subject_f_report, | ||
| tc1_subject_eta_expanded_report | ||
| ), | ||
| requires: [] | ||
| } | ||
|
|
||
| data tc1_substrate_lens_eta_equivalence_strict_fire_suite: TestSuite = { | ||
| name: "tc1_substrate_lens_eta_equivalence_strict_fire_suite", | ||
| claims: [tc1_eta_equivalence_executable_claim] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/v3/compiler/tests/integration/tc1_substrate_lens_eta_equivalence_strict_fire_test.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| //! **Layer:** integration | ||
| //! | ||
| //! TC1 substrate lens eta-equivalence — strict-fire executable form (§1.8 gate #11). | ||
| //! | ||
| //! V1 first slice per Pattern-A / E6-G1.a (Q-PAFS Path A ACCEPTED 2026-05-06; Q-Reification | ||
| //! Option A ratified 2026-05-07 in PR #2096; Substrate Gate A merged 2026-05-07 in PR #2079). | ||
| //! Cross-Mgr split per Evaluator E3.c (gunbc#1970): Verification authors the .dag-side η-pair + | ||
| //! lens consumer envelope; Evaluator wires lens-fold-over-`Dag` substrate-fact projection. | ||
| //! | ||
| //! Today's runner returns `NotYetImplemented` with the canonical "structural shape is valid" | ||
| //! reason (`eval_binary_dimension_report_equals_shape` in `src/v3/compiler/src/test_runner.rs`). | ||
| //! Per Director (C-modified) ratification at gunbc#828 2026-05-07: §1.8 gate #11 status STAYS | ||
| //! DECLARED on this scaffold landing; the NotYetImplemented sentinel is fail-closed-by- | ||
| //! construction (any actual implementation that runs WILL fail this assertion when E3.c lands, | ||
| //! forcing fixture upgrade). Status flips DECLARED → CONSUMER_LANDED → PASSING in one move on | ||
| //! Evaluator E3.c (gunbc#1970) merge + assertion upgrade. | ||
|
|
||
| use v3_compiler::compile_to_dag; | ||
| use v3_compiler::test_runner::{ClaimResult, TestRunner}; | ||
| use v3_compiler::CompileError; | ||
|
|
||
| const FIXTURE_SOURCE: &str = | ||
| include_str!("../fixtures/tc1_substrate_lens_eta_equivalence_strict_fire.dag"); | ||
| const FIXTURE_PATH: &str = | ||
| "src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_strict_fire.dag"; | ||
| const SUITE_NAME: &str = "tc1_substrate_lens_eta_equivalence_strict_fire_suite"; | ||
|
|
||
| #[test] | ||
| fn tc1_strict_fire_suite_has_canonical_executable_claim_with_valid_binary_shape() { | ||
| let dag = match compile_to_dag(FIXTURE_SOURCE, FIXTURE_PATH) { | ||
| Ok(dag) => { | ||
| assert!( | ||
| dag.diagnostics().is_empty(), | ||
| "{FIXTURE_PATH}: expected empty module diagnostics, got {:?}", | ||
| dag.diagnostics().iter().collect::<Vec<_>>() | ||
| ); | ||
| dag | ||
| } | ||
| Err(CompileError::Semantic(dag)) => panic!( | ||
| "{FIXTURE_PATH} should lower without module diagnostics. Got `Err(Semantic)`: {:?}", | ||
| dag.diagnostics().iter().collect::<Vec<_>>() | ||
| ), | ||
| Err(other) => panic!("unexpected compile error for {FIXTURE_PATH}: {other:?}"), | ||
| }; | ||
|
|
||
| let results = TestRunner::new(&dag).run_suite(SUITE_NAME); | ||
| assert_eq!(results.len(), 1, "strict-fire suite has exactly one claim"); | ||
| assert_eq!( | ||
| results[0].claim_name, "tc1_eta_equivalence_executable", | ||
| "claim name must be the §1.8 #11 canonical gate name" | ||
| ); | ||
| // Today: shape-valid NotYetImplemented (runner waits on Evaluator E3.c / gunbc#1970). | ||
| // When E3.c lands, this assertion flips from NotYetImplemented to Pass — that is the | ||
| // §1.8 #11 CONSUMER_LANDED → PASSING transition without further fixture edits. | ||
| assert!( | ||
| matches!( | ||
| &results[0].result, | ||
| ClaimResult::NotYetImplemented(reason) | ||
| if reason.contains("BinaryDimensionReportEquals") | ||
| && reason.contains("structural shape is valid") | ||
| ), | ||
| "expected BinaryDimensionReportEquals shape-valid NotYetImplemented, got {:?}", | ||
| results[0].result | ||
| ); | ||
| } | ||
|
|
||
| // INVARIANTS P1 / P5 — checkable receipt: this integration crate must not build if the cited | ||
| // worker brief is missing from the worktree. | ||
| const _: &str = include_str!(concat!( | ||
| env!("CARGO_MANIFEST_DIR"), | ||
| "/../../../docs/briefs/r3-v-pattern-a-tc1-v1-worker.md" | ||
| )); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.