cli: lower place bases iteratively
This commit is contained in:
5 files changed
+529
-54
No files matched your search
@@ -571,4 +571,6 @@ The [spawn increment](source-expression-depth-audit.md#task-spawn-argument-conti
|
||||
The [mutex make/take increment](source-expression-depth-audit.md#mutex-maketake-operand-continuations) preserves consuming/content/type priority, explicit moves, spans, loans, emission and host OOM. Build/units/format, lifetime/related/CFG and 310 focused CLI checks pass; scalar checks and original/formatted lower reach 65,536, mixed checks reach 32,768 then existing E5101, runtime/source-AIR/fuel reach 1,024 and rejected positions reach 65,536. All 1,793 ordinary conformance files have exact successful coverage. Frozen public check/lower parity passes (1,423/506) over `tests/conformance/**/*.aji`; read-only Claude core/final reviews found no production or fixture defect within their recorded scope. The filename-only follow-up subset passes 48 checks. At that mutex checkpoint index operands aborted at 1,024 before/after; other walks, Q-060 and Phase 6 remain open. No semantic or depth-limit change.
|
||||
|
||||
|
||||
The [scalar index operand increment](source-expression-depth-audit.md#scalar-index-operand-continuations) preserves base/type/operand priority, usize hints, bounds facts, unchecked state, loans, load/end order, spans and host OOM. Build/units/format and store-mode/array-argument/lifetime/CFG suites pass; exact ordinary conformance (1,793), public frozen parity (1,423/506), the original focused run passes 318 CLI checks (check through 32,768 then existing E5101 at 65,536; lower/fmt through 65,536; runtime/fuel through 1,024), and separate overlapping 30-call fuel/28-call CFG/deref/proven-context subsets pass. Read-only Claude core/final reviews found no production defect and their fixture/wording suggestions are covered. The recorded nested-array base-index probe still aborts at 1,024 before/after, with other place/control/liveness callbacks, Q-060 and Phase 6 open. No semantic or new depth-limit change.
|
||||
The [scalar index operand increment](source-expression-depth-audit.md#scalar-index-operand-continuations) preserves base/type/operand priority, usize hints, bounds facts, unchecked state, loans, load/end order, spans and host OOM. Build/units/format and store-mode/array-argument/lifetime/CFG suites pass; exact ordinary conformance (1,793), public frozen parity (1,423/506), the original focused run passes 318 CLI checks (check through 32,768 then existing E5101 at 65,536; lower/fmt through 65,536; runtime/fuel through 1,024), and separate overlapping 30-call fuel/28-call CFG/deref/proven-context subsets pass. Read-only Claude core/final reviews found no production defect and their fixture/wording suggestions are covered. At that scalar-operand checkpoint the recorded nested-array base-index probe still aborted at 1,024 before/after; its subsequent repair is recorded below. Other place/control/liveness callbacks, Q-060 and Phase 6 remain open. No semantic or new depth-limit change.
|
||||
|
||||
The [raw-place base increment](source-expression-depth-audit.md#raw-place-base-continuations) repairs the recorded 1,024-level nested-array base failure using iterative field/index projections and one ancestor-name list. Borrow modes, parents, child-first ends, range ordering, facts, unchecked selection, spans and host OOM separation are preserved. Exact ordinary conformance coverage, public check/lower parity and 159 focused CLI calls pass; expanded units pass, and scoped read-only Claude core/final reviews found no production defect. Follow-up block/if probes confirm remaining parser aborts at 1,024 before/after. Q-061, Q-060 full GC validation and Phase 6 remain open; no semantic or depth-limit change.
|
||||
@@ -1070,8 +1070,97 @@ 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.
|
||||
At that operand checkpoint place base/range/borrow, graph/control and other
|
||||
native callbacks still needed repair/audit. Raw place bases are repaired in
|
||||
the next section; Q-061, Q-060 full GC and Phase 6 remain open.
|
||||
|
||||
## Raw place base continuations
|
||||
|
||||
The recorded nested-array `a[0usize][0usize]...` failure at 1,024 is
|
||||
repaired. `placeRaw` collects field/index projections, evaluates the leaf,
|
||||
then resumes projections inside out. It preserves mutable mode, diagnostic
|
||||
and emission spans, field lookup before outer projections, base validation
|
||||
before bounds, lo/check/hi/check order, parent identities, current proven
|
||||
facts and the outermost unchecked index. The unchanged leaf still calls
|
||||
`expr` for dereference; bounds also enter expression lowering. Those callback
|
||||
combinations are not whole-frontend closure evidence.
|
||||
|
||||
One owned list accumulates ancestor names in the original order; consumers
|
||||
still end children before parents. This removes the old per-projection full
|
||||
list copy. Frames and lists use the caller arena: `deinit` does not promise
|
||||
physical release before arena destruction. The returned slice remains stable;
|
||||
other callers' slices are never mutated. Host allocation errors propagate
|
||||
without language diagnostics or partial public AIR. Private state after host
|
||||
OOM is not a recoverable language contract; `uncheckedPlace` still clears its
|
||||
flag on every exit. No peak-memory or total pipeline complexity measurement
|
||||
is claimed.
|
||||
|
||||
Validation at this checkpoint:
|
||||
|
||||
- Direct comparisons with the former recursive raw body cover leaves, fields,
|
||||
scalar indices, ranges, failures, CFG, facts, explicit mutable modes and
|
||||
synthetic unchecked range/index children. Leaf/type/emission helpers are
|
||||
shared; the comparison is independent only for traversal and sequencing.
|
||||
- Helper ASTs exercise 32,768 array-base projections, nominal field projections
|
||||
with an innermost field error, and repeated ranges above a dereference leaf.
|
||||
Parent chains, spans and reverse ends are checked. These are helper tests,
|
||||
not complete CLI acceptance at that depth.
|
||||
- Recovering/persistent allocation sweeps cover a grown 64-index worklist after
|
||||
setup and public success/rejection lowering including setup, fields and
|
||||
ranges. Arena-backing cleanup is checked; early physical scratch release
|
||||
and every mixed deep callback combination are not established.
|
||||
- All 1,793 ordinary conformance cases pass with exact corpus coverage;
|
||||
frozen public checks/lowerings remain byte-exact (1,423/506). Store modes,
|
||||
array arguments, lifetimes and CFG suites pass (348/85/188/146 checks,
|
||||
plus 8/3 lifetime/CFG AIR twins).
|
||||
- The added hosted block passes 159 CLI calls: array/borrowed-field/range
|
||||
chains at 1/16/256/1,024, formatter fixed points and exact AIR, bounded
|
||||
source/AIR returned records and exact fuel exhaustion through 256, mixed
|
||||
writes/dereferences/unchecked/proven contexts and seven rejection positions
|
||||
across check/lower/run/report/explore. The full accumulating expression-depth
|
||||
file was not rerun; this count covers only the new block.
|
||||
|
||||
Build, final expanded units and formatting checks pass. Read-only Claude core
|
||||
and final follow-up reviews found no production defect within their recorded
|
||||
body/caller/fixture scope; neither ran tests. The final reviewer could not read
|
||||
the core report in `/tmp`, and independently compared the diff/live code with
|
||||
the retained old-body oracle. Its documentation scope corrections are reflected
|
||||
here; non-blocking OOM/public-depth coverage limits remain explicit. The core
|
||||
field/range/deep-error and public OOM test gaps were expanded. Neither review
|
||||
establishes independent normative/full-Q-061 conformance. A suggestion
|
||||
that arena list deinit immediately releases scratch was not adopted: this
|
||||
allocator retains storage until arena destruction.
|
||||
|
||||
Memory checklist: the preserved invariant is the existing exclusive/shared
|
||||
borrow tree and child-first termination (spec 08 §§11–12, AIR 07a). Verifier
|
||||
rules, interpreter behavior, effects, features, traps, codes and backward
|
||||
compatibility are unchanged. Deep read/borrow/range chains are checked through
|
||||
1,024 in the CLI and 32,768 in helper tests. Write, unchecked, proven and mixed dereference CLI
|
||||
contexts are shallow; deep dereference/range and unchecked behavior is only
|
||||
helper-stage evidence. Invalid field/bound operands retain E7002/E7005 at the
|
||||
first relevant construct. Existing `source/layer6/unchecked.aji`, index-scalar and
|
||||
bounds-trap cases remain in the complete conformance gate. Deterministic
|
||||
source/AIR and fuel checks preserve observable execution. No normative text,
|
||||
syntax, bundle growth or new depth limit is introduced.
|
||||
|
||||
Evidence under `.zig-cache/contract-gate/type-depth/`: `place-base-` build,
|
||||
unit, conformance/audit, public-parity, focused-depth and integration logs;
|
||||
`place-base-initial-probes.json` records the original array reproducer;
|
||||
`place-base-review.diff`, `place-base-final-review.diff` and copied
|
||||
`claude-place-base-{core,final}-review.md` delimit review scope. Original
|
||||
`/tmp` reports and these ignored cache artifacts are untracked and transient;
|
||||
the conclusions and limits above are the committed record.
|
||||
Initial fixture attempts incorrectly allowed source struct `zero`, counted
|
||||
nominal type declarations as instructions, omitted `local.zero`, expected the
|
||||
wrong capture envelope, and used a self-referencing AST construction. Those
|
||||
fixture errors were corrected; none is counted as a successful gate.
|
||||
|
||||
Finite follow-up block and if expressions accept 16/256 but abort at 1,024
|
||||
before and after, with empty stdout and parser re-entry in the traceback.
|
||||
`place-base-next-probes.json` and matching stdout/stderr retain all results.
|
||||
Control parsing/lowering, multi-result/graph callbacks and liveness/read/
|
||||
assignment scans keep Q-061 open. Q-060's full GC validation and Phase 6 exit
|
||||
review remain independent open gates.
|
||||
|
||||
## Remaining work
|
||||
|
||||
@@ -1086,8 +1175,8 @@ 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. 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. |
|
||||
| Parser `ifExpr`, block/statement and match/arm expression entry | Finite block/if probes above confirm parser aborts at 1,024 before/after the raw-place repair; 16/256 accept. Alternating control/statement combinations still need audit. |
|
||||
| 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 failure is repaired by the raw-place increment above. Dereference/bound expression callbacks and graph/control combinations still need audit. 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
|
||||
@@ -1097,4 +1186,5 @@ 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, mutex and
|
||||
scalar index operand increments have the scoped reviews recorded above.
|
||||
scalar index operand increments have the scoped reviews recorded above. The
|
||||
raw-place increment records its core and final follow-up reviews explicitly.
|
||||
@@ -815,3 +815,20 @@ fixture/wording suggestions are covered. The recorded nested-array base-index
|
||||
probe still aborts at 1,024 before/after; place/range/borrow,
|
||||
control/liveness and other paths, Q-060 and Phase 6 remain open. No semantic or
|
||||
new depth-limit change.
|
||||
|
||||
### Raw place base depth increment
|
||||
|
||||
The [raw-place increment](../design/source-expression-depth-audit.md#raw-place-base-continuations)
|
||||
repairs the recorded nested-array base failure at 1,024. Iterative field/index
|
||||
projections preserve borrow modes/parents/ends, spans, field/bounds error
|
||||
priority, range order, facts and unchecked selection. One ancestor list
|
||||
replaces repeated full-list copies; caller-arena lifetime and host OOM
|
||||
propagation remain explicit.
|
||||
|
||||
All 1,793 ordinary conformance cases, exact public check/lower parity
|
||||
(1,423/506), store/array-argument/lifetime/CFG suites and 159 new focused CLI
|
||||
calls pass. Expanded units pass; scoped read-only Claude core/final reviews found no
|
||||
production defect. Documentation scope corrections are recorded in the audit. The whole accumulating expression-depth suite is not
|
||||
claimed. Block/if parsing still aborts at 1,024 before/after; other callbacks
|
||||
and liveness/read/assignment scans, Q-060 full GC validation and Phase 6 exit
|
||||
review remain open. No normative, feature, bundle or accepted-depth change.
|
||||
Reference in new issue
Block a user