Files
aji/docs/design/open-questions.md
T

46 KiB
Raw Blame History

Open Questions

Non-normative log of gaps and ambiguities in the draft spec. Each entry names the phase that is blocked until it is answered. Close an entry by changing the spec (or accepting an RFC) and recording the resolution here; do not delete entries.

Status values: open, resolved.

ID Status Blocks Question
Q-001 resolved P0 Text AIR grammar
Q-002 open P0 Instruction contract tables
Q-003 resolved P0 Diagnostic codes for parse errors
Q-004 resolved P0 Observable trap semantics
Q-005 resolved P0 Verifier resource budget values
Q-006 resolved P0 Target description for usize and layout in the interpreter
Q-007 resolved P0 Integer edge cases besides overflow
Q-008 resolved P0 How hello writes output before capabilities exist
Q-009 resolved P1 Borrow lifetimes in AIR
Q-010 resolved P1 Region generation checks: static, dynamic, or both
Q-011 resolved P2 Effect hierarchy and discharge
Q-012 resolved P2 Capability representation and host instantiation
Q-013 resolved P3 Deterministic select rule and scheduler seed
Q-014 resolved P3 Send/Share derivation for aggregates holding capabilities
Q-015 resolved P5 Operational weak-memory model for the interpreter
Q-016 open P0 Floating-point determinism
Q-017 open P8 Replay file format
Q-018 resolved P2 Runtime diagnostics (traps) vs verifier diagnostics
Q-019 resolved P3 Non-terminating programs in test tooling
Q-020 resolved P2 Size bound for SSA array values
Q-024 resolved P5 Memory-model clarifications found by the independent oracle
Q-025 resolved STD-5 Array construction from complete element values
Q-034 open P6-11 adoption Source borrow-return calls (implementation prepared; RFC 0036 Proposed)
Q-035 resolved STD-5 Whole-value linear aggregates
Q-036 resolved STD-6a Dynamic initialized linear buffer storage and drain
Q-038 resolved STD-6d.2 Pure construction of built-in errors
Q-039 resolved STD-6d Explicit static function parameters
Q-041 resolved P6-2 task block forms Source scope-handle value bindings

Q-001 — Text AIR grammar

Spec 07 shows illustrative AIR but no grammar. Undecided: comment syntax; constant spelling (const.u64 0?); type suffix convention on opcodes (add.checked.u64 vs typed operands); module header and version/feature-bit declaration (spec 00 §5 requires them); how types, structs and enums are declared; canonical whitespace for the serializer.

Proposed home: docs/reference/air-text.ebnf plus normative text in spec 07.

Resolved (P0-1): docs/reference/air-text.ebnf and spec 07 §8. Comments use ;; opcodes carry the type suffix (add.checked.u64, const.u64 5); the module header is four lines (module, air, lang, features).

Q-002 — Instruction contract tables

Spec 07 §4 and RFC 0004 require per-opcode contracts (operands, results, ownership/borrow transition, memory set, sync, effects, capabilities, traps, transfer function, interpreter behavior). None are written. Each phase must write the contracts for the opcodes it introduces before implementing them.

Proposed home: a normative docs/spec/07-air.md appendix or docs/spec/air/ per instruction family.

Partially resolved (P0-3): format-version-0 instructions are specified in spec 07a. Stays open for the instructions of later phases.

Q-003 — Diagnostic codes for parse errors

The registry has no codes for malformed AIR text. Options: a new E0xxx range for syntax, or E50xx under AIR/verifier.

Resolved (P0-1): new range E0xxx (E0001–E0006) for text and module errors. Undefined values and unknown block labels use the semantic codes E5001 and E5002.

Q-004 — Observable trap semantics

Spec 01 §6 defines a trap as termination "according to runtime policy". The interpreter needs: trap kinds (overflow, assert, bounds, explicit, …), how a trap is reported (exit status, structured record), and whether the trap location is observable.

Resolved (P0-2): spec 01 §6. Traps terminate the program and produce a record with a stable T0xxx code, function, block and instruction index.

Q-005 — Verifier resource budget values

Spec 08 §7 says budgets are "configured/spec-defined". A user-configurable budget would let a flag change which programs are accepted, which conflicts with "no compiler flags that change language semantics". Proposal: fixed spec-defined budgets per profile, reported in E5101.

Resolved (P0-2): fixed, non-configurable limits in spec 08 §7.

Q-006 — Target description in the interpreter

usize/isize match the target pointer width (spec 02 §1) and struct layout is implementation-defined (spec 02 §7). For determinism the interpreter must run against an explicit target description. Undecided: format, default, and whether it is part of the AIR module (spec 00 §5 "optional target requirements").

Resolved (P0-2): spec 09 §9. Target description with pointer_bits; the interpreter defaults to air64. usize/isize are never widen operands, so verification is target-independent.

Q-007 — Integer edge cases besides overflow

Unspecified: division and remainder by zero; signed MIN / -1; shift amounts ≥ bit width; signed right shift; casts between widths and signedness (spec 01 §2 forbids implicit conversion but explicit cast semantics are absent).

