Phase 5: atomics through every layer (RFC 0015)

AIR: linear atomic<T> (AtomicScalar), atomic.new/take/load/store/RMW/
cmpxchg (two results)/fence with explicit orderings; feature atomics
published. Verifier: ordering tables (E4201), ordinary access (E4202),
effects [atomic] / [atomic, atomic.weak], linearity, take while lent
(E4101, also for mutex.take). Interpreter: timestamped message machine
(src/interp/weak.zig); views travel through spawn/join, channels, mutexes,
close and cancel; seq_cst reads the latest message and programs without
weak reads make no extra draw (existing records unchanged). aji explore:
exhaustive exploration that branches only before visible operations.
Litmus: 20/20 tests give exactly the oracle's sets; differential test
(1500 random programs) found no unsound outcome. .aji layer 10, Quick
Reference atomics, source coverage 67/67, audit report atomic_operations.
AIR bundle +5.9 %, QUICK.md +0.5k.
This commit is contained in:
dev committed 2026-10-06 08:05:01 +03:00
1 parent ce9ef03bc0
commit 4242132b2a
70 files changed
+2630 -80

No files matched your search

@@ -119,7 +119,8 @@ The toolchain should emit an audit artifact containing:
"allocations": 0,
"runtime_checks": {"overflow": 0, "division": 0, "shift": 0, "cast": 0, "bounds": 0, "assert": 0, "guard": 0},
"proven_checks": {"bounds": 0},
"unsafe_operations": [{"block": "entry", "inst": 0, "op": "borrow.index.unchecked"}]
"unsafe_operations": [{"block": "entry", "inst": 0, "op": "borrow.index.unchecked"}],
"atomic_operations": [{"block": "entry", "inst": 3, "op": "atomic.load", "ordering": "acquire", "weak": true}]
}
],
"capability_kinds": ["…"],
@@ -134,7 +135,8 @@ Fields:
- `calls`, `intrinsics`: distinct callees and intrinsic names in order of first occurrence; together with `effects_*` this is the effect graph.
- `runtime_checks`: instructions whose safety condition is checked at runtime and may trap — `overflow` (checked `add`/`sub`/`mul`, and `div`/`rem` for signed `MIN / -1`), `division` (`div`/`rem` by zero), `shift` (`shl`/`shr`), `cast` (`cast.checked`), `bounds` (`borrow.index`, `slice.sub`, `slice.split`, `slice.copy`), `assert`, `guard`.
- `proven_checks.bounds`: `borrow.index.proven` instructions, whose check the verifier eliminated.
- `atomic_operations` (feature `atomics`, spec 04 §25): every atomic memory operation in order. `ordering` is the operation's ordering, or `success.failure` for `atomic.cmpxchg`. `weak` is true for a non-`seq_cst` access: a site where interleaving reasoning is not enough. `effects_used` contains `atomic` for every such operation and `atomic.weak` for every weak one.
- `capability_kinds`: distinct capability kinds appearing in any type of the module, sorted.
- All lists of names are in order of first occurrence in the module unless stated otherwise; effect lists are sorted.
Ownership/borrow proof summaries, weak atomic sites, lock-order findings and contract status are added to this document by the phases that introduce them, as new fields; existing fields keep their meaning.
Ownership/borrow proof summaries, lock-order findings and contract status are added to this document by the phases that introduce them, as new fields; existing fields keep their meaning.