Phase 3: owner decisions on RFC 0012 implementation

- spec 04 §40: mutex<T> always linear, never copyable; mutex.take is the
  only way to dismantle it and needs no live borrow (hence no guard and
  no waiter); no unlock or destructor
- P3-10 (async buffer claims, E4303) moved to P7-10 with task-aware
  I/O; E4303 stays reserved; Phase 3 scope closed
- RFC 0012 erratum: consumption after send is E2002, use is E2001
- tests: take while borrowed (E2101), use after take (E3001)
This commit is contained in:
dev committed 2026-10-04 16:57:59 +03:00
1 parent aaf32b6853
commit 929132c81d
8 files changed
+50 -8

No files matched your search

+4 -3
View File
@@ -4,6 +4,8 @@ Non-normative. Part of the [implementation plan](README.md).
**Goal:** tasks that cannot outlive their scopes, ownership transfer through bounded channels, synchronized shared state, cooperative cancellation, and a deterministic scheduler.
**Out of scope (owner decision):** async I/O and its buffer claims (`E4303` stays reserved; P7-10); `RwLock`, several receivers and atomics (later RFCs). No further features are added to Phase 3.
**Exit criterion:** `parallel_map` and `channel_transfer` examples run under deterministic and randomized schedules.
**Spec inputs:** spec 04 §1–19, 11 §3, §5–6. RFC 0002 is proposed for acceptance (owner decision); acceptance integrates it into the spec.
@@ -15,7 +17,6 @@ Non-normative. Part of the [implementation plan](README.md).
- no child task outlives its scope; no silent detachment;
- values moved into migratable tasks are `Send`; concurrently read values are `Share`;
- concurrent mutable borrows are proven disjoint;
- buffers owned by in-flight async operations are inaccessible;
- every interpreter run is reproducible from its seed.
## Tasks
@@ -32,7 +33,7 @@ Non-normative. Part of the [implementation plan](README.md).
| P3-7 | done | Interpreter tasks: spawn, join, cancel, cancellation points, shields, task failure | P3-3 | `src/interp/` | cancellation observed only at defined points; shield defers it |
| P3-8 | done | Bounded and rendezvous channels with ownership transfer | P3-7 | interpreter + verifier | sender cannot use moved message (E2001); capacity 0 rendezvous test |
| 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 | todo | Async I/O buffer claims (depends on task-aware I/O, spec 04 §36.1; deferral proposed to the owner) | P3-7 | verifier + runtime | E4303 accept/reject |
| 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 |
@@ -40,4 +41,4 @@ Non-normative. Part of the [implementation plan](README.md).
## Conformance tests to add
Negative corpus entries owned by this phase: non-Send transfer, non-Share concurrent read, task escape, async buffer use while in flight. Plus E4101, E4302. Scheduler tests for every synchronization primitive (testing policy in AGENTS.md).
Negative corpus entries owned by this phase: non-Send transfer, non-Share concurrent read, task escape. Plus E4101, E4302. Scheduler tests for every synchronization primitive (testing policy in AGENTS.md).