Phase 3: reference programs and schedule stress mode

- program_parallel_map: four exclusive loans of disjoint quarters
- program_channel_transfer: heap-owned messages moved through a bounded
  channel; the 64-byte budget fits exactly the bounded worst case
- program_tcp_echo_tasks: server task, one echo task per connection,
  two client tasks sharing address and message by shared loans
- runner --stress N: seeds 0..N-1 under quanta 1, 2, 7 and the test's
  own; failures print the replay command; CI runs --stress 200
- plan: P3-12, P3-13 done
This commit is contained in:
dev committed 2026-10-04 17:01:05 +03:00
1 parent 929132c81d
commit 9f322cfe31
7 files changed
+453 -7

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ Non-normative. How the reference implementation is tested. Policy (what must be
| Conformance | `tests/conformance/` | `zig build conformance` | spec behavior: accept/reject, later run output and traps |
| Reference programs | `tests/programs/` (from P2) | `zig build conformance` | the six programs in `plan/conformance-suite.md` |
| Litmus | `tests/litmus/` (from P5) | `zig build litmus` | memory-model outcomes allowed/forbidden |
| Schedule stress | via runner flags (from P3) | `zig build conformance -- --schedules=N` | randomized and systematic interleavings |
| Schedule stress | runner flag (P3-12) | `zig build conformance -- --stress N` | every test with `schedules:` runs schedule seeds 0…N-1 under quanta 1, 2, 7 and its own; a failure prints the replay command. Systematic exploration (DPOR) is Phase 5 |
| Native parity | (from P7) | `zig build parity` | interpreter and native backend agree on the whole corpus |
Unit, conformance and hosted smoke tests exist today; conformance covers accept, reject and run tests in the deterministic profile, and `tests/hosted/smoke.py` checks observable effects (files, streams, sockets) of hosted runs.
+2 -2
View File
@@ -35,8 +35,8 @@ Non-normative. Part of the [implementation plan](README.md).
| P3-9 | done | Mutex with linear guards and the critical-section rule (E4304); RwLock deferred | P3-7 | interpreter + verifier | guard not `Send`; unlock consumes guard; E3002 on leaked guard |
| P3-10 | moved | Async I/O buffer claims: moved to P7-10 (owner decision; needs task-aware I/O) | P3-7 | verifier + runtime | E4303 accept/reject |
| P3-11 | todo | Blocking effect and blocking pool policy | P3-7 | spec 04 §18, runtime | `thread.block` from ordinary task handled per spec |
| P3-12 | doing | Runner: `seed:`/`schedules:`/`quantum:` headers (schedule budget kept separate from fuel); stress modes (1/2/N workers, random, forced yield, slow consumer, cancellation during waits, I/O reordering) | P3-3 | `tools/conformance.zig` | stress modes selectable; failing seed printed for replay |
| P3-13 | todo | Reference programs: parallel-map, channel transfer, tcp-echo with tasks | P3-8, P3-9 | `tests/programs/` | pass under all stress modes |
| P3-12 | done | Runner: `seed:`/`schedules:`/`quantum:` headers (schedule budget kept separate from fuel); `--stress N`: seeds 0…N-1 × quanta 1 (forced yield), 2, 7 and the test's own, replay command on failure; slow consumers and cancellation during waits are covered by the run corpus; worker-count modes belong to native runtimes (P7) | P3-3 | `tools/conformance.zig` | stress mode selectable; failing seed printed for replay |
| P3-13 | done | Reference programs: parallel-map, channel transfer, tcp-echo with tasks | P3-8, P3-9 | `tests/conformance/phase3/run/program_*.air` | pass under `--stress` |
| P3-14 | todo | Phase exit review | all | plan status | exit criterion passes |
## Conformance tests to add