Resolved (P0-2): spec 02 §2.1 and spec 07a.

Q-008 — hello before capabilities

Phase 0's exit criterion runs AIR hello, but io.stdout_write needs cap<io.write> (Phase 2). Options: bring a minimal io.write capability and intrinsic into Phase 0, or define Phase 0 hello as a function whose return value the test harness checks.

Resolved (P0-2): Phase 0 hello is a @main that returns a value which aji run reports (spec 07a "Run result"). A hello that writes to stdout moves to P2-11, after slices (P1) and capabilities (P2).

Q-009 — Borrow lifetimes in AIR

Spec 03 §4 shows 'a lifetimes in source; AIR has borrow.ref/borrow.end but no notation for lifetime relationships across function signatures. Undecided: explicit lifetime parameters in AIR signatures vs scope-based borrows only.

Resolved (RFC 0005): second-class borrows; returns use from %param; explicit borrow.end with path linearity (spec 07 §8.8, spec 08 §11).

Q-010 — Region generation checks

Spec 03 §8.1 allows removing generation checks "when statically proven unnecessary", implying a dynamic check otherwise; E2104 implies static rejection. Undecided: which cases are static errors, which compile to runtime checks, and what the runtime failure is.

Resolved (owner decision, RFC 0005): static checks only; no runtime generation checks in safe code (spec 03 §8.1). Specified in detail with regions in Phase 2.

Q-011 — Effect hierarchy and discharge

Spec 05 §2 lists effects such as atomic and atomic.weak, io.write and fs.write. Undecided: whether effects form a hierarchy (does atomic cover atomic.weak?), and what a "verifier-recognized boundary" that discharges an effect is.

Resolved (RFC 0006): effects are flat atoms from a closed registry; no implication and no discharge in format 0; function pointer types must carry effect sets (spec 05 §9).

Q-012 — Capability representation and host instantiation

Binary AIR has a CAPABILITY_TABLE (spec 07 §6). Undecided: how capabilities appear in text AIR, how an entry point declares the capabilities it needs, how the host/interpreter grants them, and how narrowing (spec 05 §4) is expressed.

Resolved (RFC 0006): cap<K> is an opaque, copyable reference to a shared host authority object; it enters only as a named @main parameter bound by --grant name=kind[:scope]; cap.narrow is the only, fallible, transformation; failed instantiation is not_instantiated (exit 6) (spec 05 §10).

Q-013 — Deterministic select and scheduler seed

Spec 04 §14 and spec 11 §6 require a stable rule in deterministic mode but do not define it. Also undecided: scheduler seed format and which choice points are recorded.

Resolved (RFC 0012, spec 04 §39): ready arms chosen by a draw from the schedule generator (not textual order); task choices and arm choices share one stream and one choices count. The schedule seed was settled by RFC 0011.

Q-014 — Send/Share for aggregates holding capabilities

Spec 02 §6 derives properties structurally; spec 05 §5 says capability types define their own transfer rules. Undecided: the derivation for a struct mixing ordinary fields with Local or move-only capabilities.

Resolved (RFC 0011): Send/Share are structural; every capability kind is Send and Share, so an aggregate holding capabilities is Send/Share exactly when its other members are (spec 04 §35).

Q-015 — Operational weak-memory model

The SB litmus test requires the interpreter not to forbid r1=0, r2=0 under relaxed ordering. Undecided: which executable model to use (store buffers, a promising-style semantics, or an axiomatic checker over recorded executions) and how much of C11's model to adopt.

Resolved (RFC 0015):

  • The normative model is axiomatic: the Aji RC11 profile of spec 04 §20, including NO-THIN-AIR (sb ∪ rf acyclic).
  • An enumerator derived from the axioms is the executable oracle (spec 04 §20.5).
  • The interpreter is an operational machine. For every program, observed ⊆ allowed. For the finite normative litmus corpus only, observed_exhaustive = allowed (spec 04 §20.5, §42).
  • Weak choices are draws from the schedule stream.
  • Promises are not needed, because NO-THIN-AIR forbids the cyclic load-buffering outcome.

Q-016 — Floating-point determinism

f32/f64 are listed in spec 02 §1 but reserved by spec 07 §8.4: AIR rejects their use with E0006, reason reserved_type, and .aji 0.1 exposes no floating-point types. They do not create a determinism gap in currently accepted programs. This question remains open for future activation: NaN payloads, fused operations, rounding mode and denormals need explicit rules before floating point can participate in deterministic replay.

Q-017 — Replay file format

Spec 11 §4 mentions .ajr files without a format or compatibility rule.

Moved to Phase 8 by RFC 0015 (D13). The deterministic profile already reproduces runs from seeds and quantum. A replay file for hosted or native runs must record scheduler choices, reads-from choices, modification orders and the SC order.

Q-018 — Runtime diagnostics

The error registry covers verifier/compiler errors. Traps and runtime check failures (bounds, generation, overflow) need stable machine-readable records too, either in the same registry (e.g. R codes) or a separate one.

