cli: lower atomic value operands iteratively

This commit is contained in:
dev committed 2026-10-11 15:54:37 +03:00
1 parent 062fce5cfd
commit 8d6792d4f1
5 files changed
+422 -32

No files matched your search

+2
View File
@@ -554,3 +554,5 @@ The [enum-payload increment](source-expression-depth-audit.md#enum-payload-conti
The [boolean builtin increment](source-expression-depth-audit.md#boolean-builtin-operand-continuations) preserves assert/assume arity, non-consuming operands, type/error spans, unsafe registration and emission order, using shared continuations. All 1,793 ordinary conformance cases, public check/lower parity (1,423/506) and 282 focused depth checks pass. Expanded units and 69 supplemental checks pass; read-only Claude core/follow-up reviews found no production defect. Final span/counter unit checks pass. Own/region argument callbacks still abort at 1,024 before and after; remaining callbacks/walks keep Q-061 and Phase 6 open. No new semantic or depth limit changes.
The [consuming ownership builtin increment](source-expression-depth-audit.md#consuming-ownership-builtin-continuations) preserves own.take/free and region.destroy arity, explicit transfers, type/error priority, emission and OOM separation. All 1,793 ordinary conformance cases, public check/lower parity (1,423/506) and 351 frozen-core CLI checks pass; corrected OOM/expanded units pass. 108 formatted-rejection checks pass; read-only Claude core/follow-up reviews found no production defect. Final `own<bool>` CFG unit comparisons pass. Atomic-new/take pairs and task.join still abort at 1,024. Q-061, Q-060 full GC and Phase 6 gates remain open; no semantic/depth-limit change.
The [atomic operand increment](source-expression-depth-audit.md#atomic-operand-continuations) preserves new/take and ordinary update operand rules, cell/ordering/type priority, temporary loans, emission and host OOM separation through shared continuations. Build/units/format, all 1,793 ordinary conformance cases, public check/lower parity (1,423/506) and 33/635/234 targeted checks pass. Focused depth validation passes 270 checks in two subset runs (57/213), including exact rejections and temporary-loan updates through 65,536; mixed chains reach the existing E5101 instruction limit, with runtime/fuel checked through 1,024. Read-only Claude core/follow-up reviews found no production defect. Task.join still aborts at 1,024; other callbacks/walks, Q-060 full GC and Phase 6 gates remain open. No semantic/order-default/depth-limit change.
+49 -1
View File
@@ -798,6 +798,54 @@ not completion of every pending call. Separate atomic-new/take pairs accept 16 i
established. Other builtin/place/control and liveness callbacks, Q-060 full GC
validation and Phase 6 gates remain open.
## Atomic operand continuations
Atomic new/take and ordinary store/RMW value operands now share the expression
driver (spec 15 §12; spec 04). Arity precedes children; take checks explicit
consumption, while new has no type hint. Updates retain cell/ordering-before-
value priority, exact type checks and temporary-borrow endings after emission.
Load/fence and multi-result compare-exchange retain their existing paths. The
invariant is unchanged: cells are linear and atomic operations use a shared
borrow with explicit ordering. Verifier/effect/runtime rules, instruction text,
names, spans and CFG are unchanged; no default ordering, new feature/code/
format/bundle/limit or ownership/concurrency rule. Public output parity and
existing positive/rejected atomic conformance cases establish compatibility.
Copied `ReferenceAtomics` bodies use the former recursive operand path;
shared leaf/place/type/emission helpers limit oracle independence. Shallow
comparisons include bool/integer cells, temporary/bound borrows, orders, arity,
non-values and scalar/aggregate/CFG consumers. Deep units pass 32,768 new/take
pairs and RMW operands with exact counts/spans. Recovering/persistent public
OOM sweeps check successful and E7003/E7005/E7006 baselines, no swallowed OOM
and backing cleanup. States and work buffers retain caller-arena lifetime.
Build/units/format pass.
Ordinary conformance passes all 1,793 cases with exact coverage
(`atomic-operand-conformance.jsonl` and its audit), including schedule cases;
frozen public check/lower outputs are exact (1,423/506). Atomic-access/nonvalue/
independent-error suites pass 33/635/234 checks. Focused CLI validation passes
270 checks in two corrected subset runs: pair 57 and mixed/update/rejection 213
(`atomic-operand-pair-depth.log`, `atomic-operand-followup-depth.log`). New/take
pairs and temporary shared-borrow updates accept through 65,536; mixed
call/negation/atomic chains accept through 32,768 and reach the existing E5101
instruction limit at 65,536 (`max: 262144`, `found: 327683`). Six error families
retain exact code/position/priority through 65,536 across check/lower/run/report/
explore. Formatter fixed points and lower parity pass; source/AIR results and
exact fuel are exercised only through 1,024. Existing `source/layer10/sc_only.aji`
passes 30 schedules; `source/layer10/reject/take_while_lent.aji` retains E4101.
Read-only Claude core/follow-up
reviews found no production defect (`/tmp/aji-atomic-operand-review.md` and
`/tmp/aji-atomic-operand-followup-review.md`); fixture arithmetic/limit and
span/type gaps were corrected. Neither reviewer ran tests. The mixed fixture
uses a function call as its leaf, so signed-literal folding does not erase the
first negation.
No new whole-expression-suite, arbitrary callback or runtime-depth claim.
Task.join still aborts at 1,024 before and after
(`atomic-operand-next-probes.json`); bounded 16/256 records remain equal.
Other builtin/place/control and liveness walks, Q-060 full GC and Phase 6
exit gates remain open.
## Remaining work
Follow-up checks accept 16 parenthesized/mixed-call levels but abort
@@ -812,7 +860,7 @@ includes a confirmed lowerer failure and inspection-only risks:
| Production path | Evidence and next scope |
|---|---|
| Parser `ifExpr`, block/statement and match/arm expression entry | Native callback re-entry remains. Bounded block/if regression probes above pass; arbitrary and alternating control/statement depth is unverified. |
| Lowerer non-scalar `expr` callbacks: builtin/variant calls, fields/indices/places, arrays/structs, if/match/arms and blocks/statements | Ordinary calls, struct/value-field, array and enum-payload descent are repaired above. Boolean and consuming own/region builtin operands are repaired above. Atomic-new/take pairs and task.join still abort at 1,024 in both binaries. Other callback depth remains unverified; include alternating scalar/non-scalar expressions. |
| Lowerer non-scalar `expr` callbacks: builtin/variant calls, fields/indices/places, arrays/structs, if/match/arms and blocks/statements | Ordinary calls, struct/value-field, array and enum-payload descent are repaired above. Boolean and consuming own/region builtin operands are repaired above. Ordinary atomic operand callbacks are repaired above; task.join still aborts at 1,024 in both binaries. Other callback depth remains unverified; include alternating scalar/non-scalar expressions. |
| Lowerer use-after-region/liveness and assignment scans (`After`, first-use/read scans, `blockAssigns`/`stmtAssigns`/`exprAssigns`, match/select helpers) | Recursive AST walks inspected; audit their callers and finite deep inputs separately. |
The formatter's expression-marking traversal already uses a worklist, as