0%

contract-coherence-zero

Every remaining test-all failure is one shape: the post-AIMS realization ContractCoherenceViolation. The VF-3 oracle (ori_arc::aims::verify::oracle::verify_coherence) re-derives MemoryContract from subject-independent realized evidence and disagrees with the inferred contract. Every disagreement is in the SAME direction: the inferred contract is optimistic, the realized evidence is conservative.

Measured baseline

Source: test-all run 1785046490971773359-7aecd20f, snapshot 45b912e37480, Infrastructure failures: 0 (the harness is sound; every failure is compiler-side).

MetricReading
passed24964
failed380
lcfail (LLVM compile fail)334
failure records401
infrastructure failures0

Mismatch taxonomy

OccurrencesMismatchInferred sourceCure surface
458EffectMismatch { field: "may_share", inferred: false, realized: true }IC-5 EffectSummaryaims-rules.md IC-5 derivation vs realized sharing evidence
100ParamAccess { inferred: Borrowed, realized: Owned }IC-3 ParamContract.accessIC-2/IC-3 SCC fixpoint vs realized owned transfer
11ParamMayShare { inferred: false, realized: true }IC-3 ParamContract.may_shareIC-3 per-param may_share(OR) join

Records by kind-set: 333 EffectMismatch only; 41 ParamAccess only; 17 EffectMismatch + ParamAccess; 10 ParamMayShare only.

Failing AOT integration tests (46)

Suite aot, failure_kind test_failure. Every one panics at compiler/ori_llvm/tests/aot/util/compile.rs:116 with error[E5001]: LLVM module verification failed carrying a ContractCoherenceViolation.

TestMismatch kinds
arc::test_arc_borrowed_param_str_concat_caller_survivesParamAccess(Borrowed->Owned)
arc::test_arc_borrowed_param_str_concat_not_cowEffectMismatch(may_share), ParamAccess(Borrowed->Owned)
arc::test_arc_opaque_closure_wrapperParamAccess(Borrowed->Owned)
borrow_independence::test_borrow_nested_projectEffectMismatch(may_share)
borrow_independence::test_borrow_then_let_aliasEffectMismatch(may_share)
borrowed_invoke_leak::mutation_in_closure_declined_cleanEffectMismatch(may_share)
burden_yield_identity_push_dup::test_yield_identity_borrowed_source_single_reuse_no_double_freeEffectMismatch(may_share)
default_minmax_mono_in_generic::test_min_max_str_in_genericParamMayShare(false->true)
derives::test_aot_derive_tuple_field_compare_hashEffectMismatch(may_share)
enum_discriminant::test_enum_rc_payload_narrowed_tagEffectMismatch(may_share)
error_constructor::test_error_constructor_first_class_valueEffectMismatch(may_share)
fat_ptr_iter::control_flow::test_matrix_nested_list_two_callsEffectMismatch(may_share)
fat_ptr_iter::cow::test_push_element_borrowed_paramEffectMismatch(may_share)
fat_ptr_iter::cow::test_push_element_borrowed_param_two_callsEffectMismatch(may_share)
fat_ptr_iter::for_yield::test_yield_identity_str_list_borrowed_paramEffectMismatch(may_share)
fat_ptr_iter::for_yield::test_yield_identity_str_list_two_callsEffectMismatch(may_share)
fat_ptr_iter::nested_list::test_nested_str_list_two_callsEffectMismatch(may_share)
generics::test_borrow_list_int_for_yield_then_return_no_leakParamMayShare(false->true)
generics::test_borrow_list_int_mixed_apply_then_return_no_leakParamMayShare(false->true)
generics::test_borrow_list_int_one_borrow_apply_then_return_no_leakParamMayShare(false->true)
generics::test_borrow_list_int_two_borrow_applies_then_return_no_leakParamMayShare(false->true)
generics::test_borrow_list_str_for_yield_then_return_no_leakParamMayShare(false->true)
generics::test_edge_consumed_and_returned_uses_return_flow_onlyParamMayShare(false->true)
generics::test_iter_then_return_str_elements_survive_iter_consumeParamMayShare(false->true)
higher_order::test_closure_returned_from_functionParamAccess(Borrowed->Owned)
higher_order::test_multi_inst_map_lambdaEffectMismatch(may_share)
inc_symmetry::test_inc_symmetry_borrow_then_let_aliasEffectMismatch(may_share)
ir_checks::run_all_codegen_filecheckEffectMismatch(may_share)
ir_quality_attributes::test_closure_wrapper_sret_no_noundefParamAccess(Borrowed->Owned)
ir_quality_attributes::test_indirect_params_have_dereferenceableEffectMismatch(may_share), ParamAccess(Borrowed->Owned)
ir_quality_attributes::test_indirect_params_have_nonnullEffectMismatch(may_share), ParamAccess(Borrowed->Owned)
ir_quality_attributes::test_indirect_params_have_noundefEffectMismatch(may_share), ParamAccess(Borrowed->Owned)
iterator_drop::enum_tagged_ptr_match_empty_pathEffectMismatch(may_share)
iterators::test_for_over_range_iteratorEffectMismatch(may_share)
journey_guard::test_journey_19_rc_lifecycleEffectMismatch(may_share)
match_alias::test_closure_option_none_capture_fresh_arm_no_suppressEffectMismatch(may_share)
match_alias::test_closure_option_str_capture_two_call_no_leakEffectMismatch(may_share)
match_alias::test_closure_result_err_capture_two_call_no_leakEffectMismatch(may_share)
match_alias::test_let_alias_struct_strEffectMismatch(may_share)
memory_stress::test_mem_diamond_closure_captureEffectMismatch(may_share)
multi_module_glue::single_module_first_class_error_still_worksEffectMismatch(may_share)
predicate_stack_probe::probe_closure_transferred_into_struct_no_double_free_negativeEffectMismatch(may_share)
predicate_stack_probe::probe_owned_set_int_returned_after_iter_freed_onceParamMayShare(false->true)
predicate_stack_probe::probe_project_borrowed_view_struct_str_field_no_double_freeEffectMismatch(may_share)
predicate_stack_probe::probe_set_str_collect_iter_consume_then_return_param_no_leakParamMayShare(false->true)
strings::test_str_in_tupleEffectMismatch(may_share)