Resolved (P0-2): traps share the registry in a separate T0xxx range (docs/reference/error-codes.md).

Q-019 — Non-terminating programs in test tooling

A program may legitimately loop forever, so the language cannot bound execution. The conformance runner and ajid still need a way to stop a run without making the outcome depend on wall-clock time. Options: a deterministic step budget that is a tooling parameter (reported as "budget exhausted", never as a language trap), or explicit fuel: in test headers. Must be decided before scheduler stress tests (P3), which multiply run counts.

Resolved: deterministic instruction fuel (spec 11 §7). Wall-clock time is never used to determine semantic test termination. Fuel exhaustion is an execution-runner outcome (limit_exceeded, CLI exit code 5), not an Aji trap.

Q-020 — Size bound for SSA array values

Frame storage is bounded (max_local_frame, spec 08 §11.5), but an SSA value of type array<T, N> (for example from array.splat) is bounded only by N ≤ 2^32. A module can therefore ask the interpreter for gigabytes in one instruction, and the outcome then depends on host memory. Options: apply the same accounted-size limit to every type in the module (E5101), or a separate max_value_bytes. Needs an owner decision; changing it later would turn accepted modules into rejected ones, so it should be settled before format 0 is released.

Resolved (owner decision, DD-015): max_value_size = 1 048 576 bytes bounds the accounted size of every materializable type in a module (spec 08 §7.1); max_local_frame stays a separate limit. Both are normative, deterministic, independent of host memory and reported as E5101. Accounted sizes use checked arithmetic; overflow is E5101. Total allocation is a Phase 2 concern (allocation capabilities and runtime limits).

Q-021 — @main parameter names that are .aji keywords

Parameter names are preserved by lowering and are the binding points for grants (spec 15 §2). An AIR program whose @main has a parameter named after a .aji keyword (%in in tests/conformance/phase2/run/echo_stdin.air) has no source equivalent with the same instantiation contract, so a grant in=io.read cannot target a .aji program. Options: accept the restriction (keywords are not parameter names; AIR programs meant to have a source twin avoid them), or a raw-identifier spelling for this position. Not urgent; noted when the source/AIR equivalence test for echo_stdin had to drop its equivalent: reference.

Resolved (owner decision): no language change. For runtime grants the source parameter name is what matters, not identity with a hand-written AIR program: the source program names the parameter input and is run with --grant input=…, and that AIR test simply has no equivalent: twin. Escaped identifiers (`in`) are deferred until there is a real need, because they grow the grammar for a rare case.

Q-022 — Byte strings dominate the source/AIR size metric

A byte string lowers to one local.zero, then a borrow, index, store and end per non-zero byte, because format 0 has no byte-array constant. In the Layer 6 programs this makes up most of the AIR (hello: mechanical_air_eliminated 0.94). The metric then measures a representation cost of format 0 more than the mechanics an agent would otherwise write. Options for P6A-9: report the metric both with and without byte-string materialization, or count each byte string as one AIR construct. A byte-array constant in AIR would be a format change (spec 07 §8.7) and is out of scope for 6A.

Resolved (owner decision): report both. mechanical_air_eliminated_raw counts all AIR actually generated and stays the main engineering metric. mechanical_air_eliminated_normalized counts each byte-string materialization as one logical constant operation, under one fixed rule for every program (spec 15 §11).

Q-023 — ref of a whole array passed to a ref<[T; N]> parameter

In .aji a borrow of a whole array written as an argument (f(ref a), a: [u64; 4]) is always lowered as a slice (slice<u64>), so a function declared with a parameter ref<[u64; 4]> cannot be called with ref a (E7005). Spec 15 §5 says that binding a borrow of a whole array (ref r = a;) gives a slice. It does not say what an argument borrow gives, so the frontend's choice is not specified. Options: the argument borrow follows the parameter type (array borrow for ref<[T; N]>, slice for slice<T>), which is a small amount of inference from a known signature; or keep slices only and state it in spec 15. Found while writing the interpreter memory test; not urgent.

Resolved (DD-021, spec 15 §5): an explicit temporary borrow preserves an array when the known ordinary-call parameter is an array borrow. Exact type/length/mode checks remain; slices, bindings, byte-string shorthand, retained origins and task loans keep their existing rules.

Q-024 — Memory-model clarifications found by the independent oracle

The independent author of tools/litmus/enumerate.py (P5-1a) worked from spec 04 §20 only. It reported five points the text leaves implicit. For each, the author chose the RC11 reading, and all 20 corpus tests agree with the stated sets under it. Proposed clarifying text for spec 04 §20, for owner approval:

  1. RMW events (§20.1–§20.2). An RMW consists of a read event and a write event of the same location, related by rmw, with the read immediately sb-before the write. Both carry the RMW's ordering. A failed compare-exchange is a single read with the failure ordering and is not in rmw.
  2. Initial writes (§20.1). The initializing write of a cell is non-atomic (it starts no sw), first in mo, and hb-before every event of every task that can reach the cell.
  3. Primitive orders (§20.3). "A total order consistent with hb" means that no hb edge between two operations of one object points backwards in that order.
  4. Channels (§20.3). A channel's messages are received in send order (FIFO), and each message is received at most once. Capacity is not yet modelled. For a bounded channel, a later RFC must say whether a receive that frees a slot synchronizes with the send that was waiting for it. The litmus format has no capacity.
  5. Release sequence (§20.2). rs = [W] ; (rf ; rmw)* is deliberately the C++20 form, without RC11's same-thread later stores. Spec 04 §20.2 says "C++20" in the comment; no change is needed beyond keeping it explicit.

