feat(vm): add reference identity and deterministic value hashing

This commit is contained in:
2026-10-23 14:29:00 +01:00
parent 57992cf214
commit 69ad1931de
41 changed files with 2521 additions and 121 deletions
@@ -192,3 +192,13 @@ remain unchanged. CPU timings never change guest-visible cycle weights.
## Random core integration
The [random core](02e-vm-owned-random-core.md) charges fixed calls before checks and bounded range calls as 4+8*N (at most 64 draws), retaining fault cycles and whole-instruction overshoot.
## Identity and hash attempts
The [identity/hash contract](02f-vm-identity-and-value-hashing.md) charges
8+w(T) for reference hash, 4+w(A)+w(B) for identity comparison, eight for scalar
numeric hashes, and 8+n resident UTF-8 bytes for String. Known lengths charge
before traversal/refusal; null/wrong/unavailable String carriers charge eight.
Checked cost overflow charges base and faults. These are total attempted costs,
without a generic extra INTRINSIC cycle or refunds. Existing whole-instruction
overshoot and zero-budget rules apply; the operations introduce no safepoint.
@@ -253,3 +253,11 @@ entry and one per destination field execution slot for the complete declared
attempt, including skipped destinations. Quotas are unchanged.
This is a generic typed storage mechanism; collection algorithms and node topology
remain source-owned, with no collection-specific VM instruction or syscall.
## Identity and value hashing
[Identity and value hashing](02f-vm-identity-and-value-hashing.md) defines
REF_IDENTITY_HASH 0x0097 and REF_IDENTITY_EQ 0x0098, complete typed source
groups, one/two TypeId immediates, exact attempted costs and operand-preserving
faults. It also defines intrinsics 0x4100–0x4102 and their shared bounded
invocation profile. Old EQ and REF_* categories retain their contracts.
@@ -315,3 +315,13 @@ STORAGE_PUBLISH (0xAA) provide generic logical validation, complete stored-group
transfer and prepared atomic publication. Their encoding, typed operands, exact
faults, overlap semantics, costs and preflight/commit guarantees are defined by
the [canonical instruction contract](02-vm-instruction-set.md#logical-guards-and-atomic-storage-publication). No new Registry category, syscall, collection algorithm or safepoint is introduced.
## Identity queries
[Identity queries](02f-vm-identity-and-value-hashing.md) add opcodes 0x0097
(source TypeId, six bytes) and 0x0098 (left/right TypeIds, ten bytes). Sources
are Struct, Array, Fn, Trait and Random; validate complete groups before
consulting handles. They add no PBX section, value type or layout change. The
older REF_IS_EXACT/IMPLEMENTS/TO_TRAIT/CAST category restrictions remain intact.
Intrinsic argument nullability is explicit per entry: hash.string admits known
null at load without relaxing the static masks of existing String intrinsics.
@@ -0,0 +1,178 @@
# VM Identity, Value Hashing and Bounded Intrinsic Invocation
Domain: VM values/intrinsics. Function: normative.
## Operations
| Operation | ID | Immediate/inputs, bottom to top | Result | Attempt cycles |
| --- | --- | --- | --- | --- |
| REF_IDENTITY_HASH | opcode 0x0097 | source:TypeId; complete source group | Int64 | 8+w(source) |
| REF_IDENTITY_EQ | opcode 0x0098 | left:TypeId,right:TypeId; left group,right group | Bool | 4+w(left)+w(right) |
| hash.i64@1 | intrinsic 0x4100 | value:Int64 | Int64 | 8 |
| hash.float@1 | intrinsic 0x4101 | value:Float | Int64 | 8 |
| hash.string@1 | intrinsic 0x4102 | value:String, nullable | Int64 | 8+n |
Opcodes are u16 LE, immediate TypeIds u32 LE. The reference instructions occupy
six/ten bytes. INTRINSIC remains opcode 0x0072 followed by u32 ID, six bytes.
w(T) is resolved Registry slot width; n is present UTF-8 byte length, zero for
null. Success consumes complete groups and publishes one result; failure retains
inputs/owners. TypeIds are static metadata, never arbitrary guest selectors.
## Identity and equality domains
Identity sources MUST be Struct, Array, Fn, Trait or Random. String, Dynamic,
internal boxes and other builtins are invalid categories. The old REF_* source
rules and global EQ are unchanged. Validate the complete left group before the
right, and both before comparing: exact type/category, liveness/generation and
Registry. An invalid right input cannot be hidden by an unequal/absent left.
Struct/Array identity is instance identity, without traversing fields/elements.
Fn identity is Closure identity, including empty captures; distinct creation
stays distinct even with identical code/captures. Random identity is generator
identity, independent of seed/state; the query neither advances nor hashes state.
Trait identity is the receiver after validating the entire receiver and
ImplementationId against owner/trait metadata. ImplementationId zero is valid
for a coherent present view. Static trait type and implementation do not enter
the hash. Valid views through different traits and their concrete reference
agree. This adds no implicit trait implementation to Fn/Random.
Canonical stack absence is Null for one-slot references/String and [Null,Null]
for Trait. Two eligible absences compare true, absence/present false; absence
hashes to Int64(0). Zero is not exclusive to absence. HeapRef(0,0) is not stack
absence: existing validators classify it TYPE for Struct/Array/Fn/Trait and
INVALID_HANDLE for Random. Malformed/stale values never become false/null.
The producer controls comparisons across static types and the equality used by
collections. Within the selected domain/context, equals(a,b) implies equal
hashes; equal hashes do not imply equality. No universal cross-numeric, Dynamic
box or object-content equality is introduced. A producer joining integer/Float
equality must define coherent canonicalization. Int32 can widen exactly to Int64,
Bool map to 0/1; SDK component mixing must preserve order and boundaries.
Fold to 32 bits is explicit, not abs or lossy numeric conversion. Equality/hash
must remain stable while used as a key; the VM cannot prove custom callbacks.
## Hash-v1
Use XXH64, seed u64 zero, per the
[upstream v0.8.3 specification](https://github.com/Cyan4973/xxHash/blob/v0.8.3/doc/xxhash_spec.md).
Return the digest's identical 64-bit pattern in Int64, including negative values.
All algorithm arithmetic wraps modulo 2^64; host word size/endianness is irrelevant.
| Input | Exact message |
| --- | --- |
| Int64 | Eight LE two's-complement bytes. |
| Finite Float zero | Eight zero bytes for either sign. |
| Other finite Float | Eight LE IEEE 754 binary64 bit-pattern bytes. |
| Present String | Exact resident UTF-8 bytes and their message length, without terminator/prefix/normalization. |
| Present reference | index:u32 LE followed by generation:u32 LE after validation. |
| Accepted absence | Return zero directly; do not hash an empty message. |
Float MUST NOT be numerically converted to integer. NaN/infinity trap NON_FINITE.
Empty String hashes the empty message and remains unequal to null. String owners,
origin/retention and allocation history do not affect content hashing. Reference
hash excludes fields, Random state, FunctionId, captures, view type and native
addresses. There is no cryptographic, uniqueness, capability or confidentiality
guarantee. The hash cannot be converted into a guest reference and creates no root.
Same scalar data/content and contract produce identical bits across hosts and
sessions. An object's hash remains stable while alive, independently of mutation;
reproduction depends on the same VM revision and allocation/collection sequence.
Objects have no shared/persistent identity across sessions/revisions. Time, native
addresses and host entropy are excluded. Existing entry boundaries preserve heap/
session provenance; the handle encoding gains no global session identifier.
## Shared bounded invocation
The three scalar hashes declare invocation_model=borrowed_inline_v1,
scratch_model=none, context_access=none, deterministic=true, may_allocate=false,
mutates_guest_state=false. Protocol/cost selection follows descriptors, not the
owner name. Native Rust handler functions are allowed; guest calls/reentry are not.
1. Resolve metadata and charge using safe carrier inspection.
2. Check temporaries above the frame floor and validate borrowed inputs in order.
3. Admit resources declared by that entry's profile.
4. Compute into bounded local output storage derived from ret_layout.
5. Validate the complete result's width and carriers.
6. Replace/consume inputs and publish output in an infallible commit.
Inputs remain original stack roots/owners until commit. No argument BudgetVec,
Vec-returning callback or mutable HostContext implements this profile. Unsupported
inline result capacity or inconsistent descriptor/handler is rejected without
dynamic-buffer fallback. Each new hash replaces one slot with one and requires
no stack growth, guest allocation or dynamic scratch. No GC, safepoint, guest
callback or scheduling occurs inside the operation. Faults retain inputs and
discard partial results. Stateful handlers retain their own preparation/commit;
Random keeps its existing candidate-state, allocation and bounded-attempt rules.
## Costs, faults and admission
Charge each decoded attempt once, including refusal, without an extra generic
INTRINSIC cycle. Numeric hashes use fixed cost eight. String costs 8+n for an
available String carrier, before traversal or provenance/ownership refusal.
Null/wrong/unavailable carrier and underflow cost eight. Checked cost overflow
charges base and traps RESOURCE_LIMIT without wrap or traversal. Reference costs
use resolved widths even on underflow/refusal. Charge before height/group checks;
validate left then right, and Float finitude after its exact carrier. No refunds.
| Cause | Outcome |
| --- | --- |
| Invalid immediate TypeId/category | LOAD_INVALID_REFERENCE. |
| Invalid encoding/unknown intrinsic/proven static conflict | Existing structured load rejection, including dead code, no guest cycles. |
| Incomplete temporary inputs | STACK_UNDERFLOW 0x08. |
| Wrong carrier/type/malformed group/view | TYPE 0x04. |
| Dead/stale/invalid reference | INVALID_HANDLE 0x0F under existing typed validation. |
| Non-finite Float reaching execution | NON_FINITE 0x14. |
| Checked cost/resource overflow | RESOURCE_LIMIT 0x10 with applicable resource detail. |
| Handler result violates descriptor | INVALID_INTRINSIC 0x0D; original operands retained. |
Accepted null does not trap NULL_REFERENCE; Null to a numeric hash is TYPE.
TrapInfo retains attempted PC/opcode, available source span and resource context.
Budget zero executes nothing; positive fuel admits a whole instruction and can
overshoot. There is no per-byte preemption, quota-rescue GC, hash cache/table,
new String limit or relaxed ownership/resource quota.
## Intrinsic catalog schema 2
Schema version is independent of canonical intrinsic version. INTRINSICS.csv is
generated from descriptors, ordered by ID, UTF-8/LF. The exact header is:
```csv
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,schema_version,arg_nullable,invocation_model,scratch_model,context_access,cost_arg_index,cost_per_byte
```
schema_version is 2 on every row. arg_nullable is one lowercase boolean per
argument slot, pipe-separated, empty only for no arguments; widths must match
arg_layout. cost_arg_index is a zero-based String slot for the byte model and
empty for other models. cost_per_byte is one for String hashing and zero for
fixed/random_rejection_v1. Base/fixed cost remains cost_cycles. Unsupported or
inconsistent schema, profile, model, layout, index or capacity fails explicitly.
```csv
0x4100,16640,hash.i64,1,hash,i64,1,1,Int64,Int64,true,false,value,8,false,fixed,0,0,2,false,borrowed_inline_v1,none,none,,0
0x4101,16641,hash.float,1,hash,float,1,1,Float,Int64,true,false,value,8,false,fixed,0,0,2,false,borrowed_inline_v1,none,none,,0
0x4102,16642,hash.string,1,hash,string,1,1,String,Int64,true,false,value,8,false,argument_utf8_bytes_v1,0,0,2,true,borrowed_inline_v1,none,none,0,1
```
Static admission and native validation use per-entry arg_nullable. Known null
is valid for hash.string; other String intrinsics retain their old static masks.
Nullable structural admission does not remove domain preconditions such as a
Random mutation requiring a present generator.
Old Host entries use host_buffered_v1/existing_contract_v1/host; old VM-owned
entries vm_owned_v1/existing_contract_v1/vm_state. These retain existing effects,
accounting, limits, IDs, signatures, versions and costs, not the new profile's
guarantees. Old scalar/color args have false nullability, Random args true;
no-arg lists are empty. Legacy cost_arg_index is empty and cost_per_byte zero.
No broad migration is required. The builtin constant catalog remains unchanged.
## Producer boundary
Publish exact provider revision, schema and catalog digests. Consumers explicitly
port metadata, admission, lowering/emission, mirrors, packaged provenance and
normal/optimized conformance. CSV-only updates are not completed integration.
Reject unsupported data without inferring purity/nullability/zero scratch from
deterministic or names. Preserve faults, ordering and charged work even when
results are discarded. Collections, defaults and custom/Dynamic strategies remain
consumer-owned. Set/Map, storage publication, Lua FE, arbitrary byte strings,
a new Float domain and general structural hashing are outside this contract.
@@ -232,3 +232,12 @@ roots throughout preparation; the commit phase has no allocation, GC, scheduler
callback boundary. Refusal changes neither destinations nor input groups, and
releases temporary reservations. Consumer return carriers must be prepared before
publication. See [the instruction contract](02c-program-registry-and-pbx-v0.md#logical-guards-and-atomic-storage-publication).
## Borrowed intrinsic invocation
The [bounded intrinsic profile](02f-vm-identity-and-value-hashing.md) keeps
original arguments/owners rooted until result validation and stack commit. Hash
intrinsics use no guest allocation, dynamic scratch or stack growth; native
output storage is bounded by the declared result layout. They do not collect,
reenter or call guest code. Hash values create no roots. Legacy intrinsic
resource/effect contracts remain explicit and do not inherit these guarantees.
+4
View File
@@ -132,3 +132,7 @@ In those cases:
## Random core integration
The [VM-owned random core](02e-vm-owned-random-core.md) defines opaque Random references, PCG64 and the random intrinsic surface.
## Identity and hashing integration
The [identity and value hashing contract](02f-vm-identity-and-value-hashing.md) defines typed reference queries, scalar/content hash-v1, bounded intrinsic invocation and catalog schema 2. See the [producer handoff](../../vm-arch/identity-hashing-producer-handoff.md) and [qualification record](../../vm-arch/IDENTITY_HASHING_QUALIFICATION.md) for implementation evidence and consumer integration targets.
@@ -0,0 +1,110 @@
# Identity and hashing qualification
Qualification date: 2026-10-23. Target: aarch64-apple-darwin. Toolchain:
rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1 (797e8a9bc 2026-08-05).
The [machine-readable record](identity-hashing-qualification.json) contains exact
source/artifact SHA-256 values and commands. The
[canonical contract](../specs/runtime/02f-vm-identity-and-value-hashing.md) is normative;
the [producer handoff](identity-hashing-producer-handoff.md) defines consumer work.
## Delivery identity
Base revision: `57992cf214e8a5f9de53a40dba9aaa7fab038c91`. This qualification
covers working-tree changes identified by source fingerprint
`a0d202e46fbca3319d7b04fe09906388c015da7b606216e75bd7c62041011885`.
The base revision alone does not contain this delivery. The JSON lists the
29 source/test files and their individual digests. To reproduce the aggregate,
visit sorted paths and hash the concatenation of path UTF-8, NUL, exact file
bytes and NUL for each file.
| Artifact | SHA-256 |
| --- | --- |
| Cargo.lock | cffad9ed62f38a591538abd81dd39270d6022397342c8189f4ac6c7baaa8e795 |
| INTRINSICS.csv | 7c1c363f5f0f941b3ab27cfc72af41e13e44cd4371c687db8300721288f47e63 |
| BUILTIN_CONSTANTS.csv | e407e4718127aa7ef7b1097b5b4b67d86dd979235e73a551a7c36b628cddc039 |
| hash-conformance.tsv | a863486eaea14ab1a010f076f355eed0d5738207dad3651f7d10e92fc09f74d4 |
Schema 2 has 25 columns and 108 intrinsic rows. Comparison against the base
revision confirms that all 18 prior fields of each of the 105 old entries are
unchanged. Three hash entries were added. Builtin constants are byte-identical.
Existing historical math/random qualification records retain their original
revision claims.
## Executed checks
All commands use the checked-in lockfile and offline dependency cache.
| Command | Result |
| --- | --- |
| `cargo test --locked --offline -p prometeu-bytecode -p prometeu-vm --no-fail-fast` | 453 passed, 0 failed, 3 existing ignored. |
| `cargo test --locked --offline -p prometeu-vm --features resource-diagnostics --no-fail-fast` | 401 passed, 0 failed, 2 existing ignored. |
| `cargo test --locked --offline -p prometeu-quality-checks -p prometeu-layer-tests --no-fail-fast` | 19 passed, 0 failed. |
| `cargo test --locked --offline --release -p prometeu-vm --test identity_hashing --test intrinsic_profiles --test execution_allocations` | 12 passed, 0 failed. |
| `cargo check --locked --offline --workspace --all-targets` | Passed, including headless/desktop, firmware, tools and shared consumers. |
| `cargo fmt --all --check` | Passed. |
| `git diff --check` | Passed. |
## Independent oracles and covered behavior
The [118 vectors](../../crates/console/prometeu-vm/tests/fixtures/hash-conformance.tsv)
come from the official C XXH64 v0.8.3 reference, not the Rust implementation.
The [generator and provenance](../../crates/console/prometeu-vm/tests/fixtures/hash-oracle.md)
pin the upstream header by SHA-256 and verify its version. Raw byte vectors
cover every length through 70 and longer stripe/tail boundaries through 4097;
the remaining cases cover signed integer extremes, finite binary64 bit patterns,
UTF-8/NUL/empty strings, reference index/generation pairs and direct null zero.
Every vector is checked by the Rust algorithm. Scalar/String/null vectors also
execute through serialized PBX, typed admission and the real interpreter.
Independent raw instruction bytes check IDs, LE immediates, truncations,
assembler/disassembler behavior and Registry widths. Neutral PBX tests cover
Struct/Array/Fn/Random identity, distinct closure creation, aliases, mutation,
Random advancement, multiple Trait views, valid implementation zero, all eligible
null groups and exact successful instruction costs. Admission rejects ineligible
source types, bad immediates/IDs, wrong numeric carriers and old String nulls,
including invalid metadata in unreachable code where appropriate.
Private fault injection covers non-finite Float bits, stale/malformed references,
wrong concrete types, invalid/partial Trait pairs, left-before-right validation,
invalid right operands despite null left, underflow, foreign String ownership,
checked String cost overflow and malformed/missing/excess handler results.
Assertions preserve complete operands and String owners, resource usage, Float
NaN payload bits and charged cycles. Misbehaving output handlers use a different
owner namespace to exercise the shared invocation protocol. Descriptor tests
reject unsupported layouts, inconsistent metadata and undeclared capabilities.
Real GC retains live aliases and permits collection when only an Int64 hash is
retained; reuse increments the generation and old handles still fault. Existing
generation-exhaustion tests cover retirement without wrap. Hashing equal String
content across image, session concatenation and explicit import owners agrees.
Sequential handle distribution exercises 256 reduced buckets; deliberate bucket
collisions still require reference equality. This is distribution evidence,
not a uniqueness or adversarial-resistance claim.
## Allocation, resources and scheduling
Ten new warmed instruction regions cover three scalar hashes, five reference
hash categories, Struct equality and Trait equality. After ten warmup iterations,
1,000 measured iterations per region allocate/deallocate nothing natively,
including reallocations, and create no guest heap objects. Original values remain
in locals so owner destruction does not contaminate the measured region. The
same checks pass in debug, resource-diagnostics and selected release execution.
Quota-injection tests exhaust guest/handle/auxiliary/temporary/String budgets
before reference/scalar queries and check unchanged resource use. New queries do
not trigger GC, grow their result stack, request scratch or call the host. Fault
checks cover guest resource/owner preservation; the native allocator measurement
covers successful warmed execution, not the existing diagnostic formatting path.
Zero fuel leaves PC/state unchanged; one positive cycle admits the entire
instruction, including a 65-byte String hash costing 73, with no extra generic
INTRINSIC cycle. Foreign String owners are rejected only after full byte cost.
## Scope of evidence
This record covers the local target and configurations above. Other hosts,
architectures and cross-host execution comparisons were not run. The explicit
LE implementation and independent vectors support portability but do not replace
qualification on additional advertised targets. Studio source compilation,
normal/optimized source conformance, catalog pins/mirrors and packaged SDK
resources remain the [consumer handoff](identity-hashing-producer-handoff.md).
No Lua frontend, Set/Map or structural/Dynamic equality is reported as delivered.
+109 -106
View File
@@ -1,106 +1,109 @@
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
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,schema_version,arg_nullable,invocation_model,scratch_model,context_access,cost_arg_index,cost_per_byte
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,2,false|false|false|false,host_buffered_v1,existing_contract_v1,host,,0
0x1001,4097,vec2.length,1,vec2,length,2,1,Float|Float,Float,true,false,x|y,40,false,fixed,0,0,2,false|false,host_buffered_v1,existing_contract_v1,host,,0
0x1100,4352,color.from_raw,1,color,from_raw,1,1,Int64,builtin:color,true,false,raw,1,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,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,2,false|false|false,host_buffered_v1,existing_contract_v1,host,,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,2,false|false|false|false,host_buffered_v1,existing_contract_v1,host,,0
0x1103,4355,color.html_rgba,1,color,html_rgba,1,1,String,builtin:color,true,false,value,1,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x1104,4356,color.gray_scale,1,color,gray_scale,1,1,Int64,builtin:color,true,false,value,1,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x1105,4357,color.hex,1,color,hex,1,1,builtin:color,Int64,true,false,color,1,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x1106,4358,color.alpha,1,color,alpha,1,1,builtin:color,Int64,true,false,color,1,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x1120,4384,color.black,1,color,black,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1121,4385,color.white,1,color,white,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1122,4386,color.red,1,color,red,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1123,4387,color.green,1,color,green,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1124,4388,color.blue,1,color,blue,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1125,4389,color.yellow,1,color,yellow,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1126,4390,color.orange,1,color,orange,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1127,4391,color.indigo,1,color,indigo,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1128,4392,color.gray,1,color,gray,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x1129,4393,color.cyan,1,color,cyan,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x112A,4394,color.magenta,1,color,magenta,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x112B,4395,color.transparent,1,color,transparent,0,1,,builtin:color,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2100,8448,input.pad.up.pressed,1,input.pad.up,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2101,8449,input.pad.up.released,1,input.pad.up,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2102,8450,input.pad.up.down,1,input.pad.up,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2103,8451,input.pad.up.hold,1,input.pad.up,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2104,8452,input.pad.down.pressed,1,input.pad.down,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2105,8453,input.pad.down.released,1,input.pad.down,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2106,8454,input.pad.down.down,1,input.pad.down,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2107,8455,input.pad.down.hold,1,input.pad.down,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2108,8456,input.pad.left.pressed,1,input.pad.left,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2109,8457,input.pad.left.released,1,input.pad.left,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x210A,8458,input.pad.left.down,1,input.pad.left,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x210B,8459,input.pad.left.hold,1,input.pad.left,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x210C,8460,input.pad.right.pressed,1,input.pad.right,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x210D,8461,input.pad.right.released,1,input.pad.right,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x210E,8462,input.pad.right.down,1,input.pad.right,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x210F,8463,input.pad.right.hold,1,input.pad.right,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2110,8464,input.pad.a.pressed,1,input.pad.a,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2111,8465,input.pad.a.released,1,input.pad.a,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2112,8466,input.pad.a.down,1,input.pad.a,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2113,8467,input.pad.a.hold,1,input.pad.a,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2114,8468,input.pad.b.pressed,1,input.pad.b,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2115,8469,input.pad.b.released,1,input.pad.b,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2116,8470,input.pad.b.down,1,input.pad.b,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2117,8471,input.pad.b.hold,1,input.pad.b,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2118,8472,input.pad.x.pressed,1,input.pad.x,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2119,8473,input.pad.x.released,1,input.pad.x,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x211A,8474,input.pad.x.down,1,input.pad.x,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x211B,8475,input.pad.x.hold,1,input.pad.x,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x211C,8476,input.pad.y.pressed,1,input.pad.y,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x211D,8477,input.pad.y.released,1,input.pad.y,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x211E,8478,input.pad.y.down,1,input.pad.y,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x211F,8479,input.pad.y.hold,1,input.pad.y,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2120,8480,input.pad.l.pressed,1,input.pad.l,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2121,8481,input.pad.l.released,1,input.pad.l,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2122,8482,input.pad.l.down,1,input.pad.l,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2123,8483,input.pad.l.hold,1,input.pad.l,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2124,8484,input.pad.r.pressed,1,input.pad.r,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2125,8485,input.pad.r.released,1,input.pad.r,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2126,8486,input.pad.r.down,1,input.pad.r,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2127,8487,input.pad.r.hold,1,input.pad.r,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2128,8488,input.pad.start.pressed,1,input.pad.start,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2129,8489,input.pad.start.released,1,input.pad.start,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x212A,8490,input.pad.start.down,1,input.pad.start,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x212B,8491,input.pad.start.hold,1,input.pad.start,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x212C,8492,input.pad.select.pressed,1,input.pad.select,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x212D,8493,input.pad.select.released,1,input.pad.select,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x212E,8494,input.pad.select.down,1,input.pad.select,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x212F,8495,input.pad.select.hold,1,input.pad.select,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2130,8496,input.touch.button.pressed,1,input.touch.button,pressed,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2131,8497,input.touch.button.released,1,input.touch.button,released,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2132,8498,input.touch.button.down,1,input.touch.button,down,0,1,,Bool,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2133,8499,input.touch.button.hold,1,input.touch.button,hold,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2134,8500,input.touch.x,1,input.touch,x,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x2135,8501,input.touch.y,1,input.touch,y,0,1,,Int64,true,false,,1,false,fixed,0,0,2,,host_buffered_v1,existing_contract_v1,host,,0
0x3000,12288,math.i32.min,1,math.i32,min,2,1,Int32|Int32,Int32,true,false,a|b,2,false,fixed,0,0,2,false|false,host_buffered_v1,existing_contract_v1,host,,0
0x3001,12289,math.i32.max,1,math.i32,max,2,1,Int32|Int32,Int32,true,false,a|b,2,false,fixed,0,0,2,false|false,host_buffered_v1,existing_contract_v1,host,,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,2,false|false|false,host_buffered_v1,existing_contract_v1,host,,0
0x3003,12291,math.i32.abs,1,math.i32,abs,1,1,Int32,Int32,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3004,12292,math.i64.min,1,math.i64,min,2,1,Int64|Int64,Int64,true,false,a|b,2,false,fixed,0,0,2,false|false,host_buffered_v1,existing_contract_v1,host,,0
0x3005,12293,math.i64.max,1,math.i64,max,2,1,Int64|Int64,Int64,true,false,a|b,2,false,fixed,0,0,2,false|false,host_buffered_v1,existing_contract_v1,host,,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,2,false|false|false,host_buffered_v1,existing_contract_v1,host,,0
0x3007,12295,math.i64.abs,1,math.i64,abs,1,1,Int64,Int64,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3008,12296,mathf.min,1,mathf,min,2,1,Float|Float,Float,true,false,a|b,2,false,fixed,0,0,2,false|false,host_buffered_v1,existing_contract_v1,host,,0
0x3009,12297,mathf.max,1,mathf,max,2,1,Float|Float,Float,true,false,a|b,2,false,fixed,0,0,2,false|false,host_buffered_v1,existing_contract_v1,host,,0
0x300A,12298,mathf.clamp,1,mathf,clamp,3,1,Float|Float|Float,Float,true,false,value|min|max,4,false,fixed,0,0,2,false|false|false,host_buffered_v1,existing_contract_v1,host,,0
0x300B,12299,mathf.abs,1,mathf,abs,1,1,Float,Float,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x300C,12300,mathf.floor,1,mathf,floor,1,1,Float,Float,true,false,value,4,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x300D,12301,mathf.ceil,1,mathf,ceil,1,1,Float,Float,true,false,value,4,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x300E,12302,mathf.trunc,1,mathf,trunc,1,1,Float,Float,true,false,value,4,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x300F,12303,mathf.round,1,mathf,round,1,1,Float,Float,true,false,value,4,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3010,12304,mathf.sqrt,1,mathf,sqrt,1,1,Float,Float,true,false,value,16,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3011,12305,mathf.sin,1,mathf,sin,1,1,Float,Float,true,false,angle,32,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3012,12306,mathf.cos,1,mathf,cos,1,1,Float,Float,true,false,angle,32,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3013,12307,mathf.atan2,1,mathf,atan2,2,1,Float|Float,Float,true,false,y|x,48,false,fixed,0,0,2,false|false,host_buffered_v1,existing_contract_v1,host,,0
0x3014,12308,math.i32.to_i64,1,math.i32,to_i64,1,1,Int32,Int64,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3015,12309,math.i64.to_i32,1,math.i64,to_i32,1,1,Int64,Int32,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3016,12310,math.i32.to_float,1,math.i32,to_float,1,1,Int32,Float,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3017,12311,math.i64.to_float,1,math.i64,to_float,1,1,Int64,Float,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3018,12312,mathf.to_i32,1,mathf,to_i32,1,1,Float,Int32,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x3019,12313,mathf.to_i64,1,mathf,to_i64,1,1,Float,Int64,true,false,value,2,false,fixed,0,0,2,false,host_buffered_v1,existing_contract_v1,host,,0
0x4000,16384,random.new,1,random,new,1,1,Int64,builtin:Random,true,true,seed,32,true,fixed,0,0,2,false,vm_owned_v1,existing_contract_v1,vm_state,,0
0x4001,16385,random.next,1,random,next,1,1,builtin:Random,Int64,true,false,rng,8,true,fixed,0,0,2,true,vm_owned_v1,existing_contract_v1,vm_state,,0
0x4002,16386,random.nextf,1,random,nextf,1,1,builtin:Random,Float,true,false,rng,12,true,fixed,0,0,2,true,vm_owned_v1,existing_contract_v1,vm_state,,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,2,true|false|false,vm_owned_v1,existing_contract_v1,vm_state,,0
0x4100,16640,hash.i64,1,hash,i64,1,1,Int64,Int64,true,false,value,8,false,fixed,0,0,2,false,borrowed_inline_v1,none,none,,0
0x4101,16641,hash.float,1,hash,float,1,1,Float,Int64,true,false,value,8,false,fixed,0,0,2,false,borrowed_inline_v1,none,none,,0
0x4102,16642,hash.string,1,hash,string,1,1,String,Int64,true,false,value,8,false,argument_utf8_bytes_v1,0,0,2,true,borrowed_inline_v1,none,none,0,1
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 schema_version arg_nullable invocation_model scratch_model context_access cost_arg_index cost_per_byte
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 2 false|false|false|false host_buffered_v1 existing_contract_v1 host 0
3 0x1001 4097 vec2.length 1 vec2 length 2 1 Float|Float Float true false x|y 40 false fixed 0 0 2 false|false host_buffered_v1 existing_contract_v1 host 0
4 0x1100 4352 color.from_raw 1 color from_raw 1 1 Int64 builtin:color true false raw 1 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 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 2 false|false|false host_buffered_v1 existing_contract_v1 host 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 2 false|false|false|false host_buffered_v1 existing_contract_v1 host 0
7 0x1103 4355 color.html_rgba 1 color html_rgba 1 1 String builtin:color true false value 1 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
8 0x1104 4356 color.gray_scale 1 color gray_scale 1 1 Int64 builtin:color true false value 1 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
9 0x1105 4357 color.hex 1 color hex 1 1 builtin:color Int64 true false color 1 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
10 0x1106 4358 color.alpha 1 color alpha 1 1 builtin:color Int64 true false color 1 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
11 0x1120 4384 color.black 1 color black 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
12 0x1121 4385 color.white 1 color white 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
13 0x1122 4386 color.red 1 color red 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
14 0x1123 4387 color.green 1 color green 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
15 0x1124 4388 color.blue 1 color blue 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
16 0x1125 4389 color.yellow 1 color yellow 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
17 0x1126 4390 color.orange 1 color orange 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
18 0x1127 4391 color.indigo 1 color indigo 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
19 0x1128 4392 color.gray 1 color gray 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
20 0x1129 4393 color.cyan 1 color cyan 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
21 0x112A 4394 color.magenta 1 color magenta 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
22 0x112B 4395 color.transparent 1 color transparent 0 1 builtin:color true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
23 0x2100 8448 input.pad.up.pressed 1 input.pad.up pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
24 0x2101 8449 input.pad.up.released 1 input.pad.up released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
25 0x2102 8450 input.pad.up.down 1 input.pad.up down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
26 0x2103 8451 input.pad.up.hold 1 input.pad.up hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
27 0x2104 8452 input.pad.down.pressed 1 input.pad.down pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
28 0x2105 8453 input.pad.down.released 1 input.pad.down released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
29 0x2106 8454 input.pad.down.down 1 input.pad.down down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
30 0x2107 8455 input.pad.down.hold 1 input.pad.down hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
31 0x2108 8456 input.pad.left.pressed 1 input.pad.left pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
32 0x2109 8457 input.pad.left.released 1 input.pad.left released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
33 0x210A 8458 input.pad.left.down 1 input.pad.left down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
34 0x210B 8459 input.pad.left.hold 1 input.pad.left hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
35 0x210C 8460 input.pad.right.pressed 1 input.pad.right pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
36 0x210D 8461 input.pad.right.released 1 input.pad.right released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
37 0x210E 8462 input.pad.right.down 1 input.pad.right down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
38 0x210F 8463 input.pad.right.hold 1 input.pad.right hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
39 0x2110 8464 input.pad.a.pressed 1 input.pad.a pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
40 0x2111 8465 input.pad.a.released 1 input.pad.a released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
41 0x2112 8466 input.pad.a.down 1 input.pad.a down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
42 0x2113 8467 input.pad.a.hold 1 input.pad.a hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
43 0x2114 8468 input.pad.b.pressed 1 input.pad.b pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
44 0x2115 8469 input.pad.b.released 1 input.pad.b released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
45 0x2116 8470 input.pad.b.down 1 input.pad.b down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
46 0x2117 8471 input.pad.b.hold 1 input.pad.b hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
47 0x2118 8472 input.pad.x.pressed 1 input.pad.x pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
48 0x2119 8473 input.pad.x.released 1 input.pad.x released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
49 0x211A 8474 input.pad.x.down 1 input.pad.x down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
50 0x211B 8475 input.pad.x.hold 1 input.pad.x hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
51 0x211C 8476 input.pad.y.pressed 1 input.pad.y pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
52 0x211D 8477 input.pad.y.released 1 input.pad.y released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
53 0x211E 8478 input.pad.y.down 1 input.pad.y down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
54 0x211F 8479 input.pad.y.hold 1 input.pad.y hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
55 0x2120 8480 input.pad.l.pressed 1 input.pad.l pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
56 0x2121 8481 input.pad.l.released 1 input.pad.l released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
57 0x2122 8482 input.pad.l.down 1 input.pad.l down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
58 0x2123 8483 input.pad.l.hold 1 input.pad.l hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
59 0x2124 8484 input.pad.r.pressed 1 input.pad.r pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
60 0x2125 8485 input.pad.r.released 1 input.pad.r released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
61 0x2126 8486 input.pad.r.down 1 input.pad.r down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
62 0x2127 8487 input.pad.r.hold 1 input.pad.r hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
63 0x2128 8488 input.pad.start.pressed 1 input.pad.start pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
64 0x2129 8489 input.pad.start.released 1 input.pad.start released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
65 0x212A 8490 input.pad.start.down 1 input.pad.start down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
66 0x212B 8491 input.pad.start.hold 1 input.pad.start hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
67 0x212C 8492 input.pad.select.pressed 1 input.pad.select pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
68 0x212D 8493 input.pad.select.released 1 input.pad.select released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
69 0x212E 8494 input.pad.select.down 1 input.pad.select down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
70 0x212F 8495 input.pad.select.hold 1 input.pad.select hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
71 0x2130 8496 input.touch.button.pressed 1 input.touch.button pressed 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
72 0x2131 8497 input.touch.button.released 1 input.touch.button released 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
73 0x2132 8498 input.touch.button.down 1 input.touch.button down 0 1 Bool true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
74 0x2133 8499 input.touch.button.hold 1 input.touch.button hold 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
75 0x2134 8500 input.touch.x 1 input.touch x 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 0
76 0x2135 8501 input.touch.y 1 input.touch y 0 1 Int64 true false 1 false fixed 0 0 2 host_buffered_v1 existing_contract_v1 host 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 2 false|false host_buffered_v1 existing_contract_v1 host 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 2 false|false host_buffered_v1 existing_contract_v1 host 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 2 false|false|false host_buffered_v1 existing_contract_v1 host 0
80 0x3003 12291 math.i32.abs 1 math.i32 abs 1 1 Int32 Int32 true false value 2 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 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 2 false|false host_buffered_v1 existing_contract_v1 host 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 2 false|false host_buffered_v1 existing_contract_v1 host 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 2 false|false|false host_buffered_v1 existing_contract_v1 host 0
84 0x3007 12295 math.i64.abs 1 math.i64 abs 1 1 Int64 Int64 true false value 2 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
85 0x3008 12296 mathf.min 1 mathf min 2 1 Float|Float Float true false a|b 2 false fixed 0 0 2 false|false host_buffered_v1 existing_contract_v1 host 0
86 0x3009 12297 mathf.max 1 mathf max 2 1 Float|Float Float true false a|b 2 false fixed 0 0 2 false|false host_buffered_v1 existing_contract_v1 host 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 2 false|false|false host_buffered_v1 existing_contract_v1 host 0
88 0x300B 12299 mathf.abs 1 mathf abs 1 1 Float Float true false value 2 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
89 0x300C 12300 mathf.floor 1 mathf floor 1 1 Float Float true false value 4 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
90 0x300D 12301 mathf.ceil 1 mathf ceil 1 1 Float Float true false value 4 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
91 0x300E 12302 mathf.trunc 1 mathf trunc 1 1 Float Float true false value 4 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
92 0x300F 12303 mathf.round 1 mathf round 1 1 Float Float true false value 4 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
93 0x3010 12304 mathf.sqrt 1 mathf sqrt 1 1 Float Float true false value 16 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
94 0x3011 12305 mathf.sin 1 mathf sin 1 1 Float Float true false angle 32 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
95 0x3012 12306 mathf.cos 1 mathf cos 1 1 Float Float true false angle 32 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
96 0x3013 12307 mathf.atan2 1 mathf atan2 2 1 Float|Float Float true false y|x 48 false fixed 0 0 2 false|false host_buffered_v1 existing_contract_v1 host 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 2 false host_buffered_v1 existing_contract_v1 host 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 2 false host_buffered_v1 existing_contract_v1 host 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 2 false host_buffered_v1 existing_contract_v1 host 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 2 false host_buffered_v1 existing_contract_v1 host 0
101 0x3018 12312 mathf.to_i32 1 mathf to_i32 1 1 Float Int32 true false value 2 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
102 0x3019 12313 mathf.to_i64 1 mathf to_i64 1 1 Float Int64 true false value 2 false fixed 0 0 2 false host_buffered_v1 existing_contract_v1 host 0
103 0x4000 16384 random.new 1 random new 1 1 Int64 builtin:Random true true seed 32 true fixed 0 0 2 false vm_owned_v1 existing_contract_v1 vm_state 0
104 0x4001 16385 random.next 1 random next 1 1 builtin:Random Int64 true false rng 8 true fixed 0 0 2 true vm_owned_v1 existing_contract_v1 vm_state 0
105 0x4002 16386 random.nextf 1 random nextf 1 1 builtin:Random Float true false rng 12 true fixed 0 0 2 true vm_owned_v1 existing_contract_v1 vm_state 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 2 true|false|false vm_owned_v1 existing_contract_v1 vm_state 0
107 0x4100 16640 hash.i64 1 hash i64 1 1 Int64 Int64 true false value 8 false fixed 0 0 2 false borrowed_inline_v1 none none 0
108 0x4101 16641 hash.float 1 hash float 1 1 Float Int64 true false value 8 false fixed 0 0 2 false borrowed_inline_v1 none none 0
109 0x4102 16642 hash.string 1 hash string 1 1 String Int64 true false value 8 false argument_utf8_bytes_v1 0 0 2 true borrowed_inline_v1 none none 0 1
+17 -2
View File
@@ -107,9 +107,10 @@ 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_model is fixed or random_rejection_v1. cost_cycles is the full fixed
- cost_model is fixed, random_rejection_v1, or argument_utf8_bytes_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.
fixed and String byte-cost entries; random.range publishes base 4, attempt 8, maximum 64.
hash.string publishes base 8, argument index 0 and one cycle per UTF-8 byte.
- 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
@@ -207,3 +208,17 @@ source-selected Struct destinations. Its schema is an ordinary Registry Struct;
no new category, request object, syscall or safepoint is introduced. Exact nullable
destination rules, stack effects, validation, costs and commit semantics are in the
[canonical instruction contract](../specs/runtime/02-vm-instruction-set.md#atomic-publication-of-multiple-struct-instances).
## Identity/hash and catalog schema 2
The [identity/hash specification](../specs/runtime/02f-vm-identity-and-value-hashing.md)
defines opcodes 0x0097/0x0098, intrinsics 0x4100–0x4102, XXH64 hash-v1 and
borrowed_inline_v1. INTRINSICS.csv schema 2 retains its original eighteen columns
and appends schema_version, arg_nullable, invocation_model, scratch_model,
context_access, cost_arg_index and cost_per_byte. Descriptors remain authoritative;
unknown or inconsistent schemas/profiles/models must fail explicitly. Existing
canonical versions, signatures, effects and costs remain unchanged.
See the [identity/hash producer handoff](identity-hashing-producer-handoff.md) and
[qualification record](IDENTITY_HASHING_QUALIFICATION.md) for emitted PBX, catalog
provenance and consumer acceptance evidence.
@@ -0,0 +1,104 @@
# Identity and hashing producer handoff
The runtime provides the five operations in the
[identity/hash contract](../specs/runtime/02f-vm-identity-and-value-hashing.md).
The [catalog](INTRINSICS.csv) uses schema 2. Compiler/SDK integration is pending
consumer work; the neutral PBX corpus qualifies the provider independently of
any source language. No host, firmware, syscall or Lua frontend is required.
## Provider identity
The [qualification record](IDENTITY_HASHING_QUALIFICATION.md) identifies the
source base revision, source fingerprint, toolchain, catalog/constant/vector
SHA-256 values and executed commands. Pin the delivered runtime revision and
catalog digest together when importing this provider. A catalog-only copy does
not establish consumer compatibility. The hash contract version remains one;
schema version two changes metadata representation, not old intrinsic versions.
## Representation and emission
| Operation | Encoding | Complete input group(s) | Output | Cycles |
| --- | --- | --- | --- | --- |
| REF_IDENTITY_HASH | u16 0x0097, u32 source TypeId | source | Int64 | 8+w(source) |
| REF_IDENTITY_EQ | u16 0x0098, u32 left TypeId, u32 right TypeId | left then right | Bool | 4+w(left)+w(right) |
| hash.i64@1 | INTRINSIC u32 0x4100 | Int64 | Int64 | 8 |
| hash.float@1 | INTRINSIC u32 0x4101 | Float | Int64 | 8 |
| hash.string@1 | INTRINSIC u32 0x4102 | nullable String | Int64 | 8+UTF-8 bytes |
All fields are little-endian. TypeIds are program-local Registry indices.
Reference eligibility is exactly Struct/Array/Fn/Trait/Random; preserve complete
Trait pairs and source evaluation order. Valid trait views hash/compare their
receiver, including ImplementationId zero. Do not project String/Dynamic through
these opcodes or widen the older REF_* category rules.
For example, with TypeId 5 a Struct and TypeId 7 its Trait, emit:
```text
STRUCT_NEW 5
SET_LOCAL 0
GET_LOCAL 0
REF_IDENTITY_HASH 5
GET_LOCAL 0
REF_TO_TRAIT source=5,target=7
REF_IDENTITY_HASH 7
EQ
RET
```
The result is true. Trait conversion must have a coherent Registry implementation.
Hash values use signed Int64 carriers with unchanged digest bits; negative results
are valid. SDK code must define ordered component composition, optional/Dynamic
strategies, 32-bit folding, and coherent equality domains. Integer/Float equality
across domains requires explicit canonicalization; numerical Float-to-Int64
conversion is not the Float hashing algorithm.
## Metadata import and rejection
Import all 25 exact columns, including schema_version=2 on every row and ordered
arg_nullable booleans matching flattened argument slots. Preserve the existing
18 fields. Validate:
- borrowed_inline_v1/none/none is the hash profile; deterministic=true,
may_allocate=false and mutates_guest_state=false are separate claims.
- fixed numeric costs have no cost_arg_index and cost_per_byte=0.
- argument_utf8_bytes_v1 uses String slot zero, cost_per_byte=1 and base eight;
attempt_cost_cycles/max_attempts are zero.
- Old Host and VM-owned entries retain their explicit profiles and existing
contract; their metadata does not promise the bounded profile's execution model.
- Known null is admitted for hash.string only among String arguments; previous
String intrinsics and numeric hashes keep non-nullable admission. Random
nullable admission still allows runtime receiver precondition faults.
Reject unsupported schemas, profiles, cost models, capacities and inconsistent
layouts/nullable widths/indexes explicitly. Do not infer nullability, scratch,
context access or purity from names or deterministic alone. Preserve observable
faults and charged work when results are unused. Optimization must not skip
complete right-side validation because a left operand is null or differs.
## Studio consumer ownership and acceptance
The following targets belong to the Studio/compiler delivery, outside this
runtime implementation:
| Target | Required result and acceptance evidence |
| --- | --- |
| Manual IRVMIntrinsicDefinition and intrinsic registry | Represent/import schema, nullable mask, invocation/scratch/context and cost parameters; reject unknown or inconsistent entries. |
| IR, verifier, lowering and emitter | Represent both typed reference instructions, complete operand groups and exact IDs; admit nullable String per entry; preserve fault order and costs. |
| Catalog mirrors and runtime-catalog pin | Copy generated schema 2 artifacts, record runtime revision and SHA-256, retain all old IDs/versions/contracts and constant bytes. |
| Packaged compiler and SDK resources | Installed resources and generated code use the same pin, schema and definitions as development execution. |
| SDK equality/hash wrappers | Explicit domain policy, null handling, Float zero normalization, Int32 widening, Bool mapping, composition and 32-bit folding. No implicit object-content or universal Dynamic equality. |
| Normal and optimized source corpus | Execute emitted PBX against the runtime and compare result bits, faults, retained operands and cycles. Include the neutral cases below and packaged execution. |
Consumer corpus coverage must include signed Int64 extremes and negative digests;
finite Float subnormals/extremes/2^53, both zeros and injected non-finite faults;
UTF-8, NUL, empty/null and equal content with different owners; aliases versus
distinct objects/closures/generators; mutation and Random advancement; Trait
views and implementation zero; absent and malformed groups; stale handles after
GC/reuse; rejected right groups despite null/different left groups; zero fuel,
positive overshoot and discarded results. Reuse the
[reference vectors](../../crates/console/prometeu-vm/tests/fixtures/hash-conformance.tsv)
with their [independent oracle provenance](../../crates/console/prometeu-vm/tests/fixtures/hash-oracle.md).
Set/Map implementation, source frontend integration, general structural equality,
storage-publication integration and any future Lua frontend retain their own
scope and validation. This handoff does not report those consumers as delivered.
@@ -0,0 +1,126 @@
{
"date": "2026-10-23",
"target": "aarch64-apple-darwin",
"rustc": "1.98.1 (48a229cea 2026-09-01)",
"cargo": "1.98.1 (797e8a9bc 2026-08-05)",
"base_revision": "57992cf214e8a5f9de53a40dba9aaa7fab038c91",
"delivery_state": "working tree; source and artifact digests identify this qualification",
"source_fingerprint_encoding": "For sorted source_files paths, SHA256(path UTF-8 + NUL + file bytes + NUL), concatenated in order.",
"source_fingerprint_sha256": "a0d202e46fbca3319d7b04fe09906388c015da7b606216e75bd7c62041011885",
"source_files": {
"crates/console/prometeu-bytecode/src/assembler.rs": "f6167c76402dda95e32e12d801791625be0232864df96eab6857bedbc94cfe95",
"crates/console/prometeu-bytecode/src/disassembler.rs": "c75a82b46d7845ea08d3fdee7abba4ce4f8bfb589c787d8ce72728da973947c7",
"crates/console/prometeu-bytecode/src/opcode.rs": "ec3ae01e521190757c882df5119ad86ee35204986bbf894cc57c6a565f31c097",
"crates/console/prometeu-bytecode/src/opcode_spec.rs": "cf393b2681bc7326fb79f1646bfbaf507b371e45648a6ef0d835eccbb6b9adba",
"crates/console/prometeu-bytecode/src/registry.rs": "6fe288fe41bf753279a8dcbe4b62d8878c82c7c0e7227ef10764af1b4f37e13d",
"crates/console/prometeu-bytecode/src/registry_instruction.rs": "957a06d9d9d801021af9341a01b84a21299e2ffe8c1bc50dfcec867ea7e18030",
"crates/console/prometeu-bytecode/tests/registry_isa.rs": "c67183a8b7100690fdd3b723b43024fc63afe63b8fb50bbcd1fb61f3f0e75323",
"crates/console/prometeu-vm/src/builtins.rs": "061785b356373f92c69cb6c774344b3e6ae77d33014061529e4ce905da5afe33",
"crates/console/prometeu-vm/src/catalog.rs": "d4f53cd5da6e7b90a3454aefd696baac1d49b2a4cf8cada2d563a6f3c190f81a",
"crates/console/prometeu-vm/src/hash_intrinsics.rs": "40c307e78e773908a42a187ca7a0b42667d38f72a480208d2b8255d8c322e324",
"crates/console/prometeu-vm/src/hashing.rs": "5f81f74560fd126e4344fdb47e4a6ba916b94954ccf8ce70af796adbacf10ab1",
"crates/console/prometeu-vm/src/input_intrinsics.rs": "5d0f6985f1bb0038405dd853816d9e16b636a3157d870a282aeaf742c30700ae",
"crates/console/prometeu-vm/src/intrinsic_contract.rs": "09908ccff4586c0985cdf5b3b65b0844dd175dffa301ed5902d4e0b83f16bc49",
"crates/console/prometeu-vm/src/lib.rs": "c69e7fcb9dd6a6d3c174c1ec6ed61d0c3a884254aa3882438bfe1b99e22c273f",
"crates/console/prometeu-vm/src/math_intrinsics.rs": "22101a563b5fd5f4a47b463b3482be80d39483a8a0cea285453cff385174cb19",
"crates/console/prometeu-vm/src/random_intrinsics.rs": "dfc398ed6a62c2fb50d9316d1ec9e03c04fa1651f6087e8c108ded5668894a2a",
"crates/console/prometeu-vm/src/registry_verifier/types.rs": "4a3af80df86c01cdad4d2f78c7e0578cb8e4afab9ff5148d13c431cf4cbc8d85",
"crates/console/prometeu-vm/src/value_contract.rs": "69bb9dc6921e3a5ef2f4fc0d36a952ae7717335859ee864afd0744799314ae81",
"crates/console/prometeu-vm/src/virtual_machine.rs": "cbe860aaec823400bd3657f6d4fb2cf2b18d65295527ad63a58021e7cf117b03",
"crates/console/prometeu-vm/src/virtual_machine/identity.rs": "0f16d16030fd4b233185abc140346fe89134bd1cd783e652c7f2bafa4ce7030a",
"crates/console/prometeu-vm/src/virtual_machine/identity_tests.rs": "859d8db588de45129dd70c86260f864fa8412581de3972080dc772bb5e306800",
"crates/console/prometeu-vm/src/virtual_machine/intrinsic.rs": "1b7ac3a384b4dee22906d9bfb274a4375eefefe3ce3ba80e1c34b0cc120816e2",
"crates/console/prometeu-vm/tests/execution_allocations.rs": "ab21890759be059c93b3b8a54cfbe33f8372b41e608e461fe0923c8f15a5434f",
"crates/console/prometeu-vm/tests/fixtures/hash-conformance.tsv": "a863486eaea14ab1a010f076f355eed0d5738207dad3651f7d10e92fc09f74d4",
"crates/console/prometeu-vm/tests/fixtures/hash-oracle.md": "2001e073c610a78df79d21fb973aa017ddf23312751716445f106d60b71e4113",
"crates/console/prometeu-vm/tests/fixtures/hash-oracle.py": "48bb6cae67b96f9bd8c306236d74ef61dc9aa0309c846c289298f870ceb367a1",
"crates/console/prometeu-vm/tests/identity_hashing.rs": "9ec0c42354fb5cc0eaa440aa2405e2fdffea3b91a98f2d8399275d2d1ebf8304",
"crates/console/prometeu-vm/tests/intrinsic_profiles.rs": "3bc549f666e4b3b30789704fa7a9f050273a370340e1f40ca33fcd10cc61402c",
"crates/console/prometeu-vm/tests/support/identity.rs": "cd8407f94d8c3b4782eaacbd5a934f278f25ee20d604c2f6862e7646bca54069"
},
"artifact_sha256": {
"Cargo.lock": "cffad9ed62f38a591538abd81dd39270d6022397342c8189f4ac6c7baaa8e795",
"docs/vm-arch/INTRINSICS.csv": "7c1c363f5f0f941b3ab27cfc72af41e13e44cd4371c687db8300721288f47e63",
"docs/vm-arch/BUILTIN_CONSTANTS.csv": "e407e4718127aa7ef7b1097b5b4b67d86dd979235e73a551a7c36b628cddc039",
"crates/console/prometeu-vm/tests/fixtures/hash-conformance.tsv": "a863486eaea14ab1a010f076f355eed0d5738207dad3651f7d10e92fc09f74d4"
},
"checks": [
{
"command": "cargo test --locked --offline -p prometeu-bytecode -p prometeu-vm --no-fail-fast",
"result": "passed",
"passed": 453,
"failed": 0,
"ignored": 3
},
{
"command": "cargo test --locked --offline -p prometeu-vm --features resource-diagnostics --no-fail-fast",
"result": "passed",
"passed": 401,
"failed": 0,
"ignored": 2
},
{
"command": "cargo test --locked --offline -p prometeu-quality-checks -p prometeu-layer-tests --no-fail-fast",
"result": "passed",
"passed": 19,
"failed": 0,
"ignored": 0
},
{
"command": "cargo test --locked --offline --release -p prometeu-vm --test identity_hashing --test intrinsic_profiles --test execution_allocations",
"result": "passed",
"passed": 12,
"failed": 0,
"ignored": 0
},
{
"command": "cargo check --locked --offline --workspace --all-targets",
"result": "passed"
},
{
"command": "cargo fmt --all --check",
"result": "passed"
},
{
"command": "git diff --check",
"result": "passed"
},
{
"command": "Regenerate catalog from runtime descriptors and compare exact bytes",
"result": "passed"
},
{
"command": "Regenerate 118 vectors from the pinned official C reference and compare exact bytes",
"result": "passed"
},
{
"command": "Compare all 105 legacy catalog entries first 18 fields and constant catalog bytes against base revision",
"result": "passed"
},
{
"command": "Verify source/artifact SHA-256 values, changed Markdown links, published workflow references and lesson links",
"result": "passed"
}
],
"oracle": {
"algorithm": "XXH64 seed 0",
"upstream": "xxHash v0.8.3 official C header",
"header_sha256": "17973c0dc49d9854ca26caa191f0e12f7a424b68858d9a78de3860d959d85e4b",
"vectors": 118
},
"legacy": {
"intrinsic_entries_preserved": 105,
"previous_fields_per_entry_preserved": 18,
"new_entries": 3,
"constant_catalog_byte_identical": true
},
"allocator": {
"new_instruction_regions": 10,
"warmup_iterations": 10,
"measured_iterations_per_region": 1000,
"native_allocations": 0,
"native_deallocations": 0,
"guest_allocations": 0
},
"limits": "Local debug/default, debug/resource-diagnostics, and selected release evidence only. No source compiler, Studio packaging, other host/target, or GUI execution qualified."
}