Skip to main content

Module sync_model

Module sync_model 

Source
Available on crate feature proptest only.
Expand description

The model family: seeded peer topologies, driven through push and pull from one seed, and checked at quiescence against a model of their own.

§What this adds that the worked examples cannot

Every rule in rules is a worked example against one peer. The clauses this family checks — every peer ends up holding the union (SY-4, SY-24), holds it once (SY-11), and forwards in arrival order (SY-25) — are statements about a set of peers under a runner, and the interesting failures are interleavings: a lost ack, a page delivered twice, a page that lands after a later one, a partition that heals. This family generates those. Each case is a topology of three to six peers — A—B—C chains included, where the ends never meet — and up to thirty-two steps of writes, exchanges, partitions and heals, each exchange carrying a fault. After the last step every link heals and the harness sweeps until nothing moves; then each peer’s whole log is pulled and judged.

§How it holds several peers, and SY-8

The family opens one fixture per node, so every node is an isolated peer, and plays the runner itself: per edge, a resume token each way and at most one page in flight. Each peer is still driven only through its own port, one relationship at a time, which is what SY-8 asks of the port. What SY-8’s Rule: line says of the whole testkit — every rule takes exactly one peer handle — is true of rules and not of this family, and SY-24’s own Rule: line already names a three-peer test. The tension is recorded in .kb/open-questions/sy-8-rule-line-versus-multi-peer-rules.md rather than settled here.

§Deterministic, and a failure prints its seed

A master RNG with a fixed seed draws one u64 per case, and that seed alone builds the case. So a peer either passes or it does not, the same on every machine, and a failure names its seed in hex beside the smallest scenario it shrank to. The case count is proptest’s Config::default()’s, so PROPTEST_CASES buys more coverage. Before any generated case, three scenarios pinned by value run first: a seed’s meaning moves whenever the generator does, and these must not.

§Bounded

No clock (CF-33). Every loop is counted: steps, sweeps, pulls and shrink moves. A peer that never settles fails the rule rather than hanging it (H-13).

§Not on wasm32

proptest does not build there, so the module, its macros and its dependency are absent on that target whatever the feature says.

Modules§

rules
The model rules. See the module documentation for what the family does, and each rule for what it rejects.