Points 1–3 and 5 are editorial. Point 4 fixes FIFO, which spec 04 §38 already implies for the interpreter, but leaves capacity synchronization open.

Resolved (owner, 2026-10-06; spec 04 §20.1–§20.3).

  1. A successful RMW or compare-exchange is a read event plus a write event plus an rmw edge. A failed compare-exchange is a read only.
  2. A distinguished initialization write. It precedes every other write in mo, happens-before every program access, and is a service event of the model, not a source-level access or a race.
  3. An object order is consistent with hb: if a hb→ b, then a precedes b.
  4. Channels:
    • buffered channels are FIFO in one enqueue order chosen by the execution;
    • rendezvous pairs are chosen by the scheduler;
    • a send synchronizes with the receive that obtains its value;
    • capacity affects blocking and scheduling, not memory ordering;
    • capacity-based synchronization would be a separate feature by RFC.
  5. The C++20 release sequence, stated explicitly.

Q-025 — No array construction from element values in AIR

Found by the independent author of program_atomic_stats.air (P5-9b). AIR has array.splat but no way to build an array from distinct element values. A six-element constant array costs a mutable borrow, six borrow.index/store/borrow.end triples and six index constants. .aji has the same gap: it has [e; N] but no array literal. The options are an array.make T (%a, %b, …) instruction (a value constructor like struct.make) with an .aji literal [a, b, c], or no change. This is a convenience question, not a correctness one. It is not urgent, and any RFC for it must report its agent-complexity cost.

Resolved on STD-5 (RFC 0023 Implemented): array.make and ordered source literals transfer complete linear elements. Copy-only frame stores/splat cannot express this ownership-preserving construction. The same constructor supports distinct Copy elements; its contract, feature gate, argument limits and measured complexity are specified with the vertical linear_aggregates feature.

Q-026 — Standard library distribution and initial source imports

The source frontend had no import resolution and the package manifest no dependencies. A source-only std therefore needed either manual concatenation or a specified import path.

Resolved in the std bootstrap branch: spec 15 §13 defines a closed compiler-pinned registry, fully qualified calls, deterministic name mangling and library source locations. Spec 16 defines the initial pure API. General user modules and imported types remain STD-3/P6-3; no filesystem search is invented. RFC 0016 records the proposal; the owner adopted it with the intermediate std merge (2026-10-07).

Q-027 — Empty byte strings in source

Found while testing std.bytes: the frontend rejects b"" with E7006 (“an empty byte string has no array type”), but spec 15 §5 does not state a nonempty restriction. Zero-length byte slices work as ref storage[0..0] and std tests use that existing form. Resolve the source literal rule separately; the std bootstrap does not change it or format-0 array semantics.

Q-028 — Recoverable endian reads need public standard result types

A plain integer cannot distinguish a decoded zero from a short input. A trap on malformed protocol input is not a recoverable API, and a boolean plus mutable out-parameter leaves an invalid/stale output for callers to track.

Resolved in the endian work branch: spec 16 §2.3 defines width-specific read result enums and one write result enum. Spec 15 §13 defines fully qualified standard enum type names, constructors and patterns using existing AIR enum semantics. RFC 0017 records the proposal. General modules, imported struct literals, generics and a must-use result rule remain outside this change.

Q-029 — Bounded byte copy/search/split and recoverable arithmetic surface

Short destination capacity needs explicit failure without partial mutation. A substring search's empty needle can match the end of empty data, so the existing single-byte length sentinel cannot unambiguously encode all outcomes. A returned split pair would hold borrows inside an aggregate before that source/lifetime surface is available. Arithmetic operators currently either trap or wrap; buffer sizing needs a recoverable overflow result.

Resolved in the STD-1b branch: spec 16 §2.4 reuses WriteResult for copy, adds FindResult for substring search, and composes splitting from explicit caller-owned slices. Spec 16 §2.1.1 adds checked add/sub/mul for u64 and target-width usize with ordinary result enums. Wrapping stays with existing operators. No new borrowed aggregate, generic type, AIR instruction or arithmetic mode is introduced. RFC 0018 records this API policy; the owner adopted it with the intermediate std merge (2026-10-07).

Q-030 — Strict text/encoding failures and destination state

UTF-8 needs a scalar-level iteration contract without an owning iterator. Hex/Base64 decoders need a choice between permissive input and one reproducible accepted encoding, plus a defined destination state when a bad byte appears after a valid prefix. Size calculations must not trap before reporting short capacity.