Failing ori_llvm spec sources (21)

Suite ori_llvm, failure_kinds llvm_compile_fail (334) + file_error (21). The 334 compile failures collapse onto these 21 distinct sources.

SourceMismatch kinds
tests/aims/moved_fields_partial_move.oriEffectMismatch(may_share)
tests/spec/aims/symmetric_partial_move_allowed.oriEffectMismatch(may_share)
tests/spec/declarations/argument_punning.oriParamAccess(Borrowed->Owned)
tests/spec/declarations/default_params.oriEffectMismatch(may_share), ParamAccess(Borrowed->Owned)
tests/spec/declarations/sum_types.oriEffectMismatch(may_share)
tests/spec/expressions/coalesce.oriEffectMismatch(may_share)
tests/spec/expressions/lambda_mono.oriParamAccess(Borrowed->Owned)
tests/spec/expressions/template_literals.oriParamAccess(Borrowed->Owned)
tests/spec/generics/composite_mono_enum_eq.oriEffectMismatch(may_share)
tests/spec/patterns/match.oriEffectMismatch(may_share)
tests/spec/patterns/match_patterns.oriEffectMismatch(may_share)
tests/spec/test_coalesce_copy.oriEffectMismatch(may_share)
tests/spec/test_coalesce_minimal.oriEffectMismatch(may_share)
tests/spec/traits/derive/comparable_hashable_wrapper_fields.oriEffectMismatch(may_share)
tests/spec/traits/index/definition.oriEffectMismatch(may_share)
tests/spec/traits/method_resolution/builtin_method_known.oriEffectMismatch(may_share)
tests/spec/traits/traceable/error_trace_heap_msg.oriEffectMismatch(may_share)
tests/spec/types/enum/niche/option_str.oriEffectMismatch(may_share)
tests/spec/types/sum/test_many_types.oriEffectMismatch(may_share)
tests/spec/types/sum/test_single_field.oriEffectMismatch(may_share)
tests/spec/types/sum_types.oriEffectMismatch(may_share)

Deliverables

  • Cure EffectMismatch { field: "may_share", inferred: false, realized: true } — 458 occurrences across 350 failure records, the dominant class. IC-5 EffectSummary derivation under-reports sharing the VF-3 oracle re-derives from realized evidence.
  • Cure ParamAccess { inferred: Borrowed, realized: Owned } — 100 occurrences across 58 failure records. IC-3 ParamContract.access disagrees with the realized owned transfer.
  • Cure ParamMayShare { param_index, inferred: false, realized: true } — 11 occurrences across 10 failure records. Per-param IC-3 may_share under-reports.
  • Prove each cure in the compiled Lean BEFORE implementing per arc.md §CP-1, then sync all four surfaces per §CP-2 (compiled Lean, .proof, aims-rules.md + arc.md, Annex E §AIMS).
  • All 46 failing ori_llvm::aot integration tests green: the arc, borrow_independence, borrowed_invoke_leak, burden_yield_identity_push_dup, generics, match_alias, fat_ptr_iter, higher_order, ir_quality_attributes, ir_checks, iterator_drop, predicate_stack_probe, memory_stress, journey_guard, derives, enum_discriminant, error_constructor, strings, iterators, multi_module_glue, default_minmax_mono_in_generic, and inc_symmetry clusters.
  • All 21 distinct ori_llvm spec sources compile: tests/aims/moved_fields_partial_move.ori plus the 20 tests/spec files spanning declarations, expressions, patterns, types/sum, types/enum/niche, generics, aims, and traits (derive, index, method_resolution, traceable).
  • TDD matrix BEFORE the cure: mismatch-kind x contract-dimension x call-shape, each cell carrying a positive pin and a reverted-fix negative pin that FAILS when the cure is backed out.
  • Layer coverage per layer-coverage.md §1: L9 cross-executor parity (evaluator vs every affected admitted executor on one corpus) and L10 resource/ownership leak-freedom, each covered or explicitly N/A with a stated reason.
  • Re-run the north-star gate to a green terminal aggregate: python -m scripts.test_all_runtime run then its emitted blocking status_command, asserting failed=0 skipped=0 lcfail=0 and zero leaks with the AIMS verifier gate ACTIVE.

Discipline

  • Calculus-first per arc.md §CP-1: prove the governing theorem in the compiled Lean BEFORE implementing. A failing test is first-order evidence of an IMPLEMENTATION divergence (case a), never a licence to weaken the calculus.
  • Four-surface sync per arc.md §CP-2: compiled Lean, .proof, aims-rules.md + arc.md, and Annex E §AIMS move in the same change set.
  • The oracle is the conservative party in all three shapes. Suppressing the oracle, widening the inferred contract to match without proof, or gating the check on the failing inputs is INVERTED-TDD:gated-deliverable.
  • Every cure carries a reverted-fix negative pin that FAILS when the cure is backed out.