diff --git a/dag/gunbc/ci_layer_roots.dag b/dag/gunbc/ci_layer_roots.dag index a2d6d2d077e..1f32f3524a7 100644 --- a/dag/gunbc/ci_layer_roots.dag +++ b/dag/gunbc/ci_layer_roots.dag @@ -155,7 +155,7 @@ data long_lane_exclusion_note: String = "test/claim/long/ is the LONG-test home data wet_integration_offline_note: String = "Four wet-integration entries above (host_effect_apply, deploy_access_privilege, ci_deploy_observed_wet, random_bytes_csprng) are OFFLINE per the hermetic-floor posture (operator 2026-07-11: integration-style witnesses must not run regularly; CI runs hermetic/mocked behavior checks). Each performs genuinely live host effects the hermetic envelope refuses by construction: host_effect_apply drives real LocalShell/SSH host effects (the 133s row atop the slow-witness census), deploy_access_privilege applies privileged shell mutations through fixture actors, ci_deploy_observed_wet shells whoami + sudo -n, random_bytes_csprng reads host entropy. Hermetic duals stay discovered where they exist (the ci_deploy split keeps the pure half; deploy_access_check(access, actor) is the mock-shaped dual). Local recipe: claim_batch --wet --source-root dag --source-root src/v2 --entry per file. Dissolve-on: the scheduled (nightly) lane un-darkens and admits wet integration rows under its own budget — then these four enroll there as declared execution rows and the exclusion rows delete." -data known_red_frontier_note: String = "Two entries above (logic_ground_truth_test, english_emit_add_test) are the KNOWN-RED FRONTIER: witnesses red on main for feature gaps owned by named lanes, exposed per-PR only when a whole-corpus-affecting diff (like the 2026-07-12 interpreter change) selects the entire tree. They are RED CONTROLS for their lanes, not broken tests — deleting them would discard the discriminating input; leaving them discovered reds every wide PR on debts those PRs did not create. So they sit here as declared, countable rows (the typed self-host-frontier pattern applied to witnesses), each with its diagnosis and dissolve-on. logic_ground_truth_test (4 witnesses): the v1 resolver does not bind imported bare variant constructors in EXPRESSION position (import v2.std.logic { True } then gt_complement(a: True) -> undefined variable: True; patterns-via-scrutinee work) — the namespace-only-resolution lane's containment SymbolIndex covers exactly this class; dissolve-on: that lane lands imported-variant value bindings, these four run green, the entry deletes. english_emit_add_test (1 witness): the english-language emit-ingest round trip returns false undiagnosed (S2 emit family); dissolve-on: the S2 behavioral-closure lane greens it locally, the entry deletes. Local recipe per file: claim_batch --source-root dag --source-root src/v2 --entry --functions . compiler_closure_emit_from_ingest_test (1 witness, compiler_closure_scoped_ingest_module_count_ok_holds, admitted 2026-07-19): it asserts COMPLETE ingest coverage for the src/v2/compiler/00_compile.dag closure. That closure is 91 source reads and the manifest emitter inlines the full Lossless text of every row, so it exceeds MANIFEST_INLINE_LIST_MAX (64) and the emitted carrier is legitimately Empty. The witness was GREEN until 2026-07-19 only because the receipt fabricated its own numbers — produced_row_count was emitted as read_count and coverage_complete was hardcoded true, so it asserted complete coverage over an empty carrier and could never go red. Making the receipt honest (the elision is now the typed, counted SourceRootManifestElided { read_count, cap }) turned a fabricated green into a true red. It is admitted here rather than deleted because it is the discriminating input for the carrier deficit: when the carrier can hold 91 rows, this witness greens by itself and that greening is the un-quarantine event. Its gate did not go vacuous — compiler_closure_ingest_receipt_describes_carrier_holds replaced it as the live claim (the receipt must describe the carrier that landed, falsifiable at any corpus size). Owner: wise-bee-768 / the module-identity storage-binding lane. Dissolve-on: manifest rows carry a source ref plus content hash instead of inlined text, the parse oracle reads through the ref with hash verification, the cap stops binding, this witness greens and the row deletes. emit_host_fold_closure_equals_eval_test (UN-QUARANTINED 2026-07-20, smart-hawk-154 / witness-realization lane 3): three probe_red rows deleted — the eval walk now materializes RuntimeClosure for an Arrow TypeNode in runtime-argument position (eval_fold_is_closure_argument_edge / eval_fold_closure_argument_child_state in 05_eval.dag), so the closure at transform child 3 of fold_fixture_param_call_body evaluates to a real closure value instead of falling through eval_type_node_atom's non-Atom arm into allocate_literal and refusing (BuildFailed). The dissolve-on condition was met as written: emit_host_fold_closure_equals_eval_holds greens wet against the real fold body subgraph, with no empty Value-behavior ComputationNode stub — the interpreted leg reads the closure from the EVALUATED argument list rather than re-walking the node AST, so eval is genuinely exercised. The (a) agreement leg is restored to the family aggregate as emit_on_demand_fold_closure_agreement_holds, routed through run_test_claim_emit_vs_eval so it compares both legs rather than reading the native cached path as its own oracle. No literal-atom roster was extended (dag_symbol_is_fixture_body_literal_atom and v2_evaluator untouched), per the PR 6879 diagnosis-table tripwire. Local recipe: claim_batch --wet --source-root src/v2 --source-root dag --entry src/v2/test/claim/execution/emit_host_fold_closure_equals_eval_test.dag --function . emit_on_demand_field_access_family_witness_test + emit_on_demand_complement_family_witness_test (UN-QUARANTINED 2026-07-20, witty-owl-841 / eval-repair arc): ten probe_red rows deleted — dag_node_is_eval_literal_atom (dag.dag single authority for complement/pick/record fixture literals) plus eval_type_node_atom bind-miss→allocate_literal (interpretation-owned fixture params) and non-Atom TypeNode→allocate_literal (Conj variant scrutinee) repair the lane-2 equals_eval BuildFailed roots; emit_host_complement_equals_eval_all_holds, emit_host_field_access_equals_eval_all_holds, and wet agreement witnesses green locally. Pure subtests in the same files stay OfflineLocalRecipe via test/claim/execution/ exclusion. emit_host_meet_join_equals_eval_test (meet/join, cross-lane receipt 2026-07-20): shares complement literal root — emit_host_meet_equals_eval_holds, emit_host_join_equals_eval_holds, emit_host_meet_join_equals_eval_all_holds green wet locally; no probe_red rows ever admitted (pre-red was family-note debt only, deleted). emit_host_variant_construct_equals_eval_test (variant_construct byproduct): non-Atom TypeNode→allocate_literal closes eval_rejected_bind_key_absent on Conj scrutinee — emit_host_variant_construct_equals_eval_holds + _all_holds green wet locally; no probe_red rows (deferred root repaired by consolidation, not a separate quarantine admission). +data known_red_frontier_note: String = "Two entries above (logic_ground_truth_test, english_emit_add_test) are the KNOWN-RED FRONTIER: witnesses red on main for feature gaps owned by named lanes, exposed per-PR only when a whole-corpus-affecting diff (like the 2026-07-12 interpreter change) selects the entire tree. They are RED CONTROLS for their lanes, not broken tests — deleting them would discard the discriminating input; leaving them discovered reds every wide PR on debts those PRs did not create. So they sit here as declared, countable rows (the typed self-host-frontier pattern applied to witnesses), each with its diagnosis and dissolve-on. logic_ground_truth_test (4 witnesses): the v1 resolver does not bind imported bare variant constructors in EXPRESSION position (import v2.std.logic { True } then gt_complement(a: True) -> undefined variable: True; patterns-via-scrutinee work) — the namespace-only-resolution lane's containment SymbolIndex covers exactly this class; dissolve-on: that lane lands imported-variant value bindings, these four run green, the entry deletes. english_emit_add_test (1 witness): the english-language emit-ingest round trip returns false undiagnosed (S2 emit family); dissolve-on: the S2 behavioral-closure lane greens it locally, the entry deletes. Local recipe per file: claim_batch --source-root dag --source-root src/v2 --entry --functions . compiler_closure_emit_from_ingest_test (1 witness, compiler_closure_scoped_ingest_module_count_ok_holds, admitted 2026-07-19): it asserts COMPLETE ingest coverage for the src/v2/compiler/00_compile.dag closure. That closure is 91 source reads and the manifest emitter inlines the full Lossless text of every row, so it exceeds MANIFEST_INLINE_LIST_MAX (64) and the emitted carrier is legitimately Empty. The witness was GREEN until 2026-07-19 only because the receipt fabricated its own numbers — produced_row_count was emitted as read_count and coverage_complete was hardcoded true, so it asserted complete coverage over an empty carrier and could never go red. Making the receipt honest (the elision is now the typed, counted SourceRootManifestElided { read_count, cap }) turned a fabricated green into a true red. It is admitted here rather than deleted because it is the discriminating input for the carrier deficit: when the carrier can hold 91 rows, this witness greens by itself and that greening is the un-quarantine event. Its gate did not go vacuous — compiler_closure_ingest_receipt_describes_carrier_holds replaced it as the live claim (the receipt must describe the carrier that landed, falsifiable at any corpus size). Owner: wise-bee-768 / the module-identity storage-binding lane. Dissolve-on: manifest rows carry a source ref plus content hash instead of inlined text, the parse oracle reads through the ref with hash verification, the cap stops binding, this witness greens and the row deletes. emit_host_fold_closure_equals_eval_test (UN-QUARANTINED 2026-07-20, smart-hawk-154 / witness-realization lane 3): three probe_red rows deleted — the eval walk now materializes RuntimeClosure for an Arrow TypeNode in runtime-argument position (eval_fold_is_closure_argument_edge / eval_fold_closure_argument_child_state in 05_eval.dag), so the closure at transform child 3 of fold_fixture_param_call_body evaluates to a real closure value instead of falling through eval_type_node_atom's non-Atom arm into allocate_literal and refusing (BuildFailed). The dissolve-on condition was met as written: emit_host_fold_closure_equals_eval_holds greens wet against the real fold body subgraph, with no empty Value-behavior ComputationNode stub — the interpreted leg reads the closure from the EVALUATED argument list rather than re-walking the node AST, so eval is genuinely exercised. The (a) agreement leg is restored to the family aggregate — since the family-crate migration (merry-pike-487 fan-out) it rides emit_on_demand_match_loop_fold_family_one_build_holds via run_test_claim_from_source_emit_vs_eval_cached, still comparing both legs (oracle = eval) rather than reading the native cached path as its own oracle. No literal-atom roster was extended (dag_symbol_is_fixture_body_literal_atom and v2_evaluator untouched), per the PR 6879 diagnosis-table tripwire. Local recipe: claim_batch --wet --source-root src/v2 --source-root dag --entry src/v2/test/claim/execution/emit_host_fold_closure_equals_eval_test.dag --function . emit_on_demand_field_access_family_witness_test + emit_on_demand_complement_family_witness_test (UN-QUARANTINED 2026-07-20, witty-owl-841 / eval-repair arc): ten probe_red rows deleted — dag_node_is_eval_literal_atom (dag.dag single authority for complement/pick/record fixture literals) plus eval_type_node_atom bind-miss→allocate_literal (interpretation-owned fixture params) and non-Atom TypeNode→allocate_literal (Conj variant scrutinee) repair the lane-2 equals_eval BuildFailed roots; emit_host_complement_equals_eval_all_holds, emit_host_field_access_equals_eval_all_holds, and wet agreement witnesses green locally. Pure subtests in the same files stay OfflineLocalRecipe via test/claim/execution/ exclusion. SCOPE CORRECTION on that un-quarantine (admitted 2026-07-22, merry-pike-487 / one-build migration): the un-quarantine covered the equals_eval lane; executing the offline field_access suite surfaced that the ALT-tree NATIVE leg was NEVER satisfiable — the wrong-field alt tree emits fn get(r: (i32,)) -> i32 { r.1 } under main-suffix get((9,)), field 1 on a 1-tuple, rustc E0609, the crate cannot build — so emit_on_demand_field_access_native_content_change_cold_rebuild_holds (alt octet 1) could never pass and never ran in CI (OfflineLocalRecipe exclusion). The alt native leg is scoped OUT of emit_on_demand_field_access_native_one_build_holds: no probe_red row is admitted because nothing runs red (the leg is not asserted), content-change key sensitivity stays PURE (closure_keys_differ), and the wrong-fixture RED stays eval-anchored on the primary build. Owner: the native-path repair PR 6990 reconciliation. Dissolve-on: the emitted alt source compiles — restore the alt cold run with its octet flip inside emit_on_demand_field_access_native_one_build_holds, then delete this admission and the pointer note field_access_alt_native_quarantine_note. emit_host_meet_join_equals_eval_test (meet/join, cross-lane receipt 2026-07-20): shares complement literal root — emit_host_meet_equals_eval_holds, emit_host_join_equals_eval_holds, emit_host_meet_join_equals_eval_all_holds green wet locally; no probe_red rows ever admitted (pre-red was family-note debt only, deleted). emit_host_variant_construct_equals_eval_test (variant_construct byproduct): non-Atom TypeNode→allocate_literal closes eval_rejected_bind_key_absent on Conj scrutinee — emit_host_variant_construct_equals_eval_holds + _all_holds green wet locally; no probe_red rows (deferred root repaired by consolidation, not a separate quarantine admission). This roster must not grow silently: a new known-red admission requires the same per-file diagnosis + owner + dissolve-on in this note, and an entry whose witness runs green locally is stale and deletes." diff --git a/dag/gunbc/witness_family_fanout.dag b/dag/gunbc/witness_family_fanout.dag index 7f9a0044972..220a6fe79bc 100644 --- a/dag/gunbc/witness_family_fanout.dag +++ b/dag/gunbc/witness_family_fanout.dag @@ -36,20 +36,20 @@ data witness_family_fanout_lanes: List = [ lane_number: 4, kind: EmitHostExecutionFamily, title: "variant_construct — variant-construct-then-match emit-on-demand native witnesses", - scope_note: "emit_on_demand_variant_construct_family_witness_test: native cold/warm octet receipts (NOT equals_eval agreement — pre-red debt in emit_host_variant_construct_equals_eval_test.dag), wrong-value RED, closure_digest key sensitivity.", + scope_note: "emit_on_demand_variant_construct_family_witness_test: consolidated to ONE-BUILD grain (emit_on_demand_variant_construct_native_one_build_holds — primary cold/warm octet 9 + wrong-value alt cold octet 1 in one root, 2 builds; formerly 5), closure_digest key sensitivity pure.", witness_entry: "src/v2/test/claim/execution/emit_on_demand_variant_construct_family_witness_test.dag", witness_function: "emit_on_demand_variant_construct_family_witnesses", - lane_state: "LANDED (wise-fox-351)" + lane_state: "LANDED (wise-fox-351); one-build consolidation (merry-pike-487 fan-out)" }, WitnessFamilyLane { lane_id: ^witness_family_lane_classical_not_ingested, lane_number: 4, kind: EmitHostExecutionFamily, title: "classical_not_ingested — ingested classical_not emit-on-demand native witnesses", - scope_note: "emit_on_demand_classical_not_ingested_family_witness_test: interpreted==native equals_eval via run_test_claim_emit_vs_eval, native cold/warm, swapped-source RED, closure_digest key sensitivity.", + scope_note: "emit_on_demand_classical_not_ingested_family_witness_test: consolidated to ONE-BUILD grain (emit_on_demand_classical_not_native_one_build_holds — primary cold/warm octet 0 + cached eval-anchored agreement warm + swapped-source alt cold octet 1 with cached mismatch RED, 2 builds; formerly ~6), closure_digest key sensitivity pure.", witness_entry: "src/v2/test/claim/execution/emit_on_demand_classical_not_ingested_family_witness_test.dag", witness_function: "emit_on_demand_classical_not_ingested_family_witnesses", - lane_state: "LANDED (wise-fox-351)" + lane_state: "LANDED (wise-fox-351); one-build consolidation (merry-pike-487 fan-out)" }, WitnessFamilyLane { lane_id: ^witness_family_lane_family_crate_grain, diff --git a/dag/std/emit_on_demand.dag b/dag/std/emit_on_demand.dag index 01dd23ec749..eef07f0b2f6 100644 --- a/dag/std/emit_on_demand.dag +++ b/dag/std/emit_on_demand.dag @@ -10,7 +10,7 @@ import std.realization { Materialization, Share, Recompute } data emit_on_demand_module_note: String = "Witness-realization kernel (plan P3): the pure-spec authority for emit-on-demand native execution — closure ContentHash -> artifact store lookup -> cold (emit+build+run+put) | warm (run-only, compile skipped). Composes P2 std.artifact_store (ContentKeyed, eviction counted) and std.realization (Share on store hit). Source grain (toolchain: source-artifact) is the emit cache; native grain (toolchain: native-artifact) is the zero-compile warm path. The interpreter's surviving roles are named here with dissolution triggers (P3 ACCEPT (c)). Host transport: extdeps.realization.emit_on_demand_host; spine/realize_pack scheduling: v2.std.emit_on_demand. Serial kernel family: emit_host_add (#6879). Fan-out lane 2 (swift-stag-662): emit_host_field_access + emit_host_complement. Width-5 partition ratified on #6879 comment." -data emit_on_demand_cache_key_authority_note: String = "Cache key purity (§5 cache-impurity): emit_on_demand_key hashes ArtifactKey { closure_digest, emitter_identity, target_language, toolchain } — closure_digest is the content hash of declared inputs (inferred_tree_digest over the witness root + evaluated facts; emitted source + build inputs derive from that tree). Witness test_id subdirectories under /tmp are isolation-only shims; they are NOT key material. A changed subject changes closure_digest -> new key -> new workspace path -> cold rebuild (witness: emit_on_demand_native_content_change_cold_rebuild_holds)." +data emit_on_demand_cache_key_authority_note: String = "Cache key purity (§5 cache-impurity): emit_on_demand_key hashes ArtifactKey { closure_digest, emitter_identity, target_language, toolchain } — closure_digest is the content hash of declared inputs (inferred_tree_digest over the witness root + evaluated facts; emitted source + build inputs derive from that tree). Witness test_id subdirectories under /tmp are isolation-only shims; they are NOT key material. A changed subject changes closure_digest -> new key -> new workspace path -> cold rebuild (witness: the one-build receipts, e.g. emit_on_demand_kernel_native_one_build_holds's alt-key cold leg and family_crate_member_change_cold_rebuild_holds)." data witness_family_build_grain_ruling: String = "Build-grain ruling (operator-directed 2026-07-21, answered by measurement): per-witness native crates cost ~17s of cargo build EACH and lose to the interpreter on wall clock; ONE family-grain crate — every member fn concatenated into one emitted source with an argv-dispatched main — pays the build once, and every member run after the first is compile_skipped. Build at family grain, never per witness. This supersedes witness-realization-plan FLAG B v0 (one binary per entry closure). The family artifact reuses the SAME key authority: emit_on_demand_key over family_closure_digest(member digests) — the family is a different closure input, not a second key scheme. Member LIST ORDER is declared key material (concat order and dispatcher arm order are artifact content); the digest is tag-seeded so a singleton family never collides with its bare member digest. Receipt by execution: emit_on_demand_family_crate_witness_test (one-build-members-warm, unknown-member RED, member-change cold rebuild)." diff --git a/src/v2/compiler/emit_host.dag b/src/v2/compiler/emit_host.dag index a246a9d6031..5d2addc3a05 100644 --- a/src/v2/compiler/emit_host.dag +++ b/src/v2/compiler/emit_host.dag @@ -502,6 +502,10 @@ fn run_test_claim_emit_vs_eval_verdict( } } +fn emit_host_no_run_args() -> List { + [] +} + fn run_test_claim_emit_vs_eval_verdict_from_run( subject: TestClaimEvalSubject, target: TargetModel, diff --git a/src/v2/extdeps/languages/rust_test.dag b/src/v2/extdeps/languages/rust_test.dag index 34d7af343d1..69ea6ad0a12 100644 --- a/src/v2/extdeps/languages/rust_test.dag +++ b/src/v2/extdeps/languages/rust_test.dag @@ -2424,6 +2424,84 @@ fn rust_logic_family_target_model_staging() -> TargetModel { } } +data rust_match_loop_fold_family_prelude: String = "\n\nfn fold_call_callee(xs: i32, z: i32, f: impl Fn(i32, i32) -> i32) -> i32 { f(xs, z) }" + +data rust_match_loop_fold_family_member_match: RustEmitHostFamilyMember = RustEmitHostFamilyMember { + member_id: "match", + result_expression: "one_or_two()" +} + +data rust_match_loop_fold_family_member_loop: RustEmitHostFamilyMember = RustEmitHostFamilyMember { + member_id: "loop", + result_expression: "one()" +} + +data rust_match_loop_fold_family_member_fold: RustEmitHostFamilyMember = RustEmitHostFamilyMember { + member_id: "fold", + result_expression: "fold_demo(3, 4)" +} + +fn rust_match_loop_fold_family_dispatch_members() -> List { + [ + rust_match_loop_fold_family_member_match, + rust_match_loop_fold_family_member_loop, + rust_match_loop_fold_family_member_fold + ] +} + +fn rust_match_loop_fold_family_host_transport_descriptor() -> HostTransportDescriptor { + HostTransportDescriptor { + identity: ^rust_host_transport_match_loop_fold_family_identity, + workspace: [ + WorkspaceFile { + path: "Cargo.toml", + content: FixedText { text: rust_emit_host_cargo_manifest } + }, + WorkspaceFile { + path: "src/main.rs", + content: EmittedWithSuffix { + suffix: rust_family_main_suffix( + prelude: rust_match_loop_fold_family_prelude, + members: rust_match_loop_fold_family_dispatch_members() + ) + } + } + ], + build: [ + ProcessInvocation { + program: HostToolProgram { executable: "cargo" }, + args: [LiteralArg { text: "build" }, LiteralArg { text: "--quiet" }] + } + ], + run: ProcessInvocation { + program: HostToolProgram { executable: "cargo" }, + args: [LiteralArg { text: "run" }, LiteralArg { text: "--quiet" }] + }, + runtime_value_codec: FixedWidthBytes { width: 5 } + } +} + +fn rust_match_loop_fold_family_runtime_row() -> TargetEmitHostRuntimeRow { + HostRuntimeRowPresent { + row: EmitHostRuntimeRow { + transport: rust_match_loop_fold_family_host_transport_descriptor(), + runtime_primitive_type: rust_emit_host_runtime_primitive_type_node() + } + } +} + +fn rust_match_loop_fold_family_target_model_staging() -> TargetModel { + let base = rust_match_target_model_staging() + TargetModel { + bundle: base.bundle, + lex: base.lex, + binding_spellings: base.binding_spellings, + token_class_emit_transforms: base.token_class_emit_transforms, + authority_source_text: base.authority_source_text, + runtime_row: rust_match_loop_fold_family_runtime_row() + } +} + data rust_rec_source_text: String = "fn mk() -> Rec { Rec { v: 9 } }" data rust_rec_wrong_value_source_text: String = "fn mk() -> Rec { Rec { v: 8 } }" diff --git a/src/v2/test/claim/execution/emit_on_demand_classical_not_ingested_family_witness_test.dag b/src/v2/test/claim/execution/emit_on_demand_classical_not_ingested_family_witness_test.dag index aff983d7a25..67f06a1eb83 100644 --- a/src/v2/test/claim/execution/emit_on_demand_classical_not_ingested_family_witness_test.dag +++ b/src/v2/test/claim/execution/emit_on_demand_classical_not_ingested_family_witness_test.dag @@ -27,8 +27,9 @@ import v2.compiler.emit { emit } import extdeps.communication.medium { Medium } import v2.compiler.emit_host { emit_host_octets_byte_string, + emit_host_no_run_args, run_emit_host_cached, - run_test_claim_emit_vs_eval, + run_test_claim_from_source_emit_vs_eval_cached, } import v2.compiler.eval { TestClaimEvalSubject, @@ -56,7 +57,7 @@ import v2.std.live_tree { LiveTreeDisposition, ReadsLiveTree } data live_tree_disposition: LiveTreeDisposition = ReadsLiveTree -data emit_on_demand_classical_not_family_note: String = "Witness-realization fan-out lane 4 (classical_not_ingested): emit-on-demand native execution for ingested classical_not — extension of #6879 kernel. Wet: interpreted==native equals_eval agreement via run_test_claim_emit_vs_eval (ingested pipeline), cold/warm compile_skipped, swapped-source RED, closure_digest key sensitivity." +data emit_on_demand_classical_not_family_note: String = "Witness-realization fan-out lane 4 (classical_not_ingested), consolidated to ONE-BUILD grain (std.emit_on_demand witness_family_build_grain_ruling, merry-pike-487 fan-out): the singleton family's crate builds ONCE per corpus pass. The single wet receipt is emit_on_demand_classical_not_native_one_build_holds: one root, both keys evicted up front; primary (ingested pipeline) cold then warm (octet 0), the eval-anchored agreement runs WARM on the same build (run_test_claim_from_source_emit_vs_eval_cached — oracle stays eval), then the swapped-source alt colds in the SAME root with the flipped octet 1 AND its eval-anchored semantic-mismatch RED runs warm on the alt build. Formerly ~6 crate builds per pass; now 2. Pure receipts unchanged." data classical_not_family_cache_root: String = "/tmp/gunbc_emit_on_demand_classical_not_family" data classical_not_family_emitter: String = "v2.compiler.emit" @@ -114,13 +115,6 @@ fn classical_not_family_cache_root_for(test_id: String) -> String { concat(classical_not_family_cache_root, "/", test_id) } -fn classical_not_family_evict_and_workspace(test_id: String, tree: InferredTree) -> String { - let key = classical_not_family_native_key_for(tree: tree) - let root = classical_not_family_cache_root_for(test_id: test_id) - let _evict = emit_on_demand_evict_native_cache(cache_root: root, key: key) - native_cache_workspace_root(cache_root: root, key: key) -} - fn classical_not_family_cached_run_with_source( workspace: String, tree: InferredTree, @@ -279,38 +273,36 @@ test fn emit_on_demand_classical_not_closure_keys_differ_for_distinct_trees_hold } } -test fn emit_on_demand_classical_not_agreement_holds() -> Bool { - match classical_not_family_tree() { - Accepted { value: tree, diagnostics: _ } => - ingested_classical_not_verdict_is_pass( - run: run_test_claim_emit_vs_eval( - subject: classical_not_family_subject(tree: tree), - target: rust_classical_not_ingested_target_model_staging() - ) - ) - Rejected { diagnostics: _ } => false - } +fn classical_not_cached_agreement_pass(workspace: String, tree: InferredTree) -> Bool { + ingested_classical_not_verdict_is_pass( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: classical_not_family_subject(tree: tree), + source_outcome: emit(tree: tree, target: rust_classical_not_ingested_target_model_staging()), + target: rust_classical_not_ingested_target_model_staging(), + workspace_dir: workspace, + run_args: emit_host_no_run_args() + ) + ) } -test fn emit_on_demand_classical_not_wrong_fixture_refuses_holds() -> Bool { - match classical_not_family_alt_tree() { - Accepted { value: tree, diagnostics: _ } => - ingested_classical_not_verdict_is_semantic_mismatch( - run: run_test_claim_emit_vs_eval( - subject: classical_not_family_subject(tree: tree), - target: rust_classical_not_ingested_target_model_staging() - ) - ) - Rejected { diagnostics: _ } => false - } +fn classical_not_cached_wrong_fixture_mismatch(workspace: String, tree: InferredTree) -> Bool { + ingested_classical_not_verdict_is_semantic_mismatch( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: classical_not_family_subject(tree: tree), + source_outcome: emit(tree: tree, target: rust_classical_not_ingested_target_model_staging()), + target: rust_classical_not_ingested_target_model_staging(), + workspace_dir: workspace, + run_args: emit_host_no_run_args() + ) + ) } -test fn emit_on_demand_classical_not_native_content_change_cold_rebuild_holds() -> Bool { +test fn emit_on_demand_classical_not_native_one_build_holds() -> Bool { match classical_not_family_tree() { Accepted { value: tree_primary, diagnostics: _ } => match classical_not_family_alt_tree() { Accepted { value: tree_alt, diagnostics: _ } => - let shared_parent = classical_not_family_cache_root_for(test_id: "classical_not_content_change_miss") + let shared_parent = classical_not_family_cache_root_for(test_id: "native_one_build") let key_primary = classical_not_family_native_key_for(tree: tree_primary) let key_alt = classical_not_family_native_key_for(tree: tree_alt) if key_primary == key_alt { @@ -326,12 +318,20 @@ test fn emit_on_demand_classical_not_native_content_change_cold_rebuild_holds() ) let workspace_alt = native_cache_workspace_root(cache_root: shared_parent, key: key_alt) warmed + && classical_not_cached_agreement_pass( + workspace: workspace_primary, + tree: tree_primary + ) && classical_not_family_cached_run_checks( workspace: workspace_alt, tree: tree_alt, expect_compile_skipped: false, expected_octet: 1 ) + && classical_not_cached_wrong_fixture_mismatch( + workspace: workspace_alt, + tree: tree_alt + ) } Rejected { diagnostics: _ } => false } @@ -339,49 +339,12 @@ test fn emit_on_demand_classical_not_native_content_change_cold_rebuild_holds() } } -test fn emit_on_demand_classical_not_native_cold_holds() -> Bool { - match classical_not_family_tree() { - Accepted { value: tree, diagnostics: _ } => - let workspace = classical_not_family_evict_and_workspace( - test_id: "classical_not_native_cold", - tree: tree - ) - classical_not_family_cached_run_checks( - workspace: workspace, - tree: tree, - expect_compile_skipped: false, - expected_octet: 0 - ) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_classical_not_native_cold_then_warm_holds() -> Bool { - match classical_not_family_tree() { - Accepted { value: tree, diagnostics: _ } => - let workspace = classical_not_family_evict_and_workspace( - test_id: "classical_not_native_cold_then_warm", - tree: tree - ) - classical_not_family_cached_cold_then_warm( - workspace: workspace, - tree: tree, - expected_octet: 0 - ) - Rejected { diagnostics: _ } => false - } -} - test fn emit_on_demand_classical_not_ingested_family_witnesses() -> Bool { emit_on_demand_classical_not_grain_keys_differ_holds() && emit_on_demand_classical_not_materialize_recompute_on_miss_holds() && emit_on_demand_classical_not_interpreter_roles_bounded_holds() && emit_on_demand_classical_not_schedule_refuses_unreadable_budget_holds() && emit_on_demand_classical_not_closure_keys_differ_for_distinct_trees_holds() - && emit_on_demand_classical_not_agreement_holds() - && emit_on_demand_classical_not_wrong_fixture_refuses_holds() - && emit_on_demand_classical_not_native_content_change_cold_rebuild_holds() - && emit_on_demand_classical_not_native_cold_holds() - && emit_on_demand_classical_not_native_cold_then_warm_holds() + && emit_on_demand_classical_not_native_one_build_holds() && emit_on_demand_classical_not_materialize_share_on_hit_holds() } diff --git a/src/v2/test/claim/execution/emit_on_demand_field_access_family_witness_test.dag b/src/v2/test/claim/execution/emit_on_demand_field_access_family_witness_test.dag index 83d07b5c62f..6104bb4d5e7 100644 --- a/src/v2/test/claim/execution/emit_on_demand_field_access_family_witness_test.dag +++ b/src/v2/test/claim/execution/emit_on_demand_field_access_family_witness_test.dag @@ -27,8 +27,9 @@ import v2.compiler.emit { emit } import extdeps.communication.medium { Medium } import v2.compiler.emit_host { emit_host_octets_byte_string, + emit_host_no_run_args, run_emit_host_cached, - run_test_claim_emit_vs_eval, + run_test_claim_from_source_emit_vs_eval_cached, } import v2.compiler.eval { Inputs, @@ -52,7 +53,7 @@ import v2.std.live_tree { LiveTreeDisposition, ReadsLiveTree } data live_tree_disposition: LiveTreeDisposition = ReadsLiveTree -data emit_on_demand_field_access_family_note: String = "Witness-realization lane 2 (witness_family_fanout): emit_host_field_access family — P3 ACCEPT witnesses mirroring emit_on_demand_kernel_witness_test.dag. Wet tests run before pure share-on-hit in the aggregate (eval-call memo ordering trap)." +data emit_on_demand_field_access_family_note: String = "Witness-realization lane 2 (witness_family_fanout), consolidated to ONE-BUILD grain (std.emit_on_demand witness_family_build_grain_ruling, merry-pike-487 fan-out): the singleton family's crate builds ONCE per corpus pass. The single wet receipt is emit_on_demand_field_access_native_one_build_holds: one root, both keys evicted up front; primary cold then warm (octet 9), the eval-anchored agreement AND the wrong-fixture semantic-mismatch RED (wrong-field subject over the primary build) run WARM on the same build, then the wrong-field alt tree colds in the SAME root with the flipped octet 1. Formerly ~7 crate builds per pass; now 2. Wet tests run before pure share-on-hit in the aggregate (eval-call memo ordering trap). Pure receipts unchanged." data field_access_family_cache_root: String = "/tmp/gunbc_emit_on_demand_field_access" data field_access_family_emitter: String = "v2.compiler.emit" @@ -185,11 +186,28 @@ fn field_access_family_cache_root_for(test_id: String) -> String { concat(field_access_family_cache_root, "/", test_id) } -fn field_access_family_evict_and_workspace(test_id: String, tree: InferredTree) -> String { - let key = field_access_family_native_key_for(tree: tree) - let root = field_access_family_cache_root_for(test_id: test_id) - let _evict = emit_on_demand_evict_native_cache(cache_root: root, key: key) - native_cache_workspace_root(cache_root: root, key: key) +fn field_access_cached_agreement_pass(workspace: String, tree: InferredTree) -> Bool { + emit_field_eval_verdict_is_pass( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: emit_field_eval_subject(tree: tree), + source_outcome: emit(tree: tree, target: rust_field_access_target_model_staging()), + target: rust_field_access_target_model_staging(), + workspace_dir: workspace, + run_args: emit_host_no_run_args() + ) + ) +} + +fn field_access_cached_wrong_fixture_mismatch(workspace: String, tree: InferredTree) -> Bool { + emit_field_eval_verdict_is_semantic_mismatch( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: emit_field_eval_wrong_fixture_subject(tree: tree), + source_outcome: emit(tree: tree, target: rust_field_access_target_model_staging()), + target: rust_field_access_target_model_staging(), + workspace_dir: workspace, + run_args: emit_host_no_run_args() + ) + ) } fn field_access_family_cached_run_checks( @@ -248,109 +266,34 @@ test fn emit_on_demand_field_access_closure_keys_differ_for_distinct_trees_holds } } -test fn emit_on_demand_field_access_native_content_change_cold_rebuild_holds() -> Bool { - match field_access_family_primary_tree() { - Accepted { value: tree_primary, diagnostics: _ } => - match field_access_family_alt_tree() { - Accepted { value: tree_alt, diagnostics: _ } => - let shared_parent = field_access_family_cache_root_for(test_id: "content_change_miss") - let key_primary = field_access_family_native_key_for(tree: tree_primary) - let key_alt = field_access_family_native_key_for(tree: tree_alt) - if key_primary == key_alt { - false - } else { - let workspace_primary = native_cache_workspace_root( - cache_root: shared_parent, - key: key_primary - ) - let _evict_primary = emit_on_demand_evict_native_cache( - cache_root: shared_parent, - key: key_primary - ) - let _evict_alt = emit_on_demand_evict_native_cache( - cache_root: shared_parent, - key: key_alt - ) - let warmed = field_access_family_cached_cold_then_warm( - workspace: workspace_primary, - tree: tree_primary, - expected_octet: 9 - ) - let workspace_alt = native_cache_workspace_root( - cache_root: shared_parent, - key: key_alt - ) - warmed - && field_access_family_cached_run_checks( - workspace: workspace_alt, - tree: tree_alt, - expect_compile_skipped: false, - expected_octet: 1 - ) - } - Rejected { diagnostics: _ } => false - } - Rejected { diagnostics: _ } => false - } -} +data field_access_alt_native_quarantine_note: String = "Pointer only — the ALT-tree NATIVE leg of this suite is scoped out as a known-red admission whose single authority is gunbc.ci_layer_roots known_red_frontier_note (admitted 2026-07-22, merry-pike-487): rustc E0609 on the emitted alt source, owner = PR 6990 reconciliation, dissolve-on = alt source compiles, restore the alt cold run in emit_on_demand_field_access_native_one_build_holds and delete both notes." -test fn emit_on_demand_field_access_agreement_holds() -> Bool { +test fn emit_on_demand_field_access_native_one_build_holds() -> Bool { match field_access_family_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - emit_field_eval_verdict_is_pass( - run: run_test_claim_emit_vs_eval( - subject: emit_field_eval_subject(tree: tree), - target: rust_field_access_target_model_staging() - ) + Accepted { value: tree_primary, diagnostics: _ } => + let shared_parent = field_access_family_cache_root_for(test_id: "native_one_build") + let key_primary = field_access_family_native_key_for(tree: tree_primary) + let workspace_primary = native_cache_workspace_root( + cache_root: shared_parent, + key: key_primary ) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_field_access_wrong_fixture_refuses_holds() -> Bool { - match emit_field_eval_producer_tree() { - Accepted { value: tree, diagnostics: _ } => - emit_field_eval_verdict_is_semantic_mismatch( - run: run_test_claim_emit_vs_eval( - subject: emit_field_eval_wrong_fixture_subject(tree: tree), - target: rust_field_access_target_model_staging() - ) + let _evict_primary = emit_on_demand_evict_native_cache( + cache_root: shared_parent, + key: key_primary ) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_field_access_native_cold_holds() -> Bool { - match field_access_family_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - let workspace = field_access_family_evict_and_workspace(test_id: "native_cold", tree: tree) - field_access_family_cached_run_checks( - workspace: workspace, - tree: tree, - expect_compile_skipped: false, + field_access_family_cached_cold_then_warm( + workspace: workspace_primary, + tree: tree_primary, expected_octet: 9 ) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_field_access_native_warm_holds() -> Bool { - match field_access_family_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - let workspace = field_access_family_evict_and_workspace(test_id: "native_warm", tree: tree) - field_access_family_cached_cold_then_warm(workspace: workspace, tree: tree, expected_octet: 9) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_field_access_native_cold_then_warm_holds() -> Bool { - match field_access_family_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - let workspace = field_access_family_evict_and_workspace( - test_id: "native_cold_then_warm", - tree: tree - ) - field_access_family_cached_cold_then_warm(workspace: workspace, tree: tree, expected_octet: 9) + && field_access_cached_agreement_pass( + workspace: workspace_primary, + tree: tree_primary + ) + && field_access_cached_wrong_fixture_mismatch( + workspace: workspace_primary, + tree: tree_primary + ) Rejected { diagnostics: _ } => false } } @@ -377,11 +320,6 @@ test fn emit_on_demand_field_access_family_witnesses() -> Bool { && emit_on_demand_field_access_interpreter_roles_bounded_holds() && emit_on_demand_field_access_schedule_refuses_unreadable_budget_holds() && emit_on_demand_field_access_closure_keys_differ_for_distinct_trees_holds() - && emit_on_demand_field_access_agreement_holds() - && emit_on_demand_field_access_wrong_fixture_refuses_holds() - && emit_on_demand_field_access_native_content_change_cold_rebuild_holds() - && emit_on_demand_field_access_native_cold_holds() - && emit_on_demand_field_access_native_warm_holds() - && emit_on_demand_field_access_native_cold_then_warm_holds() + && emit_on_demand_field_access_native_one_build_holds() && emit_on_demand_field_access_materialize_share_on_hit_holds() } diff --git a/src/v2/test/claim/execution/emit_on_demand_kernel_witness_test.dag b/src/v2/test/claim/execution/emit_on_demand_kernel_witness_test.dag index a50c6608203..65d7092000a 100644 --- a/src/v2/test/claim/execution/emit_on_demand_kernel_witness_test.dag +++ b/src/v2/test/claim/execution/emit_on_demand_kernel_witness_test.dag @@ -28,8 +28,9 @@ import v2.compiler.emit { emit } import extdeps.communication.medium { Medium } import v2.compiler.emit_host { emit_host_octets_byte_string, + emit_host_no_run_args, run_emit_host_cached, - run_test_claim_emit_vs_eval, + run_test_claim_from_source_emit_vs_eval_cached, } import v2.compiler.eval { TestClaimEvalSubject, @@ -60,7 +61,7 @@ import v2.std.live_tree { LiveTreeDisposition, ReadsLiveTree } data live_tree_disposition: LiveTreeDisposition = ReadsLiveTree -data emit_on_demand_kernel_note: String = "Witness-realization kernel ACCEPT witnesses (plan P3) for the emit_host_add family — the serial kernel's first customer. Pure: store Share qualification, realize_pack scheduling refusal, interpreter surviving roles bounded, closure_digest key sensitivity. Wet: (a) emit_host_add_equals_eval agreement via run_test_claim_emit_vs_eval; (b) native cold-then-warm with compile_skipped on the second run_emit_host_cached call; (c) changed inferred_tree_digest -> new key -> cold rebuild (cache-impurity MISS); (d) wrong-oracle RED control. test_id subdirs isolate sibling witnesses only; workspace path suffix is emit_on_demand_key(inferred_tree_digest(tree), ...), not test_id." +data emit_on_demand_kernel_note: String = "Witness-realization kernel ACCEPT witnesses (plan P3) for the emit_host_add family — the serial kernel's first customer, consolidated to ONE-BUILD grain (std.emit_on_demand witness_family_build_grain_ruling, merry-pike-487 fan-out): the singleton family's crate is built ONCE per corpus pass. The single wet receipt is emit_on_demand_kernel_native_one_build_holds: one root, both keys evicted up front; primary cold then warm (compile_skipped octet receipts), the eval-anchored agreement (run_test_claim_from_source_emit_vs_eval_cached, oracle = eval, primitive-five subject) and the wrong-oracle RED (primitive-six subject -> semantic mismatch) run WARM on the same build, then the changed-tree alt key colds in the SAME root (cache-impurity MISS discriminator). Formerly ~7 crate builds per pass (per-test eviction roots + 2 uncached agreement runs); now 2. Pure receipts unchanged. Workspace path suffix is emit_on_demand_key(inferred_tree_digest(tree), ...), not test_id." data kernel_cache_root: String = "/tmp/gunbc_emit_on_demand_kernel" data kernel_emitter: String = "v2.compiler.emit" @@ -221,13 +222,6 @@ fn kernel_cache_root_for(test_id: String) -> String { concat(kernel_cache_root, "/", test_id) } -fn kernel_evict_and_workspace(test_id: String) -> String { - let key = kernel_native_key() - let root = kernel_cache_root_for(test_id: test_id) - let _evict = emit_on_demand_evict_native_cache(cache_root: root, key: key) - native_cache_workspace_root(cache_root: root, key: key) -} - fn kernel_cached_run_checks_for_tree( workspace: String, tree: InferredTree, @@ -245,14 +239,6 @@ fn kernel_cached_run_checks_for_tree( } } -fn kernel_cached_run_checks(workspace: String, expect_compile_skipped: Bool) -> Bool { - kernel_cached_run_checks_for_tree( - workspace: workspace, - tree: emit_eval_subject_tree(), - expect_compile_skipped: expect_compile_skipped - ) -} - fn kernel_cached_cold_then_warm_for_tree(workspace: String, tree: InferredTree) -> Bool { match emit(tree: tree, target: rust_target_model_staging()) { Accepted { value: source, diagnostics: _ } => @@ -272,10 +258,27 @@ fn kernel_cached_cold_then_warm_for_tree(workspace: String, tree: InferredTree) } } -fn kernel_cached_cold_then_warm(workspace: String) -> Bool { - kernel_cached_cold_then_warm_for_tree( - workspace: workspace, - tree: emit_eval_subject_tree() +fn kernel_cached_agreement_pass(workspace: String) -> Bool { + emit_eval_verdict_is_pass( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: kernel_add_subject(call_primitive: emit_eval_call_primitive_five), + source_outcome: emit(tree: emit_eval_subject_tree(), target: rust_target_model_staging()), + target: rust_target_model_staging(), + workspace_dir: workspace, + run_args: emit_host_no_run_args() + ) + ) +} + +fn kernel_cached_wrong_oracle_mismatch(workspace: String) -> Bool { + emit_eval_verdict_is_semantic_mismatch( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: kernel_add_subject(call_primitive: emit_eval_call_primitive_six), + source_outcome: emit(tree: emit_eval_subject_tree(), target: rust_target_model_staging()), + target: rust_target_model_staging(), + workspace_dir: workspace, + run_args: emit_host_no_run_args() + ) ) } @@ -285,8 +288,8 @@ test fn emit_on_demand_closure_keys_differ_for_distinct_trees_holds() -> Bool { key_primary != key_alt } -test fn emit_on_demand_native_content_change_cold_rebuild_holds() -> Bool { - let shared_parent = kernel_cache_root_for(test_id: "content_change_miss") +test fn emit_on_demand_kernel_native_one_build_holds() -> Bool { + let shared_parent = kernel_cache_root_for(test_id: "native_one_build") let tree_primary = emit_eval_subject_tree() let tree_alt = kernel_alt_subject_tree() let key_primary = kernel_native_key_for(tree: tree_primary) @@ -315,6 +318,8 @@ test fn emit_on_demand_native_content_change_cold_rebuild_holds() -> Bool { key: key_alt ) warmed + && kernel_cached_agreement_pass(workspace: workspace_primary) + && kernel_cached_wrong_oracle_mismatch(workspace: workspace_primary) && kernel_cached_run_checks_for_tree( workspace: workspace_alt, tree: tree_alt, @@ -323,50 +328,12 @@ test fn emit_on_demand_native_content_change_cold_rebuild_holds() -> Bool { } } -test fn emit_on_demand_add_agreement_holds() -> Bool { - emit_eval_verdict_is_pass( - run: run_test_claim_emit_vs_eval( - subject: kernel_add_subject(call_primitive: emit_eval_call_primitive_five), - target: rust_target_model_staging() - ) - ) -} - -test fn emit_on_demand_add_wrong_oracle_refuses_holds() -> Bool { - emit_eval_verdict_is_semantic_mismatch( - run: run_test_claim_emit_vs_eval( - subject: kernel_add_subject(call_primitive: emit_eval_call_primitive_six), - target: rust_target_model_staging() - ) - ) -} - -test fn emit_on_demand_native_cold_holds() -> Bool { - let workspace = kernel_evict_and_workspace(test_id: "native_cold") - kernel_cached_run_checks(workspace: workspace, expect_compile_skipped: false) -} - -test fn emit_on_demand_native_warm_holds() -> Bool { - let workspace = kernel_evict_and_workspace(test_id: "native_warm") - kernel_cached_cold_then_warm(workspace: workspace) -} - -test fn emit_on_demand_native_cold_then_warm_holds() -> Bool { - let workspace = kernel_evict_and_workspace(test_id: "native_cold_then_warm") - kernel_cached_cold_then_warm(workspace: workspace) -} - test fn emit_on_demand_kernel_witnesses() -> Bool { emit_on_demand_grain_keys_differ_holds() && emit_on_demand_materialize_recompute_on_miss_holds() && emit_on_demand_interpreter_roles_bounded_holds() && emit_on_demand_schedule_refuses_unreadable_budget_holds() && emit_on_demand_closure_keys_differ_for_distinct_trees_holds() - && emit_on_demand_add_agreement_holds() - && emit_on_demand_add_wrong_oracle_refuses_holds() - && emit_on_demand_native_content_change_cold_rebuild_holds() - && emit_on_demand_native_cold_holds() - && emit_on_demand_native_warm_holds() - && emit_on_demand_native_cold_then_warm_holds() + && emit_on_demand_kernel_native_one_build_holds() && emit_on_demand_materialize_share_on_hit_holds() } diff --git a/src/v2/test/claim/execution/emit_on_demand_match_loop_fold_family_witness_test.dag b/src/v2/test/claim/execution/emit_on_demand_match_loop_fold_family_witness_test.dag index 356fce7b9e8..5799c8da304 100644 --- a/src/v2/test/claim/execution/emit_on_demand_match_loop_fold_family_witness_test.dag +++ b/src/v2/test/claim/execution/emit_on_demand_match_loop_fold_family_witness_test.dag @@ -18,16 +18,18 @@ import std.emit_on_demand { emit_on_demand_key, emit_on_demand_lookup, materialization_for_lookup, EmitOnDemandHit, EmitOnDemandMiss, interpreter_surviving_roles_bounded, + family_closure_digest, } import v2.std.emit_on_demand { witness_family_realize_width } import extdeps.realization.emit_on_demand_host { native_cache_workspace_root, emit_on_demand_evict_native_cache, } -import v2.compiler.emit { emit } import extdeps.communication.medium { Medium } +import v2.compiler.emit_module { EmitFamilyMember, emit_family } import v2.compiler.emit_host { emit_host_octets_byte_string, - run_emit_host_cached, + run_emit_host_cached_with_run_args, + run_test_claim_from_source_emit_vs_eval_cached, } import v2.compiler.eval { Inputs, @@ -39,25 +41,25 @@ import v2.extdeps.languages.rust_test { rust_match_target_model_staging, rust_loop_target_model_staging, rust_fold_call_target_model_staging, + rust_match_loop_fold_family_target_model_staging, + rust_family_member_run_args, } import v2.test.execution.emit_host_match_equals_eval { emit_match_eval_producer_tree, emit_match_eval_swapped_producer_tree, emit_match_eval_subgraph_node, - emit_match_eval_run, + emit_match_eval_subject, emit_match_eval_verdict_is_pass, } import v2.test.execution.emit_host_loop_equals_eval { emit_loop_eval_producer_tree, emit_loop_eval_wrong_value_producer_tree, - emit_loop_eval_run, + emit_loop_eval_subject, emit_loop_eval_verdict_is_pass, emit_loop_eval_verdict_is_fail, - emit_loop_eval_subgraph_node, } import v2.test.execution.emit_host_fold_closure_equals_eval { - emit_fold_eval_run, - emit_fold_eval_subgraph_node, + emit_fold_eval_subject, emit_fold_eval_tree_for, emit_fold_eval_verdict_is_pass, } @@ -65,7 +67,6 @@ import v2.test.emit.fold_call_closure_fixture { fold_fixture_param_canonical_arrow, fold_fixture_param_wrong_arrow, } -import v2.std.compilers.target_model { TargetModel } import v2.std.machine { Byte } import v2.std.collection { List, Optional, Present, Absent, optional_present, optional_absent } import v2.std.diagnostic { Accepted, Rejected, Outcome } @@ -74,7 +75,7 @@ import v2.std.live_tree { LiveTreeDisposition, ReadsLiveTree } data live_tree_disposition: LiveTreeDisposition = ReadsLiveTree -data emit_on_demand_match_loop_fold_note: String = "Witness-realization fan-out lane 3 (#6879 kernel extension): emit_host match + loop + fold_closure families end-to-end. P3 per family: (a) interpreted==native agreement via emit_host_*_equals_eval — match, loop, and fold all green (fold un-quarantined 2026-07-20 once the eval walk gained structural closure-arg support: an Arrow TypeNode in runtime-argument position materializes RuntimeClosure instead of refusing, so the closure at transform child 3 of fold_fixture_param_call_body evaluates; the native cached-path witnesses remain a separate leg and are not the agreement oracle); (b) native cached-path octet discrimination; (c) native cold-then-warm with compile_skipped; (d) distinct inferred_tree_digest -> new key -> cold rebuild; (e) wrong-oracle RED via discriminating native octets. Shared pure: store Share/Recompute, realize_pack refusal, interpreter roles bounded." +data emit_on_demand_match_loop_fold_note: String = "Witness-realization fan-out lane 3, migrated to FAMILY-CRATE grain (std.emit_on_demand witness_family_build_grain_ruling, merry-pike-487 fan-out): match + loop + fold are three members of ONE native crate (emit_family concatenation under the derived argv-dispatched main rust_match_loop_fold_family_target_model_staging; the fold member's helper fn rides the family prelude). The single native receipt is emit_on_demand_match_loop_fold_family_one_build_holds: ONE root, both family keys evicted up front; the primary family builds once (match cold, loop/fold/match-again compile_skipped), the eval-anchored member agreements (interpreted == native via run_test_claim_from_source_emit_vs_eval_cached — the agreement oracle stays eval, never the native path itself) and the unknown-member refusal run WARM on the same build; the ALL-ALT family (swapped match, wrong-value loop, wrong-arrow fold) is the content-change RED: new family key -> ONE cold rebuild carrying every wrong-fixture octet flip (match 1->2, loop 1->2, fold 7->-1) plus the eval-anchored loop mismatch. Under the prior per-witness grain this suite paid ~20 crate builds per corpus pass; now 2. Shared pure receipts unchanged: store Share/Recompute, realize_pack refusal, interpreter roles bounded, grain key split." data family_cache_root: String = "/tmp/gunbc_emit_on_demand_match_loop_fold_family" data family_emitter: String = "v2.compiler.emit" @@ -106,136 +107,12 @@ fn family_cache_root_for(test_id: String) -> String { concat(family_cache_root, "/", test_id) } -fn family_cached_run_logical_ok( - workspace: String, - target: TargetModel, - source: Medium, - fixture_inputs: Inputs, - expect_compile_skipped: Bool -) -> Bool { - match run_emit_host_cached( - workspace_dir: workspace, - target: target, - source: source, - fixture_inputs: fixture_inputs - ) { - Accepted { value: receipt, diagnostics: _ } => - match receipt.logical_run { - Accepted { value: HostLogicalRun { stdout: _ }, diagnostics: None } => - receipt.compile_skipped == expect_compile_skipped - _ => false - } - Rejected { diagnostics: _ } => false - } -} - -fn family_cached_run_succeeded( - workspace: String, - target: TargetModel, - source: Medium, - fixture_inputs: Inputs, - expect_compile_skipped: Bool, - expected_octets: List -) -> Bool { - match run_emit_host_cached( - workspace_dir: workspace, - target: target, - source: source, - fixture_inputs: fixture_inputs - ) { - Accepted { value: receipt, diagnostics: _ } => - match receipt.logical_run { - Accepted { - value: HostLogicalRun { stdout: stdout }, - diagnostics: None - } => - receipt.compile_skipped == expect_compile_skipped - && stdout.bytes == emit_host_octets_byte_string(octets: expected_octets) - _ => false - } - Rejected { diagnostics: _ } => false - } -} - -fn family_cached_run_checks_for_tree( - workspace: String, - tree: InferredTree, - target: TargetModel, - fixture_inputs: Inputs, - expect_compile_skipped: Bool, - expected_octets: List -) -> Bool { - match emit(tree: tree, target: target) { - Accepted { value: source, diagnostics: _ } => - family_cached_run_succeeded( - workspace: workspace, - target: target, - source: source, - fixture_inputs: fixture_inputs, - expect_compile_skipped: expect_compile_skipped, - expected_octets: expected_octets - ) - Rejected { diagnostics: _ } => false - } -} - -fn family_cached_run_logical_checks_for_tree( - workspace: String, - tree: InferredTree, - target: TargetModel, - fixture_inputs: Inputs, - expect_compile_skipped: Bool -) -> Bool { - match emit(tree: tree, target: target) { - Accepted { value: source, diagnostics: _ } => - family_cached_run_logical_ok( - workspace: workspace, - target: target, - source: source, - fixture_inputs: fixture_inputs, - expect_compile_skipped: expect_compile_skipped - ) - Rejected { diagnostics: _ } => false - } -} - -fn family_cached_cold_then_warm_for_tree( - workspace: String, - tree: InferredTree, - target: TargetModel, - fixture_inputs: Inputs, - expected_octets: List -) -> Bool { - match emit(tree: tree, target: target) { - Accepted { value: source, diagnostics: _ } => - family_cached_run_succeeded( - workspace: workspace, - target: target, - source: source, - fixture_inputs: fixture_inputs, - expect_compile_skipped: false, - expected_octets: expected_octets - ) - && family_cached_run_succeeded( - workspace: workspace, - target: target, - source: source, - fixture_inputs: fixture_inputs, - expect_compile_skipped: true, - expected_octets: expected_octets - ) - Rejected { diagnostics: _ } => false - } -} - -fn family_evict_and_workspace(test_id: String, key: ContentHash) -> String { - let root = family_cache_root_for(test_id: test_id) - let _evict = emit_on_demand_evict_native_cache(cache_root: root, key: key) - native_cache_workspace_root(cache_root: root, key: key) -} - data match_expected_octets: List = [0, 1, 0, 0, 0] data match_alt_expected_octets: List = [0, 2, 0, 0, 0] +data loop_expected_octets: List = [0, 1, 0, 0, 0] +data loop_alt_expected_octets: List = [0, 2, 0, 0, 0] +data fold_expected_octets: List = [0, 7, 0, 0, 0] +data fold_alt_expected_octets: List = [0, 255, 255, 255, 255] fn match_fixture_inputs() -> Inputs { inputs_for_emit_host( @@ -253,142 +130,6 @@ fn match_alt_tree() -> Outcome { emit_match_eval_swapped_producer_tree() } -test fn emit_on_demand_match_agreement_holds() -> Bool { - match emit_match_eval_producer_tree() { - Accepted { value: tree, diagnostics: _ } => - emit_match_eval_verdict_is_pass(run: emit_match_eval_run(tree: tree)) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_match_native_cached_octets_holds() -> Bool { - match match_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "match_agreement", key: key) - family_cached_run_checks_for_tree( - workspace: workspace, - tree: tree, - target: rust_match_target_model_staging(), - fixture_inputs: match_fixture_inputs(), - expect_compile_skipped: false, - expected_octets: match_expected_octets - ) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_match_wrong_fixture_refuses_holds() -> Bool { - match match_alt_tree() { - Accepted { value: tree, diagnostics: _ } => - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "match_wrong_fixture", key: key) - family_cached_run_checks_for_tree( - workspace: workspace, - tree: tree, - target: rust_match_target_model_staging(), - fixture_inputs: match_fixture_inputs(), - expect_compile_skipped: false, - expected_octets: match_alt_expected_octets - ) - && (match_alt_expected_octets == match_expected_octets) == false - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_match_native_cold_holds() -> Bool { - match match_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "match_native_cold", key: key) - family_cached_run_checks_for_tree( - workspace: workspace, - tree: tree, - target: rust_match_target_model_staging(), - fixture_inputs: match_fixture_inputs(), - expect_compile_skipped: false, - expected_octets: match_expected_octets - ) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_match_native_cold_then_warm_holds() -> Bool { - match match_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "match_native_cold_then_warm", key: key) - family_cached_cold_then_warm_for_tree( - workspace: workspace, - tree: tree, - target: rust_match_target_model_staging(), - fixture_inputs: match_fixture_inputs(), - expected_octets: match_expected_octets - ) - Rejected { diagnostics: _ } => false - } -} - -test fn emit_on_demand_match_content_change_cold_rebuild_holds() -> Bool { - match match_primary_tree() { - Accepted { value: tree_primary, diagnostics: _ } => - match match_alt_tree() { - Accepted { value: tree_alt, diagnostics: _ } => - let key_primary = family_native_key_for(tree: tree_primary) - let key_alt = family_native_key_for(tree: tree_alt) - if key_primary == key_alt { - false - } else { - let shared_parent = family_cache_root_for(test_id: "match_content_change") - let workspace_primary = native_cache_workspace_root( - cache_root: shared_parent, - key: key_primary - ) - let _evict_primary = emit_on_demand_evict_native_cache( - cache_root: shared_parent, - key: key_primary - ) - let _evict_alt = emit_on_demand_evict_native_cache( - cache_root: shared_parent, - key: key_alt - ) - let warmed = family_cached_cold_then_warm_for_tree( - workspace: workspace_primary, - tree: tree_primary, - target: rust_match_target_model_staging(), - fixture_inputs: match_fixture_inputs(), - expected_octets: match_expected_octets - ) - let workspace_alt = native_cache_workspace_root( - cache_root: shared_parent, - key: key_alt - ) - warmed - && family_cached_run_logical_checks_for_tree( - workspace: workspace_alt, - tree: tree_alt, - target: rust_match_target_model_staging(), - fixture_inputs: match_fixture_inputs(), - expect_compile_skipped: false - ) - } - Rejected { diagnostics: _ } => false - } - Rejected { diagnostics: _ } => false - } -} - -data loop_expected_octets: List = [0, 1, 0, 0, 0] -data loop_alt_expected_octets: List = [0, 2, 0, 0, 0] - -fn loop_fixture_inputs() -> Inputs { - inputs_for_emit_host( - claim_input_root: emit_loop_eval_subgraph_node, - expected_eval_root: emit_loop_eval_subgraph_node, - claim_pin: ^emit_loop_eval_evaluator_pin - ) -} - fn loop_primary_tree() -> Outcome { emit_loop_eval_producer_tree() } @@ -397,227 +138,319 @@ fn loop_alt_tree() -> Outcome { emit_loop_eval_wrong_value_producer_tree() } -test fn emit_on_demand_loop_agreement_holds() -> Bool { - match loop_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - emit_loop_eval_verdict_is_pass(run: emit_loop_eval_run(tree: tree)) - Rejected { diagnostics: _ } => false - } +fn fold_primary_tree() -> InferredTree { + emit_fold_eval_tree_for(root: fold_fixture_param_canonical_arrow) } -test fn emit_on_demand_loop_wrong_fixture_refuses_holds() -> Bool { - match loop_alt_tree() { - Accepted { value: tree, diagnostics: _ } => - emit_loop_eval_verdict_is_fail(run: emit_loop_eval_run(tree: tree)) - Rejected { diagnostics: _ } => false - } +fn fold_alt_tree() -> InferredTree { + emit_fold_eval_tree_for(root: fold_fixture_param_wrong_arrow) } -test fn emit_on_demand_loop_native_cold_holds() -> Bool { - match loop_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "loop_native_cold", key: key) - family_cached_run_checks_for_tree( - workspace: workspace, - tree: tree, - target: rust_loop_target_model_staging(), - fixture_inputs: loop_fixture_inputs(), - expect_compile_skipped: false, - expected_octets: loop_expected_octets - ) - Rejected { diagnostics: _ } => false - } +fn mlf_family_members( + match_tree: InferredTree, + loop_tree: InferredTree, + fold_tree: InferredTree +) -> List { + [ + EmitFamilyMember { + tree: match_tree, + target: rust_match_target_model_staging() + }, + EmitFamilyMember { + tree: loop_tree, + target: rust_loop_target_model_staging() + }, + EmitFamilyMember { + tree: fold_tree, + target: rust_fold_call_target_model_staging() + } + ] +} + +fn mlf_no_member_digests() -> List { + [] +} + +fn mlf_family_digest(members: List) -> ContentHash { + family_closure_digest( + members: fold_list( + xs: members, + empty: mlf_no_member_digests(), + cons: fn(acc, member) { + concat(acc, [inferred_tree_digest(tree: member.tree)]) + } + ) + ) } -test fn emit_on_demand_loop_native_cold_then_warm_holds() -> Bool { - match loop_primary_tree() { - Accepted { value: tree, diagnostics: _ } => - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "loop_native_cold_then_warm", key: key) - family_cached_cold_then_warm_for_tree( - workspace: workspace, - tree: tree, - target: rust_loop_target_model_staging(), - fixture_inputs: loop_fixture_inputs(), - expected_octets: loop_expected_octets - ) +fn mlf_family_native_key(members: List) -> ContentHash { + emit_on_demand_key( + closure_digest: mlf_family_digest(members: members), + emitter_identity: family_emitter, + target_language: "rust", + grain: NativeArtifact + ) +} + +fn mlf_family_member_run( + workspace: String, + source: Medium, + member_id: String, + expect_compile_skipped: Bool, + expected_octets: List +) -> Bool { + match run_emit_host_cached_with_run_args( + workspace_dir: workspace, + target: rust_match_loop_fold_family_target_model_staging(), + source: source, + fixture_inputs: match_fixture_inputs(), + run_args: rust_family_member_run_args(member_id: member_id) + ) { + Accepted { value: receipt, diagnostics: _ } => + match receipt.logical_run { + Accepted { + value: HostLogicalRun { stdout: stdout }, + diagnostics: None + } => + receipt.compile_skipped == expect_compile_skipped + && stdout.bytes == emit_host_octets_byte_string(octets: expected_octets) + _ => false + } Rejected { diagnostics: _ } => false } } -test fn emit_on_demand_loop_content_change_cold_rebuild_holds() -> Bool { - match loop_primary_tree() { - Accepted { value: tree_primary, diagnostics: _ } => - match loop_alt_tree() { - Accepted { value: tree_alt, diagnostics: _ } => - let key_primary = family_native_key_for(tree: tree_primary) - let key_alt = family_native_key_for(tree: tree_alt) - if key_primary == key_alt { - false - } else { - let shared_parent = family_cache_root_for(test_id: "loop_content_change") - let workspace_primary = native_cache_workspace_root( - cache_root: shared_parent, - key: key_primary - ) - let _evict_primary = emit_on_demand_evict_native_cache( - cache_root: shared_parent, - key: key_primary - ) - let _evict_alt = emit_on_demand_evict_native_cache( - cache_root: shared_parent, - key: key_alt - ) - let warmed = family_cached_cold_then_warm_for_tree( - workspace: workspace_primary, - tree: tree_primary, - target: rust_loop_target_model_staging(), - fixture_inputs: loop_fixture_inputs(), - expected_octets: loop_expected_octets - ) - let workspace_alt = native_cache_workspace_root( - cache_root: shared_parent, - key: key_alt - ) - warmed - && family_cached_run_logical_checks_for_tree( - workspace: workspace_alt, - tree: tree_alt, - target: rust_loop_target_model_staging(), - fixture_inputs: loop_fixture_inputs(), - expect_compile_skipped: false - ) - } - Rejected { diagnostics: _ } => false +fn mlf_family_member_run_refused( + workspace: String, + source: Medium, + member_id: String +) -> Bool { + match run_emit_host_cached_with_run_args( + workspace_dir: workspace, + target: rust_match_loop_fold_family_target_model_staging(), + source: source, + fixture_inputs: match_fixture_inputs(), + run_args: rust_family_member_run_args(member_id: member_id) + ) { + Accepted { value: receipt, diagnostics: _ } => + match receipt.logical_run { + Accepted { value: _, diagnostics: _ } => false + Rejected { diagnostics: _ } => true } Rejected { diagnostics: _ } => false } } -data fold_expected_octets: List = [0, 7, 0, 0, 0] -data fold_alt_expected_octets: List = [0, 255, 255, 255, 255] - -fn fold_fixture_inputs() -> Inputs { - inputs_for_emit_host( - claim_input_root: emit_fold_eval_subgraph_node, - expected_eval_root: emit_fold_eval_subgraph_node, - claim_pin: ^emit_fold_eval_evaluator_pin +fn mlf_family_primary_agreements( + workspace: String, + source: Medium, + match_tree: InferredTree, + loop_tree: InferredTree +) -> Bool { + emit_match_eval_verdict_is_pass( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: emit_match_eval_subject(tree: match_tree), + source_outcome: Accepted { value: source, diagnostics: None }, + target: rust_match_loop_fold_family_target_model_staging(), + workspace_dir: workspace, + run_args: rust_family_member_run_args(member_id: "match") + ) ) + && emit_loop_eval_verdict_is_pass( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: emit_loop_eval_subject(tree: loop_tree), + source_outcome: Accepted { value: source, diagnostics: None }, + target: rust_match_loop_fold_family_target_model_staging(), + workspace_dir: workspace, + run_args: rust_family_member_run_args(member_id: "loop") + ) + ) + && emit_fold_eval_verdict_is_pass( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: emit_fold_eval_subject(root: fold_fixture_param_canonical_arrow), + source_outcome: Accepted { value: source, diagnostics: None }, + target: rust_match_loop_fold_family_target_model_staging(), + workspace_dir: workspace, + run_args: rust_family_member_run_args(member_id: "fold") + ) + ) } -fn fold_primary_tree() -> InferredTree { - emit_fold_eval_tree_for(root: fold_fixture_param_canonical_arrow) -} - -fn fold_alt_tree() -> InferredTree { - emit_fold_eval_tree_for(root: fold_fixture_param_wrong_arrow) -} - -data emit_on_demand_fold_agreement_note: String = "The (a) leg for fold, restored on un-quarantine (2026-07-20) once eval gained structural closure-arg support. Like the match and loop agreement witnesses it routes through emit_fold_eval_run -> run_test_claim_emit_vs_eval, so the verdict is a comparison of BOTH legs: emit()-to-native host run versus eval() of the same subgraph. It is deliberately NOT a native-cached-path assertion — the cached-octets witnesses below cover that, and an agreement fn that read the native path as its own oracle would be checking the native leg against itself." - -test fn emit_on_demand_fold_closure_agreement_holds() -> Bool { - emit_fold_eval_verdict_is_pass( - run: emit_fold_eval_run(root: fold_fixture_param_canonical_arrow) +fn mlf_family_alt_loop_mismatch( + workspace: String, + source: Medium, + loop_alt: InferredTree +) -> Bool { + emit_loop_eval_verdict_is_fail( + run: run_test_claim_from_source_emit_vs_eval_cached( + subject: emit_loop_eval_subject(tree: loop_alt), + source_outcome: Accepted { value: source, diagnostics: None }, + target: rust_match_loop_fold_family_target_model_staging(), + workspace_dir: workspace, + run_args: rust_family_member_run_args(member_id: "loop") + ) ) } -test fn emit_on_demand_fold_closure_native_cached_octets_holds() -> Bool { - let tree = fold_primary_tree() - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "fold_native_cached_octets", key: key) - family_cached_run_checks_for_tree( +fn mlf_family_primary_runs(workspace: String, source: Medium) -> Bool { + mlf_family_member_run( workspace: workspace, - tree: tree, - target: rust_fold_call_target_model_staging(), - fixture_inputs: fold_fixture_inputs(), + source: source, + member_id: "match", expect_compile_skipped: false, - expected_octets: fold_expected_octets + expected_octets: match_expected_octets ) + && mlf_family_member_run( + workspace: workspace, + source: source, + member_id: "loop", + expect_compile_skipped: true, + expected_octets: loop_expected_octets + ) + && mlf_family_member_run( + workspace: workspace, + source: source, + member_id: "fold", + expect_compile_skipped: true, + expected_octets: fold_expected_octets + ) + && mlf_family_member_run( + workspace: workspace, + source: source, + member_id: "match", + expect_compile_skipped: true, + expected_octets: match_expected_octets + ) } -test fn emit_on_demand_fold_closure_wrong_fixture_refuses_holds() -> Bool { - let tree = fold_alt_tree() - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "fold_wrong_fixture", key: key) - family_cached_run_checks_for_tree( +fn mlf_family_alt_runs(workspace: String, source: Medium) -> Bool { + mlf_family_member_run( workspace: workspace, - tree: tree, - target: rust_fold_call_target_model_staging(), - fixture_inputs: fold_fixture_inputs(), + source: source, + member_id: "match", expect_compile_skipped: false, - expected_octets: fold_alt_expected_octets + expected_octets: match_alt_expected_octets ) + && mlf_family_member_run( + workspace: workspace, + source: source, + member_id: "loop", + expect_compile_skipped: true, + expected_octets: loop_alt_expected_octets + ) + && mlf_family_member_run( + workspace: workspace, + source: source, + member_id: "fold", + expect_compile_skipped: true, + expected_octets: fold_alt_expected_octets + ) + && (match_alt_expected_octets == match_expected_octets) == false + && (loop_alt_expected_octets == loop_expected_octets) == false && (fold_alt_expected_octets == fold_expected_octets) == false } -test fn emit_on_demand_fold_closure_native_cold_holds() -> Bool { - let tree = fold_primary_tree() - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "fold_native_cold", key: key) - family_cached_run_checks_for_tree( - workspace: workspace, - tree: tree, - target: rust_fold_call_target_model_staging(), - fixture_inputs: fold_fixture_inputs(), - expect_compile_skipped: false, - expected_octets: fold_expected_octets - ) -} - -test fn emit_on_demand_fold_closure_native_cold_then_warm_holds() -> Bool { - let tree = fold_primary_tree() - let key = family_native_key_for(tree: tree) - let workspace = family_evict_and_workspace(test_id: "fold_native_cold_then_warm", key: key) - family_cached_cold_then_warm_for_tree( - workspace: workspace, - tree: tree, - target: rust_fold_call_target_model_staging(), - fixture_inputs: fold_fixture_inputs(), - expected_octets: fold_expected_octets - ) -} - -test fn emit_on_demand_fold_closure_content_change_cold_rebuild_holds() -> Bool { - let tree_primary = fold_primary_tree() - let tree_alt = fold_alt_tree() - let key_primary = family_native_key_for(tree: tree_primary) - let key_alt = family_native_key_for(tree: tree_alt) - if key_primary == key_alt { - false - } else { - let shared_parent = family_cache_root_for(test_id: "fold_content_change") - let workspace_primary = native_cache_workspace_root( - cache_root: shared_parent, - key: key_primary - ) - let _evict_primary = emit_on_demand_evict_native_cache( - cache_root: shared_parent, - key: key_primary - ) - let _evict_alt = emit_on_demand_evict_native_cache( - cache_root: shared_parent, - key: key_alt +fn mlf_family_one_build_with_sources( + workspace_primary: String, + workspace_alt: String, + source: Medium, + alt_source: Medium, + match_tree: InferredTree, + loop_tree: InferredTree, + loop_alt: InferredTree +) -> Bool { + mlf_family_primary_runs(workspace: workspace_primary, source: source) + && mlf_family_primary_agreements( + workspace: workspace_primary, + source: source, + match_tree: match_tree, + loop_tree: loop_tree ) - let warmed = family_cached_cold_then_warm_for_tree( + && mlf_family_member_run_refused( workspace: workspace_primary, - tree: tree_primary, - target: rust_fold_call_target_model_staging(), - fixture_inputs: fold_fixture_inputs(), - expected_octets: fold_expected_octets + source: source, + member_id: "absent_member" ) - let workspace_alt = native_cache_workspace_root( - cache_root: shared_parent, - key: key_alt + && mlf_family_alt_runs(workspace: workspace_alt, source: alt_source) + && mlf_family_alt_loop_mismatch( + workspace: workspace_alt, + source: alt_source, + loop_alt: loop_alt ) - warmed - && family_cached_run_logical_checks_for_tree( - workspace: workspace_alt, - tree: tree_alt, - target: rust_fold_call_target_model_staging(), - fixture_inputs: fold_fixture_inputs(), - expect_compile_skipped: false - ) +} + +test fn emit_on_demand_match_loop_fold_family_one_build_holds() -> Bool { + match match_primary_tree() { + Accepted { value: match_tree, diagnostics: _ } => + match loop_primary_tree() { + Accepted { value: loop_tree, diagnostics: _ } => + match match_alt_tree() { + Accepted { value: match_alt, diagnostics: _ } => + match loop_alt_tree() { + Accepted { value: loop_alt, diagnostics: _ } => + let members = mlf_family_members( + match_tree: match_tree, + loop_tree: loop_tree, + fold_tree: fold_primary_tree() + ) + let alt_members = mlf_family_members( + match_tree: match_alt, + loop_tree: loop_alt, + fold_tree: fold_alt_tree() + ) + let key_primary = mlf_family_native_key(members: members) + let key_alt = mlf_family_native_key(members: alt_members) + if key_primary == key_alt { + false + } else { + let root = family_cache_root_for(test_id: "family_one_build") + let _evict_primary = emit_on_demand_evict_native_cache( + cache_root: root, + key: key_primary + ) + let _evict_alt = emit_on_demand_evict_native_cache( + cache_root: root, + key: key_alt + ) + let workspace_primary = native_cache_workspace_root( + cache_root: root, + key: key_primary + ) + let workspace_alt = native_cache_workspace_root( + cache_root: root, + key: key_alt + ) + match emit_family( + members: members, + transport_target: rust_match_loop_fold_family_target_model_staging() + ) { + Accepted { value: source, diagnostics: _ } => + match emit_family( + members: alt_members, + transport_target: rust_match_loop_fold_family_target_model_staging() + ) { + Accepted { value: alt_source, diagnostics: _ } => + mlf_family_one_build_with_sources( + workspace_primary: workspace_primary, + workspace_alt: workspace_alt, + source: source, + alt_source: alt_source, + match_tree: match_tree, + loop_tree: loop_tree, + loop_alt: loop_alt + ) + Rejected { diagnostics: _ } => false + } + Rejected { diagnostics: _ } => false + } + } + Rejected { diagnostics: _ } => false + } + Rejected { diagnostics: _ } => false + } + Rejected { diagnostics: _ } => false + } + Rejected { diagnostics: _ } => false } } @@ -707,22 +540,6 @@ test fn emit_on_demand_match_loop_fold_family_witnesses() -> Bool { && emit_on_demand_match_loop_fold_materialize_recompute_on_miss_holds() && emit_on_demand_match_loop_fold_interpreter_roles_bounded_holds() && emit_on_demand_match_loop_fold_schedule_refuses_unreadable_budget_holds() - && emit_on_demand_match_agreement_holds() - && emit_on_demand_match_native_cached_octets_holds() - && emit_on_demand_match_wrong_fixture_refuses_holds() - && emit_on_demand_match_native_cold_holds() - && emit_on_demand_match_native_cold_then_warm_holds() - && emit_on_demand_match_content_change_cold_rebuild_holds() - && emit_on_demand_loop_agreement_holds() - && emit_on_demand_loop_wrong_fixture_refuses_holds() - && emit_on_demand_loop_native_cold_holds() - && emit_on_demand_loop_native_cold_then_warm_holds() - && emit_on_demand_loop_content_change_cold_rebuild_holds() - && emit_on_demand_fold_closure_agreement_holds() - && emit_on_demand_fold_closure_native_cached_octets_holds() - && emit_on_demand_fold_closure_wrong_fixture_refuses_holds() - && emit_on_demand_fold_closure_native_cold_holds() - && emit_on_demand_fold_closure_native_cold_then_warm_holds() - && emit_on_demand_fold_closure_content_change_cold_rebuild_holds() + && emit_on_demand_match_loop_fold_family_one_build_holds() && emit_on_demand_match_loop_fold_materialize_share_on_hit_holds() } diff --git a/src/v2/test/claim/execution/emit_on_demand_variant_construct_family_witness_test.dag b/src/v2/test/claim/execution/emit_on_demand_variant_construct_family_witness_test.dag index f984514ad2c..3a28c63f4cb 100644 --- a/src/v2/test/claim/execution/emit_on_demand_variant_construct_family_witness_test.dag +++ b/src/v2/test/claim/execution/emit_on_demand_variant_construct_family_witness_test.dag @@ -49,7 +49,7 @@ import v2.std.live_tree { LiveTreeDisposition, ReadsLiveTree } data live_tree_disposition: LiveTreeDisposition = ReadsLiveTree -data emit_on_demand_variant_construct_family_note: String = "Witness-realization fan-out lane 4 (variant_construct): emit-on-demand native execution for variant-construct-then-match — extension of #6879 kernel. Wet: interpreted==native equals_eval (emit_host_variant_construct_equals_eval_test.dag — closed by eval_type_node_atom non-Atom TypeNode→allocate_literal, witty-owl-841), native cold/warm receipts, wrong-value fixture RED, closure_digest key sensitivity." +data emit_on_demand_variant_construct_family_note: String = "Witness-realization fan-out lane 4 (variant_construct), consolidated to ONE-BUILD grain (std.emit_on_demand witness_family_build_grain_ruling, merry-pike-487 fan-out): the singleton family's crate builds ONCE per corpus pass. The single wet receipt is emit_on_demand_variant_construct_native_one_build_holds: one root, both keys evicted up front; primary cold then warm (octet 9), then the wrong-value alt tree colds in the SAME root with the flipped octet 1 — the content-change MISS and the wrong-value RED in one cold rebuild. Formerly 5 crate builds per pass (per-test eviction roots); now 2. Interpreted==native agreement stays in emit_host_variant_construct_equals_eval_test.dag (its own oracle leg). Pure receipts unchanged." data variant_construct_family_cache_root: String = "/tmp/gunbc_emit_on_demand_variant_construct_family" data variant_construct_family_emitter: String = "v2.compiler.emit" @@ -90,13 +90,6 @@ fn variant_construct_family_cache_root_for(test_id: String) -> String { concat(variant_construct_family_cache_root, "/", test_id) } -fn variant_construct_family_evict_and_workspace(test_id: String, tree: InferredTree) -> String { - let key = variant_construct_family_native_key_for(tree: tree) - let root = variant_construct_family_cache_root_for(test_id: test_id) - let _evict = emit_on_demand_evict_native_cache(cache_root: root, key: key) - native_cache_workspace_root(cache_root: root, key: key) -} - fn variant_construct_family_cached_run_with_source( workspace: String, tree: InferredTree, @@ -231,21 +224,8 @@ test fn emit_on_demand_variant_construct_closure_keys_differ_for_distinct_trees_ key_primary != key_alt } -test fn emit_on_demand_variant_construct_wrong_fixture_refuses_holds() -> Bool { - let workspace = variant_construct_family_evict_and_workspace( - test_id: "variant_wrong_fixture_native", - tree: emit_variant_construct_eval_wrong_value_tree - ) - variant_construct_family_cached_run_checks( - workspace: workspace, - tree: emit_variant_construct_eval_wrong_value_tree, - expect_compile_skipped: false, - expected_octet: 1 - ) -} - -test fn emit_on_demand_variant_construct_native_content_change_cold_rebuild_holds() -> Bool { - let shared_parent = variant_construct_family_cache_root_for(test_id: "variant_content_change_miss") +test fn emit_on_demand_variant_construct_native_one_build_holds() -> Bool { + let shared_parent = variant_construct_family_cache_root_for(test_id: "native_one_build") let tree_primary = emit_variant_construct_eval_tree let tree_alt = emit_variant_construct_eval_wrong_value_tree let key_primary = variant_construct_family_native_key_for(tree: tree_primary) @@ -272,40 +252,12 @@ test fn emit_on_demand_variant_construct_native_content_change_cold_rebuild_hold } } -test fn emit_on_demand_variant_construct_native_cold_holds() -> Bool { - let workspace = variant_construct_family_evict_and_workspace( - test_id: "variant_native_cold", - tree: emit_variant_construct_eval_tree - ) - variant_construct_family_cached_run_checks( - workspace: workspace, - tree: emit_variant_construct_eval_tree, - expect_compile_skipped: false, - expected_octet: 9 - ) -} - -test fn emit_on_demand_variant_construct_native_cold_then_warm_holds() -> Bool { - let workspace = variant_construct_family_evict_and_workspace( - test_id: "variant_native_cold_then_warm", - tree: emit_variant_construct_eval_tree - ) - variant_construct_family_cached_cold_then_warm( - workspace: workspace, - tree: emit_variant_construct_eval_tree, - expected_octet: 9 - ) -} - test fn emit_on_demand_variant_construct_family_witnesses() -> Bool { emit_on_demand_variant_construct_grain_keys_differ_holds() && emit_on_demand_variant_construct_materialize_recompute_on_miss_holds() && emit_on_demand_variant_construct_interpreter_roles_bounded_holds() && emit_on_demand_variant_construct_schedule_refuses_unreadable_budget_holds() && emit_on_demand_variant_construct_closure_keys_differ_for_distinct_trees_holds() - && emit_on_demand_variant_construct_wrong_fixture_refuses_holds() - && emit_on_demand_variant_construct_native_content_change_cold_rebuild_holds() - && emit_on_demand_variant_construct_native_cold_holds() - && emit_on_demand_variant_construct_native_cold_then_warm_holds() + && emit_on_demand_variant_construct_native_one_build_holds() && emit_on_demand_variant_construct_materialize_share_on_hit_holds() } diff --git a/src/v2/test/claim/witness_admission_test.dag b/src/v2/test/claim/witness_admission_test.dag index df0b9b2cf63..3a27de08591 100644 --- a/src/v2/test/claim/witness_admission_test.dag +++ b/src/v2/test/claim/witness_admission_test.dag @@ -72,7 +72,7 @@ fn witness_known_red_probe_consumer_holds() -> Bool { fn witness_field_access_wet_offline_consumer_holds() -> Bool { match witness_consumer_cadence_for_row( entry: "src/v2/test/claim/execution/emit_on_demand_field_access_family_witness_test.dag", - function: "emit_on_demand_field_access_agreement_holds", + function: "emit_on_demand_field_access_family_witnesses", excluded_from_discovery: true ) { OfflineLocalRecipe => true