Resolved in STD-2a: spec 16 §2.5–§2.7 define UTF-8 next/validate with explicit offsets, lowercase hex output with case-insensitive ASCII decoding, and canonical padded standard Base64 with checked unused bits. Decoders validate all input before checking output capacity and before writing; invalid input wins over short output and both preserve the entire destination. Capacity guards avoid arithmetic overflow. RFC 0019 records the policy. No streaming state, URL-safe/permissive options, borrowed iterator or allocation is introduced. Formatting remains STD-2b.

Q-031 — Minimal formatting and signed limits

Formatting needs a defined byte representation, insufficient-capacity state and signed-minimum behavior before a library promises arbitrary integer output. A format-string parser or growable writer would add contracts beyond the supplied-buffer milestone.

Resolved in the STD-2b branch: spec 16 §2.8 defines decimal writers for u64/i64 and target-width usize/isize with one ordinary result enum. Complete capacity is checked before mutation, successful counts include the sign, suffixes stay unchanged and no terminator is emitted. Signed minimum is supported without negating it directly. RFC 0020 records the proposal. General formatting, other widths, floats and parsing remain separate work; explicit caller offsets compose records with existing byte copy.

Q-032 — Package module resolution and namespace boundaries

General source modules need explicit build inputs, stable ordering/provenance, local name binding and a choice of import visibility before reusable types can be published. Ambient directory/manifest discovery would make verification depend on environment state; transitive names would make one module's public surface depend on unrelated imports.

Resolved on the STD-3 branch (RFC 0021 Implemented): spec 12 §1.3 supplies an explicit [modules] name-to-source map, with bounded no-follow loading inside the chosen package root. Spec 15 §14 specifies an acyclic graph, direct qualified imports, module-local names, qualified struct literals, module-aware spawning, stable mangling and whole-graph verification through existing AIR. All declarations are available through import; aliases, re-exports, visibility modifiers, dependencies and generics remain separate work. File-only commands never discover manifests.

Q-033 — Generic specialization and property constraints

The source plan names monomorphized generics but does not define application syntax, checking of unused templates, specialization bounds or precise Freeze/Local constraints.

Resolved on the STD-4 branch (RFC 0022 Implemented): spec 15 §15 defines explicit ::<...> expression arguments, applied type names, ordered canonical specializations and concrete-body checking. Copy/Send/Share reuse existing rules; Freeze is format-0 IslandSafe content and Local is context-bound state, with explicit propagation rather than complementing Send. No trait inference or generic runtime representation is added; ordinary aggregate restrictions remain until linear_aggregates.

Q-034 — Source calls returning borrows

During STD-4 validation, existing from declarations still return the frontend's unimplemented outcome and borrow bindings accept places rather than borrow-returning calls. Generics preserve the syntax/metadata and this existing limitation; they do not add an implicit lifetime or a new binding spelling. A separate source/lifetime increment must specify and implement the binding/temporary-end rules vertically before public libraries return retained borrowed views.

Implementation prepared (P6-11, RFC 0036 Proposed): spec 15 §19 and the frontend define exact-mode ref/mut call bindings, a named borrowed from argument, named returns and transfer of owned ancestors. The existing AIR verifier enforces provenance/lifetime; no runtime rule or AIR construct changes. Source/AIR twins, generic/package/profile checks, task loans and per-step collection cover the increment. Owner adoption of RFC 0036 remains separate.

Q-035 — Whole-value linear aggregates

Resolved on the STD-5 branch (RFC 0023 Implemented): spec 03 §25 and source spec 15 §16 specify complete construction/exhaustive consumption, fixed arrays, explicit exchange and ownership-preserving allocation failure. No partial-move/field initialization state or destructor is introduced. Among heap/frame/region storage forms, only individual own may hold linear content; frame locals, repeated heap arrays and bulk regions retain Copy-only content. Dynamic linear buffers need a separately specified extension in the collection phase.

Q-036 — Dynamic initialized linear buffer storage and drain

STD-5 intentionally enables only complete fixed-size values and individually owned allocation. A growable Vec of resources needs bounded dynamic storage with explicit initialized length, moving extraction, failure-preserving growth and complete drain before freeing. Repeated own.array and bulk region/frame freeing remain Copy-only. STD-6 must specify this storage contract through all layers before publishing Vec, Vec<sender> or a HashMap owning values. Partial holes, implicit destructors or host-only container magic are not an answer.

Resolved on STD-6a (RFC 0024 Implemented): spec 03 §26 uses an initialized contiguous prefix, explicit peak-charged reserve, failure returning pushed values and empty-only free returning the buffer on failure. Views reuse slice provenance and bounds. Safe Vec wrappers are spec 16 §2.10; other collections remain separate work.

Q-037 — General hash-map key hashing and equality

HashMap<K,V> needs a stable hash/equality pair: equal keys must hash equally, while hash collisions must still compare actual keys. Current Copy/Send/Share/Freeze/Local constraints supply no user operations; type parameters cannot carry callbacks or values (spec 15 §15). Struct/byte-key equality, key ownership and effect-visible callable policies have no general source contract. A hash digest alone cannot represent original-key identity.

