capacities (25.5a): @max(n) on a list field, and a full table is a failure

'@max(64) boxes: []Box' on a property's or a state's field is a promise: the grow path of a push to
that field (only the grow path, so nothing is paid until it doubles) checks it, and growing past n is
reported by the fence - 'PoolState.boxes grew past its @max(16) (it holds 16)' - counted under
count, said under warn, and under fail (a headless or dev build's default) the run ends with exit 87.
Mem.over("what") is the same for a package's own table: ludic.base's StrTable past its most
(sb_intern) and ludic.ui's memo past three quarters of MM_CAP no longer quietly copy per call. The
census counts overflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:43:02 +03:00
parent 69d1db06a5
commit 6fb5118afd
8 changed files with 73094 additions and 71750 deletions

View file

@ -10,9 +10,23 @@ function parse_component() -> Node {
var is_computed = false
var is_sync = false # @Sync — this field replicates (NETWORKING N2)
var is_frame = false # @frame — a fn stored here runs every frame (25.2)
if is_op("@") { pi += 1; let ann = eat_id(); if ann == "Computed" { is_computed = true } else if ann == "Sync" { is_sync = true } else if ann == "frame" { is_frame = true }; skipnl() }
var cap = 0 # @max(n) — this list never holds more than n (25.5a)
if is_op("@") {
pi += 1
let ann = eat_id()
if ann == "Computed" { is_computed = true } else if ann == "Sync" { is_sync = true } else if ann == "frame" { is_frame = true }
else if ann == "max" {
eat_op("(")
let ce = expr()
if ce.kind != E_INT or ce.ival <= 0 { perr("@max takes the most the list may hold: @max(64)") }
cap = ce.ival
eat_op(")")
}
skipnl()
}
let f = node(N_FIELD); f.s = eat_id(); eat_op(":"); f.ty = ptype()
if is_frame { push(g_frame_fields, `{n.s}.{f.s}`) }
if cap > 0 { push(g_cap_keys, `{n.s}.{f.s}`); push(g_cap_vals, cap) }
if is_op("=") { pi += 1; f.a = expr() }
if is_sync { f.ival = 1 } # mark the field replicable (read by emit_net)
if is_computed { register_computed(n.s, f.s, f.ty, f.a) } # derived: no storage