feat(vm): add deterministic gameplay math and domain coverage gates
Intrepid/Prometeu/Runtime/pipeline/pr-master There was a failure building this commit

This commit is contained in:
2026-10-09 10:25:11 +01:00
parent 2e041266f1
commit 9318cf7cd3
47 changed files with 8825 additions and 281 deletions
@@ -194,6 +194,9 @@ Preserve typed reasons and available section/file offset, ID domain/record/membe
| TRAP_INVALID_HANDLE | 0x0000000F | Invalid index, dead slot, stale/invalid generation |
| TRAP_RESOURCE_LIMIT | 0x00000010 | Runtime quota/size overflow/recoverable allocation failure |
| TRAP_UNAVAILABLE | 0x00000011 | Known input query unavailable on the platform |
| TRAP_NUMERIC_DOMAIN | 0x00000012 | Invalid mathematical domain of finite arguments |
| TRAP_NUMERIC_RANGE | 0x00000013 | Finite result/destination outside representable range |
| TRAP_NON_FINITE | 0x00000014 | NaN/infinite input rejected before guest publication |
Keep TrapInfo(code,opcode,pc,message,optional span) and current trap interruption behavior; no guest-catchable exception system. Untyped null to Int32 is TRAP_TYPE, not null dereference. Invalid handles never become false/null and are validated before following them. Preserve existing stack/function/return/intrinsic error categories. No promise to recover process/allocator abort; use fallible new allocation paths rather than operational panics.
@@ -239,3 +242,16 @@ Nested records count fields, methods, parameters/results and implementation Func
Auxiliary state includes capacities of the VM operand stack, CallFrames, globals, handles/free lists, string ledgers and persistent GC structures. The VM owns one context directly; entry preparation allocates no heap execution object. Closure headers and capture payloads remain heap-owned. Call depth and per-frame cap coexist with aggregate session auxiliary cap. Constants are checked at load; runtime excess traps. Growth must not geometrically reserve beyond available quota. Cycle/frame budgets remain separate. Asset and host admission limits are outside these totals.
## Numeric admission
Float64 constant bits must be finite. Reject NaN/infinity using
LOAD_INVALID_FORMAT/NonFiniteValue with Constants section, file offset and
constant index. Reject nonfinite PushF64, even in unreachable declared code,
with LOAD_INVALID_CODE/NonFiniteValue and function/PC/offset context.
Decode/tag/truncation failures preserve structural categories. Unsupported
INTRINSIC identities are LOAD_INVALID_CODE/NativeId with function/PC and ID.
No envelope/version change is introduced. Native signature import validates
complete layouts before checking Float finitude and publishing guest slots.
See [numeric semantics](02d-gameplay-math-and-numeric-semantics.md) for fault
precedence, conversions, catalog metadata and producer examples.