Resolved on the STD-6d branch (RFCs 0029/0030/0031 Implemented): spec 15 §18 supplies exact explicit static hash/equality operations; spec 16 §2.14–§2.15 specifies general owning HashMap<K,V,H,E>/HashSet<K,H,E> with dense complete entries and Copy probe indices. HashMap<Key, Own> and owning keys pass ordinary ownership/effect/borrow/task rules, independent model traces, source/AIR/profile/package checks and collection-before-every-step/scheduler stress. Numeric U64Map retains its API. No digest identity, inferred policy or map-only compiler primitive is introduced.

Q-038 — Pure construction of built-in errors

STD-6d.2 needs to return allocation-size validation failure without allocating. Existing built-in errors were obtainable only from fallible runtime operations.

Resolved (RFC 0027 Implemented): spec 05 §14 adds feature error_values and pure error.const B.variant; source reuses B::variant. Every registered payload-free error variant is ordinary Copy data, never authority. Existing enum.make and runtime outcome rules are unchanged.

Q-039 — Explicit static function parameters

General collections and algorithms need explicit typed hash/equality/order operations, while current generics carry only types.

Resolved contract (RFC 0029 Implemented): spec 15 §18 permits explicitly selected source functions as static parameters with exact typed/effect contracts. Selection is part of nominal specialization identity and lowers to existing named AIR calls/workers. No function pointers, capture environment, inferred effects or runtime dispatch are introduced. Q-037 is resolved by the implemented and verified generic map/set contracts (RFCs 0030/0031).

Q-040 — Block statements followed by unary-leading expressions

P6-8 review found an existing parser ambiguity: if true { *p = 2u64; } *p = *p + 1u64; is consumed as an expression continued by multiplication and then rejects E7006 at the assignment. The same failure is reproduced after a standalone block or match; while dispatches separately and is not affected. Source whitespace is insignificant; spec 15 §4 and the grammar admit both block statements and expressions beginning with block/control-flow forms. The intended disambiguation must be specified before changing which previously parsed expressions are accepted. Decide how a standalone block statement ends before a dereference/other unary-leading statement while preserving block-valued expressions in explicit expression contexts. Add positive/rejected parser and lowering cases for the chosen rule. The formatter preserves the current tokens/AST and MUST NOT insert semicolons or infer the intended statement boundary. This question is separate from P6-8.

Resolved (DD-016, spec 15 §4): leading bare if, match and {…} in statement/tail position stop before outer expression operations. The next } selects a tail, ; an explicit discard, otherwise a block statement must yield void or diverge (E7006). Parentheses permit continuation; nested expression contexts retain ordinary parsing. The value guard prevents silent reinterpretation of former expressions such as {2i64} -3i64. Parser, lowering, formatter and source conformance cover the boundary and compatibility rules. This resolves one P6-1/P6-2 ambiguity, not the complete grammar tasks.

Q-041 — Source scope-handle value bindings

Independent E7006 review found that module scope_move fn main()->u64 effects [] { scope sc { let alias = move sc; } 42u64 } checks and returns 42 with fuel 10,000. Its AIR contains only task.scope.begin and task.scope.end on the same SSA value; the unused alias introduces no instruction. This observation alone establishes no memory/concurrency safety defect. Spec 15 §3 excludes scope from source type spellings, §7 ties scope completion to the block, and spec 04 §33 permits function-local scope flow while preserving linear completion. They do not explicitly say which ordinary source value-binding forms may name that internal handle or how an explicit transfer interacts with the block's retained completion obligation.

Clarify whether let/move aliases and rebinding of a scope name are permitted, how their availability relates to the originating block, and which existing diagnostic applies to rejected forms. Keep AIR scope identity, live-child/loan checks, deterministic completion and the no-escape invariant intact; add source acceptance/rejection tests for the chosen contract before changing lowering. This is separate from DD-017's reason field and RFC 0038's proposed repairs; neither adopts a new scope rule.

Resolved (DD-020, spec 15 §7): a source scope name is a lexical identifier usable only as the named first operand of task.spawn. Ordinary s/move s value uses reject E7006 invalid_expression, with name and type: scope; borrowing remains E7006 invalid_place. Ordinary shadowing remains legal and never replaces the originating block's saved completion identity. Source/AIR tests retain existing live-child and loan rules, deterministic completion and function-local AIR scope flow. Previously accepted aliases and scope-valued expressions now reject; no new syntax, reason, code or verifier/runtime state is added. This resolves one P6-2 question, not the phase.

Q-042 — Source type-position validation before AIR verification

Read-only P6-2 review reproduced module nested fn f(p: ref<ref<u64>>) -> void effects [] {} fn main() -> void effects [] {} on the preceding compiler. It reaches the verifier and reports E1001 (position: borrowed, found: ref<u64>) at the source function. Spec 15 §10 requires errors fully decided by source types to be reported as E7xxx, and the AIR type-position rule already rejects this referent. This is an existing frontend validation gap, independent of dereferenced argument parsing; no new borrow semantics is proposed.

