Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ Find Rust owners in the [compiler map](source-rust/README.md#where-code-belongs)
- 43 samples: "dependency … exceeds its reach ceiling with service …". Families: `opaque_closed_carrier_exchange` 40, `principal_component_row` 1, `process_exit_binding` 1, `range_only_localization` 1.
- 39 samples: "this call's declared result-domain set does not equal its expected result-domain set; without an expected result, a call selects the empty set: declar". Families: `foreign_retained_shared_borrow` 9, `foreign_nested_record_backing` 8, `foreign_retained_mutable_borrow` 8, `selected_provider_issuance` 8, `case_store_shapes` 1, `const_extent_node_ordinal` 1, and 4 more.

- **SAMPLE-SECTOR-REQUIRES-CONTRACT.** 40 failing samples. A session claimed this sector (requires-contract by family) on 2026-12-04. The families fail on different unproved facts, so work this one family at a time.
- 40 samples: "cannot prove requires contract for call ...". Families: `match_reference_referent` 13, `match_computed_root` 10, `nested_array_element_projection` 8, and 7 more.
- **SAMPLE-SECTOR-REQUIRES-CONTRACT.** 14 failing samples. A session claimed this sector (requires-contract by family) on 2026-12-04. The families fail on different unproved facts, so work this one family at a time.
- 14 samples: "cannot prove requires contract for call ...". Families: `nested_array_element_projection` 8, and 5 more.

- **SAMPLE-SECTOR-BITWISE-DISPATCH-ENTRY.** 40 failing samples. A session claimed this sector (bitwise, dispatch and hosted entry) on 2026-12-04.
- 10 samples: "not supported yet: cannot prove requires contract for call ...". Families: `signed_64bit_bitwise_and_mask_bound` 2, `unsigned_64bit_bitwise_or_bound` 2, `checked_asm_add_carry` 3, `checked_asm_flag_snapshot` 2, `runtime_count_index` 1. These are intended-invalid twins the checker refuses without a verdict. The bitwise four (`invalid_field`, `invalid_match_join`) read the operand through a record field or a join, where the input counterexample search does not reach, so it cannot show `masked` reaching a value below 40. The asm twins compare flag words (`snapshot ^ 1 & 2261 == 85`), which no rule decides.
Expand Down Expand Up @@ -200,8 +200,8 @@ Find Rust owners in the [compiler map](source-rust/README.md#where-code-belongs)
- 3 samples: "not supported yet: contract dynamic selection used as a static structural subject". Families: `partitioned_match_records` 1, `partitioned_scan_output` 1, `reborrowed_partition_output` 1.
- 3 samples: "not supported yet: declaration proposition". Families: `named_proposition_roster` 1, `plural_named_witnesses` 1, `proposition_surface` 1.

- **SAMPLE-SECTOR-UNCLAIMED.** 731 failing samples that no session has claimed. When you take a bullet, move it into its own sector item.
- 22 samples: "storage is changed while a conflicting reference remains live (conflicting loans)". Families: `match_loan_last_use` 14, `match_computed_root` 4, `reference_arrival_handoff` 2, `case_match_payload_loan` 1, `stamped_message_dispatch` 1.
- **SAMPLE-SECTOR-UNCLAIMED.** 727 failing samples that no session has claimed. When you take a bullet, move it into its own sector item.
- 18 samples: "storage is changed while a conflicting reference remains live (conflicting loans)". Families: `match_loan_last_use` 14, `reference_arrival_handoff` 2, `case_match_payload_loan` 1, `stamped_message_dispatch` 1.
- 21 samples: "machine … has an uncovered Trap crash; publish a same-cause … route whose guard covers this site". Families: `build_target_provider` 9, `disk_collision_lab` 5, `returned_write_destination` 4, `mold_front_vent_analysis` 2, `inferred_record_equation_call` 1.
- 20 samples: "root grant subject … must name one visible provider or admitted machine declaration". Families: `progress_selector` 9, `selected_value_application` 8, `write_only_reference_store` 1, `sealed_requirement_member` 1, `selected_crash_formal` 1.
- 19 samples: "cannot prove requires clause N of the called machine". Families: `ieee_guard_i32_from_f64` 11, `stored_exclusive_byte_view` 1, `stored_shared_byte_view_element_lend` 1, `signed_64bit_shift_right_arithmetic_bound` 1, `signed_64bit_wrapping_subtraction_bound` 1, `signed_8bit_exact_subtraction_bound` 1, and 3 more.
Expand Down
3 changes: 2 additions & 1 deletion samples/cli/facts/core/match_computed_root/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ The counter starts at 0. `compute` increments it and returns index 0; the match
selects `@mutable chosen[0]` when that element is 17. The consumer writes 41 through
the selected loan. The runtime oracle checks the written value, `chosen[1] == 5`,
`other[0] == 0` and `visits == 1`. The reject twin overwrites `chosen` while
`selected` is live and must report ``while local borrow `selected` is still active``.
`selected` is live and must report
`storage is changed while a conflicting reference remains live (conflicting loans)`.

The original programs assigned `counter = 1`, so running the computation twice
could still leave the count at 1. Their passing runtime results do not prove single
Expand Down
8 changes: 6 additions & 2 deletions samples/cli/facts/core/match_join_place_read/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ obligation.
The `target_body` place and its twin carry no source target prefix.
Build-owned target selection replaces the prefixed family with ordinary named
implementations (`X86...` and `Arm...`) of a boundary-trait requirement, selected
by explicit target-keyed Build rows. The operation, inputs, contracts and exit
oracle are unchanged. The entry wrapper and each implementation check a tag
by explicit target-keyed Build rows. The operation, inputs and exit oracle are
unchanged. The requirement and both implementations state
`requires chosen.kept == 17`: an implementation of a declared requirement must
accept every input its contract admits
([private entry inference](../../../../../wiki/spec/language/state_contracts.md#private-entry-inference)),
so it cannot rely on what one caller happens to pass. The entry wrapper and each implementation check a tag
(17 for x86-64, 29 for AArch64), so a wrong Build row traps. Observed evidence is
Linux x86-64 native and Terminal Psi agreement for the positive and source
rejection for the twin; the other hosted targets keep their authored rows,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ ArmBodyCheck satisfies SelectedBodyCheck {

boundary trait SelectedApply {
machine apply(chosen: @Pair, spare: @Pair) -> i64
requires chosen.kept == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap;
}

X86Apply satisfies SelectedApply {
machine apply(chosen: @Pair, spare: @Pair) -> i64
requires chosen.kept == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap
{
SelectedBodyCheck::require_tag(17u64);
Expand All @@ -56,6 +58,7 @@ X86Apply satisfies SelectedApply {

ArmApply satisfies SelectedApply {
machine apply(chosen: @Pair, spare: @Pair) -> i64
requires chosen.kept == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap
{
SelectedBodyCheck::require_tag(29u64);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ ArmBodyCheck satisfies SelectedBodyCheck {

boundary trait SelectedApply {
machine apply(chosen: @Pair, spare: @Pair) -> i64
requires chosen.kept == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap;
}

X86Apply satisfies SelectedApply {
machine apply(chosen: @Pair, spare: @Pair) -> i64
requires chosen.kept == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap
{
SelectedBodyCheck::require_tag(17u64);
Expand All @@ -56,6 +58,7 @@ X86Apply satisfies SelectedApply {

ArmApply satisfies SelectedApply {
machine apply(chosen: @Pair, spare: @Pair) -> i64
requires chosen.kept == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap
{
SelectedBodyCheck::require_tag(29u64);
Expand Down
8 changes: 6 additions & 2 deletions samples/cli/facts/core/match_primitive_local_origin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,12 @@ primitive-local origin recorded on a match join and read by a consumer.
The `target_body` place and its twin carry no source target prefix.
Build-owned target selection replaces the prefixed family with ordinary named
implementations (`X86...` and `Arm...`) of a boundary-trait requirement, selected
by explicit target-keyed Build rows. The operation, inputs, contracts and exit
oracle are unchanged. The entry wrapper and each implementation check a tag
by explicit target-keyed Build rows. The operation, inputs and exit oracle are
unchanged. The requirement and both implementations state
`requires chosen == 17`: an implementation of a declared requirement must
accept every input its contract admits
([private entry inference](../../../../../wiki/spec/language/state_contracts.md#private-entry-inference)),
so it cannot rely on what one caller happens to pass. The entry wrapper and each implementation check a tag
(17 for x86-64, 29 for AArch64), so a wrong Build row traps. Observed evidence is
Linux x86-64 native and Terminal Psi agreement for the positive and source
rejection for the twin; the other hosted targets keep their authored rows,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ ArmBodyCheck satisfies SelectedBodyCheck {

boundary trait SelectedApply {
machine apply(chosen: i64, spare: i64) -> i64
requires chosen == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap;
}

X86Apply satisfies SelectedApply {
machine apply(chosen: i64, spare: i64) -> i64
requires chosen == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap
{
SelectedBodyCheck::require_tag(17u64);
Expand All @@ -54,6 +56,7 @@ X86Apply satisfies SelectedApply {

ArmApply satisfies SelectedApply {
machine apply(chosen: i64, spare: i64) -> i64
requires chosen == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap
{
SelectedBodyCheck::require_tag(29u64);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ ArmBodyCheck satisfies SelectedBodyCheck {

boundary trait SelectedApply {
machine apply(chosen: i64, spare: i64) -> i64
requires chosen == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap;
}

X86Apply satisfies SelectedApply {
machine apply(chosen: i64, spare: i64) -> i64
requires chosen == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap
{
SelectedBodyCheck::require_tag(17u64);
Expand All @@ -54,6 +56,7 @@ X86Apply satisfies SelectedApply {

ArmApply satisfies SelectedApply {
machine apply(chosen: i64, spare: i64) -> i64
requires chosen == 17
reaches SelectedBodyCheck invokes SelectedBodyCheck crashes? Trap
{
SelectedBodyCheck::require_tag(29u64);
Expand Down
20 changes: 8 additions & 12 deletions samples/cli/facts/core/match_reference_referent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,14 @@ with that same compiler and run configuration `6ab3b2410ace`; the other hosts ru
it in the matrix above. Each capture verifies all 180 copied inputs and nine
product files, including `.omega-owner`.

## Unchanged failure in the broader row

The nested twin expects caller/state names `main`/`pick`; the diagnostic reports
`pick`/`entry` for the same missing 17 requirement. Its source, Build file and expectations are unchanged from fixed main.
The compiler and library sources are also unchanged.
The changed provider and control packages do not enter that nested program.
The failure therefore predates this migration and is outside its changed scope,
as allowed by [validation scope](../../../../../wiki/development/testing.md#validation-scope).

The expectation and strict validation rule are unchanged. Every failed report
remains failed. Correcting that expectation is separate work on the broader row;
this migration does not claim the row or either parent task complete.
## Reject twin expectations

Each twin pins the diagnostic the compiler prints for the unproved read:
`cannot prove requires contract for call read_through from <caller>: $joined == 17`,
with the fact the call needs (`$place == 17`) and the state it is in. The
diagnostic names the joined reference by its binding rather than repeating the
match expression. The nested twin names `pick` as the caller and `entry` as
its state, because `pick` is the machine that makes the call.

Earlier experiments and four-host observations retain their actual producer
identities and failed conclusions in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from main: match choose() { true => spare_ref, false => chosen_ref } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
"cannot prove requires contract for call read_through from main: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from main: match choose() { true => spare_ref, false => chosen_ref } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
"cannot prove requires contract for call read_through from main: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from main: match choose() { true => pair.spare, false => pair.chosen } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
"cannot prove requires contract for call read_through from main: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from main: match choose() { true => spare_ref, false => chosen_ref } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
"cannot prove requires contract for call read_through from main: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from main: match choose() { true => spare_ref, false => chosen_ref } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
"cannot prove requires contract for call read_through from main: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from apply: match choose() { true => spare, false => chosen } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
"cannot prove requires contract for call read_through from apply: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from main: match choose() { true => spare, false => chosen } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `pick`"
"cannot prove requires contract for call read_through from pick: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from apply: match choose() { true => spare, false => chosen } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
"cannot prove requires contract for call read_through from apply: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"role": "intended-invalid",
"entry": "main.omg",
"rejection_contains": [
"cannot prove requires contract for call read_through from apply: match choose() { true => spare, false => chosen } == 17 (needs fact `place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
"cannot prove requires contract for call read_through from apply: $joined == 17 (needs fact `$place == 17` here; establish it before the call via a prior contract guarantee, domain membership, or guard) in state `entry`"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ it to the same prover and kernel as an authored requirement. Describing an
arrival is inference, never evidence: the final discharge checks all calls,
body operations and joins before anything can be accepted.

Only facts about exact actuals cross here. Scalar inputs and the current
values of fields under structural inputs have names in the callee, and so
does the case a sum input holds when the callee's entry names it. A written
Only facts about exact actuals cross here. Scalar inputs, the scalar a
reference such as `@i64` refers to, and the current values of fields under
structural inputs have names in the callee, and so does the case a sum input
holds when the callee's entry names it. A written
boundary stops caller inference, while its own declared facts can justify calls
within its body.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,49 @@ machine entry() {{
);
}

/// A provider that states `requires $chosen == 17` forwards to a private
/// helper, and the helper's read needs that fact. The provider's refinement
/// witness reads the helper's body again, and must give it the caller's fact
/// as the whole-program check does. The twin's helper selects the other
/// reference, about which no caller says anything.
#[test]
fn a_provider_passes_its_requirement_to_a_private_helper() {
let text = r#"
boundary trait Service {
machine go(chosen: @i64, spare: @i64) -> i64 requires $chosen == 17 reaches none;
}
Native satisfies Service {
machine go(chosen: @i64, spare: @i64) -> i64 requires $chosen == 17 reaches none {
apply(chosen, spare)
}
}
machine choose() -> bool ensures result == true { true }
machine read_through(place: @i64) -> i64 requires $place == 17 { $place }
machine apply(chosen: @i64, spare: @i64) -> i64 {
let joined: @i64 = match choose() {
true -> chosen,
false -> spare
};
read_through(joined)
}
machine entry() {
let chosen: i64 = 17;
let spare: i64 = 5;
let reply: i64 = Service::go(@chosen, @spare);
}
"#;
// The helper is private only in a package the compilation checks whole.
let subjects = [Some(crate::tests::build_purpose::package())];
supplied_with_subjects(text, "Service", &subjects)
.expect("every call of the helper passes a reference to 17");
let other = text
.replace("true -> chosen,", "true -> spare,")
.replace("false -> spare", "false -> chosen");
let refused = supplied_with_subjects(&other, "Service", &subjects)
.expect_err("no caller establishes `$spare == 17`");
assert!(refused.contains("rejected"), "{refused}");
}

#[test]
fn a_provider_conformance_witness_infers_private_helper_inputs() {
let source = |native_body: &str, sibling_body: &str| {
Expand Down
Loading
Loading