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

+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