P5-1a: independent axiomatic oracle and the litmus corpus (20 tests agree)

tools/litmus/enumerate.py was written by an independent author from spec 04
§20 alone, with the programs blind (outcome sets removed). check.py compares
its allowed sets with tests/litmus/*.lit: 20/20 equal. 21 self-tests derived
from the axioms. Both run in CI. The author's spec findings are Q-024.
This commit is contained in:
dev committed 2026-10-06 00:40:09 +03:00
1 parent cfee89ff19
commit f8d2a99249
28 files changed
+1278 -5

No files matched your search

+4 -4
View File
@@ -4,7 +4,7 @@ Litmus tests for the memory model of spec 04 §20–§30 (RFC 0015). They are se
The tests do not define the model; spec 04 §20 does. They are its consequences, and the normative conformance corpus for the interpreter (spec 04 §20.5).
**Status:** draft corpus. The sets below were derived by hand from the axioms. P5-1a makes the corpus normative: every set is confirmed with the enumerator, the test files go into `tests/litmus/`, and the owner reviews the result. When the enumerator, the interpreter and a stated set disagree, the cause is diagnosed (spec 04 §20.5). A set is never edited to match a tool without a diagnosis.
**Status:** confirmed by the independent oracle (P5-1a, 2026-10-06): the oracle's allowed set equals the stated set for all 20 tests (`python3 tools/litmus/check.py`). It becomes normative on the owner's review. Earlier status: draft corpus. The sets below were derived by hand from the axioms. The test files are `tests/litmus/*.lit` (format: `tests/litmus/README.md`), where every allowed set is written out in full. P5-1a makes the corpus normative: `tools/litmus/check.py` confirms every set against the independent oracle `tools/litmus/enumerate.py`, and the owner reviews the result. When the enumerator, the interpreter and a stated set disagree, the cause is diagnosed (spec 04 §20.5). A set is never edited to match a tool without a diagnosis.
## Rules
@@ -36,7 +36,7 @@ The tests do not define the model; spec 04 §20 does. They are its consequences,
| SB sc | all `sc` | (0,1) (1,0) (1,1) | (0,0) |
| SB fences | `rlx` accesses, `fence sc` between store and load on both sides | (0,1) (1,0) (1,1) | (0,0) |
| LB rlx | `r0=x; y=1` ‖ `r1=y; x=1`, all `rlx` | (0,0) (0,1) (1,0) | (1,1), a consequence of NO-THIN-AIR |
| IRIW acq | `x=1 rel` ‖ `y=1 rel` ‖ `r0=x acq; r1=y acq` ‖ `r2=y acq; r3=x acq` | includes (1,0,1,0) | — |
| IRIW acq | `x=1 rel` ‖ `y=1 rel` ‖ `r0=x acq; r1=y acq` ‖ `r2=y acq; r3=x acq` | all 16 tuples, including (1,0,1,0) | — |
| IRIW sc | all `sc` | every tuple except (1,0,1,0) | (1,0,1,0) |
| CoRR | `x=1 rlx` ‖ `r0=x rlx; r1=x rlx` | (0,0) (0,1) (1,1) | (1,0) |
| CoWW | `x=1 rlx; x=2 rlx`, final `x` | 2 | 1 |
@@ -46,8 +46,8 @@ The tests do not define the model; spec 04 §20 does. They are its consequences,
| CAS failure relaxed | as above with `cas.acq.rlx` | (0,0) (0,1) (1,0) (1,1) | — |
| release sequence | `d=1 rlx; f=1 rel` ‖ `add.wrap(f,2) rlx` ‖ `r0=f acq; r1=d rlx` | (0,0) (0,1) (1,1) (2,0) (2,1) (3,1) | (1,0) (3,0) |
| channel handoff | `x=1 rlx; send(t)` ‖ `recv; r0=x rlx` | (1) | (0) |
| mutex handoff | `lock; x=1 rlx; unlock` ‖ `lock; r0=x rlx; unlock`, in that lock order | (1) | (0) |
| spawn/join | `x=1 rlx`; spawn ‖ child: `r0=x rlx; x=2 rlx`; after join `r1=x rlx` | (1,2) | (0,·) (·,1) |
| mutex handoff | `lock; x=1 rlx; f=1 rlx; unlock` ‖ `lock; r0=f rlx; r1=x rlx; unlock` | (0,0) (1,1) | (1,0) (0,1) |
| spawn/join | `x=1 rlx`; spawn ‖ child: `r0=x rlx; x=2 rlx`; after join `r1=x rlx` | (1,2) | (0,2) (1,1) |
## Rejected programs