81 KiB
Source expression depth audit
This non-normative audit tracks Q-061 independently of the resolved compiler type-traversal inventory (Q-059). It uses finite generated/public source only; it does not set an expression-depth acceptance limit or report model outcomes.
Confirmed baseline failures
On the Debug CLI preceding the unary-parser repair (code at fb80413),
fn main() -> bool effects [] { return not … false; } accepts 16 prefixes.
At 1,024 prefixes, checking aborts in Lowerer.expr, with repeated .not
operand calls. At 16,384 and 65,536 prefixes, it aborts earlier in
Parser.unary. Each failing check exits by signal (observed return code -6)
without a stdout diagnostic. These are observed native-stack failures, not
language rejection rules. Stderr reports a segmentation fault at the recursive
entry/operand call, followed by repeated native frames of that function.
The ignored evidence is under .zig-cache/contract-gate/type-depth/:
expression-depth-before.json, prefix-not-*.stdout and prefix-not-*.stderr.
No wall-clock timeout terminates these probes.
Unary parser continuations
The parser records -, not, * and inline borrow prefixes in an explicit
pending list, parses the terminal operand and rebuilds the nodes inside out.
move remains a terminal name form. A borrow still parses its operand through
unary only when the next token is *; otherwise it uses postfix directly.
This preserves the existing place boundary, rather than admitting new spellings
such as ref -value, mut not value or ref move value.
Each rebuilt node retains its own start and the final operand end, including comments, newlines and file provenance. AST node order, operator association, postfix precedence and syntax failure positions are unchanged. Pending metadata is host compiler storage allocated from the caller arena. Its logical list is deinitialized on completion/error; backing storage is retained until that arena is destroyed. Allocation failure still propagates OutOfMemory; no partial AST escapes, new code or depth rejection is introduced. AIR, verifier ownership/borrow rules, runtime evaluation, fuel, effects and source/reference bundle text are unchanged.
An independent shallow copy of the old unary derivation checks 448 combinations of prefixes and successful/failed operands. It compares complete ASTs, failure records, token cursors and last-consumed positions. Its shared postfix parser is outside that oracle's scope. Separate tests parse 32,768 mixed prefix groups including borrowed dereferences, inspect every node/span iteratively and check a missing operand at the deepest position. A failing-allocator test covers all arena backing requests in a longer chain, including pending-list growth and output construction, and verifies complete release.
Syntax-only CLI probes format 1,024/16,384/65,536 not prefixes successfully
and idempotently, retaining every prefix. Missing-operand checks at
16,384/65,536 prefixes emit exactly one E7001 with independently computed
line/column and expected/found fields. These do not establish successful
deep lowering or execution. The permanent source_grammar.py suite includes
those formatting/diagnostic regressions at all three depths, with the same
syntax diagnostic across check/lower/run/report/explore/fmt.
Validation: build, units and format checks pass; all 1,793 ordinary conformance cases pass with exact unique corpus coverage. Old/new public source checks and successful lowerings are byte-identical (1,423/506). The grammar integration suite passes 312 checks; the formatter suite passes 6,078 checks over 1,469 files (1,414 parsed, 55 syntax-error fixtures, 782 identical successful AIR outputs). These are compiler regressions, not a model-capability measurement or full GC validation.
Unary lowering and addressability continuations
Direct .not, .neg, .deref and .cast operand descent now records explicit
lowering continuations. Negative zero constants still precede their operands;
loads, boolean operations, checked subtraction and casts resume afterwards.
The special negative-literal magnitude rule remains separate, including
-128i8 and the overflow from negating that value. Cast target validation still
precedes operand lowering; narrowing advice, atomic-load E4202 and operand
type/failure positions are unchanged. peekType skips a leading negation spine
without allocating; other recursive query paths are outside this repair.
The first intermediate full 16,384-prefix check exposes another native-stack
failure, in the preliminary markExpr walk, before the new expression handler
is reached. Its record/frame excerpt is retained as
source-address-mark-before.json. Addressability now uses a separate worklist
for blocks, statements, expressions, roots and pending sibling slices. It
preserves root-bound-before-base order, left/right and statement/tail order,
callee/argument order and the final split_at root visit. The old skipped select
and lock-place inputs stay skipped; storage policy is not extended here.
Both worklists are host metadata in the caller arena. Their lists are deinitialized on error/completion, but backing buffers, finished values and addressability facts retain their caller-arena lifetime. OOM propagates without a source diagnostic or public partial AIR. The verifier's load/borrow, initialization and atomic-access rules, runtime operations, ownership, lexical ends, effects and source/AIR formats are unchanged. Borrowed scalar reads remain valid; slice/array dereference and implicit atomic reads retain their existing E7006/E4202 failures. No acceptance limit, code, feature or bundle text is added.
An independent old unary derivation checks 3,072 shallow context combinations, including divergent operands, signed boundaries, borrowed/atomic values and invalid targets. It compares values, complete instruction/span/constant records, names/counters and diagnostics. It shares the unchanged non-unary handlers and query implementation, so it is not an independent oracle for those paths. Separate 32,768-node cases inspect inside-out boolean/cast spans, outside-in negative zeros and inside-out subtractions, and inner dereference rejection. The allocation test fails every arena backing request and compares complete emitted instruction prefixes, no output publication and full arena release.
An independent old addressability walk compares 17 shallow fixtures, including roots/bounds, branches, aggregates, calls, loops, scopes and skipped inputs. 32,768 mixed expression/block levels and every failing backing allocation are tested separately. Full generated checks/lowerings now accept 65,536 typed scalar boolean/negative/cast nodes, with independently counted instructions; direct malformed dereference spines reject E7005 at their inner position. These do not prove that every expression/query path is bounded.
The permanent source_expression_depth.py CI suite checks deep full lowering,
exact instruction counts, source/AIR and hosted results, fuel boundaries and
signed-minimum overflow. Baseline/current runtime records match exactly in 47
deterministic/hosted pairs. Full ordinary conformance passes 1,793 unique cases
with exact corpus coverage; units and Zig format checks pass. Q-060's full
per-step validation remains separate.
Final CLI validation passes 114 expression-depth checks, 635 non-value operand checks, 33 atomic-access checks, 312 grammar checks and the existing 6,078 formatter checks. All 1,423 public source checks and 506 successful lowerings retain byte-identical old/new results with fixed baseline/current executables.
Expression type-query continuations
On dd73b84, ( * … 1i64 ) as i64 at 16,384 dereferences aborts in
peekType, before the expected ordinary type error. Its stdout is empty and
stderr repeats dereference-query frames. The retained baseline evidence is
unary-cast-deref-query-16384.json/.stdout/.stderr; the repaired check returns
one E7005 at line 2, column 32,805 without stderr
(expression-query-repaired-cli.json).
Expression and built-in result queries now share an explicit continuation worklist. It preserves left-before-right fallback, first-known match arm, first array element, branch-tail policy, field/len classification, callee priority and built-in argument/borrow handling. Negation, shift, block and if-tail queries use loop transitions. At this initial checkpoint, type-output and continuation-allocation OOM returned unknown. The external review below identifies why that can become a false diagnostic at a caller; the host-OOM repair supersedes this behavior. Allocation counts and failure-index classifications are not promised identical. Pending lists are deinitialized; their buffers and output type nodes retain their caller-arena lifetime.
The query's callee callbacks also exposed recursive expressionPath and
bounded dotted. Both now walk field chains iteratively. expressionPath
allocates one complete string rather than every ancestor prefix; direct names
and invalid roots allocate nothing. Successful path bytes, the existing
64-byte built-in lookup buffer and null-result policy are retained. Partial
buffer contents on null are private and need not match the old implementation.
An independent copy of the old expression/built-in descent compares 703 shallow combinations. Name/signature/type lookup and callee path helpers are shared, so this oracle does not independently validate those helpers. Separate tests cover 32,768 structural/built-in expression levels, 16,384 fallback levels, 65,536 callee fields and allocation-error cleanup without diagnostics or emitted instructions. The permanent CLI suite adds cast/dereference and deep unknown-callee rejection across check/lower/run/report/explore. These helper fixtures do not establish arbitrary deep source acceptance.
Final build/units/Zig format checks and all 1,793 ordinary conformance cases
pass with exact unique corpus coverage (source-expression-query-conformance.jsonl
and its audit). The expression-depth/non-value/atomic-access suites pass
139/635/33 checks; formatter integration passes 6,078 checks. Fixed old/new
executables retain exact exit/stdout/stderr on all 1,423 public source checks
and 506 successful lowerings. These are compiler regressions, not completed
per-step GC validation or a model-capability measurement.
No normative rule, source/AIR format, feature, error code, bundle text, ownership/runtime behavior or acceptance limit changes. Q-061's other paths remain open; this increment has no fresh Claude review.
Expected-use query continuations
After the preceding query repair, let n = 1; return - … n; in an i64 function accepts
16 and 1,024 negations, but at 16,384 aborts in useIn while inferring the
unsuffixed binding's type. The failing check returns -6 with empty stdout and
repeated useIn frames. Evidence is retained as inferred-use-depth-before.json
and inferred-use-neg-16384.stdout/.stderr. This confirms the next expected-use
query failure independently of the repaired peekType path.
useIn, usesInStmt and usesInBlock now share an explicit request worklist.
It retains first-known use, left/right and call-argument order, condition/then/
else order, statement-before-tail order, return hints and cast hint removal.
Comparison/shift right-hand hints and the second for bound are queried only
after the earlier use fails. The outer inferUses rest cursor and top-level
let rebinding barrier are unchanged; nested blocks and skipped expression/
statement kinds retain their original policy. No new inference is introduced.
The requests are host metadata in the caller arena. Logical lists are deinitialized on success/error; their buffers and hint type nodes remain until arena destruction. Initially, metadata OOM returned unknown. The review and host-OOM repair below supersede that behavior because a caller can turn unknown into a false inference diagnostic. This adds allocation requests and does not promise identical failure-index outcomes. Plain unary descent is a loop without work allocations. Runtime memory, ownership, fuel and verifier rules are unchanged; no normative rule, format, feature, error code, source/reference bundle or acceptance limit is added.
The independent old expected-use descent and outer cursor compare 967 shallow expression, statement/block and two-scope combinations. Name/signature/type queries are shared and outside that oracle's independence. Separate tests cover 32,768 unary and mixed branch/call groups, 32,768 nested statement blocks, deferred-hint allocation traps and every worklist backing-allocation failure. They check complete cleanup and no query diagnostic/output; helper fixtures do not establish arbitrary deep source acceptance.
The baseline 16,384-negation source now accepts without stdout/stderr
(inferred-use-depth-repaired.json). Permanent CLI tests check inferred
negations through 65,536, exact instruction counts and fuel/source/AIR/hosted
results through 1,024. Cast-cleared context still returns E7007 at the unsuffixed
initializer through 65,536 negations across check/lower/run/report/explore.
Final build/unit/format checks and all 1,793 ordinary conformance cases pass
with exact unique corpus coverage (source-use-query-conformance.jsonl and its
audit). The permanent expression-depth suite passes 186 checks; non-value and
independent-error suites pass 635/234 checks. These do not complete Q-060's
per-step GC validation or measure model capability.
Fixed pre/post executables retain exact exit/stdout/stderr for all 1,423 public
source checks and 506 successful lowerings (source-use-query-cli-compatibility.json).
Binary operand lowering continuations
The preceding follow-up probes accept 16 levels but abort at
1,024, with empty stdout, in three independent paths: a left-associated
1i64 + … + 1i64 chain in Lowerer.binary; nested parentheses in the parser's
primary/postfix expression path; and a unary chain in a specialized generic
function body in generics.expression/walk. Evidence is retained as
post-use-query-depth-probes.json and post-use-*.stdout/.stderr. These are
observed native failures, not normative depth rejections.
Unary and binary scalar operands now share one continuation driver. Eager operators retain operand-type selection, left lowering/check before right, post-operand operator validation and exact instruction/span/name order. This also removes native re-entry on alternating unary/binary trees. Non-operand handlers remain outside this repair.
Boolean continuations preserve short-circuit lowering: validate left, emit the short constant, create RHS/join blocks and the join parameter, branch, lower/check right, branch to the stored join and resume there. Runtime still evaluates right only when needed; both operands are lowered and type checked. Negative zero order, signed-minimum literal handling, cast checks, atomic diagnostics and iref identity rules remain unchanged. Host worklist OOM propagates without a query diagnostic or public partial AIR. Its list is deinitialized; backing buffers and generated values retain their caller-arena lifetime. Allocation counts/failure-index outcomes are not promised identical.
The independent old scalar derivation now covers binary rules as well as unary descent. It compares 6,048 binary/wrapper/context combinations, in addition to the existing unary cases: values/errors, blocks, parameters, instructions/spans, counter, current block and features. Name/type/query and non-operand handlers are shared, outside this oracle's independence. Separate tests cover 32,768 left/right arithmetic nodes, 32,768 alternating groups, 16,384 boolean/unary groups in both orientations, and every backing-allocation failure on numeric and boolean fixtures with exact complete block prefixes and full cleanup. These helper tests do not assert arbitrary source acceptance.
The old 1,024-addition source now accepts, as do full arithmetic checks and
lowerings through 65,536 operations. Boolean chains accept at 1,024; at 16,384
both and/or now reach the existing E5101 block limit (spec 08 §7), with
limit: blocks per function, max: 16384, found: 32769, rather than aborting.
The raw source checks are retained in binary-lowering-repaired-depth.json
and binary-repaired-*.stdout/.stderr. The permanent CLI suite checks exact
instruction counts, fuel boundaries, values/profiles/source-to-AIR parity,
the block-limit refusal, and skipped/executed RHS division traps. Trap source
locations are checked separately; plain AIR has no source map.
Build/unit/Zig format checks and all 1,793 ordinary conformance cases pass
with exact unique corpus coverage (source-binary-lowering-conformance.jsonl
and its audit). The permanent expression-depth suite passes 360 checks.
Non-value/independent-error CLI suites pass 635/234 checks;
fixed pre/post executables retain exact exit/stdout/stderr on all 1,423 public
source checks and 506 successful lowerings
(source-binary-lowering-cli-compatibility.json). These do not establish full
GC validation or a model-capability result.
No normative rule, source/AIR format, feature, error code, bundle text, runtime instruction, ownership rule or acceptance limit changes. Q-061 remains open.
External review and host-OOM follow-up
The owner relayed a read-only Claude review of c36b269, dd73b84, e862e03,
e3f4695 and 6945b51, with the local report /tmp/aji-q061-review.md.
It found no divergence in grammar, spans, query/error/emission order or
short-circuit CFG. The reviewer ran selected synthetic CLI probes, but did
not build or run the full suites.
The review identifies a real failure-policy defect: peekType and expected-use
queries erase host OOM into null; callers can then emit E7007. The existing
array-annotation and qualified-callee helpers have the same problem. A
regression test with a one-shot allocation failure reproduces E7007 at a
negation before the repair (query-oom-before-tests.log, terminal exit 1).
The allocator resumes working after its single failure, so allocating a false
diagnostic cannot hide this defect behind a second OOM.
The implementation follow-up separates optional unknown answers from fallible
host allocation in expression/expected-use queries and their annotation,
field, signature, borrow-return and assignment-place callbacks. Callers use
try and retain their lazy fallback policy. Type-output allocations also
propagate OOM. No inference, grammar, diagnostic fields/codes, acceptance limit,
ownership, runtime or bundle rule changes. Generated nodes and worklist buffers
remain caller-arena storage; list deinit does not establish immediate physical
release. Cleanup claims refer to arena destruction, or direct allocator tests
that actually observe frees.
Validation passes: build/units/Zig format checks, all 1,793 ordinary
conformance cases with exact unique corpus coverage (query-oom-conformance.jsonl
and its audit), 360 expression-depth CLI checks and 234 independent-error CLI
checks. Frozen old/new executables retain exact exit/stdout/stderr on 1,423 public
source checks and 506 accepted lowerings (query-oom-cli-compatibility.json).
Allocation tests cover ten lowering callers, twelve annotation/signature/builtin
callback cases, every recovering direct-allocation failure in three finite
public lower fixtures, and the existing exhaustive worklist/array-output
failure loops. Recovery tests check that no diagnostic/output or retry follows
the failure; arena/direct-allocator tests check actual cleanup at their ownership
boundary. Invalid/unknown lookups still return null without allocating, and
lazy-query tests still avoid unnecessary right-side work. This establishes
compiler error policy, not a new model result or full GC pass. Q-061 is open;
this follow-up has not yet received external review.
Generic AST transformation continuations
Baseline checks at 50a7575 accept a generic body's 16 negations but abort at
1,024 in generics.expression/reflective walk, with empty stdout. An unused
template also forces transformation of nongeneric bodies: a 16-component
unknown callee produces E7002, while 16,384 components abort in generics.path.
The latter is now an observed callback failure, not just an inspection risk.
Raw records are generic-transform-before-probes.json and
generic-transform-before-*.stdout/.stderr under the ignored evidence directory.
Typed work entries now clone structural AST children in the former field, union, optional, pointer and slice order. Inputs borrow stable immutable AST storage (including the root held throughout a walk); output targets live in 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 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.
The qualified-path callback validates the immutable root first, then allocates one complete string and fills components iteratively. Direct names and invalid roots allocate nothing; path bytes and named/static-function decisions are unchanged. Host allocation failure propagates without a source diagnostic or public partial AST. List deinit is logical cleanup; work buffers, generated AST/type nodes and partial internal instances keep caller-arena lifetime until that arena is destroyed. Allocation requests and failure-index outcomes need not match the recursive implementation.
An independent copy of the former clone/path descent compares 1,760 shallow expression/environment combinations, plus function/statement/pattern/select/ lock binding-priority fixtures. It checks complete ASTs, problems, instance and requirement order and guard counters. Binding/type/instantiation helpers are shared; nested instance bodies use the production walker, outside this oracle's independence. Separate helpers exercise 32,768 mixed expression levels, nested callee targets, statement blocks, else-if unions and deepest static/binding E7006 positions, plus 65,536 qualified fields. These synthetic helpers do not claim arbitrary source acceptance. Persistent backing-allocation failures on mixed/instance fixtures check host errors, guard restoration and physical arena cleanup; every recovering direct-allocation failure in a public specialization fixture rejects diagnostics, retries and partial publication.
Full source checks/lowerings now accept generic not/neg/cast/add bodies through
65,536 levels. Generic malformed dereferences retain their inner E7005 and
source position. Deep unknown callees return E7002 with the complete name and
exact location through 65,536 fields (generic-transform-after-probes.json and
generic-transform-after-*.stdout/.stderr). The permanent CLI suite independently
counts emitted instructions, fuel boundaries and values; it checks source/AIR
and deterministic/hosted parity for smaller accepted depths and exact rejection
records across check/lower/run/report/explore.
Build/unit/Zig format checks pass. The expression-depth suite passes 497 checks;
generic/static-function CLI suites pass 42/25 checks. Frozen old/new CLIs retain
exact exit/stdout/stderr on all 1,423 public source checks and 506 accepted
lowerings (generic-transform-cli-compatibility.json). All 1,793 ordinary
conformance cases pass with exact unique corpus coverage and terminal exit 0
(generic-transform-conformance.jsonl and its audit). These are compiler
regressions, not a full per-step GC pass or a model-capability measurement.
No normative, source/AIR format, feature, code, bundle, acceptance-limit, ownership, runtime instruction or model result changes. Q-061 remains open; this generic increment has no external review yet.
Parser qualified constructor paths
The generic follow-up identified a separate recursive Parser.exprPath, called
for qualified enum variants and struct literals. A frozen pre-repair CLI
(aji-before-parser-path, production at d39a422) independently aborts at
16,384 fields for both forms, with empty stdout. Raw inputs and output are
parser-path-before-probes.json and parser-path-*.before.stdout/.stderr in
the ignored evidence directory.
Parser.exprPath now validates the root, computes the complete byte length and fills one owned spelling iteratively. Direct names and invalid roots allocate nothing. Grammar, generic arguments, constructor classification, token cursor, spans and syntax/error priority are unchanged. Checked size arithmetic and allocation failure propagate as host OOM, without a source diagnostic or public partial AST. The final string has caller-arena lifetime; allocation requests and failure-index outcomes need not match the former prefix copies.
The copied shallow recursive path oracle checks both named and invalid roots.
Separate tests exercise 65,536 fields, exact component bytes, a single output
allocation, zero-allocation answers and host OOM. Public parser tests check
qualified enum/struct forms with and without type arguments, exact spans and a
missing variant name at 65,536 fields. Every backing-allocation failure in a
smaller constructor fixture propagates host OOM and releases its arena.
Repaired CLI probes return E7002 with the complete name at line 2, column 38,
for both forms through 65,536 fields (parser-path-after-probes.json and
parser-path-*.after.stdout/.stderr).
Build, unit and Zig format checks pass. All 1,793 ordinary conformance cases
pass with terminal exit 0 and exact unique corpus coverage
(parser-path-conformance.jsonl and its audit). The expression-depth and grammar
CLI suites pass 577 and 312 checks. Constructor regressions cover generic and
nongeneric forms with exact E7002 records across check/lower/run/report/explore.
Frozen old/new CLIs retain exact exit/stdout/stderr on all 1,423
public source checks and 506 accepted lowerings
(parser-path-cli-compatibility.json).
No normative, source/AIR format, feature, code, bundle, acceptance-limit or runtime/ownership rule changes. This repairs one callback; Q-061 remains open and no external review covers this increment yet.
Shared expression parser continuations
Frozen pre-repair CLI production at 371329f (aji-before-expression-parser)
aborts while formatting 1,024 grouped or mixed-call levels, with empty stdout.
expression-parser-probes.json and expression-parser-*.before.fmt.stdout/ .stderr hold the finite inputs/results. Debug stack excerpts reread current
source files; use parse-before-expression-driver.zig for baseline line text.
Binary precedence/RHS, casts, unary prefixes, postfix and primary entry modes
now share explicit continuations. Groups, ordinary/typed/variant call arguments,
array lists/repetitions, index bounds and struct field expressions suspend on
the same worklist, including alternating forms. Grammar, comparison rejection,
or trap, borrowed-place boundaries, constructor classification, trailing
commas, type-closer splitting, spans, argument advice and error priority are
retained. Deferred call/advice restoration is separate from the formerly
success-only group/index restoration. Host OOM propagates without syntax
diagnostics or partial public AST.
The parser reuses its work buffer across entries. Native block/control callbacks
save a base cursor; each re-entered driver processes/unwinds only entries above
that base. Active driver results and current work live in stable, separately
allocated frames reused by callback depth. No AST or queued pointer targets
relocatable work storage or a driver result. Dispatch of block/if/match callbacks
occurs outside the large per-step frame. An initial local-frame regression at
256 block/if levels was caught and repaired before commit. Final probes preserve
baseline formatted bytes at 64/256 block/if levels and 64 explicit-return levels;
explicit-return block/if forms now also format at 256, where the baseline aborts
(expression-parser-control-final.json and its raw outputs). This does not prove
arbitrary callback depth safe.
Scratch deinit/destroy is logical cleanup for caller arenas. Work capacity, driver frames, AST nodes and partial outputs retain physical caller-arena lifetime. Work/driver buffers are reused rather than allocated independently for every scalar entry. Allocation requests/failure-index outcomes need not match the old recursive implementation. AST output ownership and host error handling are unchanged.
The copied shallow former descent compares 4,160 expression/form/context/entry combinations, including complete ASTs, failures, positions, token mutations and advice/scope state. Type, lexical/advice, block/control and path helpers are shared, outside the oracle's independence. Separate public parser tests cover 32,768 mixed levels, every constructor span, siblings, type arguments and exact innermost E7001 advice. Re-entry/reuse tests poison scratch bytes before reading returned ASTs. Every recovering direct allocation failure checks host OOM, empty work, restored depth/advice/call scopes and no diagnostic; persistent backing failures through public parse check arena cleanup and no partial AST.
Final probes accept checks at 65,536 grouped levels and formatting at 65,536
mixed-call levels. At this checkpoint mixed-call checking still aborted at 1,024, in lowerer
call rather than parsing (expression-parser-final-probes.json and
expression-parser-*.after.final.*.stdout/.stderr). Permanent CLI tests separate
full accepted grouped/scalar programs with exact AIR/fuel from syntax-only
mixed/call inputs, and retain complete rejection records across commands.
Build, unit and Zig format checks pass. All 1,793 ordinary conformance cases pass
with terminal exit 0 and exact unique corpus coverage
(expression-parser-conformance.jsonl and its audit). The depth, grammar and
independent-error CLI suites pass 737/312/234 checks. The formatter passes 6,078
checks over 1,469 files (1,414 parsed, 55 existing syntax errors, 782 identical
AIR outputs). Frozen old/new CLIs retain exact exit/stdout/stderr on all 1,423
public source checks and 506 accepted lowerings
(expression-parser-cli-compatibility.json). These are compiler regressions,
not a full per-step GC pass or a model-capability measurement.
No normative, source/AIR format, feature, code, bundle, acceptance-limit or ownership/runtime rule changes. Q-061 remains open for block/control parsing, non-scalar lowering and the remaining liveness/read/assignment inventory. This increment has no external review yet.
Ordinary-call argument continuations
Ordinary local/module/std/generic call arguments now suspend in the scalar
expression driver. Callee normalization, signature/arity and named-from
checks still precede arguments; values are consumed left to right, exact type
checks precede the next argument, and temporary loans end after call as
before. Returned-borrow provenance, void/never exits, generated names, spans
and short-circuit CFG are unchanged (spec 15 §5, §19).
Stable call states and worklist backing belong to the caller's arena; they
remain until that arena is destroyed, including after an error. Keeping only
state pointers in continuations avoids large native frame copies. An initial
by-value implementation regressed nested assert diagnostics at 256 levels;
final before/after probes retain identical outputs for assert, blocks and
if at 16/64/256 (call-continuations-callback-pointer.json). This is bounded
regression coverage, not arbitrary builtin/control depth safety.
The copied shallow recursive call/scalar oracle compares emission, CFG, diagnostic priority, transfers, temporary cleanup and retained parents. Place, byte-materialization and builtin helpers are shared, outside its independence. Separate 32,768-level direct/mixed call tests and recovering direct/public plus persistent backing-OOM tests pass. Host OOM remains an error union, without a source diagnostic or public partial AIR; output-arena backing is freed.
Build/unit/format checks and all 1,793 ordinary conformance cases pass with
terminal exit 0 and exact unique coverage (call-continuations-conformance
artifacts). Borrow-return/array-argument/generic/static-function/non-value/
independent-error CLI suites pass 133/85/42/25/635/234 checks. Frozen old/new
CLIs retain exact exit/stdout/stderr for 1,423 public source checks and 506
accepted lowerings (call-continuations-cli-compatibility-pointer.json).
Full direct/mixed arithmetic/negation and generic call checks, lowerings and
formatting now accept through 65,536 levels; bounded runs retain exact AIR
values and independently counted fuel. All 262 focused call-depth CLI checks
pass against the frozen final binary (call-continuations-focused-depth.log),
including exact innermost E7002 records across check/lower/run/report/explore.
The former 1,024-level mixed-call
abort is repaired. A separate alternating
Box { n: expression }.n probe still aborts at 1,024 before and after this
increment, while 16 levels accept (call-followup-field-struct-probes.json).
Builtin/variant/place callbacks, aggregate/control lowering and remaining
liveness/read/assignment walks are further Q-061 work. No normative, language/
AIR format, feature, diagnostic, bundle, limit or ownership/runtime change;
Q-060 full per-step GC validation and Phase 6 exit gates remain separate.
This increment has no external review yet.
Struct construction and value-field continuations
Struct initializers and value-field receivers now share the scalar/call driver.
Provided duplicate/unknown fields still reject before any initializer; missing
fields reject when reached in declaration order. Each field's type and consuming
name check precede its initializer, followed by its exact operand check.
Receiver type/field lookup precedes value evaluation; the field annotation is
resolved afterward, as before. Nominal .len keeps its extra query, static
array length skips receiver evaluation, and slice length evaluates it.
Borrow/place loads and temporary endings retain their existing native helper.
Constructor/read states and worklist backing belong to the caller's arena, including on errors; only stable pointers are queued. Recovering direct/public allocation failures remain host OOM without source diagnostics or public partial AIR; persistent backing failures check arena cleanup. No ownership/verifier/ runtime, normative, format, feature, diagnostic, bundle or limit change.
The copied former struct/field/length descent, linked to the shallow scalar/call
oracle, passes 864 comparisons of values, constants, full emission/CFG, errors
and loan parents, including and/or inside constructors and field receivers.
Borrow-place and array/variant helpers are shared, outside this oracle's
independence. Separate 32,768-level struct/field and mixed scalar/call tests retain
exact instruction/span order. Build/unit/format checks and all 1,793 ordinary
conformance cases pass with terminal exit 0 and exact coverage, repeated after
cleanup (struct-fields-conformance-reviewed.jsonl and its audit). Call/ownership
CLI suites pass 635/49/348/133/302/152/42/234 checks; frozen old/new public source
checks and lowerings are byte-identical (1,423/506).
The focused struct/field CLI suite passes 302 checks on the frozen pre-cleanup
binary (struct-fields-focused-depth.log). Full checks/lowerings and formatter
parity accept pure, nominal-length and generic chains through 65,536 levels;
mixed negation/call chains accept through 32,768. At 65,536 mixed levels the
existing instruction limit rejects with E5101 (instructions per function,
max: 262144, found: 327682); lowering retains the complete AIR. Bounded runs
check exact values, fuel and source/AIR parity. Deep missing/duplicate/unknown
fields retain exact codes, reasons and positions across five CLI commands.
Final cleanup removes test-only wrappers and routes query OOM checks through
expr; it does not change production traversal. Thirty-six final pre/post
cleanup CLI comparisons at depths 0/16/1,024 retain exact exit/stdout/stderr
(struct-fields-cleanup-cli-parity.json).
Before/after native assert/block/if probes remain identical at 16/64/256
(struct-fields-callback-initial.json). The former alternating struct/field
abort at 1,024 is repaired. A separate array-literal probe accepts 1,024 but
still aborts at 4,096 in both binaries (struct-fields-followup-array-probes.json
and raw stdout/stderr). This is the next confirmed lowering path; array/variant/
place and control callbacks plus liveness/read/assignment scans still keep
Q-061 open. Q-060 full per-step GC validation and Phase 6 exit gates remain
separate.
Claude's independent read-only core review and narrower cleanup follow-up found
no concrete defects (/tmp/aji-struct-fields-review.md and
/tmp/aji-struct-fields-followup-review.md). The follow-up read current code
and its own diff but could not reopen the first report outside the repo. Neither
reviewer ran builds or tests; terminal checks above are separate evidence.
The follow-up's unverified CLI E5101 byte-parity assumption is covered by the
302-check run. Deep boolean/field interactions beyond the shallow oracle,
borrow-place depth and full Q-061 completion are not established.
Array list and repetition continuations
Array initializers now share the scalar/call/struct/value-field driver. Lists
retain the 1..64 size check before children, contextual or first-element
inference, left-to-right explicit consumption, and element-position checks
before exact-type checks. Their result uses actual element type and length.
Repetitions retain the 1..2^32 bound before the operand, non-consuming operand
evaluation, then member/Copy checks and array.splat (spec 15 §5, §16).
Queries, CFG, names, spans, loans and host OOM policy are unchanged. Stable list
states and worklist buffers have caller-arena lifetime, including on errors;
public backing-failure tests observe arena destruction, not list-deinit frees.
No normative/format/feature/code/bundle, ownership/runtime or limit change.
The copied former array descent joins the independent shallow scalar/call/
struct/field oracle. It passes 1,036 comparisons including inference, consuming
names, borrow-before-Copy, position-before-type priority, void/never, boolean
CFG and synthetic list-size boundaries. Property/emission/place helpers and
non-operand fallback leaves remain shared. Separate 32,768-level tests cover
list/repetition/call alternation with bounded types, an inferred outer list
resuming at an unsuffixed or erroring sibling, exact emission/spans, and innermost
errors.
Recovering allocation sweeps include 64 inputs and an outer repetition;
persistent public failures check arena cleanup and no partial AIR/diagnostic.
The final error-sibling test passes after entry-by-entry prefix comparison:
a fixed-size-array deep comparison initially overflowed the test helper's native
stack (array-continuations-unit-siblings.log, final terminal exit 0).
Build/unit/format checks and all 1,793 ordinary conformance cases pass with
exact coverage (array-continuations-conformance.jsonl and its audit).
Array-literal/argument/linear/nonvalue/inferred-content/independent-error CLI
suites pass 152/85/49/635/302/234 checks. Nine before/after assert/block/if
probes remain byte-identical through 256 (array-continuations-callback-parity.json).
The former pure-list abort at 4,096 now accepts
(array-continuations-initial-probe.json). Pure nested types produce quadratic
AIR text; this does not claim arbitrary-sized successful aggregate output.
The focused CLI suite passes 246 checks (array-continuations-focused-depth.log):
list/repetition calls accept through 65,536, mixed scalar/struct/array calls
through 32,768; at 65,536 mixed levels the existing E5101 instruction limit
reports max: 262144, found: 458754. Both pure forms check at 4,096; bounded
runs check exact values/fuel and AIR parity, formatting remains a fixed point,
and deep unknown/bound errors retain exact CLI records. Frozen public source
checks/lowerings are byte-identical (1,423/506;
array-continuations-public-parity.json). These are straight-line shapes;
loop/liveness/assignment callers are not thereby validated.
Claude's read-only core review found no production defect, but identified two
fixture gaps: an unbound borrow name and missing position-before-type cases.
Both were corrected, with additional sibling/inference and OOM coverage.
The read-only follow-up found no concrete defects and confirmed the CLI counts,
fuel and run-record shape (/tmp/aji-array-continuations-review.md and
/tmp/aji-array-continuations-followup-review.md). Neither reviewer ran tests;
the final test-only error-sibling addition follows that review. Separate
variant-payload/call probes accept 16 levels but abort in prepareCall →
variantValue → consuming at 256 in both binaries (array-followup-variant-probes.json).
Variant/place/builtin/control callbacks and liveness/read/assignment scans keep
Q-061 open; Q-060 full GC validation and Phase 6 gates remain separate.
Enum-payload continuations
Enum payloads now share the scalar/call/struct/array/value-field driver.
Enum/variant lookup and arity still precede arguments. Each payload annotation
is resolved immediately before its consuming-name check and evaluation; exact
type checking precedes the next payload. Argument order, names, CFG, spans,
loans and delayed enum.make are preserved (spec 15 §5, §16). Built-in errors
and empty named variants finish immediately. A narrow private VariantDispatch
is widened explicitly at the call boundary. Queued states are stable caller-
arena allocations; their backing remains until arena destruction, including
on errors. Host OOM propagates without language diagnostics or public partial
AIR. No normative/format/feature/code/bundle/limit or ownership/runtime change.
The copied old constructor joins the shallow recursive oracle, passing 720 comparisons including lookup/arity priority, linear transfers, borrow/bytes, boolean CFG, arrays and failure after a consumed argument. Type/emission/place helpers and non-operand leaves remain shared. Deep tests cover 32,768 variant/ call levels with one or two payloads, exact sibling and constructor spans/order; recovering direct/public and persistent backing failures cover nonempty, empty and built-in constructors, arena cleanup and no swallowed allocation.
Build/units/format and both initial/final ordinary conformance runs pass with
exact coverage of all 1,793 cases (variant-continuations-conformance-final.jsonl
and its audit). Targeted error/generic/linear/nonvalue/inferred-content/
independent-error suites pass 26/42/49/635/302/234 checks; error/generic suites
are repeated on the final binary. Final public check/lower outputs are exact
(1,423/506; variant-continuations-public-parity-final.json). Nine bounded
assert/block/if comparisons remain exact through 256, without a frame-size
claim. The former enum-payload abort at 256 now accepts through 16,384.
The frozen initial core passes 331 focused depth CLI checks: ordinary/two/
generic chains accept through 65,536, mixed scalar/struct chains through
32,768. At 65,536 mixed levels the existing instruction limit reports E5101,
max: 262144, found: 458754. Exact bounded fuel/values, AIR and formatter
parity, and deep lookup/arity error records are checked. Final supplemental mismatch/empty-constructor checks pass 66 cases
(variant-continuations-supplemental-depth.log), including exact type-error
positions and empty-leaf checking/formatting through 65,536 with bounded
values/fuel/AIR parity. Pure recursive-type construction, loop/liveness and
arbitrary native callbacks are not established.
Read-only Claude core/follow-up reviews found no semantic defects
(/tmp/aji-variant-continuations-review.md and
/tmp/aji-variant-continuations-followup-review.md). Comments/dispatch and
fixture gaps were corrected; direct borrow/bytes, deep type-error and empty
CLI cases follow the review. Neither reviewer ran tests. Separate nested-assert
probes still abort at 1,024 before and after (variant-followup-assert-probes.json),
in prepareCall → expr. Builtin/place/control callbacks and liveness/read/
assignment walks keep Q-061 open; Q-060 full GC and Phase 6 gates remain separate.
Boolean builtin operand continuations
assert and assume now evaluate their non-consuming boolean operand in the
shared expression driver (spec 15 §4–§5; unsafe boundary: spec 13 §6). Arity precedes the child; its exact
span/type check precedes unsafe registration, emission and the void result.
Dispatch priority, names, CFG and errors remain unchanged. Stable continuation
states and work buffers retain caller-arena lifetime. Host OOM propagates
separately from source problems, including allocation while rejecting a
program. No normative, format, feature, code, bundle, limit or ownership/runtime
rule changes. The preserved invariant is that only a checked boolean reaches
the instruction. Verifier effect requirements and deterministic runtime rules
remain unchanged: source/layer6/unchecked.aji is valid and
source/nonvalue_operands/assume.aji rejects E7005; supplemental false-input
runs retain T0002/T0009. Public output parity establishes compatibility.
The copied old boolean builtin bodies join the shallow oracle, including scalar/boolean/call, aggregate/field/variant consumers and non-value operands. Shared control/place/emission/type helpers limit its independence. Deep units cover 32,768 ordinary-call operands and alternating assert/assume/call errors, exact spans, counts and unsafe registration. Public recovering/persistent OOM sweeps cover accepted and rejected programs and arena backing cleanup. Final expanded unit validation, including distinct-callee spans and exact counters, passes.
The ordinary conformance run passes all 1,793 cases with exact coverage
(boolean-builtin-conformance.jsonl and its audit). Frozen public check/lower
outputs are exact (1,423/506; boolean-builtin-public-parity.json); targeted
nonvalue/linear/independent-error suites pass 635/49/234 checks. The focused CLI
block passes 282 checks: nested void errors and ordinary-call operands through
65,536, exact diagnostic positions and cross-command records, AIR/formatter
parity, and successful values/fuel through 1,024. Supplemental trap/hosted/
feature and mixed deep arity/type validation passes 69 checks
(boolean-builtin-supplemental-depth.log). Trap/hosted/fuel runs are bounded
at 1,024; the larger depths check/lower/format or reject. These focused runs
are not a new full run of source_expression_depth.py.
Claude's read-only core/follow-up reviews found no production defect
(/tmp/aji-boolean-builtin-review.md and
/tmp/aji-boolean-builtin-followup-review.md). Fixture gaps were corrected;
final distinct-callee-span/counter assertions follow the review. Neither
reviewer ran tests. Dispatch/query shadowing was not separately validated;
mixed deep-error call frames are descended but not all resumed. A repetition
fixture requires the prepared nominal-property module and is tested there. Separate probes of
own.free, own.take and region.destroy retain JSON at 16/256 but abort at
1,024 before and after (boolean-builtin-callback-probes.json); the current
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. At this consuming checkpoint, 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 aborted 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.
Atomic operand continuations
Atomic new/take and ordinary store/RMW value operands now share the expression driver (spec 15 §12; spec 04). Arity precedes children; take checks explicit consumption, while new has no type hint. Updates retain cell/ordering-before- value priority, exact type checks and temporary-borrow endings after emission. Load/fence and multi-result compare-exchange retain their existing paths. The invariant is unchanged: cells are linear and atomic operations use a shared borrow with explicit ordering. Verifier/effect/runtime rules, instruction text, names, spans and CFG are unchanged; no default ordering, new feature/code/ format/bundle/limit or ownership/concurrency rule. Public output parity and existing positive/rejected atomic conformance cases establish compatibility.
Copied ReferenceAtomics bodies use the former recursive operand path;
shared leaf/place/type/emission helpers limit oracle independence. Shallow
comparisons include bool/integer cells, temporary/bound borrows, orders, arity,
non-values and scalar/aggregate/CFG consumers. Deep units pass 32,768 new/take
pairs and RMW operands with exact counts/spans. Recovering/persistent public
OOM sweeps check successful and E7003/E7005/E7006 baselines, no swallowed OOM
and backing cleanup. States and work buffers retain caller-arena lifetime.
Build/units/format pass.
Ordinary conformance passes all 1,793 cases with exact coverage
(atomic-operand-conformance.jsonl and its audit), including schedule cases;
frozen public check/lower outputs are exact (1,423/506). Atomic-access/nonvalue/
independent-error suites pass 33/635/234 checks. Focused CLI validation passes
270 checks in two corrected subset runs: pair 57 and mixed/update/rejection 213
(atomic-operand-pair-depth.log, atomic-operand-followup-depth.log). New/take
pairs and temporary shared-borrow updates accept through 65,536; mixed
call/negation/atomic chains accept through 32,768 and reach the existing E5101
instruction limit at 65,536 (max: 262144, found: 327683). Six error families
retain exact code/position/priority through 65,536 across check/lower/run/report/
explore. Formatter fixed points and lower parity pass; source/AIR results and
exact fuel are exercised only through 1,024. Existing source/layer10/sc_only.aji
passes 30 schedules; source/layer10/reject/take_while_lent.aji retains E4101.
Read-only Claude core/follow-up
reviews found no production defect (/tmp/aji-atomic-operand-review.md and
/tmp/aji-atomic-operand-followup-review.md); fixture arithmetic/limit and
span/type gaps were corrected. Neither reviewer ran tests. The mixed fixture
uses a function call as its leaf, so signed-literal folding does not erase the
first negation.
No new whole-expression-suite, arbitrary callback or runtime-depth claim.
At this atomic checkpoint, task.join still aborts at 1,024 before and after
(atomic-operand-next-probes.json); bounded 16/256 records remain equal.
Other builtin/place/control and liveness walks, Q-060 full GC and Phase 6
exit gates remain open.
Task join operand continuations
Task.join now uses the shared consuming operand driver (spec 15 §7; spec 04 §33–34): arity precedes children, named linear inputs still require move, the operand receives no type hint, and its task type is checked before emission. Void joins emit without a result; other joins define the same result name/type at the same call span. Tasks remain function-bound; join consumes the handle and returns its loans. Scope/result/Send/effect/verifier/runtime rules, scheduler behavior, AIR, diagnostics, bundle and limits are unchanged.
ReferenceTaskJoin copies the former body and recursively consumes through
ReferenceCalls; shared leaf/place/type/emission helpers limit independence.
Shallow comparisons cover scalar/void/linear/aggregate results, moves,
non-values, wrappers and error priority. Raw helper task results containing
borrows/tasks/scopes deliberately compare lowering only, not legal programs;
spec 04 §33.1 still rejects them. Deep 32,768 helper-call operands and rejected
join chains retain exact spans/counts/first errors. Recovering/persistent public
OOM sweeps cover scalar/void success and E7003/E7005, with host-error separation
and backing cleanup. Work states retain caller-arena lifetime.
Build/units/format, all 1,793 ordinary conformance cases with exact coverage,
frozen public checks/lowerings (1,423/506), lifetime checks (188), related-location
checks (409) and CFG-provenance checks (146) pass. Focused CLI passes 522 checks:
valid scalar/void joins with call operands and pure/mixed rejected join chains
through 65,536, exact formatted positions, source/AIR/fuel checks through 1,024
and three schedule seeds through 16. Existing source/linear/task_loan_join.aji
passes eight schedules; source/layer7/reject/scope_unjoined.aji retains E4301.
Read-only Claude core/follow-up reviews found no production or fixture defect
(/tmp/aji-task-join-review.md, /tmp/aji-task-join-followup-review.md); stale
comment/checkpoint wording is corrected. Neither ran tests. Follow-up inspected
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.
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
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.
At this spawn checkpoint, nested mutex.take(mutex.make(...)) accepts at 16
but aborts at 256/1,024 with no JSON before and after the spawn repair.
task-spawn-next-probes.json and matching raw stdout/stderr retain the evidence.
Mutex operands were the next confirmed callback repair; other walks remained open.
Mutex make/take operand continuations
Mutex.make/take now use the shared consuming driver (spec 15 §7; spec 04 §40), preserving arity, explicit-move, no-hint operand descent, void/never content rejection, element constraints and input-span type errors, followed by unchanged wrapping/result names/emission. No-live-borrow rules remain verifier-owned (E2101; E4101 for a live task loan); make is unlocked with no allocation and take has no unlock/destructor. No semantic/effect/feature/ AIR/bundle/limit/runtime/scheduler change. Work states keep arena lifetime.
The copied former ReferenceMutex uses recursive oracle consuming descent,
sharing leaf/place/type/emission helpers. Shallow comparisons cover 36 expressions × 11 wrappers (396 forms),
each under three hints, including borrowed/owning/aggregate/nonvalue operands, moves,
CFG and error priority. New-driver tests cover 32,768 make/take pairs with
exact operation spans and a deep unknown leaf emitting nothing. Six public
accepted/rejected recovering/persistent OOM sweeps preserve host errors,
absence of partial AIR and actual backing cleanup on arena destruction.
Build/units/format pass. All 310 focused CLI checks complete: scalar check
through 65,536; mixed id/negation check through 32,768 then existing E5101 at
65,536 (327683 main instructions, 327684 whole-module). Lower/fmt exact AIR
parity reaches 65,536; formatted accepted checks repeat only through 1,024.
Quantum-one/seed-7 source/AIR runtime and exact fuel boundaries reach 1,024,
without scheduler records because these operations are not scheduling points.
Eight rejected families preserve code/fields/positions and identical
check/lower/run/report/explore JSON, plus formatted positions, through 65,536.
Existing valid source/linear/mutex.aji and rejected
source/inferred_content/mutex_void.aji retain their contracts. Lifetime,
related-position and CFG suites pass (188/409/146), and all 1,793 ordinary
conformance files have exact successful coverage. This includes existing
source/layer8/reject/take_while_borrowed.aji, its E2101 rejection twin and
multi-task mutex examples; this increment adds no new mutex stress experiment.
Frozen public check/lower parity passes (1,423/506, byte-exact) over
tests/conformance/**/*.aji; task-mutex-public-parity.json/.log record it.
Read-only Claude core review found no
production or fixture defect; final read-only follow-up agrees after reading
the final diff, current code and listed evidence. Neither review ran tests,
proved every remaining path or independently counted every gate. Final
follow-up documentation suggestions are integrated. Its filename
collision observation is corrected with distinct leaf-based names; the
48-check two-family subset passes after that filename-only change.
The shallow oracle compares value/error, problem/unimplemented, blocks, allocations/constants/bindings, counter/current block, feature-use set, linear and constant flags and borrow-parent mappings; other Lowerer state is unverified. It covers return-expression fixtures, not every statement context. Deep unit spans/errors test only the new scalar driver; id/negation alternation is CLI coverage. OOM sweeps compare failure-free result tags, with baseline codes 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.
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.
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.
Shared control parser continuations
At HEAD 9534359, nested block/if expressions parse and check at 16/256
levels but abort in the parser at 1,024; a separate else-if chain formats at
1,024 but aborts at 16,384. The shared parser driver now queues block,
statement, condition, if/else-if, match/arm, select, loop, scope, shield and
lock children alongside expression continuations. All use one stable result
frame; the expression-returning entry API cannot select control-only outputs.
Unused recursive-entry wrappers and multi-frame machinery are removed.
This is a traversal repair: tokens, AST/spans, statement/tail/discard boundaries,
block_statement, arm-kind selection, error priority and borrow advice retain
their existing rules. Conditions/call advice restore on all exits; for/lock
prefix and group/index restoration remains success-only, as before. Host OOM
propagates without diagnostic conversion or a public partial AST. Work buffers
and AST allocation retain caller-arena lifetime; deinit does not promise
physical early release of arena storage. Spec/reference, AIR, verifier,
ownership/concurrency/runtime, diagnostic codes, bundles and acceptance limits
are unchanged. The existing grouped-statement discrepancy is logged separately
as Q-062, with old/new accepted CLI evidence.
An independent copy of the former mutually recursive control/expression parser compares shallow ASTs, mutated token buffers, position/end/failure and scope state. Token/type/pattern helpers remain shared, an explicit oracle limitation. Added checks cover per-token EOF/deletion sweeps with outer borrow advice; every control child form's invalid leaf; 32,768 mixed/block and ungrouped-condition levels; 32,768 statements, match/select arms and else-if links; control-heavy scratch poisoning; recovering and sticky per-call OOM above the arena, including grown queues and late failures. A physical backing tracker measures scalar, block and mixed parsing and verifies complete backing release after arena teardown. Expanded and final follow-up units pass, including both OOM modes with resize/remap disabled to inject every growth. The fixed failure-sweep guards are test bounds, not language limits.
At 32,768 levels, measured live arena backing allocations peak at:
| Input | Source bytes | Peak backing bytes |
|---|---|---|
Scalar not chain |
131,126 | 89,887,292 |
| Nested blocks | 131,127 | 139,565,186 |
| Mixed 17-form tree | 805,722 | 692,273,454 |
Work items are 448 bytes, compared with the reconstructed former
expression-only union's 424 bytes; the single frame is 1,992 bytes. The former
payload layouts were checked unchanged, but this is not a before/after peak
measurement. The 24-byte item growth does not justify boxing control payloads
and adding allocation/aliasing paths in this repair. The large stress peaks
are informational, not evidence of efficient memory use or a portable bound.
They include tokenization, owned token duplication, AST, retained work buffers
and arena slack; they exclude source text, allocator overhead and downstream
passes. Backing allocation lengths are distinct from resident process memory.
The separate 12-form, 32,768-depth hosted rejection source is 857,464 bytes;
one Linux/Debug check measured 350,804 KiB max child RSS. Its six-command
comparisons run sequentially. This does not bound other environments.
The focused standalone CLI block passes 127 calls: block/if formatting and
fixed points through 1,024; else-if through 65,536; bounded check/lower through
256 and source/AIR runtime through 16; syntax-only control contexts at 256;
and exact E7001/boolean-negation records for six public commands through
32,768 with CRLF/UTF-8 source. It is an exact extraction of the new block in
tests/hosted/source_expression_depth.py, not a run of that whole accumulating
suite. Build/format, frozen public check/lower byte parity (1,423/506), grammar
(312), formatter (6,078), independent-error (234) and repair-advice (299)
checks pass. All 1,793 ordinary conformance files pass with exact unique
coverage; no file is omitted or counted twice.
Claude's core read-only review found no demonstrated production divergence;
its API/dead-path, mutation, deep/wide, scratch and OOM suggestions are addressed
above. Read-only follow-up/final reviews also found no production defect
within their recorded scope; they ran no tests. Final review clarifications:
peak measurements are informational and the historical work-size reconstruction
is explicit; the hosted memory-heavy scope is documented. Its counter concern
does not reproduce: cli increments the global counter and the standalone
extraction records all 127 calls. Current frame/queue poisoning does not cover
abandoned arena buffers, a retained test limitation.
The new parser exposes the next confirmed failure: full checking still aborts
at 1,024 nested block/if levels in blockBodyWant/ifExpr, with empty stdout.
Lowering/control/liveness, Q-060 full GC validation and Phase 6 exit gates stay
open.
Remaining work
Follow-up checks accept 16 parenthesized/mixed-call levels but abort
with empty stdout at 1,024. A qualified enum variant returns E7002 at 16
components but aborts in Parser.exprPath at 16,384. Raw evidence is
generic-followup-depth-probes.json and generic-followup-*.stdout/.stderr.
Generic transformation, its path callback, Parser.exprPath and the shared
expression parser above are now repaired. The preceding follow-up records are
historical checkpoints, not current parser failures. The remaining inventory
includes confirmed block/if lowerer failures and inspection-only risks:
| Production path | Evidence and next scope |
|---|---|
| Parser block/statement/condition and if/match/select expression entry | Shared control/expression continuations are repaired above. Historical parser aborts no longer describe the candidate; parser-only deep coverage does not prove downstream AST traversal. |
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 inspected and exercised by deep syntax-only probes. This inventory does not 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, mutex and scalar index operand increments have the scoped reviews recorded above. The raw-place increment records its core and final follow-up reviews explicitly.