spec: accept RFC 0012 and integrate waits, channels, select and mutex

revision 2 per owner review: reserved-feature dependencies may change
until publication (general rule, DD-014); task.join.cancel returns the
handle on cancelled with loans still LOANED; channel.sender.dup from
ref<sender<T>> (MPSC, receiver_dup reserved); task.wait required by
every suspending operation, task.join included, only in modules
declaring cancellation; sent values and handles come back as block
parameters on closed/cancelled edges; explicit channel states

spec 04 §37-§41 and pointers in §11-§16, §35, §36; spec 05 §9, 07
§8.11, 07a, 08 §14, 11 §6-§7; features cancellation, channels, sync
published (implementation pending); rwlock, channel_transfer,
receiver_dup, guard_transfer reserved; effect task.wait; E4304, E4305;
Q-013 resolved; bundle +15.8 % tokens (recorded)
This commit is contained in:
dev committed 2026-10-04 16:27:38 +03:00
1 parent 4230c78dd1
commit b82bc35c5f
19 files changed
+387 -67

No files matched your search

+10 -5
View File
@@ -22,7 +22,7 @@ Declaring `features [capabilities, effects, ownership]` grants no authority. It
- Every post-baseline construct belongs to exactly one feature. A feature is a whole semantic block, not one instruction.
- A module MUST declare every feature whose constructs it uses, plus the full dependency closure; nothing is implied.
- Canonical form: names sorted lexicographically, no duplicates.
- Status `reserved`: the name and dependencies are fixed, semantics are not yet specified; modules MUST NOT use it (`unsupported_feature`).
- Status `reserved`: the name is fixed, semantics are not yet specified; modules MUST NOT use it (`unsupported_feature`). Because no valid module can use a reserved feature, its dependency set MAY change until it is published (DD-014, RFC 0012); from publication on the dependencies are part of the frozen semantics.
- Status `published`: semantics are specified in spec 07a and the relevant spec files, and are immutable. Incompatible evolution needs a new feature name or a new AIR format version.
- A dependency is listed only when the feature's semantics cannot be stated without it.
@@ -32,21 +32,26 @@ Declaring `features [capabilities, effects, ownership]` grants no authority. It
|---|---|---|---|---|
| `arrays` | published | 1 | `ownership` | `array<T, N>`, `slice<T>`, `slice_mut<T>`, `array.splat`, `borrow.index[.proven]`, `slice.*`, `guard`, bounds facts (spec 07a, spec 08 §12) |
| `atomics` | reserved | 5 | `ownership` | atomic types, the five orderings, fences, `atomic.*` instructions |
| `capabilities` | published | 2 | `effects`, `ownership` | `cap<K>`, built-in `cap_error`, `cap.narrow`, `intrinsic`, instantiation of `@main` (spec 05 §10–§12) |
| `borrow_joins` | reserved | — | `ownership` | borrow-typed block parameters (spec 08 §11.6); unscheduled |
| `channels` | reserved | 3 | `ownership` | bounded and rendezvous channels with ownership transfer |
| `cancellation` | published | 3 | `effects`, `ownership`, `tasks` | effect `task.wait` (required by suspending operations, `task.join` included), waiting-operation rule, `shield`, `task.shield.*`, `task.check_cancel`, `task.join.cancel` (spec 04 §37) |
| `capabilities` | published | 2 | `effects`, `ownership` | `cap<K>`, built-in `cap_error`, `cap.narrow`, `intrinsic`, instantiation of `@main` (spec 05 §10–§12) |
| `channel_transfer` | reserved | — | `cancellation`, `capabilities`, `channels`, `effects`, `heap`, `ownership`, `resources`, `tasks` | endpoints inside channel elements or mutex contents; unscheduled |
| `channels` | published | 3 | `cancellation`, `capabilities`, `effects`, `heap`, `ownership`, `resources`, `tasks` | `sender<T>`, `receiver<T>`, `channel.*`, `select` (spec 04 §38–§39) |
| `effects` | published | 2 | — | flat effect checking of `effects [...]` for `call` and `intrinsic` (E3101, spec 05 §9) |
| `guard_transfer` | reserved | — | `cancellation`, `effects`, `ownership`, `sync`, `tasks` | `guard<T>` as parameter, return type or aggregate member; unscheduled |
| `heap` | published | 2 | `capabilities`, `effects`, `ownership`, `resources` | `own<T>`, `own_array<T>`, `own.*`, built-in `alloc_error`, `mem.alloc` budgets and `budget` narrowing (spec 03 §18–§19) |
| `islands` | reserved | 4 | `capabilities`, `effects`, `heap`, `ownership`, `regions`, `resources` | `Island<T>`, `iref<T>`, transfer, freeze, `Frozen<T>` |
| `linear_aggregates` | reserved | — | `capabilities`, `effects`, `ownership`, `resources` | resource types as struct fields, enum payloads and array elements; unscheduled |
| `ownership` | published | 1 | — | frame storage `local<T>`, second-class borrows `ref<T>`/`mut<T>`, `from` returns, initialization (spec 07 §8.8, spec 07a, spec 08 §11, §13) |
| `receiver_dup` | reserved | — | `cancellation`, `capabilities`, `channels`, `effects`, `heap`, `ownership`, `resources`, `tasks` | several receivers of one channel (MPMC); unscheduled |
| `regions` | published | 2 | `capabilities`, `effects`, `heap`, `ownership`, `resources` | `region`, `region.*`, static generations (spec 03 §20) |
| `resource_joins` | reserved | — | `capabilities`, `effects`, `ownership`, `resources` | joins whose incoming edges carry different resource states (spec 06 §6.3); unscheduled |
| `resources` | published | 2 | `capabilities`, `effects`, `ownership` | linear resources `file<read>`, `file<write>`, `file<append>`, `listener`, `stream`; built-in `io_error`; I/O intrinsics (spec 06 §6–§7, `reference/intrinsics.md`) |
| `sync` | reserved | 3 | `ownership` | `Mutex<T>`, `RwLock<T>`, linear guards |
| `tasks` | published | 3 | `ownership` | `scope`, `task<T>`, `task.*`, loans, `Send`/`Share`, deterministic scheduler (spec 04 §33–§36) |
| `rwlock` | reserved | — | `cancellation`, `effects`, `ownership`, `sync`, `tasks` | `rwlock<T>`, read and write guards, no upgrade/downgrade; unscheduled |
| `sync` | published | 3 | `cancellation`, `effects`, `ownership`, `tasks` | `mutex<T>`, `guard<T>`, `mutex.*`, critical-section rule (spec 04 §40–§41) |
| `task_borrow_returns` | reserved | — | `ownership`, `tasks` | spawned functions returning borrows; unscheduled |
| `task_transfer` | reserved | — | `ownership`, `tasks` | `scope` and `task<T>` as parameters, return types, aggregate members or heap contents; unscheduled |
| `tasks` | published | 3 | `ownership` | `scope`, `task<T>`, `task.*`, loans, `Send`/`Share`, deterministic scheduler (spec 04 §33–§36) |
| `unsafe` | published | 2 | `arrays`, `effects`, `ownership` | `assume`, `borrow.index.unchecked`, the `trusted` boundary, the effect `unsafe` (spec 13 §6–§8) |
`capabilities` depends on `effects` so that every module that can perform an external operation is also effect-checked.
+1
View File
@@ -22,6 +22,7 @@ Normative registry of effect names for AIR format 0 (spec 05 §9). Effects are f
| `process.spawn` | `cap<process.spawn>` | later |
| `random.read` | `cap<random.read>` | RFC 0007 |
| `task.spawn` | none | Phase 3 |
| `task.wait` | none | RFC 0012 (required by suspending operations in modules declaring `cancellation`, spec 04 §37.4) |
| `thread.block` | none | Phase 3 |
| `thread.spawn` | none | Phase 3 |
| `unsafe` | none (unsafe boundary, spec 13) | Phase 2 |
+2
View File
@@ -60,6 +60,8 @@ Draft registry. Codes are stable once released in a tagged compiler version.
| E4301 | task.live_child_escape | Scope exits with live child task |
| E4302 | task.borrow_escape | Child task borrow can outlive parent storage |
| E4303 | io.buffer_in_flight | Buffer accessed while async operation owns/borrows it |
| E4304 | sync.wait_while_locked | Suspending operation, spawn, or call of a waiting/spawning function while a lock guard is live |
| E4305 | task.shield_order | Shield ended while a more inner shield is live |
## E5xxx — AIR/verifier