cli: lower task spawn arguments iteratively

This commit is contained in:
dev committed 2026-10-11 17:34:08 +03:00
1 parent b85df6777e
commit c5d0d09a81
5 files changed
+442 -31

No files matched your search

+61 -6
View File
@@ -337,8 +337,8 @@ fresh caller-arena nodes. Entries never point into copied union payloads or
queue entries. Type/pattern/binding handling, source spans and generic Copy
transfer flags retain their original policy. Calls have explicit stages:
transform type_arg, resolve/check the callee, transform it, then process
arguments in order, with the existing static-worker exception for task.spawn's
second argument. Constructors resolve their named type before their fields.
arguments in order, with the existing substitution of a bound static function
in task.spawn's second argument. Constructors resolve their named type before their fields.
Nested instantiation/type queries keep their unchanged depth-64 guards,
instance/key limits and public error policy; no expression-depth limit is added.
@@ -881,7 +881,7 @@ current lower.zig and the diff, not full CLI/docs or evidence artifacts; its
file tools could not open the core report in /tmp. The initial unit fixture aliased its
destination while copying a child; child copying now precedes assignment.
The next finite probe alternates join/spawn in one scope, with scalar arguments
At this join checkpoint, the next probe alternates join/spawn in one scope, with scalar arguments
and one live child at a time. It accepts 16 levels but aborts at 256/1,024 in
both frozen binaries (`task-join-next-probes.json`). Spawn-argument callbacks,
multi-result task.join_cancel inputs and other graph/place/control/liveness
@@ -889,6 +889,61 @@ walks retain native callback entry with depth unverified beyond these probes.
Q-060 full GC and Phase 6 exit gates remain open. No whole-frontend or arbitrary
runtime-depth claim.
## Task spawn argument continuations
Task.spawn arguments now share the expression driver (spec 15 §7;
spec 04 §33–35). Scope identity and worker signature are saved before children.
Minimum arity, scope, named worker, borrowed-result rejection and full arity
retain their priority. Each argument then checks inline borrow/bytes, explicit
consumption, hinted expression type and parameter type before appending its
name. Zero and multiple arguments emit only after completion. Bound loans
remain lent until join; scope lifetime, Send/result/effect/verifier/runtime/
scheduler rules and explicit transfers are unchanged. No diagnostic, feature,
AIR/format/bundle/limit or ownership/concurrency rule changes.
Copied `ReferenceTaskSpawn` consumes through the former recursive oracle;
shared leaf/place/type/emission helpers limit independence. Shallow forms
cover zero/multiple/qualified workers, bound borrows, owners, scope shadowing,
CFG/non-values and early/late errors. Deep 32,768 scalar/pair chains retain
scope/name/span/order facts; late unknown/inline-borrow failures emit only
preceding constants. Recovering/persistent public OOM sweeps cover two valid
baselines and E7002/E7003/E7005/E7006 without partial AIR or false diagnostics,
with actual backing cleanup. Work states/buffers retain caller-arena lifetime.
Build/units/format, all 1,793 ordinary conformance cases with exact coverage,
frozen public checks/lowerings (1,423/506), lifetime/related/CFG/static-worker
checks (188/409/146/25) pass. The focused CLI gate completes 497 distinct checks
across split runs: the first process ended with exit 143 after three accepted
and five rejected families (329 completed checks); a terminal-success follow-up
covers the other seven rejected families (168). No cause for that interruption
is established. Scalar/pair chains check through 65,536; mixed chains check
through 32,768 and reach existing E5101 at 65,536 (`found: 327685` main
instructions; the whole module has 327686). All three lower and format through
65,536 with exact AIR parity; a second check on formatted accepted input
is limited to 1,024. Quantum-one seed-7 run/fuel/source-AIR checks reach
1,024; seeds 0/1 additionally reach 16. Twelve rejected families check exact
code/fields/positions and identical check/lower/run/report/explore JSON through
65,536, including formatted positions. These are task.spawn checks, not a
whole-expression-suite or arbitrary control/liveness/runtime-depth claim.
Valid bound-loan/join examples remain covered by
`source/linear/task_loan_join.aji` and the source/AIR pair
`buffers/task_loan_join`; unjoined scope exit remains E4301 in
`source/layer7/reject/scope_unjoined.aji`. Claude's read-only
core review found no production defect; its formatted-leaf and count concerns
are now covered by executed CLI checks. Pending buffers remain arena-owned
until arena destruction, rather than being physically freed by list deinit.
The test-only unchecked field and reserved worker name were corrected;
all 473 shallow forms parse. Read-only final follow-up found no production
or fixture defect, relying on the core review plus the final diff, driver and
generic-worker code; it did not re-audit every consumer or run tests. Its exit,
formatted-check bound and schedule-seed wording suggestions are integrated.
The next finite probe, nested `mutex.take(mutex.make(...))`, accepts at 16
but aborts at 256/1,024 with no JSON before and after this spawn repair.
`task-spawn-next-probes.json` and matching raw stdout/stderr retain the evidence.
Mutex operands are the next confirmed callback repair; other walks remain open.
## Remaining work
Follow-up checks accept 16 parenthesized/mixed-call levels but abort
@@ -903,7 +958,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, consuming own/region, atomic and task.join operands are repaired above. Alternating join/spawn still aborts at 256 in both binaries. Spawn arguments and multi-result task.join_cancel inputs retain native callback entry. 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, consuming own/region, atomic, task.join and spawn operands are repaired above. Mutex make/take callbacks independently abort at 256/1,024 before and after the spawn repair. Multi-result task.join_cancel inputs and other graph/place/control callbacks retain native entry. 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
@@ -912,5 +967,5 @@ claim every listed callback fails, or that all other paths have been cleared.
Q-061 and Phase 6 remain open; Q-060's unfinished full GC validation is
independent. The five reviewed increments now have a scoped external review;
the host-OOM follow-up and intermediate repairs have no separate review.
The struct/value-field, array and enum-payload increments have the scoped
reviews recorded above.
The struct/value-field, array, enum-payload, task.join and task.spawn
increments have the scoped reviews recorded above.