cli: lower scalar index operands iteratively

This commit is contained in:
dev committed 2026-10-11 19:15:23 +03:00
1 parent 7ccded2b59
commit 29c1928aa1
5 files changed
+557 -14

No files matched your search

+76 -4
View File
@@ -996,11 +996,83 @@ checked separately; they do not compare failure-free error spans. Accepted
report/explore and full expression-suite execution are not claimed. No arbitrary
control/liveness or runtime-depth closure is established.
Follow-up index-operand nesting `a[a[...0usize]]` on `[usize; 1]` accepts
At this mutex checkpoint index-operand nesting `a[a[...0usize]]` on `[usize; 1]` accepts
16/256 but aborts at 1,024 before/after. `task-mutex-next-probes.json` and raw
stdout/stderr record the confirmed remaining callback. An initial probe used
invalid `array<usize, 1>` syntax and was corrected before this failure claim.
## Scalar index operand continuations
Value indices now share the operand driver (spec 15 §5). Range-as-value
rejection precedes base work. Base borrowing runs with unchecked cleared;
the saved outer flag is restored for base-type rejection and cleared for the
usize-hinted operand. After that operand, type checking precedes the current
SSA bounds-fact lookup, unsafe feature use, element borrow, load and reverse
child/base endings. Base identity, element type, spans and ends are stored by
value before child shadowing/CFG. No consuming check is added to the index.
Bounds proof still requires the same SSA index/slice (spec 08 §12); ownership,
aliasing and lifetime rules remain verifier-owned. Checked indexing retains
T0008; unchecked access still needs the explicit unsafe contract. Runtime,
interpreter fuel, effects, diagnostics, AIR/features/bundle and existing
complexity limits are unchanged. No semantic acceptance-depth limit is added.
Work frames and their borrowed AST/type/name data keep caller-arena lifetime.
Frame-stack memory is unmeasured; list deinit does not imply early arena release.
Copied `ReferenceIndexPlaces` retains the old recursive place/index descent,
using recursive operand references; leaf/type/borrow/emission and other
fallback helpers remain shared. Its 41 expressions × 8 wrappers × 3 hints ×
2 unchecked states compare values/errors, problem/unimplemented, blocks,
allocations/constants/bindings, counter/current block, feature-use set, linear/
constant flags, borrow parents, unchecked and bounds facts. Other state and
arbitrary statement contexts are unverified. New-driver 32,768-depth tests
check base-first and load/end order, exact spans, unknown/wrong-int partial
prefixes. Six public recovering/persistent OOM sweeps retain host errors and
actual backing cleanup. An additional private 64-level recovering sweep
covers every allocation through grown worklist capacities, late base prefixes,
no false diagnostic/output and physical backing cleanup; failure-free tags, not full error spans, are compared.
Build/follow-up units/format pass, as do store-mode/array-argument/lifetime/CFG
suites (348/85/188/146). All 1,793 ordinary conformance files have exact
successful coverage; frozen public checks/lowerings are byte-exact (1,423/506)
over `tests/conformance/**/*.aji`. The original focused run terminates with
318 successful CLI checks, before the later AIR fuel-1/context additions.
Both depth families check through 32,768; at 65,536 they receive existing
E5101 (pure main 327686; mixed main 458758/module 458759). Original/formatted
lower and formatter fixed points reach 65,536; repeated formatted accepted
checks reach 1,024. Eight rejected families preserve code/fields/positions and
identical check/lower/run/report/explore JSON through 65,536, including formatted
positions. Source/AIR accepted runs and fuel boundaries reach 1,024.
`index-operand-fuel-subset.py` completes 30 follow-up calls (10 lower,
10 source exhaustion, 10 AIR exhaustion), with quantum one/seed 7 through
1,024. Its checks overlap the earlier run and are not added as distinct tests.
The separate 28-call context subset verifies bounded CFG, dereferenced
array bases and a proven index inside a child. Runtime bound remains 1,024.
Read-only Claude core review found no production defect. Its bare linear
index/deref-base/grown-OOM/CFG/fuel fixture suggestions are implemented. Final
read-only follow-up found no production defect or fixture defect invalidating
passing results; it re-read the new driver/preparation/finish, copied old path,
tests, docs and base-probe evidence without running tests. Its subset-count,
probe-scope and frame-memory wording suggestions are integrated. Synthetic
unchecked=true equality runs are not public unchecked-index depth evidence;
public unchecked accesses retain their existing conformance coverage. The
64-level private OOM sweep starts after lowerer setup; setup is covered only
by the small public sweeps. Arbitrary/deep accepted CFG remains unverified.
Bounded source/AIR probes establish static/fuel counts: pure d>0 is 5d+6; mixed double-call
index d>0 is 7d+7 module instructions and 9d+6 fuel. At d0 the unused array
stays SSA (4 instructions/fuel; mixed's unused worker adds one static ret).
The test record includes the existing empty stdout/stderr/files capture.
Existing valid `source/layer6/unchecked.aji`, rejected
`source/layer34/reject/index_scalar.aji` (E7005), and
`source/layer34/bounds_trap.aji` (T0008) retain their contracts. No whole
expression-suite, control/liveness or runtime-depth closure claim.
Follow-up base-index nesting `a[0usize][0usize]...` on nested length-one arrays
accepts 16/256 but aborts at 1,024 before/after this operand repair.
`index-operand-next-probes.json` and matching raw files retain the evidence.
Place base/range/borrow, graph/control and other native callbacks still need
repair/audit; Q-061, Q-060 full GC and Phase 6 remain open.
## Remaining work
Follow-up checks accept 16 parenthesized/mixed-call levels but abort
@@ -1015,7 +1087,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, task.join and spawn operands are repaired above. Mutex make/take operands are repaired above, with final gates pending. Index operands independently abort at 1,024 before/after the mutex 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 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 operands are repaired above. Scalar index operands use continuations above; the recorded nested-array base-index probe still aborts at 1,024 before/after this 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
@@ -1024,5 +1096,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, enum-payload, task.join, task.spawn and mutex
increments have the scoped reviews recorded above.
The struct/value-field, array, enum-payload, task.join, task.spawn, mutex and
scalar index operand increments have the scoped reviews recorded above.