Resolved for structural positions (spec 15 §10): frontend annotation checks use the verifier's pure type-position predicates. Parameters, returns, fields, payloads, nested constructors, local annotations and known unused generic/static-contract headers reject E7005 at the invalid constructor with position and type_constructor; unknown parameter restrictions are checked after substitution. Graph-content properties retain E2111. Existing AIR acceptance, diagnostics and runtime rules are unchanged. Invalid source types formerly rejected by E1001 or a feature diagnostic now reject earlier; known invalid unused generic headers and annotations previously skipped by lowering also reject. Generic argument diagnostics may have more precise coordinates and different fields. Property checks beyond structural positions are separate (Q-043); this does not establish complete source type-check coverage.

Q-043 — Copy content validation for source dynamic owning arrays

Read-only review after Q-042 reproduced module nested fn unused(p: own_array<own<u64>>) -> void effects [] { trap; } fn main() -> void effects [] {}. It reaches the AIR verifier with E1001, dynamic heap arrays require Copy content. Spec 03 §25 requires Copy content for own_array<T>, and spec 15 §10 requires fully source-type-decided errors to be E7xxx. This is a content-property check, not a structural type position. Graph-content properties and Send/Share checks retain their separately specified verifier diagnostics.

Resolved (spec 15 §10): annotation and repeated-allocation checks report E7005 at the non-Copy content/value, with constraint: Copy and type_constructor: own_array. The shared AST property query follows nominal fields and enum payloads in their declaring namespace, honors user types before built-in names, and keeps iref content phantom. Unused generic/static headers reject when linear content is already known; unknown parameter properties wait for substitution. Recursive generic paths are distinguished by the known-linear parameter vector, so parameter rotations cannot hide a known linear leaf. Pure by-value cycles retain E1003; a proven Copy-content violation may reject before a simultaneous layout error. Graph-root content checks retain E2111. AIR acceptance, codes, type identity, allocation/cleanup and interpreter behavior are unchanged; invalid source programs now stop earlier instead of producing invalid AIR. No new syntax, code, feature or verifier/runtime state is introduced.

Q-044 — Nominal linearity query cost before layout rejection

Q-043 review identified a separate existing cost in Lowerer.linearAt: repeated fields and by-value cycles revisit nominal declarations until its depth bound, with no shared-result cache. checkRequirements asks this query before checkFiniteLayouts rejects E1003. The bound guarantees finite recursion but does not bound the number of branching revisits. Q-043's new annotation query has counted tests for shared acyclic/cyclic branches; the old classification query is unchanged. The precise cost and scope of other nominal property queries remain unverified.

Audit the existing classification/layout ordering and shared-query cost with counted tests, preserving structural ownership classes, graph/iref boundaries, source E1003 provenance, accepted-source canonical AIR and frozen AIR behavior. Avoid wall-clock timeout tests. This is an implementation audit, not a new recursion or memory rule.

Q-045 — Source array literals with second-class elements

Q-043 review reproduced fn unused(p: ref<u64>) -> void effects [] { let a = [p, p]; }: the source array literal reaches AIR type checking with E1001 because borrows cannot be stored as array elements. Q-042 validates annotations; an inferred literal has none. Q-043 now rejects that array as a repeated own.array value, but constructing it without that operation remains a separate source validation gap.

Resolved (spec 15 §5/§10): each inferred list/repeat element is checked before array construction. Borrows retain E7006 invalid_literal; forbidden member constructors (including void/never/task) report E7005 with position and type_constructor. Repeated elements use the verifier's exact Copy predicate and report E7005 with constraint: Copy and type_constructor: array. Lists preserve explicit linear moves, E7003 for missing moves and verifier E2002 for duplicates. Element validity precedes expected-type agreement with or without an annotation; an invalid annotation itself still rejects first. Thus some earlier mismatches/ownership-wrapper errors are replaced by a diagnostic at the first invalid element. The Q-043 own.array check remains a second line of defense. AIR acceptance, verifier/runtime rules and valid-source canonical output are unchanged. Wrapper construction from inferred values is separate (Q-046).

Q-046 — Inferred content types in ownership and graph constructors

Q-045 review reproduced fn unused(heap: cap<mem.alloc>, p: ref<u64>) -> void effects [mem.alloc] { let a = own.new(p, heap) or trap; trap; }: the inferred own<ref<u64>> reaches AIR E1001 in member position. Existing source annotations reject this under Q-042, but the constructor infers its content type from a value. Review identified analogous call paths in own.pack, mutex.make and graph allocation; those additional cases remain unverified.

Audit each constructor against its own existing content/position/property rules and diagnostic precedence before changing it. In particular, distinguish Copy-only construction, explicit linear transfer and graph-content E2111. Add source positives/rejections and stable E7xxx at fully source-decided errors, preserving provenance, effects/capabilities, outcomes and frozen AIR behavior. Do not apply one broad Copy restriction to every wrapper.

