open questions: Q-021 keyword parameter names, Q-022 byte strings in the size metric

This commit is contained in:
dev committed 2026-10-05 12:17:16 +03:00
1 parent c18fb7acc1
commit 61be766634
1 file changed
+8
+8
View File
@@ -144,3 +144,11 @@ A program may legitimately loop forever, so the language cannot bound execution.
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.
## 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.