cli: lower consuming ownership builtin operands iteratively

This commit is contained in:
dev committed 2026-10-11 15:09:00 +03:00
1 parent 5cc69393e4
commit 062fce5cfd
5 files changed
+333 -15

No files matched your search

+2
View File
@@ -552,3 +552,5 @@ The [array-continuation increment](source-expression-depth-audit.md#array-list-a
The [enum-payload increment](source-expression-depth-audit.md#enum-payload-continuations) preserves lookup/arity-before-arguments, per-payload type/consumption/check order, empty/built-in construction, spans/loans and OOM. Independent shallow/deep/sibling and direct/public allocation tests pass; exact ordinary conformance coverage and final public check/lower parity (1,423/506) pass. The former enum-payload failure at 256 is repaired; nested assert still aborts at 1,024 before and after. Scoped read-only Claude reviews found no semantic defects; 331 core and 66 final supplementary CLI checks pass. Q-061 and Phase 6 remain open, with no semantic or new depth limit change.
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.
+45 -1
View File
@@ -754,6 +754,50 @@ trace enters `prepareCall` from `consuming`. Other builtin/place/control
callbacks and liveness/read/assignment walks, Q-060 full GC validation and
Phase 6 exit gates remain open.
## Consuming ownership builtin continuations
`own.take`, `own.free` and `region.destroy` now share the expression driver
(spec 15 §5, §8, §16). Arity precedes explicit-name consumption checking and
operand evaluation with no expected-type hint. Exact type/error-span checks
precede extraction/destruction emission. The invariant is unchanged: ownership
is transferred explicitly once; the verifier still checks use-after-move, leaks,
linear content and live region loans. Runtime rules are unchanged, including
whole-value extraction and deterministic destruction. `layer5/own_basic.aji`
and `layer5/region.aji` remain valid; `layer5/reject/missing_move.aji` retains
E7003; `source/linear/free_linear_content.aji` still rejects E1001 at
`own.free`. No new diagnostic/feature/format/bundle/limit or ownership rule.
The old bodies in `ReferenceCalls` provide shallow comparisons across owners,
arrays, regions, nominal content and scalar/aggregate/CFG consumers. Shared
leaf/type/emission/place helpers limit independence; raw borrowed-content
owners are defensive fixtures, not newly accepted source. Deep units cover
32,768 forwarding calls and invalid nested/mixed descent, exact names/spans
and one completed builtin before rejection. Recovering/persistent public OOM
sweeps cover success and E7003/E7005. The initial missing-main fixture was
corrected and baseline results asserted before sweeping. Arena backing is
released on destruction; worklists retain caller-arena lifetime. Final expanded
units pass, including successful `own<bool>` boolean CFG comparisons.
All 1,793 ordinary conformance cases pass with exact coverage, and frozen
public check/lower outputs are exact (1,423/506). Targeted linear/nonvalue/
inferred-content suites pass 49/635/302 checks. The frozen core passes 351
focused CLI checks: forwarding calls and exact cross-command arity/type/name
errors through 65,536, formatter/AIR fidelity, values and fuel through 1,024.
Final formatted-rejection supplementary checks pass 108 cases
(`consuming-builtin-supplemental-depth.log`). This does not
claim a fresh full expression-depth suite run.
Claude's read-only core/follow-up reviews found no production defect
(`/tmp/aji-consuming-builtin-review.md` and
`/tmp/aji-consuming-builtin-followup-review.md`). Their fixture gaps were
corrected; the final `own<bool>` addition follows the review. Neither reviewer
ran tests. Deep mixed errors establish descent and one builtin completion,
not completion of every pending call. Separate atomic-new/take pairs accept 16 in both binaries, abort at
256 only before, and abort at 1,024 in both; task.join chains still abort at
1,024 (`consuming-builtin-next-probes.json`). No frame-size explanation is
established. Other builtin/place/control and liveness callbacks, Q-060 full GC
validation and Phase 6 gates remain open.
## Remaining work
Follow-up checks accept 16 parenthesized/mixed-call levels but abort
@@ -768,7 +812,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 builtin operands are repaired above; own/region argument callbacks 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. 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 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
+13
View File
@@ -721,3 +721,16 @@ checks pass. Expanded units and 69 supplemental checks pass; read-only Claude co
reviews found no production defect. Final span/counter unit checks pass. Own/region argument callbacks still abort at 1,024 in
both binaries. No semantic/depth-limit change; Q-061, Q-060 full GC validation
and Phase 6 exit gates remain open.
### Consuming ownership builtin depth increment
The [Q-061 consuming builtin increment](../design/source-expression-depth-audit.md#consuming-ownership-builtin-continuations)
shares own.take/free and region.destroy operands with the expression driver.
Arity, explicit-name transfers, type/error priority, emission and host OOM
remain unchanged; buffers retain caller-arena lifetime. Corrected OOM and
expanded units, all 1,793 ordinary conformance cases, public check/lower parity
(1,423/506), targeted linear/nonvalue/inferred-content suites (49/635/302) and
351 frozen-core depth checks 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. No semantic/depth-limit change; Q-061, Q-060 full GC
validation and Phase 6 exit gates remain open.