Function ops_agree_with_the_model
pub async fn ops_agree_with_the_model<F: Fixture>(
open: impl AsyncFn() -> F,
) -> RuleOutcomeproptest only.Expand description
A generated sequence of appends, conditional appends and reads leaves the store in the state the model predicts, and every read along the way returns exactly what the model says it should.
§Why this is not a proptest! block
proptest! generates a #[test] fn whose body is synchronous, so a
rule written that way would have to choose a block_on inside the
testkit — which is precisely what CF-23 forbids, one level down from the
runtime attribute it forbids by name. Driving the runner by hand keeps
this rule the same shape as every other one, async fn(open) -> RuleOutcome, so the adapter’s own emitter decides how it is driven.
The loop below is TestRunner::run_one’s, minus the parts that need a
synchronous closure: generate, and on failure alternate simplify and
complicate until neither moves.
§Why the RNG is deterministic
A conformance rule that fails one run in twenty is worse than no rule:
an adapter author reruns CI until it is green, and the suite has taught
them to. The seed is fixed, so a store either passes this rule or it does
not, and a failure reproduces on the reviewer’s machine. Coverage is
bought with PROPTEST_CASES — the case count is Config::default()’s,
which reads that variable — rather than with a different sample each run.
Failure persistence is never engaged, because TestRunner::run is what
consults it and this rule does not call it. An adapter running the suite
gets no .proptest-regressions file appearing in its tree.
§Behind a frontier, it runs a weaker model
A fixture that declines
READ_YOUR_OWN_WRITES is held
to a trailing model instead of the exact one. Each full read must
be a prefix of what was accepted that never shrinks, each read must be
explained by some frontier between the full reads around it, and each
condition verdict is predicted from what the store holds, with an
unknown position bounded by its neighbours’ and the verdict deferred
when those bounds do not decide it. It reads no clock and never waits
(CF-33). The rule still reports RuleOutcome::Ran; which model ran
is a fact about the fixture’s declared capability, not something the
outcome carries.
Waiting for nothing has a price. Against a declining fixture the rule does not catch:
- an accepted write that never becomes visible, which reads as lag;
- part of a batch becoming visible before the rest;
- a read that drops its newest matching events, when the frontier moved during that read and a lower frontier explains the result;
- a condition verdict whose deciding event is never shown and is not the last of its batch, or that is still open when the sequence ends.
Run at zero lag against every wrong store in the testkit’s own registry, it misses none the exact model catches.
It assumes one thing no clause states yet: visibility never moves backward, so a later full read never shows less than an earlier one. Both frontier adapters in this workspace meet that by construction. A store whose frontier retreats fails with a message that says so.