Phase 4 exit review; AIR twins for the .aji-only island rejects

New AIR rejects: island_use_after_send (E2001), island_lend_task (E4002),
island_destroy_while_borrowed (E2101), arc_content_mutex (E2111),
frozen_borrow_mut (E1001). Every Phase 4 invariant now has an AIR and an
.aji test. Full suite 392/392, also under --stress 1000 and
--collect-every-step; test-extended, hosted smoke, source coverage 61/61.
This commit is contained in:
dev committed 2026-10-05 22:22:58 +03:00
1 parent 3c5c129078
commit 7cc23338e2
7 files changed
+189 -2

No files matched your search

+2 -1
View File
@@ -155,5 +155,6 @@ Targets for Phase 6A, measured on dev tasks:
| P2 | done (exit review in the phase file) |
| P3 | done (exit review in the phase file); P3-10, P3-11 moved to P7 |
| P6A | done (exit review in `phase-6-source-language.md`; P6A-9 [results](../evaluation/results/2026-10-05-p6a-9.md)): the agent-facing source language over AIR is the architecture |
| P4, P5 | unpaused after P6A (owner decision, 2026-10-05) |
| P4 | done (exit review in the phase file) |
| P5 | unpaused after P6A (owner decision, 2026-10-05); starts after the owner decision on the P4 exit review |
| P7, P8 | not started |
+39 -1
View File
@@ -36,8 +36,46 @@ Non-normative. Part of the [implementation plan](README.md).
| P4-8 | done | Reference program `island-pipeline` in AIR and `.aji` with equivalence | P4-4, P4-5, P4-6, P4-7 | `tests/conformance/` | passes under all P3 stress modes |
| P4-9 | done | Complexity budget: AIR bundle, Quick Reference, Source Reference Bundle measured against the RFC estimate | P4-7 | `docs/agent/README.md` | growth recorded and justified |
| P4-11 | done | `reference/air-text.ebnf` covers the syntax of Phases 2–4: `cap<K>`, endpoint, task, graph and built-in types; `own.*`, `task.*`, `channel.*` (with the type operand of `channel.make`), `island.*`/`frozen.*`/`arc.*`/`iref.eq`; the multi-edge terminator forms (found by the independent author of `program_island_pipeline.air`) | — | `docs/reference/air-text.ebnf` | every instruction of spec 07a and spec 03 §22–§24 has a production |
| P4-10 | todo | Phase exit review | all | plan status | exit criterion passes |
| P4-10 | done | Phase exit review | all | plan status | exit criterion passes |
## Conformance tests to add
Negative corpus entry owned by this phase: island internal reference escape. Plus E2111, freeze-then-mutate, `Arc` of non-`Share`.
All four are present in AIR and `.aji`: `island_destroy_while_borrowed.air` / `destroy_while_borrowed.aji` (internal reference escape, `E2101`), `island_content_owner.air` / `content_owner.aji` (`E2111`), `island_use_after_freeze.air` and `frozen_borrow_mut.air` / `frozen_mut.aji` (freeze-then-mutate), `arc_content_mutex.air` / `arc_mutex.aji` (`arc` of a non-`ArcSafe` value, `E2111`).
## Exit review
- Exit criterion met: `program_island_pipeline.air`, written by an independent author from the spec, moves a cyclic graph between tasks through channels and freezes it for concurrent readers. It runs with `schedules: 30`, under `--stress 1000` (the whole suite, 392 tests, without a failure) and with `--collect-every-step`. `source/programs/island_pipeline.aji` is `equivalent:` to it. Transfer moves the owner handle only: the unit test "moving an island costs the same for any graph size" checks this with an instruction count, not a timer.
- Invariants, each with an AIR and a `.aji` test:
| Invariant | Rejected example | Code |
|---|---|---|
| an `iref<T>` is used only with its own graph's owner | `island_foreign_iref.air`, `foreign_iref.aji` (run, trap) | `T0010` |
| no edges into foreign mutable memory | `island_content_owner.air`, `content_owner.aji` | `E2111` |
| after transfer the sender holds nothing | `island_use_after_send.air`, `use_after_send.aji` | `E2001` |
| a frozen graph yields no mutable reference | `frozen_borrow_mut.air`, `frozen_mut.aji` | `E1001` / `E7005` |
| counts change only through `arc.clone` / `arc.release` | `arc_release_twice.air`; trace test "arc count trace" | `E2002` |
| an island is not `Share` | `island_lend_task.air`, `lend_island.aji` | `E4002` |
- Decision record: RFC 0014 Accepted (revision 2, owner decisions D1–D10 plus `iref` equality) and integrated into spec 02 §6, 03 §12–§14 and §22–§24, 04 §13/§35/§38.1, 07a and 15 (layer 9). Features published: `islands` (depends on `heap`) and `arc` (depends on `islands`).
- Vertical rule: every construct went through spec → AIR → verifier → interpreter → `.aji` → Quick Reference (§7 Graphs, excerpts checked against `quickref/graphs.aji`) → conformance. Source coverage: 61/61 constructs.
- Conformance: 392 tests. Phase 4 adds 16 AIR tests (3 run, 13 reject) and 20 `.aji` tests (6 run, 12 reject, the Quick Reference excerpt and the reference program).
- Grammar: `reference/air-text.ebnf` now covers the syntax of Phases 2–4 (P4-11). Every opcode in the conformance corpus and in the spec contract tables has a production.
- Complexity budget (cl100k):
| Bundle | Before | After |
|---|---|---|
| AIR Agent Reference Bundle | 35 324 | 39 154 (+10.8 % over the phase: +7.0 % RFC 0014, +3.6 % the completed grammar) |
| `QUICK.md` | 4.37k | 5.01k |
| Source docs | 22.4k | 26.7k |
RFC 0014 estimates: AIR +3–4k (measured +2.5k for the semantics), Quick Reference +600–800 (measured +640), source docs +3–4k (measured +4.3k, slightly above). The extra +1.4k in the AIR bundle is the grammar the bundle had been missing since Phase 2, not new semantics.
- Known limitations:
- Graph contents are plain data and `iref` handles only: there are no owners, resources or endpoints inside a graph.
- `arc` is built from frozen graphs only: there is no `arc<mutex<T>>` and no weak handles.
- Island memory is reclaimed only by `island.destroy`, `frozen.release` or the last `arc.release`. There is no per-object free inside a live island.
- The execution-heap collector is an interpreter mechanism, not language semantics.
- Q-023 (array argument borrows in `.aji`) remains open and is unrelated to islands.
- Not run in this phase: the M/C regression corpus. It is a regression check only and needs a frozen matrix outside this repository.
- Next: per the owner's order, decide whether the language is stable enough to start Phase 5 (atomics and the memory model) or whether a specialized atomics/concurrency benchmark comes first.