Resolved (spec 15 §10): inferred void/never content rejects E7005 before constructors form results or outcomes; never operands formerly reached a null-block panic, and void operands could produce malformed AIR/E7900. own.new, region.new and region.array use the verifier's exact Copy predicate on the completed nominal type snapshot, reporting constraint: Copy and operation at the value. own.pack rejects root borrows with position: member and type_constructor; complete linear values and allocation-failure recovery remain valid. Existing explicit-move checks run first. own.array retains its earlier Copy diagnostic, including void/never. Mutex element rules, graph properties and reserved transfers otherwise stay in the verifier: own.pack(task) retains E0006 task_transfer, and mutex endpoints retain E0006 channel_transfer. Copy-only constructors reject task content independently of that gate. Existing island.alloc precedence reports E1001 for root borrows through iref<T> positioning; root owners report E1001 without linear_aggregates, but E2111 when an owning aggregate declaration enables that feature in the module. Nominal values with owning members report E2111. This distinction depends on the feature header, not lexical block nesting, and remains with the verifier. No AIR acceptance, ownership/effect/capability rule, outcome, allocation/cleanup or deterministic interpreter behavior changes. Invalid source stops earlier; accepted canonical AIR is unchanged. This closes the audited constructor paths, not all source type-check completeness.

Q-047 — Non-value operands outside inferred constructors

Q-046 review identified other uses of never that reach lowering with no current block. Independently reproduced: module test.never_operand fn stop() -> never effects [] { trap; } fn main() -> u64 effects [] { return 1u64 + stop(); } aborts while Lowerer.binary calls def/emit after stop() terminated the block. Review also reproduced ordinary call arguments and struct fields; their exact scope remains unverified. Q-046 guards constructor content only.

Audit non-value operands in ordinary calls, operators and aggregates against spec 15 before emission. Distinguish value-requiring positions from valid void statements and never-returning control flow. Add source rejection/acceptance and CLI tests, preserving evaluation order, explicit transfers, diagnostics and canonical AIR for valid source. A source program MUST NOT cause a lowering panic; do not infer a new divergence/coercion rule from implementation behavior.

Resolved (spec 15 §10): typed operation inputs reject never with E7005 at the operand (expected, found: never) before subsequent inputs/emission, while ordinary void mismatches retain their diagnostics. Calls, operators, fields/payloads, conditions, ranges/indices, sizes, atomics, channels and place-store values use this rule. select checks a divergent send value before endpoint borrows. Return/tail/statement/branch divergence and existing SSA variable receivers remain valid; divergent assignment by name or var initialization in frame storage now performs no store. Binding/annotation checks still precede those receivers. Place writes through *, fields or indices require a value; rejecting never before target evaluation prevents formerly invalid targets from being accepted. Unknown target types use expected: a stored value, so earlier E7002 can become E7005 at the RHS. let retains its existing no-value error. Emission into a terminated block returns E7006 unreachable rather than aborting; a state-machine unit test preserves the terminated block and diagnostic span. AIR acceptance, ownership/lifetime rules, effect/capability contracts, normal-path execution and accepted-source canonical AIR are unchanged. Programs that previously aborted now reject or, for valid variable receivers, diverge normally. Q-048 records a separate store-mode gap.

Q-048 — Source place-store access modes

Q-047 review independently reproduced fn update(p: ref<u64>) -> void effects [] { *p = 1u64; }: it reaches AIR E1001 (expected: mut<T>, found: ref<u64>) instead of frontend E7xxx, although the mode is determined by source types (spec 15 §10). Review also observed accepted writes to fields of a let aggregate. An immutable binding does not necessarily imply immutable owned content; whether that behavior disagrees with the specification remains unverified and MUST NOT be guessed from the binding's mutable flag.

Audit existing place modes and referents against spec 15 §4/§5 and AIR borrow/store rules. Reject fully type-decided incompatibilities at the source, preserving ownership, aliasing/lifetime diagnostics, evaluation order and canonical AIR for valid source. Determine the binding/content distinction from governing text before proposing any semantic restriction.

Resolved (spec 15 §10): stores require mut<T>; explicit mut bindings and arguments require an exclusive place before array-to-slice conversion. Shared places reject E7005 with expected/found borrow types at the place or argument. This also prevents accepted mut bindings from silently retaining shared field/index/range modes, or requesting an exclusive slice from a shared array. Dereferenced slices are not scalar store places. Whole-array stores retain E7006; RHS evaluation, valid canonical AIR, ownership/projection/alias/lifetime rules and runtime semantics remain unchanged. Q-049 separates the unresolved Copy-let storage policy.

Q-049 — Immutable Copy bindings and mutable frame content

Read-only Q-048 review reproduced accepted let p = Pair { a: 0u64 }; p.a = 42u64; return p.a;, and exclusive borrows of Copy-let frame storage. Spec 15 §4 calls let an immutable binding; assignment by name already rejects. Whether this should also prohibit content writes through fields/indices/borrows is unresolved. Owned content through let intentionally remains mutable and is used by public std examples. Do not infer a new restriction from Binding.mutable: distinguish Copy frame storage from owners, regions, resources and borrow bindings, and settle the normative policy before changing accepted source. This question is independent of Q-048's existing shared/exclusive borrow modes.