feat(vm): add VM-owned PCG64 random and coverage headroom
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good

Implement GC-managed random generators, next/nextf intrinsics, bounded ranges and deterministic conformance coverage. Publish the runtime contract and producer guidance.

Give coverage domains at least five percentage points of measured headroom while preserving sufficient floors. Record local qualification: make ci-domains passes with 939 tests and all domain gates green.
This commit is contained in:
2026-10-09 12:51:05 +01:00
parent 9318cf7cd3
commit 3e39a90083
50 changed files with 2545 additions and 189 deletions
+4
View File
@@ -198,3 +198,7 @@ The verifier statically checks bytecode for structural safety and stack‑shape
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.
`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.
## VM-owned random core
See the [random contract](../specs/runtime/02e-vm-owned-random-core.md) for Random BuiltinId 0x0016, ObjectKind tag 9, intrinsics 0x4000–0x4003, atomic state mutation, bounded 4+8*N costs and rejection-limit trap 0x00000015. Random is managed by the VM heap and existing GC, without host entropy or PBX changes.
+51 -10
View File
@@ -42,7 +42,7 @@ LLVM lines still need an owner.
| tooling | CLI and dummy/stress PBX producers |
| dev/test-support | Shared test-program construction and development infrastructure source stubs |
Existing specialized paths and baselines retain their original values.
Existing specialized paths retain their original ownership.
Residual domains use broad crate source prefixes with explicit exclusions,
so a new module inherits the appropriate owner. A new crate or conflicting
prefix must be assigned before the ownership audit can pass.
@@ -93,9 +93,18 @@ this percentage is at least baseline_percent. Counts for functions and
regions remain supporting evidence. Scenario/contract assertions continue
to govern behavior; a percentage does not replace them.
New domains start from a fresh measured baseline, using the same truncation.
Do not lower existing thresholds to hide a failing run. An intentional scope
or baseline revision requires explicit review with measured evidence.
Measured coverage and the acceptance floor are separate values. This explicitly
reviewed revision gives every domain at least 5.00 percentage points of headroom
from the recorded local measurement. Its rule is
`new_floor = min(original_floor, measured_percent - 5.00)`, using the same
downward truncation. Floors already providing that margin remain unchanged.
Five percentage points means an 88.56% measurement permits an 83.56% floor;
it is not a relative five-percent reduction.
Floors remain fixed during CI. A failing run does not automatically lower them.
An intentional scope or floor revision requires explicit review with fresh
measured evidence. New domains also require an explicit floor supported by a
fresh measurement.
## Commands and CI
@@ -124,12 +133,13 @@ Inspect a domain:
Dependencies are the existing Rust/LLVM coverage tooling, Bash, Git, jq and rg,
plus Python 3 for the standard-library ownership auditor.
## Published local baseline
## Historical local baseline
The [measured evidence](COVERAGE_DOMAINS_EVIDENCE.json) records configuration,
The [initial measured evidence](COVERAGE_DOMAINS_EVIDENCE.json) records configuration,
source/report fingerprints, command/toolchain/host, line totals and gate
results for all 15 domains. The eight earlier domain definitions are
preserved. The seven additional baselines measured on macOS/aarch64 are:
results for all 15 domains before the margin revision. It preserves the eight
earlier domain definitions and records these seven additional starting floors
on macOS/aarch64:
| New domain | Baseline lines |
| --- | ---: |
@@ -141,7 +151,38 @@ preserved. The seven additional baselines measured on macOS/aarch64 are:
| tooling | 64.75% |
| dev/test-support | 85.96% |
These are observed starting baselines, not uniform target percentages.
These are historical starting floors; current acceptance floors appear below.
## Current local margins
The [margin evidence](COVERAGE_DOMAINS_MARGIN.json) records fresh measurements,
original and revised floors, toolchain, fingerprints and executed validation.
Only domains with less than 5.00 percentage points of headroom were adjusted.
The historical evidence above remains unchanged.
| Domain | Measured lines | Original floor | Current floor | Margin (points) |
| --- | ---: | ---: | ---: | ---: |
| system/os | 82.24% | 77.24% | 77.24% | 5.00 |
| system/runtime | 81.19% | 76.50% | 76.19% | 5.00 |
| system/fs | 81.08% | 76.08% | 76.08% | 5.00 |
| system/programs | 98.05% | 93.05% | 93.05% | 5.00 |
| asset/bank | 91.76% | 86.76% | 86.76% | 5.00 |
| firmware | 88.26% | 83.20% | 83.20% | 5.06 |
| host-dependent | 45.05% | 40.05% | 40.05% | 5.00 |
| host/headless | 88.39% | 83.39% | 83.39% | 5.00 |
| vm/core | 89.29% | 89.12% | 84.29% | 5.00 |
| bytecode | 93.26% | 93.23% | 88.26% | 5.00 |
| hal/core | 88.56% | 88.56% | 83.56% | 5.00 |
| drivers/core | 84.51% | 84.51% | 79.51% | 5.00 |
| system/core | 92.71% | 92.71% | 87.71% | 5.00 |
| tooling | 64.75% | 64.75% | 59.75% | 5.00 |
| dev/test-support | 85.96% | 85.96% | 80.96% | 5.00 |
The full local `make ci-domains` validation passed with 939 tests passed and
9 ignored. `system/runtime` measured 81.26% in the initial run and 81.19%
in verification; its final floor uses the lower measurement. All gates were
rechecked against the verification report after that final adjustment.
Platform-specific compilation and host scenarios can change report totals.
Local evidence does not certify an unexecuted Linux or Intel Mac run; evaluate
those runs using the unchanged repository policy and investigate differences.
those runs against the configured floors and investigate differences.
+235
View File
@@ -0,0 +1,235 @@
{
"date": "2026-10-09",
"host": "aarch64-apple-darwin",
"scope": "Local workspace qualification; remote pipeline failure was not reproduced locally.",
"required_margin_percentage_points": 5.0,
"rule": "floor = min(original_floor, min(initial_measured_percent, verification_measured_percent) - 5.00); all percentages truncated downward to two decimals",
"automatic_floor_updates": false,
"rustc": [
"rustc 1.98.1 (48a229cea 2026-09-01)",
"binary: rustc",
"commit-hash: 48a229ceaefd4985c50990b14116b6d856af0985",
"commit-date: 2026-09-01",
"host: aarch64-apple-darwin",
"release: 1.98.1",
"LLVM version: 22.1.8"
],
"cargo_llvm_cov": "cargo-llvm-cov 0.8.5",
"git_head": "9318cf7cd34c98095abd6c83be2db2b507735550",
"workspace_state": "Includes the previously delivered, uncommitted random core changes.",
"source_fingerprint": {
"scope": "All Rust files under crates, including tests/examples/benches",
"files": 273,
"algorithm": "SHA-256 of sorted records: relative path + NUL + file SHA-256 hex + newline",
"sha256": "5cf23ec6bf8b0aa0866d63ccc1bf8cba2b3f0d7ed85951a085eba465d118e1a1"
},
"original_config_sha256": "209b90dc32148f2ef52a3bab72e8e9df8e3daae78d97f967b891340a0bcad184",
"config_sha256": "fbcb8d2fa7366dcba5175b42719a1adf0aaddd7e6d630c708228443150a4f78d",
"historical_evidence_sha256": "b56b328f7c01f7325aea88881ccc6e4d343405bfaee1aba02518092fc39ec088",
"llvm_report_sha256": "ad1e20ff5bd40bbf82d334967dfedc49467e69065ad02c9255600286ee7c7043",
"validation": [
{
"command": "CARGO_NET_OFFLINE=true make ci-domains",
"stage": "Before floor adjustment",
"exit_code": 0,
"tests": {
"passed": 939,
"failed": 0,
"ignored": 9
},
"log_sha256": "e65e3c44bca8abd808255e3fa65d61c791b088fed6572645e774c2dd52775b5e"
},
{
"command": "CARGO_NET_OFFLINE=true make ci-domains",
"stage": "After initial floor adjustment",
"exit_code": 0,
"tests": {
"passed": 939,
"failed": 0,
"ignored": 9
},
"config_sha256": "2eb7bb9e5f0f97eb7db4ea511dad3e51237e68ad60a08aad8e24b37c01442121",
"log_sha256": "60a2726a31c1aa0423ded7720d9e9034589b9c25617ca30ffc174833b130e188"
},
{
"command": "make coverage-domain-gate",
"stage": "Final configuration against the unchanged verification report",
"exit_code": 0,
"log_sha256": "0e52dc48cf88ec1a0aba2a39db25627098137744718aa1f7f542b66a5e335ba3"
},
{
"command": "python3 scripts/audit-coverage-domains.py --report target/llvm-cov/report.json --json",
"stage": "Final ownership/evidence audit",
"exit_code": 0,
"source_files": 236
}
],
"verification_adjustment": "system/runtime measured 81.26% initially and 81.19% on verification. Its floor was reduced from 76.26% to 76.19% after the full target passed, then all gates were rechecked against the same report. Other floors were unchanged after the full run.",
"domains": {
"system/os": {
"lines_covered": 1200,
"lines_count": 1459,
"initial_measured_percent": 82.24,
"measured_percent": 82.24,
"original_floor_percent": 77.24,
"floor_percent": 77.24,
"margin_percentage_points": 5.0,
"adjusted": false,
"gate_passed": true
},
"system/runtime": {
"lines_covered": 2466,
"lines_count": 3037,
"initial_measured_percent": 81.26,
"measured_percent": 81.19,
"original_floor_percent": 76.5,
"floor_percent": 76.19,
"margin_percentage_points": 5.0,
"adjusted": true,
"gate_passed": true
},
"system/fs": {
"lines_covered": 403,
"lines_count": 497,
"initial_measured_percent": 81.08,
"measured_percent": 81.08,
"original_floor_percent": 76.08,
"floor_percent": 76.08,
"margin_percentage_points": 5.0,
"adjusted": false,
"gate_passed": true
},
"system/programs": {
"lines_covered": 555,
"lines_count": 566,
"initial_measured_percent": 98.05,
"measured_percent": 98.05,
"original_floor_percent": 93.05,
"floor_percent": 93.05,
"margin_percentage_points": 5.0,
"adjusted": false,
"gate_passed": true
},
"asset/bank": {
"lines_covered": 2640,
"lines_count": 2877,
"initial_measured_percent": 91.76,
"measured_percent": 91.76,
"original_floor_percent": 86.76,
"floor_percent": 86.76,
"margin_percentage_points": 5.0,
"adjusted": false,
"gate_passed": true
},
"firmware": {
"lines_covered": 1384,
"lines_count": 1568,
"initial_measured_percent": 88.26,
"measured_percent": 88.26,
"original_floor_percent": 83.2,
"floor_percent": 83.2,
"margin_percentage_points": 5.06,
"adjusted": false,
"gate_passed": true
},
"host-dependent": {
"lines_covered": 779,
"lines_count": 1729,
"initial_measured_percent": 45.05,
"measured_percent": 45.05,
"original_floor_percent": 40.05,
"floor_percent": 40.05,
"margin_percentage_points": 5.0,
"adjusted": false,
"gate_passed": true
},
"host/headless": {
"lines_covered": 693,
"lines_count": 784,
"initial_measured_percent": 88.39,
"measured_percent": 88.39,
"original_floor_percent": 83.39,
"floor_percent": 83.39,
"margin_percentage_points": 5.0,
"adjusted": false,
"gate_passed": true
},
"vm/core": {
"lines_covered": 7957,
"lines_count": 8911,
"initial_measured_percent": 89.29,
"measured_percent": 89.29,
"original_floor_percent": 89.12,
"floor_percent": 84.29,
"margin_percentage_points": 5.0,
"adjusted": true,
"gate_passed": true
},
"bytecode": {
"lines_covered": 3034,
"lines_count": 3253,
"initial_measured_percent": 93.26,
"measured_percent": 93.26,
"original_floor_percent": 93.23,
"floor_percent": 88.26,
"margin_percentage_points": 5.0,
"adjusted": true,
"gate_passed": true
},
"hal/core": {
"lines_covered": 2060,
"lines_count": 2326,
"initial_measured_percent": 88.56,
"measured_percent": 88.56,
"original_floor_percent": 88.56,
"floor_percent": 83.56,
"margin_percentage_points": 5.0,
"adjusted": true,
"gate_passed": true
},
"drivers/core": {
"lines_covered": 2314,
"lines_count": 2738,
"initial_measured_percent": 84.51,
"measured_percent": 84.51,
"original_floor_percent": 84.51,
"floor_percent": 79.51,
"margin_percentage_points": 5.0,
"adjusted": true,
"gate_passed": true
},
"system/core": {
"lines_covered": 1196,
"lines_count": 1290,
"initial_measured_percent": 92.71,
"measured_percent": 92.71,
"original_floor_percent": 92.71,
"floor_percent": 87.71,
"margin_percentage_points": 5.0,
"adjusted": true,
"gate_passed": true
},
"tooling": {
"lines_covered": 395,
"lines_count": 610,
"initial_measured_percent": 64.75,
"measured_percent": 64.75,
"original_floor_percent": 64.75,
"floor_percent": 59.75,
"margin_percentage_points": 5.0,
"adjusted": true,
"gate_passed": true
},
"dev/test-support": {
"lines_covered": 98,
"lines_count": 114,
"initial_measured_percent": 85.96,
"measured_percent": 85.96,
"original_floor_percent": 85.96,
"floor_percent": 80.96,
"margin_percentage_points": 5.0,
"adjusted": true,
"gate_passed": true
}
}
}
+106 -102
View File
@@ -1,102 +1,106 @@
final_id_hex,final_id_dec,canonical_name,canonical_version,owner,name,arg_slots,ret_slots,arg_layout,ret_layout,deterministic,may_allocate,parameter_names,cost_cycles
0x1000,4096,vec2.dot,1,vec2,dot,4,1,Float|Float|Float|Float,Float,true,false,ax|ay|bx|by,10
0x1001,4097,vec2.length,1,vec2,length,2,1,Float|Float,Float,true,false,x|y,40
0x1100,4352,color.from_raw,1,color,from_raw,1,1,Int64,builtin:color,true,false,raw,1
0x1101,4353,color.rgb,1,color,rgb,3,1,Int64|Int64|Int64,builtin:color,true,false,r|g|b,1
0x1102,4354,color.rgba,1,color,rgba,4,1,Int64|Int64|Int64|Int64,builtin:color,true,false,r|g|b|a,1
0x1103,4355,color.html_rgba,1,color,html_rgba,1,1,String,builtin:color,true,false,value,1
0x1104,4356,color.gray_scale,1,color,gray_scale,1,1,Int64,builtin:color,true,false,value,1
0x1105,4357,color.hex,1,color,hex,1,1,builtin:color,Int64,true,false,color,1
0x1106,4358,color.alpha,1,color,alpha,1,1,builtin:color,Int64,true,false,color,1
0x1120,4384,color.black,1,color,black,0,1,,builtin:color,true,false,,1
0x1121,4385,color.white,1,color,white,0,1,,builtin:color,true,false,,1
0x1122,4386,color.red,1,color,red,0,1,,builtin:color,true,false,,1
0x1123,4387,color.green,1,color,green,0,1,,builtin:color,true,false,,1
0x1124,4388,color.blue,1,color,blue,0,1,,builtin:color,true,false,,1
0x1125,4389,color.yellow,1,color,yellow,0,1,,builtin:color,true,false,,1
0x1126,4390,color.orange,1,color,orange,0,1,,builtin:color,true,false,,1
0x1127,4391,color.indigo,1,color,indigo,0,1,,builtin:color,true,false,,1
0x1128,4392,color.gray,1,color,gray,0,1,,builtin:color,true,false,,1
0x1129,4393,color.cyan,1,color,cyan,0,1,,builtin:color,true,false,,1
0x112A,4394,color.magenta,1,color,magenta,0,1,,builtin:color,true,false,,1
0x112B,4395,color.transparent,1,color,transparent,0,1,,builtin:color,true,false,,1
0x2100,8448,input.pad.up.pressed,1,input.pad.up,pressed,0,1,,Bool,true,false,,1
0x2101,8449,input.pad.up.released,1,input.pad.up,released,0,1,,Bool,true,false,,1
0x2102,8450,input.pad.up.down,1,input.pad.up,down,0,1,,Bool,true,false,,1
0x2103,8451,input.pad.up.hold,1,input.pad.up,hold,0,1,,Int64,true,false,,1
0x2104,8452,input.pad.down.pressed,1,input.pad.down,pressed,0,1,,Bool,true,false,,1
0x2105,8453,input.pad.down.released,1,input.pad.down,released,0,1,,Bool,true,false,,1
0x2106,8454,input.pad.down.down,1,input.pad.down,down,0,1,,Bool,true,false,,1
0x2107,8455,input.pad.down.hold,1,input.pad.down,hold,0,1,,Int64,true,false,,1
0x2108,8456,input.pad.left.pressed,1,input.pad.left,pressed,0,1,,Bool,true,false,,1
0x2109,8457,input.pad.left.released,1,input.pad.left,released,0,1,,Bool,true,false,,1
0x210A,8458,input.pad.left.down,1,input.pad.left,down,0,1,,Bool,true,false,,1
0x210B,8459,input.pad.left.hold,1,input.pad.left,hold,0,1,,Int64,true,false,,1
0x210C,8460,input.pad.right.pressed,1,input.pad.right,pressed,0,1,,Bool,true,false,,1
0x210D,8461,input.pad.right.released,1,input.pad.right,released,0,1,,Bool,true,false,,1
0x210E,8462,input.pad.right.down,1,input.pad.right,down,0,1,,Bool,true,false,,1
0x210F,8463,input.pad.right.hold,1,input.pad.right,hold,0,1,,Int64,true,false,,1
0x2110,8464,input.pad.a.pressed,1,input.pad.a,pressed,0,1,,Bool,true,false,,1
0x2111,8465,input.pad.a.released,1,input.pad.a,released,0,1,,Bool,true,false,,1
0x2112,8466,input.pad.a.down,1,input.pad.a,down,0,1,,Bool,true,false,,1
0x2113,8467,input.pad.a.hold,1,input.pad.a,hold,0,1,,Int64,true,false,,1
0x2114,8468,input.pad.b.pressed,1,input.pad.b,pressed,0,1,,Bool,true,false,,1
0x2115,8469,input.pad.b.released,1,input.pad.b,released,0,1,,Bool,true,false,,1
0x2116,8470,input.pad.b.down,1,input.pad.b,down,0,1,,Bool,true,false,,1
0x2117,8471,input.pad.b.hold,1,input.pad.b,hold,0,1,,Int64,true,false,,1
0x2118,8472,input.pad.x.pressed,1,input.pad.x,pressed,0,1,,Bool,true,false,,1
0x2119,8473,input.pad.x.released,1,input.pad.x,released,0,1,,Bool,true,false,,1
0x211A,8474,input.pad.x.down,1,input.pad.x,down,0,1,,Bool,true,false,,1
0x211B,8475,input.pad.x.hold,1,input.pad.x,hold,0,1,,Int64,true,false,,1
0x211C,8476,input.pad.y.pressed,1,input.pad.y,pressed,0,1,,Bool,true,false,,1
0x211D,8477,input.pad.y.released,1,input.pad.y,released,0,1,,Bool,true,false,,1
0x211E,8478,input.pad.y.down,1,input.pad.y,down,0,1,,Bool,true,false,,1
0x211F,8479,input.pad.y.hold,1,input.pad.y,hold,0,1,,Int64,true,false,,1
0x2120,8480,input.pad.l.pressed,1,input.pad.l,pressed,0,1,,Bool,true,false,,1
0x2121,8481,input.pad.l.released,1,input.pad.l,released,0,1,,Bool,true,false,,1
0x2122,8482,input.pad.l.down,1,input.pad.l,down,0,1,,Bool,true,false,,1
0x2123,8483,input.pad.l.hold,1,input.pad.l,hold,0,1,,Int64,true,false,,1
0x2124,8484,input.pad.r.pressed,1,input.pad.r,pressed,0,1,,Bool,true,false,,1
0x2125,8485,input.pad.r.released,1,input.pad.r,released,0,1,,Bool,true,false,,1
0x2126,8486,input.pad.r.down,1,input.pad.r,down,0,1,,Bool,true,false,,1
0x2127,8487,input.pad.r.hold,1,input.pad.r,hold,0,1,,Int64,true,false,,1
0x2128,8488,input.pad.start.pressed,1,input.pad.start,pressed,0,1,,Bool,true,false,,1
0x2129,8489,input.pad.start.released,1,input.pad.start,released,0,1,,Bool,true,false,,1
0x212A,8490,input.pad.start.down,1,input.pad.start,down,0,1,,Bool,true,false,,1
0x212B,8491,input.pad.start.hold,1,input.pad.start,hold,0,1,,Int64,true,false,,1
0x212C,8492,input.pad.select.pressed,1,input.pad.select,pressed,0,1,,Bool,true,false,,1
0x212D,8493,input.pad.select.released,1,input.pad.select,released,0,1,,Bool,true,false,,1
0x212E,8494,input.pad.select.down,1,input.pad.select,down,0,1,,Bool,true,false,,1
0x212F,8495,input.pad.select.hold,1,input.pad.select,hold,0,1,,Int64,true,false,,1
0x2130,8496,input.touch.button.pressed,1,input.touch.button,pressed,0,1,,Bool,true,false,,1
0x2131,8497,input.touch.button.released,1,input.touch.button,released,0,1,,Bool,true,false,,1
0x2132,8498,input.touch.button.down,1,input.touch.button,down,0,1,,Bool,true,false,,1
0x2133,8499,input.touch.button.hold,1,input.touch.button,hold,0,1,,Int64,true,false,,1
0x2134,8500,input.touch.x,1,input.touch,x,0,1,,Int64,true,false,,1
0x2135,8501,input.touch.y,1,input.touch,y,0,1,,Int64,true,false,,1
0x3000,12288,math.i32.min,1,math.i32,min,2,1,Int32|Int32,Int32,true,false,a|b,2
0x3001,12289,math.i32.max,1,math.i32,max,2,1,Int32|Int32,Int32,true,false,a|b,2
0x3002,12290,math.i32.clamp,1,math.i32,clamp,3,1,Int32|Int32|Int32,Int32,true,false,value|min|max,4
0x3003,12291,math.i32.abs,1,math.i32,abs,1,1,Int32,Int32,true,false,value,2
0x3004,12292,math.i64.min,1,math.i64,min,2,1,Int64|Int64,Int64,true,false,a|b,2
0x3005,12293,math.i64.max,1,math.i64,max,2,1,Int64|Int64,Int64,true,false,a|b,2
0x3006,12294,math.i64.clamp,1,math.i64,clamp,3,1,Int64|Int64|Int64,Int64,true,false,value|min|max,4
0x3007,12295,math.i64.abs,1,math.i64,abs,1,1,Int64,Int64,true,false,value,2
0x3008,12296,mathf.min,1,mathf,min,2,1,Float|Float,Float,true,false,a|b,2
0x3009,12297,mathf.max,1,mathf,max,2,1,Float|Float,Float,true,false,a|b,2
0x300A,12298,mathf.clamp,1,mathf,clamp,3,1,Float|Float|Float,Float,true,false,value|min|max,4
0x300B,12299,mathf.abs,1,mathf,abs,1,1,Float,Float,true,false,value,2
0x300C,12300,mathf.floor,1,mathf,floor,1,1,Float,Float,true,false,value,4
0x300D,12301,mathf.ceil,1,mathf,ceil,1,1,Float,Float,true,false,value,4
0x300E,12302,mathf.trunc,1,mathf,trunc,1,1,Float,Float,true,false,value,4
0x300F,12303,mathf.round,1,mathf,round,1,1,Float,Float,true,false,value,4
0x3010,12304,mathf.sqrt,1,mathf,sqrt,1,1,Float,Float,true,false,value,16
0x3011,12305,mathf.sin,1,mathf,sin,1,1,Float,Float,true,false,angle,32
0x3012,12306,mathf.cos,1,mathf,cos,1,1,Float,Float,true,false,angle,32
0x3013,12307,mathf.atan2,1,mathf,atan2,2,1,Float|Float,Float,true,false,y|x,48
0x3014,12308,math.i32.to_i64,1,math.i32,to_i64,1,1,Int32,Int64,true,false,value,2
0x3015,12309,math.i64.to_i32,1,math.i64,to_i32,1,1,Int64,Int32,true,false,value,2
0x3016,12310,math.i32.to_float,1,math.i32,to_float,1,1,Int32,Float,true,false,value,2
0x3017,12311,math.i64.to_float,1,math.i64,to_float,1,1,Int64,Float,true,false,value,2
0x3018,12312,mathf.to_i32,1,mathf,to_i32,1,1,Float,Int32,true,false,value,2
0x3019,12313,mathf.to_i64,1,mathf,to_i64,1,1,Float,Int64,true,false,value,2
final_id_hex,final_id_dec,canonical_name,canonical_version,owner,name,arg_slots,ret_slots,arg_layout,ret_layout,deterministic,may_allocate,parameter_names,cost_cycles,mutates_guest_state,cost_model,attempt_cost_cycles,max_attempts
0x1000,4096,vec2.dot,1,vec2,dot,4,1,Float|Float|Float|Float,Float,true,false,ax|ay|bx|by,10,false,fixed,0,0
0x1001,4097,vec2.length,1,vec2,length,2,1,Float|Float,Float,true,false,x|y,40,false,fixed,0,0
0x1100,4352,color.from_raw,1,color,from_raw,1,1,Int64,builtin:color,true,false,raw,1,false,fixed,0,0
0x1101,4353,color.rgb,1,color,rgb,3,1,Int64|Int64|Int64,builtin:color,true,false,r|g|b,1,false,fixed,0,0
0x1102,4354,color.rgba,1,color,rgba,4,1,Int64|Int64|Int64|Int64,builtin:color,true,false,r|g|b|a,1,false,fixed,0,0
0x1103,4355,color.html_rgba,1,color,html_rgba,1,1,String,builtin:color,true,false,value,1,false,fixed,0,0
0x1104,4356,color.gray_scale,1,color,gray_scale,1,1,Int64,builtin:color,true,false,value,1,false,fixed,0,0
0x1105,4357,color.hex,1,color,hex,1,1,builtin:color,Int64,true,false,color,1,false,fixed,0,0
0x1106,4358,color.alpha,1,color,alpha,1,1,builtin:color,Int64,true,false,color,1,false,fixed,0,0
0x1120,4384,color.black,1,color,black,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1121,4385,color.white,1,color,white,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1122,4386,color.red,1,color,red,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1123,4387,color.green,1,color,green,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1124,4388,color.blue,1,color,blue,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1125,4389,color.yellow,1,color,yellow,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1126,4390,color.orange,1,color,orange,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1127,4391,color.indigo,1,color,indigo,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1128,4392,color.gray,1,color,gray,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x1129,4393,color.cyan,1,color,cyan,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x112A,4394,color.magenta,1,color,magenta,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x112B,4395,color.transparent,1,color,transparent,0,1,,builtin:color,true,false,,1,false,fixed,0,0
0x2100,8448,input.pad.up.pressed,1,input.pad.up,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2101,8449,input.pad.up.released,1,input.pad.up,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2102,8450,input.pad.up.down,1,input.pad.up,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2103,8451,input.pad.up.hold,1,input.pad.up,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2104,8452,input.pad.down.pressed,1,input.pad.down,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2105,8453,input.pad.down.released,1,input.pad.down,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2106,8454,input.pad.down.down,1,input.pad.down,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2107,8455,input.pad.down.hold,1,input.pad.down,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2108,8456,input.pad.left.pressed,1,input.pad.left,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2109,8457,input.pad.left.released,1,input.pad.left,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x210A,8458,input.pad.left.down,1,input.pad.left,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x210B,8459,input.pad.left.hold,1,input.pad.left,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x210C,8460,input.pad.right.pressed,1,input.pad.right,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x210D,8461,input.pad.right.released,1,input.pad.right,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x210E,8462,input.pad.right.down,1,input.pad.right,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x210F,8463,input.pad.right.hold,1,input.pad.right,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2110,8464,input.pad.a.pressed,1,input.pad.a,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2111,8465,input.pad.a.released,1,input.pad.a,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2112,8466,input.pad.a.down,1,input.pad.a,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2113,8467,input.pad.a.hold,1,input.pad.a,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2114,8468,input.pad.b.pressed,1,input.pad.b,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2115,8469,input.pad.b.released,1,input.pad.b,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2116,8470,input.pad.b.down,1,input.pad.b,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2117,8471,input.pad.b.hold,1,input.pad.b,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2118,8472,input.pad.x.pressed,1,input.pad.x,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2119,8473,input.pad.x.released,1,input.pad.x,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x211A,8474,input.pad.x.down,1,input.pad.x,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x211B,8475,input.pad.x.hold,1,input.pad.x,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x211C,8476,input.pad.y.pressed,1,input.pad.y,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x211D,8477,input.pad.y.released,1,input.pad.y,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x211E,8478,input.pad.y.down,1,input.pad.y,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x211F,8479,input.pad.y.hold,1,input.pad.y,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2120,8480,input.pad.l.pressed,1,input.pad.l,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2121,8481,input.pad.l.released,1,input.pad.l,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2122,8482,input.pad.l.down,1,input.pad.l,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2123,8483,input.pad.l.hold,1,input.pad.l,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2124,8484,input.pad.r.pressed,1,input.pad.r,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2125,8485,input.pad.r.released,1,input.pad.r,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2126,8486,input.pad.r.down,1,input.pad.r,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2127,8487,input.pad.r.hold,1,input.pad.r,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2128,8488,input.pad.start.pressed,1,input.pad.start,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2129,8489,input.pad.start.released,1,input.pad.start,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x212A,8490,input.pad.start.down,1,input.pad.start,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x212B,8491,input.pad.start.hold,1,input.pad.start,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x212C,8492,input.pad.select.pressed,1,input.pad.select,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x212D,8493,input.pad.select.released,1,input.pad.select,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x212E,8494,input.pad.select.down,1,input.pad.select,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x212F,8495,input.pad.select.hold,1,input.pad.select,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2130,8496,input.touch.button.pressed,1,input.touch.button,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2131,8497,input.touch.button.released,1,input.touch.button,released,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2132,8498,input.touch.button.down,1,input.touch.button,down,0,1,,Bool,true,false,,1,false,fixed,0,0
0x2133,8499,input.touch.button.hold,1,input.touch.button,hold,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2134,8500,input.touch.x,1,input.touch,x,0,1,,Int64,true,false,,1,false,fixed,0,0
0x2135,8501,input.touch.y,1,input.touch,y,0,1,,Int64,true,false,,1,false,fixed,0,0
0x3000,12288,math.i32.min,1,math.i32,min,2,1,Int32|Int32,Int32,true,false,a|b,2,false,fixed,0,0
0x3001,12289,math.i32.max,1,math.i32,max,2,1,Int32|Int32,Int32,true,false,a|b,2,false,fixed,0,0
0x3002,12290,math.i32.clamp,1,math.i32,clamp,3,1,Int32|Int32|Int32,Int32,true,false,value|min|max,4,false,fixed,0,0
0x3003,12291,math.i32.abs,1,math.i32,abs,1,1,Int32,Int32,true,false,value,2,false,fixed,0,0
0x3004,12292,math.i64.min,1,math.i64,min,2,1,Int64|Int64,Int64,true,false,a|b,2,false,fixed,0,0
0x3005,12293,math.i64.max,1,math.i64,max,2,1,Int64|Int64,Int64,true,false,a|b,2,false,fixed,0,0
0x3006,12294,math.i64.clamp,1,math.i64,clamp,3,1,Int64|Int64|Int64,Int64,true,false,value|min|max,4,false,fixed,0,0
0x3007,12295,math.i64.abs,1,math.i64,abs,1,1,Int64,Int64,true,false,value,2,false,fixed,0,0
0x3008,12296,mathf.min,1,mathf,min,2,1,Float|Float,Float,true,false,a|b,2,false,fixed,0,0
0x3009,12297,mathf.max,1,mathf,max,2,1,Float|Float,Float,true,false,a|b,2,false,fixed,0,0
0x300A,12298,mathf.clamp,1,mathf,clamp,3,1,Float|Float|Float,Float,true,false,value|min|max,4,false,fixed,0,0
0x300B,12299,mathf.abs,1,mathf,abs,1,1,Float,Float,true,false,value,2,false,fixed,0,0
0x300C,12300,mathf.floor,1,mathf,floor,1,1,Float,Float,true,false,value,4,false,fixed,0,0
0x300D,12301,mathf.ceil,1,mathf,ceil,1,1,Float,Float,true,false,value,4,false,fixed,0,0
0x300E,12302,mathf.trunc,1,mathf,trunc,1,1,Float,Float,true,false,value,4,false,fixed,0,0
0x300F,12303,mathf.round,1,mathf,round,1,1,Float,Float,true,false,value,4,false,fixed,0,0
0x3010,12304,mathf.sqrt,1,mathf,sqrt,1,1,Float,Float,true,false,value,16,false,fixed,0,0
0x3011,12305,mathf.sin,1,mathf,sin,1,1,Float,Float,true,false,angle,32,false,fixed,0,0
0x3012,12306,mathf.cos,1,mathf,cos,1,1,Float,Float,true,false,angle,32,false,fixed,0,0
0x3013,12307,mathf.atan2,1,mathf,atan2,2,1,Float|Float,Float,true,false,y|x,48,false,fixed,0,0
0x3014,12308,math.i32.to_i64,1,math.i32,to_i64,1,1,Int32,Int64,true,false,value,2,false,fixed,0,0
0x3015,12309,math.i64.to_i32,1,math.i64,to_i32,1,1,Int64,Int32,true,false,value,2,false,fixed,0,0
0x3016,12310,math.i32.to_float,1,math.i32,to_float,1,1,Int32,Float,true,false,value,2,false,fixed,0,0
0x3017,12311,math.i64.to_float,1,math.i64,to_float,1,1,Int64,Float,true,false,value,2,false,fixed,0,0
0x3018,12312,mathf.to_i32,1,mathf,to_i32,1,1,Float,Int32,true,false,value,2,false,fixed,0,0
0x3019,12313,mathf.to_i64,1,mathf,to_i64,1,1,Float,Int64,true,false,value,2,false,fixed,0,0
0x4000,16384,random.new,1,random,new,1,1,Int64,builtin:Random,true,true,seed,32,true,fixed,0,0
0x4001,16385,random.next,1,random,next,1,1,builtin:Random,Int64,true,false,rng,8,true,fixed,0,0
0x4002,16386,random.nextf,1,random,nextf,1,1,builtin:Random,Float,true,false,rng,12,true,fixed,0,0
0x4003,16387,random.range,1,random,range,3,1,builtin:Random|Int64|Int64,Int64,true,false,rng|min|max,4,true,random_rejection_v1,8,64
1 final_id_hex final_id_dec canonical_name canonical_version owner name arg_slots ret_slots arg_layout ret_layout deterministic may_allocate parameter_names cost_cycles mutates_guest_state cost_model attempt_cost_cycles max_attempts
2 0x1000 4096 vec2.dot 1 vec2 dot 4 1 Float|Float|Float|Float Float true false ax|ay|bx|by 10 false fixed 0 0
3 0x1001 4097 vec2.length 1 vec2 length 2 1 Float|Float Float true false x|y 40 false fixed 0 0
4 0x1100 4352 color.from_raw 1 color from_raw 1 1 Int64 builtin:color true false raw 1 false fixed 0 0
5 0x1101 4353 color.rgb 1 color rgb 3 1 Int64|Int64|Int64 builtin:color true false r|g|b 1 false fixed 0 0
6 0x1102 4354 color.rgba 1 color rgba 4 1 Int64|Int64|Int64|Int64 builtin:color true false r|g|b|a 1 false fixed 0 0
7 0x1103 4355 color.html_rgba 1 color html_rgba 1 1 String builtin:color true false value 1 false fixed 0 0
8 0x1104 4356 color.gray_scale 1 color gray_scale 1 1 Int64 builtin:color true false value 1 false fixed 0 0
9 0x1105 4357 color.hex 1 color hex 1 1 builtin:color Int64 true false color 1 false fixed 0 0
10 0x1106 4358 color.alpha 1 color alpha 1 1 builtin:color Int64 true false color 1 false fixed 0 0
11 0x1120 4384 color.black 1 color black 0 1 builtin:color true false 1 false fixed 0 0
12 0x1121 4385 color.white 1 color white 0 1 builtin:color true false 1 false fixed 0 0
13 0x1122 4386 color.red 1 color red 0 1 builtin:color true false 1 false fixed 0 0
14 0x1123 4387 color.green 1 color green 0 1 builtin:color true false 1 false fixed 0 0
15 0x1124 4388 color.blue 1 color blue 0 1 builtin:color true false 1 false fixed 0 0
16 0x1125 4389 color.yellow 1 color yellow 0 1 builtin:color true false 1 false fixed 0 0
17 0x1126 4390 color.orange 1 color orange 0 1 builtin:color true false 1 false fixed 0 0
18 0x1127 4391 color.indigo 1 color indigo 0 1 builtin:color true false 1 false fixed 0 0
19 0x1128 4392 color.gray 1 color gray 0 1 builtin:color true false 1 false fixed 0 0
20 0x1129 4393 color.cyan 1 color cyan 0 1 builtin:color true false 1 false fixed 0 0
21 0x112A 4394 color.magenta 1 color magenta 0 1 builtin:color true false 1 false fixed 0 0
22 0x112B 4395 color.transparent 1 color transparent 0 1 builtin:color true false 1 false fixed 0 0
23 0x2100 8448 input.pad.up.pressed 1 input.pad.up pressed 0 1 Bool true false 1 false fixed 0 0
24 0x2101 8449 input.pad.up.released 1 input.pad.up released 0 1 Bool true false 1 false fixed 0 0
25 0x2102 8450 input.pad.up.down 1 input.pad.up down 0 1 Bool true false 1 false fixed 0 0
26 0x2103 8451 input.pad.up.hold 1 input.pad.up hold 0 1 Int64 true false 1 false fixed 0 0
27 0x2104 8452 input.pad.down.pressed 1 input.pad.down pressed 0 1 Bool true false 1 false fixed 0 0
28 0x2105 8453 input.pad.down.released 1 input.pad.down released 0 1 Bool true false 1 false fixed 0 0
29 0x2106 8454 input.pad.down.down 1 input.pad.down down 0 1 Bool true false 1 false fixed 0 0
30 0x2107 8455 input.pad.down.hold 1 input.pad.down hold 0 1 Int64 true false 1 false fixed 0 0
31 0x2108 8456 input.pad.left.pressed 1 input.pad.left pressed 0 1 Bool true false 1 false fixed 0 0
32 0x2109 8457 input.pad.left.released 1 input.pad.left released 0 1 Bool true false 1 false fixed 0 0
33 0x210A 8458 input.pad.left.down 1 input.pad.left down 0 1 Bool true false 1 false fixed 0 0
34 0x210B 8459 input.pad.left.hold 1 input.pad.left hold 0 1 Int64 true false 1 false fixed 0 0
35 0x210C 8460 input.pad.right.pressed 1 input.pad.right pressed 0 1 Bool true false 1 false fixed 0 0
36 0x210D 8461 input.pad.right.released 1 input.pad.right released 0 1 Bool true false 1 false fixed 0 0
37 0x210E 8462 input.pad.right.down 1 input.pad.right down 0 1 Bool true false 1 false fixed 0 0
38 0x210F 8463 input.pad.right.hold 1 input.pad.right hold 0 1 Int64 true false 1 false fixed 0 0
39 0x2110 8464 input.pad.a.pressed 1 input.pad.a pressed 0 1 Bool true false 1 false fixed 0 0
40 0x2111 8465 input.pad.a.released 1 input.pad.a released 0 1 Bool true false 1 false fixed 0 0
41 0x2112 8466 input.pad.a.down 1 input.pad.a down 0 1 Bool true false 1 false fixed 0 0
42 0x2113 8467 input.pad.a.hold 1 input.pad.a hold 0 1 Int64 true false 1 false fixed 0 0
43 0x2114 8468 input.pad.b.pressed 1 input.pad.b pressed 0 1 Bool true false 1 false fixed 0 0
44 0x2115 8469 input.pad.b.released 1 input.pad.b released 0 1 Bool true false 1 false fixed 0 0
45 0x2116 8470 input.pad.b.down 1 input.pad.b down 0 1 Bool true false 1 false fixed 0 0
46 0x2117 8471 input.pad.b.hold 1 input.pad.b hold 0 1 Int64 true false 1 false fixed 0 0
47 0x2118 8472 input.pad.x.pressed 1 input.pad.x pressed 0 1 Bool true false 1 false fixed 0 0
48 0x2119 8473 input.pad.x.released 1 input.pad.x released 0 1 Bool true false 1 false fixed 0 0
49 0x211A 8474 input.pad.x.down 1 input.pad.x down 0 1 Bool true false 1 false fixed 0 0
50 0x211B 8475 input.pad.x.hold 1 input.pad.x hold 0 1 Int64 true false 1 false fixed 0 0
51 0x211C 8476 input.pad.y.pressed 1 input.pad.y pressed 0 1 Bool true false 1 false fixed 0 0
52 0x211D 8477 input.pad.y.released 1 input.pad.y released 0 1 Bool true false 1 false fixed 0 0
53 0x211E 8478 input.pad.y.down 1 input.pad.y down 0 1 Bool true false 1 false fixed 0 0
54 0x211F 8479 input.pad.y.hold 1 input.pad.y hold 0 1 Int64 true false 1 false fixed 0 0
55 0x2120 8480 input.pad.l.pressed 1 input.pad.l pressed 0 1 Bool true false 1 false fixed 0 0
56 0x2121 8481 input.pad.l.released 1 input.pad.l released 0 1 Bool true false 1 false fixed 0 0
57 0x2122 8482 input.pad.l.down 1 input.pad.l down 0 1 Bool true false 1 false fixed 0 0
58 0x2123 8483 input.pad.l.hold 1 input.pad.l hold 0 1 Int64 true false 1 false fixed 0 0
59 0x2124 8484 input.pad.r.pressed 1 input.pad.r pressed 0 1 Bool true false 1 false fixed 0 0
60 0x2125 8485 input.pad.r.released 1 input.pad.r released 0 1 Bool true false 1 false fixed 0 0
61 0x2126 8486 input.pad.r.down 1 input.pad.r down 0 1 Bool true false 1 false fixed 0 0
62 0x2127 8487 input.pad.r.hold 1 input.pad.r hold 0 1 Int64 true false 1 false fixed 0 0
63 0x2128 8488 input.pad.start.pressed 1 input.pad.start pressed 0 1 Bool true false 1 false fixed 0 0
64 0x2129 8489 input.pad.start.released 1 input.pad.start released 0 1 Bool true false 1 false fixed 0 0
65 0x212A 8490 input.pad.start.down 1 input.pad.start down 0 1 Bool true false 1 false fixed 0 0
66 0x212B 8491 input.pad.start.hold 1 input.pad.start hold 0 1 Int64 true false 1 false fixed 0 0
67 0x212C 8492 input.pad.select.pressed 1 input.pad.select pressed 0 1 Bool true false 1 false fixed 0 0
68 0x212D 8493 input.pad.select.released 1 input.pad.select released 0 1 Bool true false 1 false fixed 0 0
69 0x212E 8494 input.pad.select.down 1 input.pad.select down 0 1 Bool true false 1 false fixed 0 0
70 0x212F 8495 input.pad.select.hold 1 input.pad.select hold 0 1 Int64 true false 1 false fixed 0 0
71 0x2130 8496 input.touch.button.pressed 1 input.touch.button pressed 0 1 Bool true false 1 false fixed 0 0
72 0x2131 8497 input.touch.button.released 1 input.touch.button released 0 1 Bool true false 1 false fixed 0 0
73 0x2132 8498 input.touch.button.down 1 input.touch.button down 0 1 Bool true false 1 false fixed 0 0
74 0x2133 8499 input.touch.button.hold 1 input.touch.button hold 0 1 Int64 true false 1 false fixed 0 0
75 0x2134 8500 input.touch.x 1 input.touch x 0 1 Int64 true false 1 false fixed 0 0
76 0x2135 8501 input.touch.y 1 input.touch y 0 1 Int64 true false 1 false fixed 0 0
77 0x3000 12288 math.i32.min 1 math.i32 min 2 1 Int32|Int32 Int32 true false a|b 2 false fixed 0 0
78 0x3001 12289 math.i32.max 1 math.i32 max 2 1 Int32|Int32 Int32 true false a|b 2 false fixed 0 0
79 0x3002 12290 math.i32.clamp 1 math.i32 clamp 3 1 Int32|Int32|Int32 Int32 true false value|min|max 4 false fixed 0 0
80 0x3003 12291 math.i32.abs 1 math.i32 abs 1 1 Int32 Int32 true false value 2 false fixed 0 0
81 0x3004 12292 math.i64.min 1 math.i64 min 2 1 Int64|Int64 Int64 true false a|b 2 false fixed 0 0
82 0x3005 12293 math.i64.max 1 math.i64 max 2 1 Int64|Int64 Int64 true false a|b 2 false fixed 0 0
83 0x3006 12294 math.i64.clamp 1 math.i64 clamp 3 1 Int64|Int64|Int64 Int64 true false value|min|max 4 false fixed 0 0
84 0x3007 12295 math.i64.abs 1 math.i64 abs 1 1 Int64 Int64 true false value 2 false fixed 0 0
85 0x3008 12296 mathf.min 1 mathf min 2 1 Float|Float Float true false a|b 2 false fixed 0 0
86 0x3009 12297 mathf.max 1 mathf max 2 1 Float|Float Float true false a|b 2 false fixed 0 0
87 0x300A 12298 mathf.clamp 1 mathf clamp 3 1 Float|Float|Float Float true false value|min|max 4 false fixed 0 0
88 0x300B 12299 mathf.abs 1 mathf abs 1 1 Float Float true false value 2 false fixed 0 0
89 0x300C 12300 mathf.floor 1 mathf floor 1 1 Float Float true false value 4 false fixed 0 0
90 0x300D 12301 mathf.ceil 1 mathf ceil 1 1 Float Float true false value 4 false fixed 0 0
91 0x300E 12302 mathf.trunc 1 mathf trunc 1 1 Float Float true false value 4 false fixed 0 0
92 0x300F 12303 mathf.round 1 mathf round 1 1 Float Float true false value 4 false fixed 0 0
93 0x3010 12304 mathf.sqrt 1 mathf sqrt 1 1 Float Float true false value 16 false fixed 0 0
94 0x3011 12305 mathf.sin 1 mathf sin 1 1 Float Float true false angle 32 false fixed 0 0
95 0x3012 12306 mathf.cos 1 mathf cos 1 1 Float Float true false angle 32 false fixed 0 0
96 0x3013 12307 mathf.atan2 1 mathf atan2 2 1 Float|Float Float true false y|x 48 false fixed 0 0
97 0x3014 12308 math.i32.to_i64 1 math.i32 to_i64 1 1 Int32 Int64 true false value 2 false fixed 0 0
98 0x3015 12309 math.i64.to_i32 1 math.i64 to_i32 1 1 Int64 Int32 true false value 2 false fixed 0 0
99 0x3016 12310 math.i32.to_float 1 math.i32 to_float 1 1 Int32 Float true false value 2 false fixed 0 0
100 0x3017 12311 math.i64.to_float 1 math.i64 to_float 1 1 Int64 Float true false value 2 false fixed 0 0
101 0x3018 12312 mathf.to_i32 1 mathf to_i32 1 1 Float Int32 true false value 2 false fixed 0 0
102 0x3019 12313 mathf.to_i64 1 mathf to_i64 1 1 Float Int64 true false value 2 false fixed 0 0
103 0x4000 16384 random.new 1 random new 1 1 Int64 builtin:Random true true seed 32 true fixed 0 0
104 0x4001 16385 random.next 1 random next 1 1 builtin:Random Int64 true false rng 8 true fixed 0 0
105 0x4002 16386 random.nextf 1 random nextf 1 1 builtin:Random Float true false rng 12 true fixed 0 0
106 0x4003 16387 random.range 1 random range 3 1 builtin:Random|Int64|Int64 Int64 true false rng|min|max 4 true random_rejection_v1 8 64
+12 -2
View File
@@ -107,8 +107,14 @@ Example:
- Rows must remain unique by both `(canonical_name, canonical_version)` and `final_id_hex` / `final_id_dec`.
- Rows must remain deterministically ordered by final ID.
- parameter_names uses ordered | separated names for flattened argument slots.
- cost_cycles is the total call cost; mathematical attempts charge upfront
including failure, with no additional generic INTRINSIC cycle.
- cost_model is fixed or random_rejection_v1. cost_cycles is the full fixed
cost or the variable base. attempt_cost_cycles/max_attempts are zero for
fixed entries; random.range publishes base 4, attempt 8, maximum 64.
- Mathematical and random attempts charge upfront, including failure, without
an additional generic INTRINSIC cycle. Random draws retain attempt costs.
- mutates_guest_state distinguishes reproducible stateful calls from pure
computation. It is true for all random entries; may_allocate is true only
for random.new. Consumers must preserve stateful calls and source order.
- Both [INTRINSICS.csv](INTRINSICS.csv) and
[BUILTIN_CONSTANTS.csv](BUILTIN_CONSTANTS.csv) are generated from runtime
descriptors. Float constants publish bits rather than decimal approximations.
@@ -179,3 +185,7 @@ image/verifier must reject these instructions until typed-image integration is p
#### Registry-backed collections
STRUCT_NEW (0x00A0), STRUCT_GET (0x00A1), STRUCT_SET (0x00A2), ARRAY_NEW (0x00A3), ARRAY_LEN (0x00A4), ARRAY_GET (0x00A5) and ARRAY_SET (0x00A6) require a validated Registry. Their exact immediates, full group effects, attempt costs and failure ordering are normative in the [typed collection instruction table](../specs/runtime/02-vm-instruction-set.md#typed-collection-instructions). These operations have no implicit conversion or safepoint. See the [producer handoff](collection-producer-handoff.md) for emission oracles.
## VM-owned random core
See the [random contract](../specs/runtime/02e-vm-owned-random-core.md) for Random BuiltinId 0x0016, ObjectKind tag 9, intrinsics 0x4000–0x4003, atomic state mutation, bounded 4+8*N costs and rejection-limit trap 0x00000015. Random is managed by the VM heap and existing GC, without host entropy or PBX changes.
+111
View File
@@ -0,0 +1,111 @@
{
"date": "2026-10-09",
"target": "aarch64-apple-darwin",
"profiles": [
"debug",
"release"
],
"features": "default workspace features; fpmath soft-float",
"rustc_vv": "rustc 1.98.1 (48a229cea 2026-09-01)\nbinary: rustc\ncommit-hash: 48a229ceaefd4985c50990b14116b6d856af0985\ncommit-date: 2026-09-01\nhost: aarch64-apple-darwin\nrelease: 1.98.1\nLLVM version: 22.1.8",
"lockfile_sha256": "9d2098de05ba9a1568c49f98eb144c317e62b2da57dcab4a76286d7c26d072cd",
"intrinsic_catalog_sha256": "0c1bb78a9b81d1e3480ef5713f3d70f0b06772a7dfab2fd00c1f0a6364f98daa",
"constant_catalog_sha256": "e407e4718127aa7ef7b1097b5b4b67d86dd979235e73a551a7c36b628cddc039",
"fixture_sha256": "0bee1cd0366f1716687aee8c7ac39dd495da5fe2908cce37b1443cb04fac542f",
"oracle_sha256": "0cf29cd24ba08c3fc0162e8e2a38829355bdbeda8ca8ffbfee5925180822164a",
"source_manifest_sha256": "68015d159ce1bd3d14281023c942be232037946ed273e39b6ad393a452762748",
"source_manifest_format": "sorted path + NUL + lowercase SHA-256 + newline; bytecode/vm src Rust files",
"source_files": {
"crates/console/prometeu-bytecode/src/abi.rs": "c4dcaee79b1b30f553fa7a660f8bc9280ec18d57793eb9ba173d2bea94647b95",
"crates/console/prometeu-bytecode/src/assembler.rs": "a687a32a7701602208a28b6e69c4179c54fdcea2d16c0c968d5cbd3a52481715",
"crates/console/prometeu-bytecode/src/decoder.rs": "032e9e7606b68c4d722518e7d4e97eac7fa5feecc78453a41ee8e2e14f8b87d9",
"crates/console/prometeu-bytecode/src/disassembler.rs": "07790f3d023fbe5a57efb2bde9a8a9d4c560b88f10a104c345b8f90bfba02f80",
"crates/console/prometeu-bytecode/src/isa/core.rs": "e5842ac00c1db20fa0e5504e2b10dd01ad86226884f08de50f87f1deefa7223a",
"crates/console/prometeu-bytecode/src/isa/mod.rs": "ed1bb37ae8a434bb93c0f84aef72c69520a147ad040935c3b416c64f73e7f19a",
"crates/console/prometeu-bytecode/src/lib.rs": "f1709d9533721d1334dfeb986645a493dab26b2ed42b3b7721c4fc8ead0646b8",
"crates/console/prometeu-bytecode/src/load_limits.rs": "94a2977adcfb7c12004baeae1ec96525f84d1a7f44d54b973f5b825a76212689",
"crates/console/prometeu-bytecode/src/model.rs": "86884b5fbfa5a520fcea4af6397b210d117a2b0d8ad92d625e6e73c627fdd6e3",
"crates/console/prometeu-bytecode/src/opcode.rs": "eddaffc44562afe78545119e852e2ecc82010efb60a6ae6e39a6c2bc52a0c3da",
"crates/console/prometeu-bytecode/src/opcode_spec.rs": "124ac435f3aa2c428b130c963fb1692c785183fd3b63c1ae5186307a66b1b2b5",
"crates/console/prometeu-bytecode/src/program_image.rs": "ea752b0430963be3d53e41941116a686494dce78644c5a7119e25b6db1b813b2",
"crates/console/prometeu-bytecode/src/registry.rs": "8e9173c9ea500f84da0518669472f62354bd013f684db52ca5d590e22cbdeb4e",
"crates/console/prometeu-bytecode/src/registry_codec/payloads.rs": "457db2f3470e3c746698c2c73cd2d8387918a01daf64377832b2928fb4f05e1e",
"crates/console/prometeu-bytecode/src/registry_codec/writer.rs": "97a1f19dbc335e86c2d93ca6c5115b4845dc2a23fcf7ef16748a840d03e164b6",
"crates/console/prometeu-bytecode/src/registry_codec.rs": "c9dd8c9e6568b355ac1a172ed92c9bef4d61afb18a5dde95d016c028ad688bd2",
"crates/console/prometeu-bytecode/src/registry_instruction.rs": "48e2d1a25a30bdc4ef4842855fdd0fbc38525257375ba36f489485e88b611004",
"crates/console/prometeu-bytecode/src/resource_failure.rs": "64e63da70bb7be5b4472edbe3e8e66c8b856db6fc41dfa5f2571c3535325c07b",
"crates/console/prometeu-bytecode/src/value.rs": "374d4ea2d7e319cc48d2034553ad3b9866bfce2ff24b4fc0805fa8908f1db314",
"crates/console/prometeu-vm/src/builtins.rs": "2373d9088df250eada8867c0afb33a7aac87cf7036c0dac94641c610d1cd596a",
"crates/console/prometeu-vm/src/call_frame.rs": "e89e0a549529236358374697fecc2688db3f7ab84644e7cb0226ce80206d4e66",
"crates/console/prometeu-vm/src/catalog.rs": "165413fc127760110fc33c1989c7e56984ddf463587980510160f12c6a812dab",
"crates/console/prometeu-vm/src/heap/dynamic_box.rs": "3dae99eba1ca5045fff733f38d80cd4297521d11d0fd1c58d2767e6c5c1286e9",
"crates/console/prometeu-vm/src/heap/dynamic_tests.rs": "bb7e8ed7f33d376e160b3aa7933a53e90d8d601dcde283323cb3e9aff9cf1106",
"crates/console/prometeu-vm/src/heap/random.rs": "c3d5061dcdd6d85af5e8519f21ccbd7d95d2bd54d26a077612f52ecf801fccc6",
"crates/console/prometeu-vm/src/heap.rs": "a57326be640966bd771fba36c8aa8422700ec0a0043491da46cde17d302f3a89",
"crates/console/prometeu-vm/src/input_intrinsics.rs": "4cb62267df510c02ecea74ac9e02ffb3927201054ca0c8d1cee8c879de621d95",
"crates/console/prometeu-vm/src/lib.rs": "1091dc5b97ca0221471d2f1772560f6eb8834b190604aaeead96c7937e1f89d4",
"crates/console/prometeu-vm/src/local_addressing.rs": "d74965bda1e26a5712257dfc498a3a5a262430464398561923ced9aed3e117c0",
"crates/console/prometeu-vm/src/math_intrinsics.rs": "9b13b627023a73568aa7efe407e4706fdeacb3fed60a152a76a3970d6a103723",
"crates/console/prometeu-vm/src/numeric.rs": "9e1eaf35137a89160ae09fe11634645c242f97f332c946bebc0da9fd0b533146",
"crates/console/prometeu-vm/src/object.rs": "80a138583f3de3cb262df8fd02d690931fb6bfb30316a90be7835f429dda859b",
"crates/console/prometeu-vm/src/program_image/tests.rs": "2c7f6b50d611f995a97cd3993f779ac5c0ae014f9f4108413dde152a4f9bd3c3",
"crates/console/prometeu-vm/src/program_image.rs": "a6bcced8241557586eb7bf5c6922f4222590cc32563032427ae810fd400dd663",
"crates/console/prometeu-vm/src/random.rs": "48e46d50f0665c85bb899d7324783cb1b5121378cb21f06059f2c2617e6d9e16",
"crates/console/prometeu-vm/src/random_intrinsics.rs": "abfb9d4d3e3d39085b5470b6ffcf5400c73002b050244842dda48aaf445b5b23",
"crates/console/prometeu-vm/src/registry_verifier/heights.rs": "789da044dc5b860027d302d927eb7a460ea1218d0167dffda8c097d9655910f6",
"crates/console/prometeu-vm/src/registry_verifier/tests.rs": "dde3a6a1d06c4402c93b154c4a050880a45363d0493b16af561261c03b0ba1b4",
"crates/console/prometeu-vm/src/registry_verifier/types/tests.rs": "48b5ac47156bbf24988ebc9b3ca8f59df76193231975de6cdb318a682ff68788",
"crates/console/prometeu-vm/src/registry_verifier/types.rs": "904811508ff69631855b01f43a396ec2d558b501469c84786aea56d610c995f7",
"crates/console/prometeu-vm/src/registry_verifier.rs": "985446f71017625266483be539514f8a74c61ffcf3a21e5676bd67620ae3575f",
"crates/console/prometeu-vm/src/resource_budget.rs": "bab06fb8384410d43f32f4f4d6162351b50fded755794ca69b58ac6d5c921efb",
"crates/console/prometeu-vm/src/roots.rs": "c5a26c3cf9c7655c6d3861c17412d1fa9c7738e16e18079224ad44c954660a2c",
"crates/console/prometeu-vm/src/string_ledger/tests.rs": "4c5b0d68a984f662a7aaec50f5c09075a08b991b182d2dbeb4302ef02baf4fda",
"crates/console/prometeu-vm/src/string_ledger.rs": "a16c944bb119aeb806f5765c450fa56b87c1c38568ed23c4cb0d9ee5f88f0770",
"crates/console/prometeu-vm/src/typed_storage/allocation.rs": "44db682ac5ca42f63552910e9c13ea1e8db1a3bcf1428fd0b9d0c6969bc985a1",
"crates/console/prometeu-vm/src/typed_storage/ownership_tests.rs": "c0b7c152984de0e8a150614e9d3d19ba89994ef0ed84be5345db1f890afeb8de",
"crates/console/prometeu-vm/src/typed_storage/tests.rs": "95d017485f4d62c1ad5196a0ae6dfdb816d673934e06dae5d328102121b21265",
"crates/console/prometeu-vm/src/typed_storage.rs": "8df8460a390b5fa06c41c176dc3f9c50fc9e0f7fd5136ed7a2f5b8dd1ba7125f",
"crates/console/prometeu-vm/src/value_contract/reference_tests.rs": "070dc83827cab60e753bcf68d06932d15cfa13ef8f586ce7f7a080ea67e47120",
"crates/console/prometeu-vm/src/value_contract.rs": "0214312fbba372a086bff2a14faa6ac03487c23c62dce5ca25315c0d7e560e1f",
"crates/console/prometeu-vm/src/verifier.rs": "73afffa659f46e8f35532aae015769e7eedb4bdbfd1fc9897b42b217d92aa546",
"crates/console/prometeu-vm/src/virtual_machine/callable.rs": "0e6ada8736039157a4bc90a8a70a127f1c61a325fca1b67c3c40b9fb10db5da0",
"crates/console/prometeu-vm/src/virtual_machine/callable_tests.rs": "0dcbd0513dac25fb6577be089f97d84a2c07bcf68c17bf8b4da695d5800648f4",
"crates/console/prometeu-vm/src/virtual_machine/collections.rs": "d83f753801d5f8ac228de96aedb09a200d52937e5f9dd1cc92ddcfcd9e2b10db",
"crates/console/prometeu-vm/src/virtual_machine/collections_tests.rs": "c6e8a3d0a43894f28fab8f5c3705c6030bb11ddbf80761dca44af88f7d127c47",
"crates/console/prometeu-vm/src/virtual_machine/control.rs": "70a769ae28fb985b3db95e635f1f0281f2b162d5a0f2eca39708b5e023538dd6",
"crates/console/prometeu-vm/src/virtual_machine/dynamic.rs": "898cd1bf0d882704451fba240a95eb00fd2d12369436a802d93661d4ed7f960f",
"crates/console/prometeu-vm/src/virtual_machine/gc.rs": "5bb11a32bffa112ffa5ae9e8dbb9204a62db9fd6a9e4662141c1989e9aadbb76",
"crates/console/prometeu-vm/src/virtual_machine/loader.rs": "9f3b87d886562fef2b18625a96e9b1219587232dfd2dc39615ae854b5b91dd1c",
"crates/console/prometeu-vm/src/virtual_machine/random.rs": "136cdbe46a687a7b755d559a2842d44f494cf76e8a34427eeb48494820935a42",
"crates/console/prometeu-vm/src/virtual_machine/reference.rs": "00da14fac117a307ebd030c846932e94acc503fe14b65c1a4613f82e7614718b",
"crates/console/prometeu-vm/src/virtual_machine/runtime.rs": "5547a6b0d7ab0f8c76837f4c281c8577e63d36fce667c90c256bee410b634a58",
"crates/console/prometeu-vm/src/virtual_machine/stack.rs": "778c641b4bb6dd883affaa8567a97effe7b737215654f6af3f928a4d3e05cb03",
"crates/console/prometeu-vm/src/virtual_machine/strings.rs": "82088a668f71089e2ef92c83023891b289881984642ad85a5f9c5f4c9f38e7e9",
"crates/console/prometeu-vm/src/virtual_machine/typed.rs": "06818c09e28c6d3b750fc592b22e3e943098f4448972f2eaab5c0d011d204572",
"crates/console/prometeu-vm/src/virtual_machine/typed_tests.rs": "84dc60e3c8fb25a60c0a22390195494077450ae2cb2172aa920afc2b63e16490",
"crates/console/prometeu-vm/src/virtual_machine.rs": "4a610d40415279056e7ce64672c9b67a7fba09313afa40cd98a25a2aa72f12c0",
"crates/console/prometeu-vm/src/vm_init_error.rs": "4704ca4bafe3cd760ab1e8f44d6616f6b377d0a264b65f0c8f6142ea07eec24e"
},
"results": {
"bytecode_vm_debug": {
"passed": 400,
"ignored": 3
},
"bytecode_vm_release": {
"passed": 401,
"ignored": 3
},
"workspace_debug": {
"passed": 938,
"ignored": 9
},
"final_random_guest_debug": 13,
"final_random_guest_release": 13,
"private_random_debug_release": 11
},
"unexecuted_comparisons": [
"x86_64 hosts",
"Linux",
"Windows",
"other targets"
]
}
+79
View File
@@ -0,0 +1,79 @@
# Random qualification
Executed on 2026-10-09, target `aarch64-apple-darwin`, default features, with
fpmath 0.1.1 soft-float. Toolchain: rustc 1.98.1 (48a229cea, 2026-09-01),
LLVM 22.1.8. Exact rustc -Vv, source/lockfile/catalog/fixture fingerprints and
per-file source hashes are in [RANDOM_QUALIFICATION.json](RANDOM_QUALIFICATION.json).
This record qualifies only the executed local target/profiles.
## Executed checks
| Check | Result |
| --- | --- |
| cargo test --locked -p prometeu-bytecode -p prometeu-vm | 400 passed, 3 existing ignored |
| cargo test --locked -p prometeu-bytecode -p prometeu-vm --release | 401 passed, 3 existing ignored |
| cargo test --locked --workspace | 938 passed, 9 existing ignored |
| Final random_contract guest suite, debug / release | 13 passed / 13 passed |
| Private engine/VM random tests, debug / release | 11 passed / 11 passed |
| cargo fmt --all -- --check | Passed |
| Generated intrinsic CSV and constant CSV comparison | Exact metadata parity; constants unchanged |
| Coverage source ownership audit | All source files have exactly one owner |
| git diff --check and changed-doc link/workflow-reference checks | Passed |
The complete runs preceded the final additional guest handoff assertion; the
final targeted guest runs cover all 13 assertions in both profiles. No
production source changed between these checks. The ignored tests are existing
repository tests, not unexecuted random acceptance cases.
## Independent oracle and state behavior
[Fixture provenance](../../crates/console/prometeu-vm/tests/fixtures/random-oracle.md)
pins pcg-cpp revision 428802d1a5634f96bcd0705fab379ff0113bcf13 and the six
canonical seed=42 words. A separate test-only Python mathematical model produces
48 words, signed outputs and Float bits for seeds 0, 1, 42, -1 and Int64 MIN/MAX.
Guest tests replay both integer and Float output streams and mixed operations.
The Float grid endpoint checks include +0 and the greatest value below 1.
Tests cover alias/separate-object state, direct Dynamic with exact types/typed
null, locals/globals/fields/arrays/captures/parameters/results, reachable GC
roots, reclamation, stale generations and existing session reset/import rules.
Native snapshots are not guest roots; raw handle copies are not a supported
cross-session import API. Opaque payload access and Struct/Trait misuse are
rejected by the existing admission/runtime type boundaries.
## Bounded work, faults and resources
Real PCG output exercises a rejected word followed by acceptance, charging
20 cycles and committing as one instruction. Private synthetic words exercise
the production bounded loop/transaction: immediate/multiple rejection, acceptance
on attempt 64 and 64 rejections. The cap costs 516 cycles and preserves public
state and operands; the next normal draw still returns the first canonical word.
Tests do not alter production PRNG selection or wait for a rare random event.
Fault matrices cover argument carriers before receiver checks, null/invalid/
wrong-kind handles, numeric bounds, stack height and GuestBytes/HandleSlots/
AuxiliaryBytes/TemporaryBytes refusals. Snapshots prove no operand/state changes,
no provisional charge leaks and no partial handle publication. Billing remains
observable; zero budget does nothing, positive budget allows whole-instruction
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;
unreachable unknown IDs reject with InvalidCode/NativeId and Unknown analysis
retains full runtime checks.
## Pending comparisons and consumers
Linux, Windows, x86_64 and other target comparisons have not been executed.
For each advertised target, run the pinned guest and private fixture suites in
debug/release and record toolchain/features/source/catalog fingerprints plus
bits/faults/cycles. Do not infer qualification from this local result.
CPU benchmarks were not run and do not set virtual costs.
Frontend emission/optimization and reference-game workload integration remain
separate consumer deliveries. Their concrete acceptance tests are in the
[random producer handoff](random-producer-handoff.md). Statistical quality,
sequence conformance and game readiness are separate evidence; none is a
cryptographic guarantee. The normative contract is the
[random spec](../specs/runtime/02e-vm-owned-random-core.md).
+73
View File
@@ -0,0 +1,73 @@
# Random producer handoff
The runtime implements [Random v1](../specs/runtime/02e-vm-owned-random-core.md).
PBS namespace projection/lowering and reference-game integration remain pending
consumer work. No host entropy, syscall or firmware provider is required.
Use the generated [intrinsic catalog](INTRINSICS.csv); never copy its IDs or
cost/effect rules into an independent algorithm implementation.
## Types and emission
Declare program TypeId 0 as BuiltinId 0x0011 (Int64), TypeId 1 as BuiltinId
0x0016 (Random), and TypeId 2 as BuiltinId 0x0012 (Float). TypeIds are local
program identities, not builtin IDs. Random uses one nullable reference slot.
This function has no parameters, one local slot and results [Int64, Float,
Int64]. Its intrinsic IDs are decimal 16384 through 16387 (hex 0x4000–0x4003),
all version 1. Operands are ordered seed; rng; rng; and rng/min/max respectively.
```text
PUSH_I64 42
INTRINSIC 16384
SET_LOCAL 0
GET_LOCAL 0
INTRINSIC 16385
GET_LOCAL 0
INTRINSIC 16386
GET_LOCAL 0
PUSH_I64 -7
PUSH_I64 -6
INTRINSIC 16387
RET
```
The complete function costs 82 virtual cycles: 32+8+12+12 for the four calls,
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
and loader, not direct host callbacks.
## Storage and Dynamic
Emit ordinary SET/GET_LOCAL and SET/GET_GLOBAL for handle aliases; typed
Struct fields and Array elements declare the Random TypeId and use existing
collection instructions. Captures and parameter/result groups use that same
one-slot type. NEW cannot create Random; allocate with random.new first.
DYN_PACK 1 followed by DYN_UNPACK 1 preserves the same generator without a
multislot box. Typed null preserves tag 1 and extracts only to that exact type.
No Struct or Trait adaptation is implied by physical HeapRef representation.
## Consumer acceptance tests
Frontend delivery must import Random and all four exact v1 signatures, preserve
source evaluation order for positional/named arguments, retain aliases, and
emit correct ordered carriers. All random entries are deterministic and
mutates_guest_state=true. Only new may_allocate=true. These calls cannot be
compile-time evaluated, folded, eliminated or reordered based on seeds/literals
or the deterministic flag. Range metadata publishes base 4, attempt 8 and
maximum 64, not a fixed total of 4. Test generated PBX against the sequence and
fault/cycle traces above, including mixed next/nextf/range and duplicated handles.
Reference-game delivery must use explicit seeds and replay equal ordered
inputs to compare result bits, fault identities and cycles. Keep generators
separate when independent state is required; copying handles does not fork a
stream. Test min>=max -> NUMERIC_DOMAIN at cost 4 with retained operands/state;
null receiver -> NULL_REFERENCE; incorrect carriers -> TYPE. Failed attempted
calls retain their charged cycles. No PickRandom or helper surface is exposed.
Additional target qualification must run the pinned fixture suite in debug
and release on each advertised target, recording target/toolchain/features,
lockfile, source/catalog fingerprints and result bits/faults/cycles. The
[current qualification record](RANDOM_QUALIFICATION.md) identifies executed
local evidence; unexecuted comparisons are pending tests, not portability claims.
@@ -157,3 +157,9 @@ External compiler acceptance requires these exact bytes and signatures, Fn
pass/return/storage, shared cells, named-argument evaluation order, nested sync
continuation and structured failure tests. The runtime's binary/behavioral oracles
are available; no external implementation is claimed.
## Random reference consumer
The runtime supports Random BuiltinId 0x0016 and the four VM-owned random
intrinsics. The [random handoff](random-producer-handoff.md) supplies PBX
emission, effects, variable costs and pending frontend/game acceptance tests.