Keep PBX at v0 and simplify Jenkins quality gate
Intrepid/Prometeu/Runtime/pipeline/pr-master There was a failure building this commit
Intrepid/Prometeu/Runtime/pipeline/pr-master There was a failure building this commit
This commit is contained in:
@@ -160,9 +160,9 @@ Primary cause:
|
||||
enemy.updateAI(): 1,012 cycles
|
||||
```
|
||||
|
||||
## Program Registry v1 integration
|
||||
## Program Registry integration
|
||||
|
||||
The [Dynamic/reference instruction table](02c-program-registry-and-pbx-v1.md#dynamic-and-reference-instructions) specifies fixed costs of 8/4/3/4/4/5/4 cycles for opcodes 0x0090–0x0096. Each decoded attempt charges once, including a trap. Input retains the existing one-cycle INTRINSIC rule. Load work quotas are deterministic analysis units, not execution cycles or a wall-clock timeout.
|
||||
The [Dynamic/reference instruction table](02c-program-registry-and-pbx-v0.md#dynamic-and-reference-instructions) specifies fixed costs of 8/4/3/4/4/5/4 cycles for opcodes 0x0090–0x0096. Each decoded attempt charges once, including a trap. Input retains the existing one-cycle INTRINSIC rule. Load work quotas are deterministic analysis units, not execution cycles or a wall-clock timeout.
|
||||
|
||||
|
||||
## Collection Attempt Charging
|
||||
|
||||
@@ -129,9 +129,9 @@ The PVM is:
|
||||
- single execution context; retired SPAWN/YIELD/SLEEP are rejected;
|
||||
- embedded inside the larger PROMETEU console model, not equal to it.
|
||||
|
||||
## Program Registry v1 integration
|
||||
## Program Registry integration
|
||||
|
||||
[Program Registry and PBX v1](02c-program-registry-and-pbx-v1.md) defines typed immediate domains, opcodes 0x0090–0x0096, complete multi-slot groups and conservative type-flow verification. Unknown facts require runtime validation and do not alone reject an otherwise valid join. Opcode bytes remain u16; TypeId immediates are u32 little-endian.
|
||||
[Program Registry and PBX v0](02c-program-registry-and-pbx-v0.md) defines typed immediate domains, opcodes 0x0090–0x0096, complete multi-slot groups and conservative type-flow verification. Unknown facts require runtime validation and do not alone reject an otherwise valid join. Opcode bytes remain u16; TypeId immediates are u32 little-endian.
|
||||
|
||||
|
||||
## Typed Collection Instructions
|
||||
@@ -154,7 +154,7 @@ STRUCT operations require a Struct descriptor; ARRAY operations require an Array
|
||||
|
||||
After charging the attempt, incomplete temporary operands trap with STACK_UNDERFLOW. Instance operations check receiver carrier, absence, liveness/generation, category, Registry and exact TypeId first; array access then checks exact Int64 index and bounds; SET checks the complete value group last. There is no numeric, Trait or Dynamic coercion. Negative lengths or indices and indices at/above length trap with OOB (0x03); wrong carriers/types/groups trap with TYPE (0x04); absent receivers with NULL_REFERENCE (0x0E); invalid/dead/stale handles with INVALID_HANDLE (0x0F). Positive lengths above u32, checked size/cost overflow, resource quotas and recoverable allocation failures trap with RESOURCE_LIMIT (0x10), preserving resource reason/requested/limit. Static invalid TypeIds/categories/fields produce LOAD_INVALID_REFERENCE; proven stack/type conflicts produce LOAD_INVALID_CODE. Runtime TrapInfo preserves the attempted PC, opcode and available source span.
|
||||
|
||||
Publication and ownership follow [typed collection memory](03-memory-stack-heap-and-allocation.md); charging follows [time and cycles](01-time-model-and-cycles.md). See the [producer handoff](../../vm-arch/collection-producer-handoff.md) for independent byte oracles and construction examples. Production consumers must enter through the validated PBX v1 image boundary described in [Program Registry](02c-program-registry-and-pbx-v1.md).
|
||||
Publication and ownership follow [typed collection memory](03-memory-stack-heap-and-allocation.md); charging follows [time and cycles](01-time-model-and-cycles.md). See the [producer handoff](../../vm-arch/collection-producer-handoff.md) for independent byte oracles and construction examples. Production consumers must enter through the validated PBX v0 image boundary described in [Program Registry](02c-program-registry-and-pbx-v0.md).
|
||||
|
||||
Typed callable instructions are MAKE_CLOSURE `(FunctionId,FnTypeId)`, CALL_CLOSURE `(FnTypeId)`, GET_CAPTURE `(index)` and CALL_TRAIT `(TraitTypeId,method_index)`. Their groups, encodings and attempted costs are defined in the [Fn contract](02b-vm-function-values-and-closures.md). Numbers 0x54–0x56 stay reserved and reject anywhere at load.
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ Verifier decodes every function range, validates instruction boundaries/IDs/jump
|
||||
Use a bounded worklist to fixed point, reprocessing widened states; decide state-dependent type errors after convergence so visitation order cannot cause rejection. Signature contracts suffice for calls; no interprocedural body inference is required. Partial group mutation invalidates relational facts. Unknown is not proof of compatibility and does not alone reject code: retain complete runtime checks. Type knowledge alone does not eliminate null/generation/bounds checks. CALL_CLOSURE uses expected FnTypeId to establish parameter/result groups even for unknown concrete targets. GET_CAPTURE accesses typed metadata of the enclosing function; environment is retained by CallFrame without hidden arg0. Known mismatch rejects, Unknown retains runtime checks. Exceeding memory/work budget rejects loading, never skips verification.
|
||||
|
||||
|
||||
Builtin IDs, exact slot carriers, nullable defaults and stored layouts are defined in [Program Registry and PBX v1](02c-program-registry-and-pbx-v1.md#values-storage-and-initialization). A fixed list of results does not imply a tuple object or boxing. Parameter names are optional signature metadata; frontend argument reordering must preserve source evaluation order.
|
||||
Builtin IDs, exact slot carriers, nullable defaults and stored layouts are defined in [Program Registry and PBX v0](02c-program-registry-and-pbx-v0.md#values-storage-and-initialization). A fixed list of results does not imply a tuple object or boxing. Parameter names are optional signature metadata; frontend argument reordering must preserve source evaluation order.
|
||||
|
||||
## Finite Float and explicit math conversions
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ private typed Struct cells with ordinary field operations, common to creator and
|
||||
closures. Another factory can allocate another cell. No Cell category or
|
||||
SET_CAPTURE is introduced; language lowering belongs to each frontend.
|
||||
|
||||
PBX v1 MUST include exactly one captures section, kind 8: little-endian
|
||||
PBX v0 MUST include exactly one captures section, kind 8: little-endian
|
||||
`function_count:u32`, then per FunctionId `capture_count:u32` and ordered capture
|
||||
TypeIds:u32. Outer count equals the function table; empty lists are explicit.
|
||||
Offsets/widths/maps derive at load. Records, capacities and graph work use existing
|
||||
@@ -99,7 +99,7 @@ Optional SystemOS lifecycle entry uses Registry roles and the controlled boundar
|
||||
described below; it does not introduce arbitrary native reentry.
|
||||
|
||||
See [memory](03-memory-stack-heap-and-allocation.md),
|
||||
[Registry/PBX](02c-program-registry-and-pbx-v1.md) and
|
||||
[Registry/PBX](02c-program-registry-and-pbx-v0.md) and
|
||||
[host ABI](16-host-abi-and-syscalls.md).
|
||||
|
||||
## Random core integration
|
||||
@@ -109,7 +109,7 @@ See [memory](03-memory-stack-heap-and-allocation.md),
|
||||
## System-owned lifecycle entry
|
||||
|
||||
Optional zero-argument, zero-result, capture-free lifecycle targets are bound by
|
||||
[Registry roles](02c-program-registry-and-pbx-v1.md#optional-lifecycle-roles).
|
||||
[Registry roles](02c-program-registry-and-pbx-v0.md#optional-lifecycle-roles).
|
||||
They are ordinary functions called through a controlled SystemOS boundary, not
|
||||
closure values or replacement boot entries. The boundary retains the existing
|
||||
stacks and roots, appends its frame, and returns to SystemOS immediately on outer
|
||||
|
||||
+9
-7
@@ -1,9 +1,9 @@
|
||||
# Program Registry, Typed Values and PBX v1
|
||||
# Program Registry, Typed Values and PBX v0
|
||||
|
||||
Domain: VM program metadata, binary format, typed storage and resource boundaries
|
||||
Function: normative
|
||||
|
||||
The production loader, internal producers and runtime examples use this sealed v1 contract. Typed Fn and frame environments follow [the function-value contract](02b-vm-function-values-and-closures.md); retired coroutine instructions reject at load. No provisional untyped reference is authorized.
|
||||
The production loader, internal producers and runtime examples use this sealed v0 contract. Typed Fn and frame environments follow [the function-value contract](02b-vm-function-values-and-closures.md); retired coroutine instructions reject at load. No provisional untyped reference is authorized.
|
||||
|
||||
Didactic companion: [Registry Boundaries and Owned Values](../../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md).
|
||||
|
||||
@@ -21,9 +21,11 @@ The requirements below use MUST/MUST NOT semantics. The Registry owns type/funct
|
||||
- Parameter names are optional signature metadata independent of debug. Frontends reorder named arguments to signature order while preserving source evaluation order, using temporaries. Mixing/default-argument syntax and diagnostics stay with frontends; optional/default parameters are not implicitly introduced.
|
||||
- Trait implementations are unique per (Struct, Trait), complete, immutable and ordered by method index. Explicit parameter/result TypeIds, order and arity match exactly; the implementation function has its concrete receiver as first parameter. No variance or implicit adaptation: frontend adapter functions may satisfy the exact signature. CALL_TRAIT resolves TraitTypeId/method index through this immutable table; targets have empty captures and receive concrete receiver first, never ImplementationId as an argument.
|
||||
|
||||
## PBX v1 encoding
|
||||
## PBX v0 encoding
|
||||
|
||||
PBX v1 only: magic `PBX\0`, little-endian, 32-byte header, zero reserved bytes and directory triples `(kind:u32, offset:u32, length:u32)`. Preserve existing non-Registry section encodings except expressly required changes. Reject unsupported versions, unknown/duplicate/missing sections, overlap, overflow, truncation and trailing table bytes. Section Code is raw instructions without a count prefix.
|
||||
The format remains in development at version 0; changes to the current schema do not imply a version bump or compatibility with earlier development layouts.
|
||||
|
||||
PBX v0 only (u16 version at offset 4 MUST be zero): magic `PBX\0`, little-endian, 32-byte header, zero reserved bytes and directory triples `(kind:u32, offset:u32, length:u32)`. Preserve existing non-Registry section encodings except expressly required changes. Reject unsupported versions, unknown/duplicate/missing sections, overlap, overflow, truncation and trailing table bytes. Section Code is raw instructions without a count prefix.
|
||||
|
||||
| Kind | Section | Presence |
|
||||
| --- | --- | --- |
|
||||
@@ -42,7 +44,7 @@ The fixed header is:
|
||||
| Byte offset | Encoding | Meaning |
|
||||
| --- | --- | --- |
|
||||
| 0 | four bytes | `PBX\0` |
|
||||
| 4 | u16 | version 1 |
|
||||
| 4 | u16 | version 0 |
|
||||
| 6 | u8 | endianness 0 (little-endian) |
|
||||
| 7 | u8 | reserved, zero |
|
||||
| 8 | u32 | section count |
|
||||
@@ -103,7 +105,7 @@ are not the binding mechanism.
|
||||
Pause/resume hooks may be absent. MemcardBoot is required for a cartridge with
|
||||
the memcard capability and is invoked only at its explicit bootstrap gate.
|
||||
Additional roles require a future contract; there is
|
||||
no termination role. PBX remains version 1, with no old-layout fallback or
|
||||
no termination role. PBX remains version 0, with no old-layout fallback or
|
||||
external-artifact compatibility. Producers MUST regenerate their images and
|
||||
emit this byte for every function, including zero for ordinary functions.
|
||||
Frontend compilers choose their own source syntax and lower it to these roles.
|
||||
@@ -303,4 +305,4 @@ precedence, conversions, catalog metadata and producer examples.
|
||||
|
||||
## Random core integration
|
||||
|
||||
[Random](02e-vm-owned-random-core.md) adds BuiltinId 0x0016 and intrinsic IDs 0x4000–0x4003 using existing PBX v1 encoding. Registry categories remain unchanged; unsupported identities are rejected, without fallback.
|
||||
[Random](02e-vm-owned-random-core.md) adds BuiltinId 0x0016 and intrinsic IDs 0x4000–0x4003 using existing PBX v0 encoding. Registry categories remain unchanged; unsupported identities are rejected, without fallback.
|
||||
@@ -6,7 +6,7 @@
|
||||
It occupies one execution slot: present values use `Value::HeapRef`; the default
|
||||
is `Value::Null`. Typed storage uses index:u32 and generation:u32, eight bytes
|
||||
aligned to eight, with GuestReference ownership. Registry categories remain
|
||||
Builtin, Struct, Array, Trait and Fn. PBX v1 encoding is unchanged.
|
||||
Builtin, Struct, Array, Trait and Fn. PBX v0 encoding is unchanged.
|
||||
|
||||
ObjectKind::Random has tag 9; DynamicBox remains 8 and tag 6 remains reserved.
|
||||
Its private logical payload is State:u128 and Inc:u128, 32 bytes with no child
|
||||
@@ -131,7 +131,7 @@ generator state and prior owners, releases provisional resources and publishes
|
||||
no partial handle. range draws on private candidate state and rolls it back
|
||||
on any fault, including the rejection limit. Executed cycles are not refunded.
|
||||
|
||||
Loader/verifier recognize Random and all signatures without changing PBX v1.
|
||||
Loader/verifier recognize Random and all signatures without changing PBX v0.
|
||||
Unknown intrinsic IDs, including unreachable ones, use LOAD_INVALID_CODE/NativeId;
|
||||
runtime INVALID_INTRINSIC is invariant defense. Invalid Registry IDs/signatures
|
||||
retain existing categories. Unknown type analysis requires full runtime checks.
|
||||
@@ -161,7 +161,7 @@ claim unexecuted host comparisons. CPU benchmarks do not set virtual costs.
|
||||
Frontend and reference-game integration consume the published contract through
|
||||
separate handoffs. Local core completion does not require those implementations
|
||||
or acquisition of hardware. See [numeric semantics](02d-gameplay-math-and-numeric-semantics.md),
|
||||
[Registry/PBX](02c-program-registry-and-pbx-v1.md),
|
||||
[Registry/PBX](02c-program-registry-and-pbx-v0.md),
|
||||
[memory](03-memory-stack-heap-and-allocation.md) and
|
||||
[cycles](01-time-model-and-cycles.md).
|
||||
|
||||
|
||||
@@ -199,9 +199,9 @@ Any violation results in a trap or rejected program image.
|
||||
- [`08-save-memory-and-memcard.md`](08-save-memory-and-memcard.md) defines save storage outside VM heap ownership.
|
||||
- [`16a-syscall-policies.md`](16a-syscall-policies.md) defines host-root rules and host/heap interaction policy.
|
||||
|
||||
## Program Registry v1 integration
|
||||
## Program Registry integration
|
||||
|
||||
[Program Registry and PBX v1](02c-program-registry-and-pbx-v1.md#values-storage-and-initialization) specifies compact typed layouts, defaults, native String/Dynamic ownership and generational handles. Its [memory quotas](02c-program-registry-and-pbx-v1.md#memory-ownership-and-quotas) apply jointly before allocation. Registry metadata is immutable image-owned native memory, outside guest GC. Stack/local execution retains Value.
|
||||
[Program Registry and PBX v0](02c-program-registry-and-pbx-v0.md#values-storage-and-initialization) specifies compact typed layouts, defaults, native String/Dynamic ownership and generational handles. Its [memory quotas](02c-program-registry-and-pbx-v0.md#memory-ownership-and-quotas) apply jointly before allocation. Registry metadata is immutable image-owned native memory, outside guest GC. Stack/local execution retains Value.
|
||||
|
||||
|
||||
## Typed Array and Struct Storage
|
||||
|
||||
@@ -84,7 +84,7 @@ Input.pad().up().hold()
|
||||
Input.touch().x()
|
||||
```
|
||||
|
||||
Source syntax MUST lower directly to one fixed zero-argument query; pad/touch/button are catalogue prefixes, not guest values. Endpoints cannot be stored or passed, even transiently. The complete 54-query table and removed IDs are specified in [Program Registry input](02c-program-registry-and-pbx-v1.md#input). Unknown IDs are invalid intrinsics; a known unavailable query raises TRAP_UNAVAILABLE (0x11), never a fabricated false/zero.
|
||||
Source syntax MUST lower directly to one fixed zero-argument query; pad/touch/button are catalogue prefixes, not guest values. Endpoints cannot be stored or passed, even transiently. The complete 54-query table and removed IDs are specified in [Program Registry input](02c-program-registry-and-pbx-v0.md#input). Unknown IDs are invalid intrinsics; a known unavailable query raises TRAP_UNAVAILABLE (0x11), never a fabricated false/zero.
|
||||
|
||||
## 6 Determinism and Replay
|
||||
|
||||
|
||||
@@ -172,4 +172,4 @@ Every PROMETEU game that uses TOUCH:
|
||||
|
||||
## Fixed query catalogue
|
||||
|
||||
Touch button queries occupy 0x2130–0x2133 (pressed/released/down/hold); x/y use 0x2134/0x2135. All have zero arguments and read the frame snapshot. Button states return Bool; hold and coordinates return Int64. See the [complete input contract](02c-program-registry-and-pbx-v1.md#input).
|
||||
Touch button queries occupy 0x2130–0x2133 (pressed/released/down/hold); x/y use 0x2134/0x2135. All have zero arguments and read the frame snapshot. Button states return Bool; hold and coordinates return Int64. See the [complete input contract](02c-program-registry-and-pbx-v0.md#input).
|
||||
|
||||
@@ -352,6 +352,6 @@ All machine diagnostics and profiling data:
|
||||
- do not require a guest-visible debug ABI;
|
||||
- are consistent regardless of whether host diagnostics are active or not.
|
||||
|
||||
## Program Registry v1 integration
|
||||
## Program Registry integration
|
||||
|
||||
Loader diagnostics MUST preserve the [structured load tags, reasons and context](02c-program-registry-and-pbx-v1.md#errors-and-publication). Signature names remain available independently of debug data; names do not establish identity. Tools must distinguish image Registry, guest heap, native strings, auxiliary execution state and temporary quotas rather than reporting their sum as RSS.
|
||||
Loader diagnostics MUST preserve the [structured load tags, reasons and context](02c-program-registry-and-pbx-v0.md#errors-and-publication). Signature names remain available independently of debug data; names do not establish identity. Tools must distinguish image Registry, guest heap, native strings, auxiliary execution state and temporary quotas rather than reporting their sum as RSS.
|
||||
|
||||
@@ -175,8 +175,8 @@ structured faults, progress on partial failure and retained desktop run/debug.
|
||||
Neither Studio UI nor an AI model is required. See `tests/automation_process.rs`
|
||||
in prometeu-cli and the in-process deterministic-control tests in the headless crate.
|
||||
|
||||
## Program Registry v1 integration
|
||||
## Program Registry integration
|
||||
|
||||
When exposing initialization failures, retain the [structured load error](02c-program-registry-and-pbx-v1.md#errors-and-publication) code, typed reason and available context. Human-readable messages are not a parsing contract; a load error has no fabricated runtime PC. Failed loads must not publish executable sessions. Existing protocol request names and transport behavior are unchanged.
|
||||
When exposing initialization failures, retain the [structured load error](02c-program-registry-and-pbx-v0.md#errors-and-publication) code, typed reason and available context. Human-readable messages are not a parsing contract; a load error has no fabricated runtime PC. Failed loads must not publish executable sessions. Existing protocol request names and transport behavior are unchanged.
|
||||
|
||||
Heap reference inspection values use `{"kind":"heap_ref","value":{"index":u32,"generation":u32}}`. Both components are required to distinguish a live incarnation from a reused slot; the wire representation must not truncate handles to indices. Inspection does not grant cross-session transfer authority.
|
||||
|
||||
@@ -229,9 +229,9 @@ The cartridge spec therefore distinguishes:
|
||||
- [`14-boot-profiles.md`](14-boot-profiles.md) defines cartridge selection at boot.
|
||||
- [`15-asset-management.md`](15-asset-management.md) defines the `assets.pa` envelope, asset table semantics, preload lifecycle, and residency semantics.
|
||||
|
||||
## Program Registry v1 integration
|
||||
## Program Registry integration
|
||||
|
||||
Program payloads MUST use the PBX v1 envelope and mandatory sections defined in [Program Registry and PBX v1](02c-program-registry-and-pbx-v1.md#pbx-v1-encoding). The file limit is 64 MiB and Code is limited to 32 MiB. Unsupported versions are rejected; runtime examples are regenerated rather than converted by a compatibility loader. The existing func_id = 0 boot authority is unchanged.
|
||||
Program payloads MUST use the PBX v0 envelope and mandatory sections defined in [Program Registry and PBX v0](02c-program-registry-and-pbx-v0.md#pbx-v0-encoding). The file limit is 64 MiB and Code is limited to 32 MiB. Unsupported versions are rejected; runtime examples are regenerated rather than converted by a compatibility loader. The existing func_id = 0 boot authority is unchanged.
|
||||
|
||||
## Fn Execution Boundary
|
||||
|
||||
|
||||
@@ -372,9 +372,9 @@ Only user-defined functions and closures are first-class.
|
||||
- [`08-save-memory-and-memcard.md`](08-save-memory-and-memcard.md) defines persistent save-domain semantics.
|
||||
- [`02a-vm-values-and-calling-convention.md`](02a-vm-values-and-calling-convention.md) defines the slot/call philosophy reused by the syscall ABI.
|
||||
|
||||
## Program Registry v1 integration
|
||||
## Program Registry integration
|
||||
|
||||
Native boundaries MUST respect the [Registry typed-value and ownership contract](02c-program-registry-and-pbx-v1.md): exact carriers and complete groups, generational reference validation, string provenance and preallocation quotas. Existing SYSC binding errors remain structured and separate from Registry errors. Input consists of 54 VM-owned fixed queries, never endpoint objects or host syscalls.
|
||||
Native boundaries MUST respect the [Registry typed-value and ownership contract](02c-program-registry-and-pbx-v0.md): exact carriers and complete groups, generational reference validation, string provenance and preallocation quotas. Existing SYSC binding errors remain structured and separate from Registry errors. Input consists of 54 VM-owned fixed queries, never endpoint objects or host syscalls.
|
||||
|
||||
## Fn Execution Boundary
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ In the current state, no chapter under the active `docs/specs/runtime/` root is
|
||||
| [`02-vm-instruction-set.md`](02-vm-instruction-set.md) | VM subsystem overview | normative |
|
||||
| [`02a-vm-values-and-calling-convention.md`](02a-vm-values-and-calling-convention.md) | VM values and calling convention | normative |
|
||||
| [`02b-vm-function-values-and-closures.md`](02b-vm-function-values-and-closures.md) | VM closures and function values | normative |
|
||||
| [`02c-program-registry-and-pbx-v1.md`](02c-program-registry-and-pbx-v1.md) | Registry, typed storage, PBX v1 and quotas | normative |
|
||||
| [`02c-program-registry-and-pbx-v0.md`](02c-program-registry-and-pbx-v0.md) | Registry, typed storage, PBX v0 and quotas | normative |
|
||||
| [02d-gameplay-math-and-numeric-semantics.md](02d-gameplay-math-and-numeric-semantics.md) | VM math, numeric faults, cycles and consumer examples | normative |
|
||||
| [`03-memory-stack-heap-and-allocation.md`](03-memory-stack-heap-and-allocation.md) | VM memory model | normative |
|
||||
| [`04-gfx-peripheral.md`](04-gfx-peripheral.md) | virtual hardware: graphics | normative |
|
||||
|
||||
@@ -193,9 +193,9 @@ The verifier statically checks bytecode for structural safety and stack‑shape
|
||||
- When adding new opcodes or object kinds, extend the verifier and GC traversal accordingly (children enumeration, environment scanning, root sets).
|
||||
- Update this document alongside any architectural change that affects runtime invariants.
|
||||
|
||||
## Program Registry v1
|
||||
## Program Registry
|
||||
|
||||
The [Program Registry contract](../specs/runtime/02c-program-registry-and-pbx-v1.md) defines immutable image-owned Type/Function metadata linked by dense IDs. Descriptors are native metadata outside guest GC; nominal identity does not depend on names. Stack/local execution retains Value, while typed storage uses resolved aligned layouts. PBX v1 is the sole target format; publication requires full bounded validation. Fn tag 4 and mandatory captures section 8 extend the Registry; no old-schema fallback is permitted.
|
||||
The [Program Registry contract](../specs/runtime/02c-program-registry-and-pbx-v0.md) defines immutable image-owned Type/Function metadata linked by dense IDs. Descriptors are native metadata outside guest GC; nominal identity does not depend on names. Stack/local execution retains Value, while typed storage uses resolved aligned layouts. PBX v0 is the sole target format; publication requires full bounded validation. Fn tag 4 and mandatory captures section 8 extend the Registry; no old-schema fallback is permitted.
|
||||
|
||||
`ValidatedProgramImage::load` publishes a shared image only after bounded decoding, native binding and Registry verification; `VirtualMachine::from_image` creates sessions that consume its typed signatures, constants and conversion instructions. Production and internal generators must use this sole sealed-v1 path. Typed Fn integration and legacy removal are implemented together; publication alone is not proof that every consumer has migrated. [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md) explains the published mechanisms. The [producer handoff](registry-producer-handoff.md) documents schema, input IDs and named-argument order, while [layout evidence](registry-layout-evidence.md) records reproducible load/access/GC measurements and the current publication boundary.
|
||||
|
||||
|
||||
@@ -119,22 +119,20 @@ fresh measurement.
|
||||
|
||||
## Commands and CI
|
||||
|
||||
`make ci-domains` is the authoritative repository quality gate. Both
|
||||
[GitHub CI](../../.github/workflows/ci.yml) and
|
||||
[Jenkins](../../files/config/Jenkinsfile) provision dependencies and invoke that
|
||||
same target. `make ci` is an alias. Invoke one gate per checkout at a time.
|
||||
[Jenkins](../../files/config/Jenkinsfile) orchestrates the quality gate through explicit
|
||||
stages invoking Makefile targets. `make ci-domains` runs the same checks locally
|
||||
and in [GitHub CI](../../.github/workflows/ci.yml); `make ci` is an alias.
|
||||
Invoke one gate per checkout at a time.
|
||||
|
||||
The Makefile supplies this ordered sequence to the serial evidence runner:
|
||||
The ordered checks are:
|
||||
|
||||
1. Clean LLVM coverage instrumentation from the previous run.
|
||||
2. Check formatting with `cargo fmt --all -- --check`.
|
||||
3. Run `cargo clippy --workspace --all-targets --all-features -- -D warnings`.
|
||||
4. Test gate failure/report handling with the Python regression suite.
|
||||
5. Run `cargo test --workspace --all-targets --all-features --no-fail-fast`.
|
||||
6. Run the five ignored debugger socket tests through `make test-debugger-socket`.
|
||||
7. Generate fresh workspace/all-feature LLVM coverage, HTML, full JSON,
|
||||
Cobertura XML and summary JSON.
|
||||
8. Audit source ownership/evidence and check every fixed coverage domain floor.
|
||||
1. Clean previous LLVM coverage instrumentation and reports.
|
||||
2. Check formatting.
|
||||
3. Run workspace Clippy with warnings denied.
|
||||
4. Run workspace tests across all targets and features.
|
||||
5. Run the five ignored debugger socket tests.
|
||||
6. Generate workspace coverage, HTML, full JSON, Cobertura and summary JSON.
|
||||
7. Audit source ownership/evidence and check every fixed coverage domain floor.
|
||||
|
||||
The socket command is deliberately restricted:
|
||||
|
||||
@@ -148,8 +146,8 @@ It selects `test_debug_port_opens`, `test_debug_reconnection`,
|
||||
Local sandbox TCP permissions must permit bind/connect; a permission denial is
|
||||
not evidence of a debugger behavior regression.
|
||||
|
||||
The runner executes child Make targets with `-j1` even if the outer invocation
|
||||
uses `-j`. CI invokes `make ci-domains` serially. Do not run a separate Cargo,
|
||||
The local Make recipe executes child targets serially with `-j1`, even if the outer
|
||||
invocation uses `-j`. Jenkins executes its stages sequentially. Do not run a separate Cargo,
|
||||
coverage-clean or report process concurrently in the same checkout: serialized
|
||||
steps inside one gate cannot protect against an independent process.
|
||||
|
||||
@@ -169,26 +167,20 @@ runner still uses this helper after installing stable Rust.
|
||||
|
||||
Linux packages include build-essential, pkg-config, libasound2-dev, libudev-dev,
|
||||
libxkbcommon-dev, libwayland-dev, libx11-dev, libxrandr-dev, libxi-dev, Python 3,
|
||||
jq, ripgrep, Git, curl and CA certificates. ALSA development files satisfy CPAL's
|
||||
jq, Git, curl and CA certificates. ALSA development files satisfy CPAL's
|
||||
Linux build dependency; a running audio device is not needed. Non-Linux local
|
||||
hosts must already provide native compiler/SDK tools, Bash, Make, pkg-config,
|
||||
Python 3, jq, rg and Git. The provisioning script verifies these commands.
|
||||
Python 3, jq and Git. The provisioning script verifies these commands.
|
||||
|
||||
`target/quality-gate/metadata.json` records revision, dirty working tree, host,
|
||||
Rust/coverage-tool versions, configuration/source fingerprints, ordered step
|
||||
exit codes and report hashes. Each step has a separate combined-output log.
|
||||
The runner stops on the first failed Make target and returns its nonzero exit
|
||||
status; the log preserves underlying Cargo diagnostics. Three regression cases
|
||||
check failure logs/identity, fresh success evidence and partial-report retention
|
||||
when a later gate fails.
|
||||
Jenkins owns stage status, console logs, build identity and artifact fingerprints.
|
||||
GitHub retains step logs and uploaded coverage artifacts. Local execution streams
|
||||
command output and stops at the first failed target; no separate Python runner
|
||||
or metadata report is required.
|
||||
|
||||
Both pipelines discard old generated report directories before environment checks or setup and
|
||||
publish current artifacts even after gate failure. An early failed gate has
|
||||
metadata/logs but no old coverage report. Failure after generation preserves the
|
||||
partial current reports. Prerequisite or setup failure can leave no report at all and
|
||||
still fails CI. Reports are archived from `target/quality-gate/**` and
|
||||
`target/llvm-cov/**`; Jenkins also publishes current HTML when present. Artifact
|
||||
publication does not turn a failed gate into success.
|
||||
Both pipelines discard old coverage reports before prerequisite checks or setup,
|
||||
and archive current `target/llvm-cov/**` reports even after failure. Early failures
|
||||
may leave no report; later failures retain partial current reports. Jenkins also
|
||||
publishes HTML when present. Artifact publication does not mask a failed gate.
|
||||
|
||||
List domains or inspect ownership and existing evidence:
|
||||
|
||||
@@ -218,7 +210,7 @@ cargo test -p prometeu-cli --test automation_process packaged_installation_smoke
|
||||
# File-host commit latency with the production asset decoder.
|
||||
cargo test --release -p prometeu-system --all-features qualify_file_commits_with_production_asset_decoder -- --ignored --nocapture
|
||||
# Explicit layout observation.
|
||||
cargo test --release -p prometeu-bytecode --test registry_v1 reference_map_probe -- --ignored --exact --nocapture
|
||||
cargo test --release -p prometeu-bytecode --test registry_v0 reference_map_probe -- --ignored --exact --nocapture
|
||||
```
|
||||
|
||||
Other ignored timing probes remain opt-in by their individual test names.
|
||||
@@ -342,5 +334,5 @@ on that platform without lowering the existing floors.
|
||||
|
||||
No physical audio, eight-hour soak, packaged-installation or ignored manual
|
||||
latency/layout qualification was selected by this gate. Prior manual observations
|
||||
remain separate evidence. Current executable metadata and reports are emitted
|
||||
under `target/quality-gate/` and `target/llvm-cov/` by every invocation.
|
||||
remain separate evidence. Current coverage reports are emitted under `target/llvm-cov/`; CI retains execution
|
||||
logs and build status.
|
||||
|
||||
@@ -163,7 +163,7 @@ For exact immediates and stack effects, see `CoreOpCode::spec()` which is the si
|
||||
|
||||
## Registry instruction encodings
|
||||
|
||||
The [Registry contract](../specs/runtime/02c-program-registry-and-pbx-v1.md#dynamic-and-reference-instructions)
|
||||
The [Registry contract](../specs/runtime/02c-program-registry-and-pbx-v0.md#dynamic-and-reference-instructions)
|
||||
defines opcodes 0x0090–0x0096. Tooling recognizes their u32 TypeId immediates:
|
||||
|
||||
```text
|
||||
|
||||
@@ -59,7 +59,7 @@ overshoot, and faults precede BudgetExhausted without successful-step credit.
|
||||
|
||||
Generated metadata exposes guest mutation and variable costs. No RNG execution
|
||||
uses HostContext, syscalls, host entropy/time/address initialization, FFI,
|
||||
bigint runtime arithmetic or a parallel catalog. PBX v1 remains unchanged;
|
||||
bigint runtime arithmetic or a parallel catalog. PBX v0 remains unchanged;
|
||||
unreachable unknown IDs reject with InvalidCode/NativeId and Unknown analysis
|
||||
retains full runtime checks.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Typed collection producer and consumer handoff
|
||||
|
||||
The [collection ISA](../specs/runtime/02-vm-instruction-set.md#typed-collection-instructions), [memory contract](../specs/runtime/03-memory-stack-heap-and-allocation.md#typed-array-and-struct-storage) and [attempt charging](../specs/runtime/01-time-model-and-cycles.md#collection-attempt-charging) are normative. This interface has executable evidence through locally serialized PBX v1, `ValidatedProgramImage::load` and `VirtualMachine::from_image`. Production initialize, internal test producers and both example generators use the same sealed v1 path. External SDK/frontend adaptation remains a separate consumer obligation.
|
||||
The [collection ISA](../specs/runtime/02-vm-instruction-set.md#typed-collection-instructions), [memory contract](../specs/runtime/03-memory-stack-heap-and-allocation.md#typed-array-and-struct-storage) and [attempt charging](../specs/runtime/01-time-model-and-cycles.md#collection-attempt-charging) are normative. This interface has executable evidence through locally serialized PBX v0, `ValidatedProgramImage::load` and `VirtualMachine::from_image`. Production initialize, internal test producers and both example generators use the same sealed v0 path. External SDK/frontend adaptation remains a separate consumer obligation.
|
||||
|
||||
## Encoding and complete groups
|
||||
|
||||
@@ -62,7 +62,7 @@ Consumers must recognize all seven encodings, invoke Registry-derived effects in
|
||||
|
||||
Executable oracles live in bytecode `tests/registry_isa.rs`, VM `tests/collection_conformance.rs`, VM `virtual_machine/collections_tests.rs` and layer `tests/typed_collections.rs`. They cover independent bytes, default/alias/group operations, attempt costs and refusals, malformed/proven types, ownership and actual FRAME_SYNC graph reclamation. VM unit tests inject otherwise unreachable invalid state only inside tests. Optimized ownership/conformance runs complement debug evidence.
|
||||
|
||||
Dummy Boy and Stress emit sealed PBX v1, including empty captures sections, and
|
||||
Dummy Boy and Stress emit sealed PBX v0, including empty captures sections, and
|
||||
run through the production host. Fn is a one-slot nullable HeapRef value in fields
|
||||
and arrays; Dynamic can carry it with its exact Fn TypeId. Closure environments and
|
||||
shared private cells participate in existing reference maps. Default construction
|
||||
|
||||
@@ -35,7 +35,7 @@ three PUSH_I64 at 2 each, three GET_LOCAL at 2 each, SET_LOCAL at 2 and RET at 4
|
||||
Its ordered results are Int64 bits 0x86B1DA1D72062B68, Float bits
|
||||
0x3FB304AA46C98538 and Int64 -7. The unit interval consumes the third word;
|
||||
a subsequent next returns bits 0xF9090E529A7DAE00. Actual producer emission is
|
||||
exercised by the VM random contract tests through the official PBX v1 writer
|
||||
exercised by the VM random contract tests through the official PBX v0 writer
|
||||
and loader, not direct host callbacks.
|
||||
|
||||
## Storage and Dynamic
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Registry layout, load and GC evidence
|
||||
|
||||
This report records bounded technical fixtures for Registry layout, loading and GC. The normative contract is [Program Registry and PBX v1](../specs/runtime/02c-program-registry-and-pbx-v1.md); producer obligations and publication status are in the [producer handoff](registry-producer-handoff.md). [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md) explains the published mechanisms.
|
||||
This report records bounded technical fixtures for Registry layout, loading and GC. The normative contract is [Program Registry and PBX v0](../specs/runtime/02c-program-registry-and-pbx-v0.md); producer obligations and publication status are in the [producer handoff](registry-producer-handoff.md). [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md) explains the published mechanisms.
|
||||
|
||||
Measured on 2026-10-07: Darwin arm64, Rust 1.98.1 (`48a229cea`), host `aarch64-apple-darwin`, LLVM 22.1.8, optimized Cargo release profile. The code baseline is `c6fff08`; this report's commit also contains the load high-water instrumentation and measurement fixtures. Wall-clock values are single observations, not thresholds or statistically established throughput. No timing assertion is used.
|
||||
|
||||
## Reproduction
|
||||
|
||||
```sh
|
||||
cargo test -p prometeu-bytecode --release --test registry_v1 reference_map_probe -- --ignored --nocapture
|
||||
cargo test -p prometeu-bytecode --release --test registry_v0 reference_map_probe -- --ignored --nocapture
|
||||
cargo test -p prometeu-vm --release --lib probe -- --ignored --nocapture --test-threads=1
|
||||
cargo test -p prometeu-vm --release --lib decoded_trait_box_is_the_only_receiver_root_across_frame_sync_gc --quiet
|
||||
cargo test -p prometeu-vm --lib ownership_tests --quiet
|
||||
@@ -92,6 +92,6 @@ The native fixture stores one session-imported 13-byte String in both a String f
|
||||
|
||||
## Publication boundary
|
||||
|
||||
The sealed v1 image, bounded verifier, typed direct calls, Dynamic/reference execution, metered native strings and structured host diagnostics have executable evidence. Production `VirtualMachine::initialize` still uses the old loader, and existing generators still emit version 0. Their coordinated migration must preserve existing closures and requires a typed callable contract; the producer handoff records pending implementation targets and validation requirements.
|
||||
The sealed v0 image, bounded verifier, typed direct calls, Dynamic/reference execution, metered native strings and structured host diagnostics have executable evidence. Production `VirtualMachine::initialize` and both example generators now use the validated Registry format with typed callables and mandatory captures. The PBX version remains 0 during development; the producer handoff describes the current schema.
|
||||
|
||||
These measurements cover bounded layout/load/access/ownership/GC behavior. Representative-game capacity/headroom and coordinated long-run stress require separate workloads and evidence. No external compiler implementation, cross-host stress acceptance, regenerated production PBX smoke or final production activation is claimed by this report.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Registry v1 producer and consumer handoff
|
||||
# Registry producer and consumer handoff
|
||||
|
||||
This document describes the Registry v1 producer and consumer interfaces. The normative contract
|
||||
is [Program Registry and PBX v1](../specs/runtime/02c-program-registry-and-pbx-v1.md).
|
||||
This document describes the Registry producer and consumer interfaces. The normative contract
|
||||
is [Program Registry and PBX v0](../specs/runtime/02c-program-registry-and-pbx-v0.md).
|
||||
The rationale and published mechanisms are explained in [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md).
|
||||
The completed callable and production integration is explained in [Typed Callables and Frame-Owned Continuations](../../discussion/lessons/DSC-0052-vm-closures-captures-and-dynamic-calls/LSN-0061-typed-callables-and-frame-owned-continuations.md).
|
||||
|
||||
@@ -10,7 +10,7 @@ The completed callable and production integration is explained in [Typed Callabl
|
||||
The production `initialize` path uses bounded `ValidatedProgramImage::load` and
|
||||
`VirtualMachine::from_image`. The v0 decoder, slot-only verifier, scheduler and
|
||||
unchecked executable constructors have been removed. Internal test producers,
|
||||
Dummy Boy and Stress emit sealed v1 with typed Fn metadata and mandatory captures.
|
||||
Dummy Boy and Stress emit sealed v0 with typed Fn metadata and mandatory captures.
|
||||
The runtime retains existing constant/string ownership, collections, Dynamic and
|
||||
reference boundaries. The separate render frame scheduler remains active.
|
||||
|
||||
@@ -30,7 +30,7 @@ repository publishes requirements and oracles; those modules have not been edite
|
||||
|
||||
## Exact producer obligations
|
||||
|
||||
Emit PBX version 1 only. The header is 32 bytes: magic at 0, u16 version at 4,
|
||||
Emit PBX version 0 only. The header is 32 bytes: magic at 0, u16 version at 4,
|
||||
little-endian flag 0 at 6, reserved zero at 7, section count at 8 and twenty zero
|
||||
bytes at 12. Directory entries are file-relative u32 kind/offset/length triples.
|
||||
Mandatory kinds are 0, 1, 2, 4, 5, 6, 7 and 8; debug kind 3 is optional. Keep empty
|
||||
@@ -85,7 +85,7 @@ and payload publication cannot deadlock each other.
|
||||
## Independent binary oracles
|
||||
|
||||
The manually specified minimal executable in
|
||||
`crates/console/prometeu-bytecode/tests/registry_v1.rs::minimal_bytes` is 194 bytes.
|
||||
`crates/console/prometeu-bytecode/tests/registry_v0.rs::minimal_bytes` is 194 bytes.
|
||||
Its directory begins at 32; eight entries end at 128:
|
||||
|
||||
| Kind | Offset | Length | Payload |
|
||||
@@ -125,7 +125,7 @@ execution remains valid. Names do not adapt trait method compatibility.
|
||||
|
||||
## Endpoint-free input lowering
|
||||
|
||||
The [complete 54-entry table](../specs/runtime/02c-program-registry-and-pbx-v1.md#input)
|
||||
The [complete 54-entry table](../specs/runtime/02c-program-registry-and-pbx-v0.md#input)
|
||||
defines every accepted name/ID/result. Queries take zero guest arguments, read the
|
||||
logical-frame snapshot and cost one intrinsic cycle. States return Bool;
|
||||
hold/x/y return Int64. For example, `input.pad.a.down` lowers directly to
|
||||
|
||||
@@ -8,7 +8,7 @@ elapsed; the user explicitly waived the eight-hour completion requirement for
|
||||
this delivery. Eight-hour endurance was not demonstrated. Linux and other
|
||||
architectures have not been tested by this qualification.
|
||||
|
||||
The normative contracts remain [Registry/PBX v1](../specs/runtime/02c-program-registry-and-pbx-v1.md),
|
||||
The normative contracts remain [Registry/PBX v0](../specs/runtime/02c-program-registry-and-pbx-v0.md),
|
||||
[memory/GC](../specs/runtime/03-memory-stack-heap-and-allocation.md),
|
||||
[typed callables](../specs/runtime/02b-vm-function-values-and-closures.md), and
|
||||
[single-context lifecycle](../specs/runtime/09a-coroutines-and-cooperative-scheduling.md).
|
||||
@@ -56,9 +56,9 @@ and function context are checked where applicable. VM quotas are not RSS caps.
|
||||
| Resource / invariant | Accepted limit / rule | Enforcement and evidence |
|
||||
| --- | --- | --- |
|
||||
| Input PBX | 64 MiB | HAL `cartridge_loader::read_program` checks metadata before read and detects extra data without unchecked growth. `program_admission_accepts_exact_limit_and_rejects_growth_after_metadata`, metadata-before-read, short/interrupted-read and real sparse-file rejection tests. |
|
||||
| Code | 32 MiB | Bytecode envelope/owned decoder uses `LoadBudget` before materialization; `registry_v1` covers oversized declarations, truncation, code ranges and transactional payload refusal. |
|
||||
| Code | 32 MiB | Bytecode envelope/owned decoder uses `LoadBudget` before materialization; `registry_v0` covers oversized declarations, truncation, code ranges and transactional payload refusal. |
|
||||
| Type/function records | 65,536 each | Registry decoder/resolver bounded count admission; `oversized_counts_fail_before_dependent_allocation` and invalid reference tests. |
|
||||
| Implementation/nested records | 262,144 / 1,048,576 | Registry resolution/codec count checks; multi-slot/trait records, aggregate checks and owned-payload rollback coverage in `registry_v1`. |
|
||||
| Implementation/nested records | 262,144 / 1,048,576 | Registry resolution/codec count checks; multi-slot/trait records, aggregate checks and owned-payload rollback coverage in `registry_v0`. |
|
||||
| Names | 4,096 bytes each; 4 MiB aggregate | `name_limits_include_aggregate_and_empty_is_not_absent`; invalid UTF-8/flags/tails rejected before publication. |
|
||||
| Retained Registry | 64 MiB/image | Charged native layouts/capacities during resolution; `work_retained_and_temporary_limits_refuse_before_publication`; explicit reference-map probe records native representation. |
|
||||
| Load scratch | 128 MiB | Parser/writer/verifier temporary buffers charged and refunded; `scratch_is_refunded_per_function_and_preserves_prior_load_ownership`, `stack_analysis_refunds_all_state_buffers_and_preserves_prior_ownership`, sealed-image load probe. |
|
||||
@@ -79,7 +79,7 @@ and function context are checked where applicable. VM quotas are not RSS caps.
|
||||
| No-sync loop | Existing slice/fuel semantics | 1,000 finite slices of a sealed `JMP 0` program return BudgetExhausted, preserve PC/depth/capacities, perform no GC, and remain breakpoint-controllable. No frame completion is fabricated. |
|
||||
|
||||
Relevant test sources:
|
||||
[Registry v1](../../crates/console/prometeu-bytecode/tests/registry_v1.rs),
|
||||
[Registry](../../crates/console/prometeu-bytecode/tests/registry_v0.rs),
|
||||
[HAL cartridge admission](../../crates/console/prometeu-hal/src/cartridge_loader.rs),
|
||||
[heap](../../crates/console/prometeu-vm/src/heap.rs),
|
||||
[string ledger](../../crates/console/prometeu-vm/src/string_ledger/tests.rs),
|
||||
|
||||
@@ -123,4 +123,4 @@ layout.
|
||||
These synthetic boundary measurements establish lookup work and ownership
|
||||
behavior. They do not establish gameplay/frame speedups, long-run memory stability,
|
||||
other-platform timings or hardware-independent latency limits. The normative
|
||||
ownership contract is in [Registry and PBX](../specs/runtime/02c-program-registry-and-pbx-v1.md#memory-ownership-and-quotas).
|
||||
ownership contract is in [Registry and PBX](../specs/runtime/02c-program-registry-and-pbx-v0.md#memory-ownership-and-quotas).
|
||||
|
||||
Reference in New Issue
Block a user