Phase 6A: .aji layer 7 (task scopes, spawn/join, channels)

- scope s { … }: task.scope.begin, task.scope.end at every normal exit
  (scope ends generalized: borrow.end or task.scope.end, innermost first)
- task.spawn(s, f, args): call-like; named linear values moved (E7003);
  lent borrows are bound first (inline borrow E7006); scope operand E7005
- task.join/cancel/cancelled; task<T>, sender<T>, receiver<T>, scope types
- channels: make<T>, dup, send, recv, close_sender, close_receiver; send,
  recv and close_receiver are outcome matches; endpoints by name, borrowed
  for the operation and ended on every edge (written `mut tx`: E7006)
- outcome rebinding: a value coming back under the name of a variable of
  its type becomes the variable's value (pending(r))
- joins carry live variables only (pruned SSA): a linear value consumed
  before a join does not travel to it; ordered after-walk over the
  enclosing statement or tail, sibling arms not counted
- parser: a keyword after `.` is a member name (task.cancelled)
- conformance equivalence ignores schedule.choices (quantum counts AIR
  instructions)
- tests: 10 run tests with AIR equivalence (Phase 3 programs), 12 rejects
  (E4301, E4101 x2, E4002, E2001, E3101, E3002, E7006 x2, E7003, E0006,
  E7005); Quick Reference tasks/channels programs now pass
- spec 15 §4/§6/§7, grammar, quick reference, bundle notes, plan
This commit is contained in:
dev committed 2026-10-05 17:55:30 +03:00
1 parent c2c238d9b1
commit 179dee3c3a
32 files changed
+1315 -41

No files matched your search

+1 -1
View File
@@ -154,7 +154,7 @@ region.reset(r);
## 7. Concurrency
Not implemented in the source frontend yet (layers 7–8): `aji check` reports these constructs as not implemented (exit code 3). They are shown as specified.
Tasks and channels work (layer 7). `select`, `lock`/`mutex`, `shield`, `task.check_cancel` and `task.join_cancel` are layer 8, not implemented yet: `aji check` reports them as not implemented (exit code 3).
```aji
mut d = data; // data: [u64; 8]
+1 -1
View File
@@ -23,7 +23,7 @@ You write `.aji`; you never need to write AIR. Diagnostics point at your source
## Concurrency status
The source frontend implements layers 1–6 of spec 15. Layers 7 (tasks, channels) and 8 (`lock`, `select`, cancellation, shields) are not implemented yet: a program that uses `scope`, `task.*`, `channel.*`, `mutex.*`, `lock`, `select` or `shield` is reported as not implemented (exit code 3). The rules below describe the language as specified.
The source frontend implements layers 1–7 of spec 15: task scopes, `task.spawn`/`join`/`cancel`/`cancelled` and channels work. Layer 8 (`lock`/`mutex.*`, `select`, `shield`, `task.check_cancel`, `task.join_cancel`) is not implemented yet: a program that uses it is reported as not implemented (exit code 3). The rules below describe the language as specified.
## The AIR reference