refactor(compiler)!: migrate SDK to minimal storage ISA
Replace retired guards and publication opcodes with SDK checks, neutral TRAP and sequential List/Linked mutations with explicit failure phases. Preserve snapshot cursors and import schema 2 metadata with the delivered provider pin. Include common/source/installed conformance, debug and release evidence, synchronized specs and the consolidated lesson. Runtime checkout remains unchanged.
This commit is contained in:
+210
@@ -0,0 +1,210 @@
|
||||
---
|
||||
id: LSN-0092
|
||||
ticket: runtime-storage-isa-consumer-migration
|
||||
title: Sequential collection mutations need explicit failure boundaries
|
||||
created: 2026-10-24
|
||||
tags: [compiler, compiler-pbs, runtime-integration, storage, collections]
|
||||
---
|
||||
|
||||
## Original problem and ownership
|
||||
|
||||
Owner: `compiler`, with propagation to `compiler/pbs` and `vm-arch`.
|
||||
|
||||
The delivered runtime removed logical guard and compound publication opcodes
|
||||
0xA7/0xA8/0xAA/0xAB. Studio's List/Linked SDK still depended on them and promised
|
||||
that every refused method preserved the complete collection. Pinning the new
|
||||
provider alone would therefore invalidate emitted PBX and leave the source
|
||||
contract unsupported. The provider also moved intrinsic metadata to schema 2.
|
||||
|
||||
AGD-0098 converged into accepted DEC-0077 and implementation PLN-0155. The user
|
||||
explicitly accepted the recommendations inspired by OpenJDK 25 and .NET 10, then
|
||||
authorized planning and implementation. These identifiers record workflow
|
||||
provenance; the completed control artifacts are removed by CLI housekeeping.
|
||||
The durable normative surfaces are the specifications linked below.
|
||||
|
||||
The entire migration belongs to Studio. Runtime revision
|
||||
`dcf6561ea73446e0a3e1cf1c73eda20923b38df0` is consumed unchanged. No runtime code,
|
||||
manifest, lockfile, instruction, quota or commit is a write target. External Cargo
|
||||
projects/targets qualify the production loader/VM without editing that checkout.
|
||||
|
||||
## Consolidated decision
|
||||
|
||||
Keep List's private array/logical size and Linked's private doubly linked nodes,
|
||||
collection identity, capacity policy and shared snapshot Cursor. Prepare logical
|
||||
checks, next sizes, values, candidates and return carriers before visible mutation;
|
||||
then use ordinary typed stores and retained ARRAY_COPY. Do not reconstruct a
|
||||
whole collection on every update to simulate the retired publication mechanism.
|
||||
|
||||
The accepted contract distinguishes three outcomes:
|
||||
|
||||
| Outcome | Guarantee |
|
||||
| --- | --- |
|
||||
| Rejection/preparation failure before the first visible mutation | The prior collection remains unchanged; argument effects and provisional allocations are not rolled back. |
|
||||
| Successful method return | All size/storage/topology, group, identity, cleanup and snapshot invariants hold. |
|
||||
| Internal/resource fault after visible mutation starts | Earlier writes can remain and invariants can be incomplete. There is no whole-method rollback, safe-reuse, retry or automatic-recovery guarantee. |
|
||||
|
||||
The last row deliberately replaces the old stronger promise. It is not a basic
|
||||
consistency guarantee. A single instruction still preserves its own entry state
|
||||
when it fails; that does not undo previous successful instructions.
|
||||
|
||||
BudgetExhausted and debugger pauses are instruction-boundary suspensions, not
|
||||
faults. Normal resumption continues the method at its current PC. Source methods
|
||||
are not atomic observation regions for the host/debugger. No user callback or
|
||||
explicit suspension is inserted into the sequence that completes mutation.
|
||||
|
||||
Java and C# informed the prepare-then-update structure, not a universal error
|
||||
recovery claim. Their ordinary iterators are also not a reason to replace an
|
||||
already accepted PBS snapshot protocol with fail-fast behavior.
|
||||
|
||||
## Final algorithms and costs
|
||||
|
||||
### List prepares packed values before shifting
|
||||
|
||||
For insertion with growth, build a private backing and copy the prefix and suffix
|
||||
directly into their final positions. For `[A,B,C]` with insertion of X at index 1,
|
||||
the candidate becomes `[A,X,B,C,...]` before storage/length are installed. Existing
|
||||
stored groups move intact, including holes, tags and identities.
|
||||
|
||||
Without growth, PBS Array assignment accepts T, whereas clearing uses
|
||||
`array.clear(index)`. Packing a new generic value can allocate. The SDK therefore
|
||||
prepares that value in a private one-slot array, shifts the suffix with ARRAY_COPY,
|
||||
copies the complete prepared slot, then updates logical length. This creates a
|
||||
charged temporary allocation and additional copy scratch; it does not clone the
|
||||
whole list or promise allocation-free insertion. A later copy/operand failure
|
||||
retains earlier writes under the accepted phase contract.
|
||||
|
||||
Removal prepares the optional result, shifts the suffix, clears the old tail and
|
||||
updates length. Clear and in-capacity resize clear their intervals in index order
|
||||
before setting length. Growing resize prepares/copies its private candidate;
|
||||
reserve/trim prepare candidates and replace storage without changing size.
|
||||
Indexed replacement and clearAt affect one checked position.
|
||||
|
||||
The policy remains capacity 16 by default, exact explicit capacity including zero,
|
||||
approximately 1.5x automatic growth with checked/clamped valid requirements,
|
||||
nonshrinking exact reserve and trim to size. Successful shrink/removal/clear never
|
||||
resurrect discarded values on regrowth. Old/candidate/temporary arrays coexist
|
||||
under ordinary quotas and tracing; reclamation is not immediate.
|
||||
|
||||
### Linked prepares nodes/results, then updates links
|
||||
|
||||
Insertion locates neighbors, checks the next signed-long size and prepares the new
|
||||
node before updating previous.next or head, next.previous or tail, then length.
|
||||
Removal prepares the optional result and neighbor values before updating those
|
||||
two sides and length. Replacement changes value only; clear changes head, tail,
|
||||
then length. Linked does not inherit Array's u32 length bound.
|
||||
|
||||
Some later source operand/carrier preparation can still refuse resources. The
|
||||
implementation and tests do not rename sequential link stores as atomic
|
||||
publication or assume that prepared source values make the remaining code
|
||||
infallible. A fault can occur after a successful earlier write.
|
||||
|
||||
### Cursor remains an independent snapshot
|
||||
|
||||
Capture constructs private immutable singly linked nodes and exposes only a
|
||||
complete result. Capture failure leaves the source unchanged. Forward and reverse
|
||||
Linked captures preserve their respective orders. Captured references preserve
|
||||
identity and observe later mutations of the referenced objects, while collection
|
||||
replacement/insertion/removal does not rewrite the captured sequence.
|
||||
|
||||
A nonempty Cursor starts at the first value. hasNext tests for a successor; next
|
||||
without one retains the last value; only an empty-born Cursor reports current
|
||||
absent. Prefixes become collectible as traversal advances, and the final current
|
||||
node/value remains retained until the Cursor releases it. No live/fail-fast
|
||||
iterator, public node or deep freeze was added.
|
||||
|
||||
## Logical refusals and the neutral terminal path
|
||||
|
||||
Bounds and length checks execute as PBS comparisons/branches. Reads/writes require
|
||||
`0 <= index < size`; insertion allows `index == size`. Negative or above-u32
|
||||
Array length/capacity requests and invalid logical indices terminate through the
|
||||
trusted private SDK fail binding, lowered to existing TRAP 0x05.
|
||||
|
||||
Common IR, IRVM, validation, optimization, emission and source spans now carry
|
||||
that zero-operand terminal operation. It raises TRAP_EXPLICIT rather than
|
||||
pretending to preserve retired guard diagnostics/costs. Physical Array operations
|
||||
that actually execute retain their own faults and resource context. None remains
|
||||
legitimate absence, not a replacement for a fault.
|
||||
|
||||
The four retired Registry kinds, publication schema builder and dedicated extra
|
||||
publication immediate fields were removed. Producer preload rejects the retired
|
||||
encodings even in dead code. Decoding actual instruction positions avoids false
|
||||
positives when an Int32 immediate contains the same numeric bytes.
|
||||
|
||||
## Copy attempt boundaries and schema 2
|
||||
|
||||
ARRAY_COPY remains u16 LE 0xA9 plus Array TypeId u32 LE, consuming source,
|
||||
sourceStart, target, targetStart, count. Exact receivers and Int64 offsets/count,
|
||||
strict physical ranges, overlap snapshots, complete groups/native owners and
|
||||
scratch cleanup remain provider responsibilities.
|
||||
|
||||
For valid selectable N and Registry width W, attempted cost is `4 + 2*N*W`, charged
|
||||
before receiver/range/group/scratch refusal. N=10/W=1 costs 24 on success and the
|
||||
specified refusals; W=2 costs 44. Empty copies validate and cost 4. Negative or
|
||||
above-u32 counts select base 4 and ordinary fault precedence. Zero budget executes
|
||||
nothing; positive budget admits the full attempt with overshoot, and a failed
|
||||
attempt is Trap with zero successful target steps. Checked arithmetic overflow
|
||||
using synthetic internal widths is separately qualified provider evidence, not a
|
||||
claim that admitted consumer descriptors can reach those widths.
|
||||
|
||||
All 108 intrinsic definitions retain all 25 schema-2 fields. A dedicated profile
|
||||
value validates schema, ordered nullable bits, invocation/scratch/context tuples
|
||||
and fixed/rejection/UTF-8 cost parameters. Deterministic does not mean pure.
|
||||
Known null String admission follows each entry: hash.string admits it and returns
|
||||
the provider's zero hash vector, while older non-nullable String entries reject
|
||||
it at load. Importing hash metadata does not deliver PBS hashing facades or Set/Map.
|
||||
|
||||
Catalogs, SHA/digests, compiler and SDK packaged resources now agree with the
|
||||
selected clean provider. Runtime architecture mirrors are copied byte-for-byte;
|
||||
ordinary compilation/parity tests continue using only local versioned resources.
|
||||
|
||||
## Qualification and reproducible evidence
|
||||
|
||||
The [qualification record](runtime-conformance-evidence.json) identifies source
|
||||
fingerprints, provider revision/clean state, toolchains, fixture digests, commands,
|
||||
log hashes, test totals and observed execution/refusal counts. Full raw logs are
|
||||
compressed losslessly as `.log.gz` files beside it; the record includes both
|
||||
compressed-file and original uncompressed SHA-256 values. The evidence separates the normal test suite, installed-JAR examples,
|
||||
explicit exporter parity, debug/release conformance and focused unchanged-provider
|
||||
copy defenses. Historical List/Linked evidence remains tied to its original pins.
|
||||
|
||||
The consumer harness measures refusal limits from setup/success peaks, then
|
||||
single-steps operations and compares every original-object state with the same
|
||||
successful instruction prefix. It asserts complete prior-state preservation only
|
||||
before visible mutation, and records completed writes afterward. Source snapshots
|
||||
are non-owning observations; they neither add guest roots nor write the collection.
|
||||
This catches both accidental early mutation and accidental claims of rollback.
|
||||
|
||||
The corpus includes normal/optimized source methods, 28 phase-marker variants,
|
||||
neutral store/copy/terminal fixtures, 22 copy cases across paired producer paths, dead retired opcodes
|
||||
versus immediate bytes, zero-budget/overshoot/fault precedence, quotas, GC,
|
||||
import/reexport and actual packaged examples compiled outside the checkout.
|
||||
Existing unrelated headless-schema gaps are reported explicitly by the harness;
|
||||
they are not silently relabeled as schema conformance or fixed in runtime here.
|
||||
|
||||
## Pitfalls and maintenance guidance
|
||||
|
||||
- Preparing a value is not proof that every later load, carrier, call or store
|
||||
sequence cannot fail. Publish the actual failure boundary.
|
||||
- Do not assert unchanged collections after every refusal once the accepted
|
||||
contract permits prior writes. Compare the real instruction prefix instead.
|
||||
- Do not unpack/rebox all shifted values or discard empty-copy validation/cycles.
|
||||
- Do not count frame locals as missing copy operands or confuse a pause with a fault.
|
||||
- Do not infer nullable admission, purity or zero scratch from names/determinism.
|
||||
- Updating a CSV/pin alone is not a consumer integration. Code, installed
|
||||
resources, source execution and provenance must move together.
|
||||
- Set/Map still need their own contracts and algorithms. The retired publication
|
||||
instructions are not available to their future implementations, and this work
|
||||
does not accept their pending product choices.
|
||||
- Changing the runtime to rescue an incomplete producer is outside this delivery.
|
||||
|
||||
## Durable references
|
||||
|
||||
- [Common Registry/PBX](../../../docs/compiler/general/specs/typed-registry-and-pbx-v0.md).
|
||||
- [Runtime catalog consumer](../../../docs/compiler/general/specs/runtime-catalog-support.md).
|
||||
- [List/Cursor](../../../docs/compiler/pbs/specs/sdk-list-and-cursor.md),
|
||||
[Linked](../../../docs/compiler/pbs/specs/sdk-linked-and-cursor.md) and
|
||||
[Array/optional](../../../docs/compiler/pbs/specs/typed-arrays-and-optional-execution.md).
|
||||
- [Conformance commands and coverage](../../../tools/pbx-conformance/README.md).
|
||||
- [Selected provider pin](../../../docs/vm-arch/runtime-catalog.properties).
|
||||
- Original decisions/planning: accepted DEC-0077 and completed PLN-0155 in DSC-0096,
|
||||
consolidated here before their required housekeeping removal.
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+1143
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+260
@@ -0,0 +1,260 @@
|
||||
{
|
||||
"discussion": "DSC-0096",
|
||||
"decision": "DEC-0077",
|
||||
"plan": "PLN-0155",
|
||||
"qualified_at": "2026-10-24T00:03:03.883761+00:00",
|
||||
"owner": "compiler",
|
||||
"propagation": [
|
||||
"compiler/pbs",
|
||||
"vm-arch"
|
||||
],
|
||||
"studio_source_base_revision": "77aada62592c10e97cbabf4386e0d6e98f12a9f4",
|
||||
"studio_qualification_is_working_tree_not_committed_provider": true,
|
||||
"studio_changed_file_sha256": {
|
||||
"docs/compiler/general/specs/runtime-catalog-support.md": "7f0b30bad26db25d4f689238da197095e4fae10cb8dfad6fd571e60644207880",
|
||||
"docs/compiler/general/specs/typed-registry-and-pbx-v0.md": "93f3ac04f5fa08ebde8ef11aa39c0ca43ffefb345ae0730c3c39557b8cce2a0f",
|
||||
"docs/compiler/pbs/specs/sdk-linked-and-cursor.md": "bd399f1923353390c6bd7e8613c53a1656e99fbb37e750abd840ceee77dd4c68",
|
||||
"docs/compiler/pbs/specs/sdk-list-and-cursor.md": "01acfa69abf381687b8a83291599506b3b95fc220e35f63f6585876649db8571",
|
||||
"docs/compiler/pbs/specs/typed-arrays-and-optional-execution.md": "68be43bef791d8e620e7398f9d5a3abd5a197342cc70b0c2f606d985fcdc3b35",
|
||||
"docs/vm-arch/ARCHITECTURE.md": "d7e3487bb2d9718bba810cf4cfaec175dcbf9b079f7df12a4fad537bd1606146",
|
||||
"docs/vm-arch/INTRINSICS.csv": "7c1c363f5f0f941b3ab27cfc72af41e13e44cd4371c687db8300721288f47e63",
|
||||
"docs/vm-arch/ISA_CORE.md": "6b3207f81d3bd782e4f9b445b19c80b64bc599d8aebc5f01d8627a477bd09c8b",
|
||||
"docs/vm-arch/README.md": "2b08f106aa952f5acf062d7bdae1a63eca5a0104a956603c5400b3d6615ba1ab",
|
||||
"docs/vm-arch/runtime-catalog.properties": "ee236a887514d31f8996c5186796fee353ad89d112614ebbf23c9ed17a84deed",
|
||||
"prometeu-architecture-tests/src/test/java/p/studio/compiler/backend/irvm/PbsListCursorTest.java": "59a331c52ca8e74ec30fef5783e0c960b641820df2679b90a0463a05002c8610",
|
||||
"prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/lowering/PbsExecutableBodyLowerer.java": "8bc5c877ee991281d9ec74dc0a2a89acd857bee777d6b7a5102caf3abb2bd921",
|
||||
"prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/lowering/PbsExecutableStackAnalyzer.java": "23aadaf62f902165a20f07f55fbcd468651c9e56017a8eba834ad487e4902c18",
|
||||
"prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/lowering/PbsRuntimeTypes.java": "20504d33df9f01aa387985b3b5abb275951d6ad52e95fd09d001189ba503afcb",
|
||||
"prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/resources/game/stdlib/1/sdk/collections/main.pbs": "e6a2df250ad2da7c98d953117fc5c7fdc3e053a1539707f10bfcb3239228cdb1",
|
||||
"prometeu-compiler/frontends/prometeu-frontend-pbs/src/test/java/p/studio/compiler/pbs/PbsGateUSdkInterfaceConformanceTest.java": "74a45482c2794996188b90be3b58bd0d5a0ac8b265671dc89b061da85dd4e73c",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/bytecode/BytecodeEmitter.java": "e1dac43d9a5c413d67f56ae331176e95ef3116526cebfb99612486603d5e4b19",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/bytecode/BytecodeOpcodeLayout.java": "4f2ac0a755820a3496d74b9dddfd65db855bc6a9f8ffc3989a9f3230f67c38ca",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/bytecode/BytecodePreloadVerifierService.java": "f2248cebce4677368bc52ca2885ab0abf1cad506974029ea09d4dd93196784a6",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/IRVMInstruction.java": "c925849d14d39943154d061bcdc15639d73963a7fc8b9adee74038f1cf677e26",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/IRVMIntrinsicDefinition.java": "4a03263237b9c305d6104187d6841d0db17ec5640347f7fb03ff019e622dd176",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/IRVMIntrinsicProfile.java": "a35a01a35a0aac341bf3c79555192d3c167609f80e607dd0ad72872722434a07",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/IRVMOp.java": "e7fc4c73d8e044d65b2d7c74a909ff550aaae098031d8cc8cb616e12b3d42dd8",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/IRVMProfileFeatureGate.java": "67b6a4c080aa15a90545ebe4bf1c72992905b9dac57e3df1e555e43cfe9afc27",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/IRVMProgram.java": "83f08c234860d92f8dc23a6cfa55b8594218dbc6861365376c11e4d29700d3eb",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/IRVMValidator.java": "086a17958152aeabf84d1f551fbc549eb7ca4ac2a4546c324cfb640a97c86d38",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/LowerToIRVMService.java": "bdf241ddc192eaf6987312a672a163f7b5cf97d58e2fbefa809c4649db35447c",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/irvm/OptimizeIRVMService.java": "ce1a90e37542a34c1f9803f50407a1fe6f63bdb7adcf41ad5641c39034a192a0",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/backend/registry/RegistryInstructionLowerer.java": "044bf756a89a88aa3f6833caf6c181c06b1fe44acb4dab58c1ee97da23b053b8",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/test/java/p/studio/compiler/backend/irvm/IRVMInstructionTest.java": "02aa2021c2351e416969055b247eac4b1bd16174a99262dc60e84b59a9e118a9",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/test/java/p/studio/compiler/backend/irvm/IRVMIntrinsicProfileTest.java": "7c5cf20642e1f41d22bb94a397a844c1452f62db70c6c1ac89af4c9011b1de58",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/test/java/p/studio/compiler/backend/irvm/IRVMIntrinsicRegistryParityTest.java": "8618ea1901e7cca90ba071523be4b74b24259374f23623c12a02588cb6444ea5",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/test/java/p/studio/compiler/backend/irvm/RuntimeCatalogPipelineTest.java": "990e8e7410cf53431d577d996b07e00cf1b4db29ca55fb3e7b2c88dba66536eb",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/test/java/p/studio/compiler/backend/registry/ArrayCopyPipelineTest.java": "b21184e96d5ae04ef07f8454caa33ba1c3c4463200f1ff70926766fa6d80f597",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/test/java/p/studio/compiler/backend/registry/PbxRegistryConformanceTest.java": "f91e030e0db28288743cba4be616c68d10c9ce2f95ce3346a0886a431587d9c0",
|
||||
"prometeu-compiler/prometeu-build-pipeline/src/test/java/p/studio/compiler/backend/registry/StoragePublicationPipelineTest.java": "e587739fe79fa4b9f4a42eefac572b3974a31611634af537e5feac57b61f55b5",
|
||||
"prometeu-compiler/prometeu-frontend-api/src/main/java/p/studio/compiler/models/IRBackend.java": "a835b94ee7f15e26616463900368d100c0c7f08782a5d0baa2a3f6adbe1c3d6d",
|
||||
"prometeu-compiler/prometeu-frontend-api/src/main/java/p/studio/compiler/models/IRBackendExecutableFunction.java": "ad4f023a8bf800a2d4ea09c2d5e14471c9e9b36ae82d84c8ed0acae954255e97",
|
||||
"prometeu-compiler/prometeu-frontend-api/src/main/java/p/studio/compiler/models/registry/IRRegistryInstruction.java": "4c8fd165d5790aaf475ad614fc9cd39fc6d0cf26bb85478d3a9dea9a30bd905f",
|
||||
"tools/pbx-conformance/README.md": "da79187f717f441e20a19dca6eeaef8e0736ae1cd89fd85fc916575f5fd9bc76",
|
||||
"tools/pbx-conformance/main.rs": "4509722b8746ccce4425dfc00582002a6782140af7b1ae43b7aaced6d8722222",
|
||||
"tools/pbx-conformance/run.py": "e66b38e6396e4afa7f1c63af157568cb37a3328a1c65057783aae3eefb7cee45"
|
||||
},
|
||||
"runtime": {
|
||||
"revision": "dcf6561ea73446e0a3e1cf1c73eda20923b38df0",
|
||||
"working_tree": "clean",
|
||||
"written_or_committed_by_this_delivery": false,
|
||||
"cargo_build_outputs": "external temporary directories only"
|
||||
},
|
||||
"catalogs_and_mirrors_sha256": {
|
||||
"INTRINSICS.csv": "7c1c363f5f0f941b3ab27cfc72af41e13e44cd4371c687db8300721288f47e63",
|
||||
"BUILTIN_CONSTANTS.csv": "e407e4718127aa7ef7b1097b5b4b67d86dd979235e73a551a7c36b628cddc039",
|
||||
"ARCHITECTURE.md": "d7e3487bb2d9718bba810cf4cfaec175dcbf9b079f7df12a4fad537bd1606146",
|
||||
"ISA_CORE.md": "6b3207f81d3bd782e4f9b445b19c80b64bc599d8aebc5f01d8627a477bd09c8b"
|
||||
},
|
||||
"commands": [
|
||||
{
|
||||
"command": "./gradlew test :prometeu-app:installedKnowledgeTest --console=plain",
|
||||
"exit_code": 0,
|
||||
"log": "gradle-regression.log.gz",
|
||||
"sha256": "85eb690857eea9e1961cf1011fff23c2f9e66185868a38681624c66a7cea3e92",
|
||||
"uncompressed_sha256": "70ecdc56dc94c7cc4544098d283d9ebc068ad692f8cc3ce7fcbafc3d6ac8af64",
|
||||
"log_encoding": "gzip"
|
||||
},
|
||||
{
|
||||
"command": "./gradlew :prometeu-compiler:prometeu-build-pipeline:test :prometeu-app:installedKnowledgeTest --console=plain",
|
||||
"exit_code": 0,
|
||||
"log": "gradle-packaged-final.log.gz",
|
||||
"sha256": "dc391a4532e28387573f4b65b02395b38ed164fd851d0b4423a4408396a46bd0",
|
||||
"uncompressed_sha256": "8b0a56da56456977455323d2e321a7291f110d57ca4e3836bd81dea2b5f1e785",
|
||||
"log_encoding": "gzip"
|
||||
},
|
||||
{
|
||||
"command": "python3 tools/runtime-catalog/verify.py --runtime ../runtime",
|
||||
"exit_code": 0,
|
||||
"log": "provider-catalog.log.gz",
|
||||
"sha256": "bab6e8190952884c3a24cf2f0cdf46890f294b150ff6accfb60f58a82aabacc3",
|
||||
"uncompressed_sha256": "28ebcd83d8c9195422e3f8d2c7a1a0be5cb52723d2789e094c60d50f7d8ad7b4",
|
||||
"log_encoding": "gzip"
|
||||
},
|
||||
{
|
||||
"command": "cargo test --manifest-path ../runtime/Cargo.toml --locked --offline --target-dir /tmp/studio-storage-provider-155 -p prometeu-vm --lib array_copy_tests",
|
||||
"exit_code": 0,
|
||||
"log": "provider-copy-tests.log.gz",
|
||||
"sha256": "a0b8f2692556846cd7b418ae91993ddd3d0c6fef1f6fb2aa4551b962996b4d3e",
|
||||
"uncompressed_sha256": "30497f7edcd3f019f99d7f9166f4b12542d931999faa32c9c912ac1dd97de308",
|
||||
"log_encoding": "gzip"
|
||||
},
|
||||
{
|
||||
"command": "CARGO_TARGET_DIR=/tmp/studio-storage-conformance-155 python3 tools/pbx-conformance/run.py --runtime ../runtime",
|
||||
"exit_code": 0,
|
||||
"log": "conformance-debug.log.gz",
|
||||
"sha256": "df08969fd266c7b8844146a42bcfc63d078792d0fa69441c5660a553a73e0255",
|
||||
"uncompressed_sha256": "40a4b73d7796eb16f9099166d794ed3bb0ccf412c8a373b016d30bd5303f78df",
|
||||
"log_encoding": "gzip"
|
||||
},
|
||||
{
|
||||
"command": "CARGO_TARGET_DIR=/tmp/studio-storage-conformance-155 python3 tools/pbx-conformance/run.py --runtime ../runtime --release",
|
||||
"exit_code": 0,
|
||||
"log": "conformance-release.log.gz",
|
||||
"sha256": "346711a7d78590e803d478520423584d60501fc70ea4856a1ed4b565ba25c7d1",
|
||||
"uncompressed_sha256": "6d7fa765a6e14626b697efb2b88b4b85ad44845ba12d72b6e98eb16907de114a",
|
||||
"log_encoding": "gzip"
|
||||
}
|
||||
],
|
||||
"latest_normal_test_reports": {
|
||||
"prometeu-studio-api": {
|
||||
"tests": 2,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-infra": {
|
||||
"tests": 7,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-app": {
|
||||
"tests": 81,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-studio-ui-javafx": {
|
||||
"tests": 20,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-architecture-tests": {
|
||||
"tests": 97,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-studio-core": {
|
||||
"tests": 110,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-compiler/prometeu-build-pipeline": {
|
||||
"tests": 197,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 12
|
||||
},
|
||||
"prometeu-compiler/prometeu-frontend-registry": {
|
||||
"tests": 8,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-compiler/prometeu-frontend-api": {
|
||||
"tests": 29,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-compiler/prometeu-compiler-core": {
|
||||
"tests": 21,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-compiler/prometeu-deps": {
|
||||
"tests": 9,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-compiler/frontends/prometeu-frontend-pbs": {
|
||||
"tests": 297,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-packer/prometeu-packer-v1": {
|
||||
"tests": 119,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"prometeu-lsp/prometeu-lsp-v1": {
|
||||
"tests": 41,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 1
|
||||
}
|
||||
},
|
||||
"installed_knowledge_test_reports": {
|
||||
"p.studio.app.compiler.InstalledKnowledgeTest": {
|
||||
"tests": 2,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
}
|
||||
},
|
||||
"normal_test_report_note": "Latest reports combine full normal regression and final backend/installed rerun; existing disabled tests remain explicitly counted, not newly skipped for this migration.",
|
||||
"conformance_profiles": {
|
||||
"debug": {
|
||||
"PBS MATH": 1,
|
||||
"PBS LIST/CURSOR SOURCE/LOAD/EXEC PASS": 54,
|
||||
"PBS LINKED SOURCE/LOAD/EXEC PASS": 52,
|
||||
"COMMON COPY COST/FAULT/GROUP PASS": 22,
|
||||
"COMMON PARTIAL FAULT PASS": 2,
|
||||
"PBS LIST PHASE REFUSAL": 136,
|
||||
"PBS LINKED PHASE REFUSAL": 406,
|
||||
"PHASE CORPUS list": 8,
|
||||
"PHASE CORPUS linked": 20,
|
||||
"UPSTREAM SCHEMA GAP": 2,
|
||||
"post_mutation_refusals": 34,
|
||||
"MATH PASS": 0,
|
||||
"RANDOM PASS": 227
|
||||
},
|
||||
"release": {
|
||||
"PBS MATH": 1,
|
||||
"PBS LIST/CURSOR SOURCE/LOAD/EXEC PASS": 54,
|
||||
"PBS LINKED SOURCE/LOAD/EXEC PASS": 52,
|
||||
"COMMON COPY COST/FAULT/GROUP PASS": 22,
|
||||
"COMMON PARTIAL FAULT PASS": 2,
|
||||
"PBS LIST PHASE REFUSAL": 136,
|
||||
"PBS LINKED PHASE REFUSAL": 406,
|
||||
"PHASE CORPUS list": 8,
|
||||
"PHASE CORPUS linked": 20,
|
||||
"UPSTREAM SCHEMA GAP": 2,
|
||||
"post_mutation_refusals": 34,
|
||||
"MATH PASS": 0,
|
||||
"RANDOM PASS": 227
|
||||
}
|
||||
},
|
||||
"generated_fixture_manifest": "generated-pbx-manifest.json",
|
||||
"generated_fixture_count": 1141,
|
||||
"generated_fixture_manifest_note": "All generated PBX files are fingerprinted; execution scope and mandatory fixture sets are defined by the harness and logs, not by directory presence alone.",
|
||||
"limitations": [
|
||||
"Qualification is local macOS/arm64, not new cross-platform evidence.",
|
||||
"The existing harness reports two unrelated headless-schema enum gaps (LifecycleRole and NonFiniteValue) explicitly; original payloads are not claimed conformant to the unmodified schema.",
|
||||
"Checked cost overflow and internally malformed/late groups are separately covered by 11 unchanged-provider copy unit tests; this does not claim synthetic widths are admitted consumer layouts.",
|
||||
"Set/Map, PBS hashing facades, live iterator semantics and runtime modifications are excluded."
|
||||
],
|
||||
"outcome": "passed",
|
||||
"generated_fixture_manifest_sha256": "f2679f21014e51812a5a79e8de26297828a7ba8685142811bff786f5fd5f5453",
|
||||
"executed_plan_sha256_before_housekeeping": "453bb2f2291c7fe188032550dcfeb2c91c0368f5112a8f28edcae14c47e9780c",
|
||||
"accepted_decision_sha256_before_housekeeping": "ab08576555aadb95769232a4ccdadcf3d717c1fa1c73ace563891cbd50b7d4f7",
|
||||
"lesson_sha256": "3ef5ede442ab9f202faead2f6ce34ebaf1e1ed2c115d49c419ce5b743a213c01"
|
||||
}
|
||||
@@ -44,10 +44,11 @@ references. Producer checks validate proven carrier facts; runtime admission
|
||||
and execution remain authoritative for reference identity, session ownership,
|
||||
platform availability and traps. Unsupported carrier tokens MUST fail explicitly.
|
||||
|
||||
Static intrinsic String facts MUST follow the provider verifier's String-only
|
||||
mask: a proven null is rejected at load time. The dispatcher's acceptance of
|
||||
null for the String ABI does not broaden that static rule. Random's static
|
||||
reference mask includes null; native handle validity is still checked at runtime.
|
||||
Intrinsic arguments MUST use each schema-2 entry's ordered nullable mask.
|
||||
A proven null is admitted for hash.string's String slot; older String entries
|
||||
remain non-nullable. Random nullable reference admission does not remove runtime
|
||||
receiver/provenance checks. Do not infer nullable admission from carrier width,
|
||||
name, determinism or a different entry using the same ABI atom.
|
||||
|
||||
Determinism MUST NOT be interpreted as purity. In particular, all Random calls
|
||||
mutate guest state. Reachable calls cannot be removed, merged or reordered in a
|
||||
@@ -57,6 +58,30 @@ base cost 4, cost 8 per attempt and a maximum of 64 attempts in the selected
|
||||
contract. The runtime performs charging; Java metadata does not implement a
|
||||
second scheduler or random algorithm.
|
||||
|
||||
## Schema 2 invocation and cost metadata
|
||||
|
||||
Every entry MUST preserve all 25 CSV columns, including schema_version=2,
|
||||
arg_nullable, invocation_model, scratch_model, context_access, cost_arg_index and
|
||||
cost_per_byte in addition to the original 18 fields. Nullable bits are lowercase
|
||||
booleans in flattened argument order, exactly one per slot; zero arguments use
|
||||
an empty mask. Numeric carriers cannot be nullable.
|
||||
|
||||
Supported coherent profiles are host_buffered_v1/existing_contract_v1/host,
|
||||
vm_owned_v1/existing_contract_v1/vm_state and borrowed_inline_v1/none/none.
|
||||
The borrowed profile requires its separately declared deterministic/nonallocating/
|
||||
nonmutating effects; existing Host/VM entries do not acquire borrowed semantics.
|
||||
Unsupported schemas, models, profiles and incoherent layouts, masks, indices or
|
||||
cost parameters MUST fail explicitly.
|
||||
|
||||
Fixed costs have no argument index, zero per-byte/attempt cost and zero attempts.
|
||||
random_rejection_v1 retains base 4, attempt cost 8 and at most 64 draws with the
|
||||
VM-owned profile. argument_utf8_bytes_v1 selects String argument zero with the
|
||||
borrowed profile, base 8, one cycle per UTF-8 byte and zero attempt fields. Empty
|
||||
or null String costs base 8 and remains subject to that entry's nullable mask.
|
||||
No consumer-side scheduler or hash implementation is added by importing metadata.
|
||||
All 108 provider entries, including hash.i64/hash.float/hash.string, are represented;
|
||||
metadata parity does not declare PBS hashing facades delivered.
|
||||
|
||||
## Constants
|
||||
|
||||
Builtin constants have their own lookup identity `(target, name, version)` and
|
||||
|
||||
@@ -188,93 +188,66 @@ tracked separately in AGD75; passing common conformance does not claim complete
|
||||
PBS lowering or complete Studio/runtime integration.
|
||||
|
||||
|
||||
## Generic logical guards and atomic storage publication
|
||||
## Minimal typed storage and range copy
|
||||
|
||||
The core includes the following generic operations, with u16 opcodes and
|
||||
little-endian u32 immediates. They introduce no new Registry category, syscall,
|
||||
source-language collection or ambient transaction. Operand order below is bottom
|
||||
to top; all integer operands are Int64.
|
||||
The supported collection storage operations are STRUCT_NEW/GET/SET (0xA0–0xA2),
|
||||
ARRAY_NEW/LEN/GET/SET (0xA3–0xA6) and ARRAY_COPY (0xA9). Logical bounds and
|
||||
multi-owner collection algorithms belong to producers. Encodings 0xA7, 0xA8,
|
||||
0xAA and 0xAB MUST be rejected at actual instruction positions, including dead
|
||||
code; identical bytes in immediates or data are not opcodes. No guard, publication
|
||||
schema, batch transaction or atomic region replaces the retired instructions.
|
||||
|
||||
| Opcode | Immediate | Stack operands consumed |
|
||||
| --- | --- | --- |
|
||||
| INDEX_GUARD `0xA7` | none | index, exclusive limit |
|
||||
| ARRAY_CHECK_LENGTH `0xA8` | Array TypeId | length |
|
||||
| ARRAY_COPY `0xA9` | Array TypeId | source, sourceStart, target, targetStart, count |
|
||||
| STORAGE_PUBLISH `0xAA` | Array TypeId, Struct TypeId, first field, second field | source, sourceStart, target, targetStart, count, fillStart, fillCount, element group, owner, first field group, second field group |
|
||||
ARRAY_COPY encodes u16 LE 0xA9 followed by Array TypeId u32 LE. Its five operands,
|
||||
bottom to top, are source, sourceStart, target, targetStart and count, with no
|
||||
result. Receivers MUST match the exact Array descriptor; offsets/count MUST use
|
||||
Int64. Ranges are physical, nonnegative and strict; an empty range may start at
|
||||
length. Snapshot source groups before writing for overlap. Preserve complete
|
||||
presence tags, immutable boxes, native owners and identities without unpacking
|
||||
and repacking existing values.
|
||||
|
||||
All operations return no values. INDEX_GUARD accepts exactly
|
||||
`0 <= index < limit`, otherwise TRAP_OOB. It does not use physical storage length.
|
||||
ARRAY_CHECK_LENGTH accepts zero through u32::MAX without allocating. Negative
|
||||
lengths produce TRAP_OOB; values above u32::MAX produce the same resource
|
||||
SizeOverflow failure as ARRAY_NEW. This check does not reserve future allocation.
|
||||
Reserve the complete TemporaryBytes scratch before writing and release it on
|
||||
success or failure. A refused instruction preserves its own operands, complete
|
||||
destinations and owners. No callback, GC or scheduler interleaves its preparation
|
||||
and commit. This guarantee covers that instruction only, not earlier instructions
|
||||
in a source method.
|
||||
|
||||
ARRAY_COPY and STORAGE_PUBLISH require exact Array receiver identities and complete
|
||||
stored groups. Every range must have nonnegative start/count and fit its physical
|
||||
array; an empty range may start at length. Invalid ranges produce TRAP_OOB, never
|
||||
clamping or truncation. Copy reads the pre-attempt source sequence, including for
|
||||
overlapping source/target ranges. Presence tags, immutable boxes, native owners and
|
||||
object identities are preserved without payload unpacking or repacking.
|
||||
For N=count and Registry-derived element width W, attempted work is C=4+2*N*W.
|
||||
With five temporary operands and exact Int64 N in 0..u32::MAX, precharge the whole
|
||||
representable C before receiver/range/group/scratch validation and retain it on
|
||||
refusal. Underflow, wrong count carrier or count outside that interval costs base
|
||||
4 and follows ordinary fault precedence, without reading frame locals or
|
||||
converting N. Checked C overflow costs 4 and raises SizeOverflow before ordinary
|
||||
validation. Above-u32 N is not automatically an allocation SizeOverflow.
|
||||
|
||||
STORAGE_PUBLISH first copies the selected source range, then fills the selected
|
||||
target range with the supplied element group, then writes the two selected fields
|
||||
on the supplied Struct owner. Fields must be distinct valid indices on that Struct;
|
||||
their types and widths come from the immutable Registry. Source code/producer owns
|
||||
selection of every range, value, owner and field. The VM implements these generic
|
||||
ordered effects and does not select collection algorithms.
|
||||
Otherwise fault order is height, source, target, offset/count carriers in source
|
||||
order, source range, target range, scratch reservation, source groups in order.
|
||||
N=0 still validates receivers/ranges and costs 4; aliases give no discount.
|
||||
N=10/W=1 costs 24 on success or receiver/range/scratch refusal. Zero budget does
|
||||
nothing; positive budget admits the full instruction with overshoot. A failed
|
||||
attempt reports Trap rather than BudgetExhausted and is not a successful step.
|
||||
Optimizers MUST NOT erase empty-copy validation, faults or required charged work.
|
||||
|
||||
Loading validates all immediate identities/categories/fields even in unreachable
|
||||
code. Verification requires complete typed operands. ARRAY_COPY consumes five
|
||||
slots; STORAGE_PUBLISH consumes `8 + elementWidth + firstWidth + secondWidth`.
|
||||
INDEX_GUARD consumes two slots and ARRAY_CHECK_LENGTH consumes one.
|
||||
## Neutral terminal failure and producer mutation boundaries
|
||||
|
||||
Execution validates all receivers, lengths/ranges, supplied groups and source
|
||||
groups, and reserves the complete charged copy scratch before writing. Validation,
|
||||
quota or host allocation refusal leaves all input operands and destinations
|
||||
unchanged, including both fields and native owners. Scratch uses TemporaryBytes,
|
||||
is refunded on success/refusal and does not relax any resource ceiling. Existing
|
||||
operands remain roots during preparation. There is no GC, callback, scheduler or
|
||||
other interleaving inside this single instruction. Commit uses already validated
|
||||
complete groups, performs no fallible allocation and consumes operands only after
|
||||
all selected effects have been published. No prepared token escapes the attempt.
|
||||
Common executable IR and IRVM represent existing TRAP (0x05) as a zero-operand,
|
||||
zero-result block terminator, preserving its source span. It raises
|
||||
TRAP_EXPLICIT, distinct from a debugger breakpoint. It neither returns nor falls
|
||||
through, and optimization MUST retain its observable failure. There is no new
|
||||
runtime opcode or encoded error argument.
|
||||
|
||||
Base cycle costs are 2 for either guard, 4 for ARRAY_COPY and 6 for STORAGE_PUBLISH.
|
||||
Copy adds `2 * count * elementWidth`; publication additionally adds
|
||||
`fillCount * elementWidth + firstWidth + secondWidth`. Work arithmetic is checked
|
||||
before mutation. A refused preparation still charges the attempted work. Neither
|
||||
operation is a safepoint. Consumers must prepare any potentially failing return
|
||||
carrier and all call operands before publication; a series of ordinary stores is
|
||||
not a substitute for whole-operation safety.
|
||||
Source producers implement logical checks with comparisons and branches. A
|
||||
trusted private PBS SDK failure binding selects this terminal instruction, not
|
||||
a backend-implemented bounds algorithm. Physical ARRAY operations retain their
|
||||
own faults/resource context. Per-instruction cycle costs and real emitted work
|
||||
apply; the retired guard costs are not simulated.
|
||||
|
||||
|
||||
## Atomic publication of multiple Struct instances
|
||||
|
||||
FIELDS_PUBLISH (`0xAB`) has one little-endian u32 schema TypeId immediate. The
|
||||
schema MUST be a Registry Struct whose ordered field types are all Struct types.
|
||||
Names are descriptive only. The schema is declarative metadata; no request object,
|
||||
new Registry category or preparation token is allocated or exposed.
|
||||
|
||||
For each schema entry, the operand stack supplies one nullable destination
|
||||
reference followed by every destination field's complete typed value group, in
|
||||
field declaration order. The stack effect is the sum, over entries, of one plus
|
||||
the destination instance's initialization-slot count; no results are produced.
|
||||
Null skips that destination, but every supplied field group is still validated.
|
||||
Non-null destinations require exact concrete Struct identity and a live reference
|
||||
of the current session/generation. Array, Trait, Fn and builtin schema entries are
|
||||
invalid, including in unreachable instructions. The full schema and exact stack
|
||||
height/groups are checked under normal Registry admission/work limits.
|
||||
|
||||
Validate all destinations and value groups before any shared write or operand
|
||||
consumption. The original operands remain roots throughout preparation. Then write
|
||||
all fields in schema order, without allocation, fallible validation, callbacks,
|
||||
GC or scheduler interleaving, and consume the entire input. Input values are
|
||||
captured before publication; repeated destinations use ordered last-write
|
||||
semantics. Complete multi-slot/native/reference groups retain identity and normal
|
||||
ownership. A failed attempt preserves every destination and the operand stack.
|
||||
|
||||
The operation allocates no publication scratch or guest object. Operand/frame and
|
||||
source value preparation remain normally charged and may fail before publication.
|
||||
Base cost is 6 cycles. After the stack-height check, precharge one cycle per schema
|
||||
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.
|
||||
Collection methods prepare bounds, next sizes, values, candidates and optional
|
||||
results before the first visible mutation. A refusal before that boundary MUST
|
||||
preserve the previous collection. A fault after it may leave earlier writes and
|
||||
incomplete collection invariants; no whole-method rollback, retry or safe-reuse
|
||||
guarantee exists. Successful methods MUST restore all published invariants.
|
||||
Prepare-before-mutation does not prove every later operand/call/store infallible.
|
||||
BudgetExhausted and debugger pauses can occur between instructions and resume at
|
||||
the current PC; they neither roll back nor complete a method. No atomic observation
|
||||
of source operations by host/debugger is promised. SDK methods introduce no user
|
||||
callbacks or explicit suspension during the updates that complete their invariants.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SDK Linked and bidirectional snapshot capture
|
||||
|
||||
Owner: `compiler/pbs`. Linked algorithms belong to executable PBS SDK source.
|
||||
Multi-object publication, storage, faults, ownership, GC and quotas remain generic
|
||||
Typed storage, faults, ownership, GC and quotas remain generic
|
||||
compiler/provider mechanisms. This contract builds on [generic structs](generic-structs-and-free-functions.md),
|
||||
[arrays and optional](typed-arrays-and-optional-execution.md) and the
|
||||
[shared Cursor protocol](sdk-list-and-cursor.md#cursor-protocol).
|
||||
@@ -44,8 +44,8 @@ successor nodes beyond the ends. Nodes and private helpers are not a public API.
|
||||
| `reverseCursor()` | Cursor<T> | Capture last to first |
|
||||
|
||||
Reading, replacing and removing by index require `0 <= i < size`; invalid indices
|
||||
raise TRAP_OOB even when empty. Insertion accepts size, including zero in an empty
|
||||
collection. Other insertion indices raise TRAP_OOB. Every valid position contains
|
||||
raise TRAP_EXPLICIT even when empty. Insertion accepts size, including zero in an empty
|
||||
collection. Other insertion indices raise TRAP_EXPLICIT. Every valid position contains
|
||||
an element, so indexed read/removal returns a present optional. Zero and false are
|
||||
present values. Empty-end results do not suppress type or resource faults.
|
||||
|
||||
@@ -56,8 +56,8 @@ Value search/removal is outside this API, consistently with List.
|
||||
|
||||
Size is nonnegative long. Indices accept int and long with localized lossless
|
||||
promotion, without general numeric conversion or truncation. The SDK checks the
|
||||
current size against the maximum signed long before incrementing, using the generic
|
||||
logical guard; an unrepresentable next size is rejected before arithmetic or
|
||||
current size against the maximum signed long before incrementing, using SDK comparisons
|
||||
and terminal TRAP_EXPLICIT; an unrepresentable next size is rejected before arithmetic or
|
||||
mutation. Array's u32 structural maximum is not a Linked size limit. Provider
|
||||
quotas and applicable structural limits can refuse allocation much earlier.
|
||||
Receiver/arguments evaluate once in source order, including named application.
|
||||
@@ -83,21 +83,29 @@ work and O(n) additional nodes; next follows one link in O(1). Allocation,
|
||||
optional-carrier preparation, ownership and eventual GC retain their normal
|
||||
costs. Repeated indexed reads are not an efficient traversal strategy.
|
||||
|
||||
## Complete mutation attempts and lifetime
|
||||
## Mutation phases and lifetime
|
||||
|
||||
Before publication, prepare bounds, next size, candidate nodes, optional results,
|
||||
all field values and call/operand resources. Private generic FIELDS_PUBLISH
|
||||
publishes complete field groups of source-selected objects after validating all
|
||||
receivers and groups. Null destinations represent missing neighbors. Algorithms
|
||||
select the new head/tail/size and neighbor fields in SDK source; the VM has no
|
||||
Linked opcode or syscall.
|
||||
Before the first visible write, prepare bounds, next size, candidate nodes,
|
||||
optional results and complete field values. Insertion updates previous.next or
|
||||
head, then next.previous or tail, then length. Removal prepares its result and
|
||||
neighbors, updates the same two sides, then length. Indexed replacement updates
|
||||
only value; clear assigns head, tail and length in that order. Source algorithms
|
||||
own these choices; the VM has no Linked instruction, publication schema or syscall.
|
||||
|
||||
No fallible allocation, callback, scheduler or GC boundary may expose partial
|
||||
publication. A refused mutation preserves all previous head/tail/size values,
|
||||
elements and neighbor links. This includes optional return preparation for
|
||||
removals and mutations without new nodes. Individually atomic stores do not prove
|
||||
whole-operation atomicity. Previously evaluated argument effects are ordinary
|
||||
source effects and are not rolled back.
|
||||
A logical rejection or preparation refusal before mutation preserves the previous
|
||||
head/tail/size, elements and neighbor links. Successful return restores all public
|
||||
invariants. An internal/resource fault after the first visible write propagates
|
||||
without rollback: earlier writes may remain and topology/size can be incomplete.
|
||||
No safe reuse, retry or automatic recovery is promised. This explicitly replaces
|
||||
the former whole-method refusal guarantee, and is not a basic-consistency claim.
|
||||
Previously evaluated argument effects remain ordinary source effects.
|
||||
|
||||
Individual instruction failures preserve their own entry state. Operand/call/
|
||||
optional preparation remains charged and can fail; sequential stores are not a
|
||||
transaction. No user callback or explicit suspension is inserted during updates.
|
||||
BudgetExhausted and debugger pauses can stop between instructions and resume at
|
||||
the current PC without completing or undoing the method. Host/debugger observation
|
||||
is not atomic. No catch, poison flag or recovery API is introduced.
|
||||
|
||||
Unpublished candidates follow normal ownership and quotas. Capture failure returns
|
||||
no partial Cursor and does not change the source. Removal and clear release
|
||||
@@ -117,11 +125,11 @@ optional-element diagnostics, both Cursor orders/states and mutation independenc
|
||||
Independently observe all original fields, link carriers, nodes and groups around
|
||||
quota refusals, including node/result/operand preparation. Exercise ordinary GC
|
||||
safepoints for removed nodes/values, clear, snapshots and prefix/final release.
|
||||
Generic publication also requires non-PBS producers and malformed/dead operand
|
||||
coverage. Regress shared Array/List/generic/contract/Cursor behavior and editor/LSP
|
||||
Neutral stores/copy/terminal failure also require non-PBS producers and
|
||||
malformed/dead instruction coverage. Regress shared Array/List/generic/contract/Cursor behavior and editor/LSP
|
||||
projections. Ship the specification and executable example with installed SDK
|
||||
knowledge, compile the actual packaged example outside the checkout and execute
|
||||
its emitted PBX with the production provider.
|
||||
|
||||
See [generic Registry/PBX publication](../../general/specs/typed-registry-and-pbx-v0.md)
|
||||
See [generic Registry/PBX storage](../../general/specs/typed-registry-and-pbx-v0.md)
|
||||
for the language-neutral instruction contract.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SDK List and snapshot Cursor
|
||||
|
||||
Owner: `compiler/pbs`. List and Cursor algorithms belong to the executable PBS
|
||||
SDK. Logical guards, complete stored-group transfers and atomic publication are
|
||||
language-neutral compiler/runtime mechanisms. This contract builds on
|
||||
SDK. Typed storage, complete stored-group transfers and terminal failure are
|
||||
language-neutral compiler/runtime mechanisms. Logical checks are SDK algorithms. This contract builds on
|
||||
[arrays and optional](typed-arrays-and-optional-execution.md),
|
||||
[generic structs](generic-structs-and-free-functions.md) and
|
||||
[generic contracts](generic-contracts.md).
|
||||
@@ -56,9 +56,12 @@ Receiver and arguments are evaluated once in source order. Indices, lengths and
|
||||
capacities accept int and long with localized lossless promotion; this does not
|
||||
add general numeric conversion. No long value may be truncated.
|
||||
|
||||
Invalid logical indices raise TRAP_OOB, including indices inside physical capacity.
|
||||
Negative lengths, structural overflow and quota refusals preserve the applicable
|
||||
Array/provider fault classification. Failures are never translated into none.
|
||||
SDK checks reject invalid logical indices, negative lengths/capacities and requests
|
||||
above Array's u32 structural maximum before mutation with TRAP_EXPLICIT and a
|
||||
source location. This includes indices inside physical capacity. Physical Array
|
||||
instructions that actually execute retain their own fault/resource classification.
|
||||
Failures are never translated into none. Growth arithmetic must not overflow or
|
||||
truncate; clamping applies only to a valid requested length.
|
||||
|
||||
## Capacity policy
|
||||
|
||||
@@ -75,20 +78,40 @@ never shrinks and preserves size. Trim uses exactly size. Old and candidate arra
|
||||
may coexist; neither discarded references nor replaced storage promise immediate
|
||||
GC or immediate quota recovery.
|
||||
|
||||
## Complete mutation attempts
|
||||
## Mutation preparation, visible writes and faults
|
||||
|
||||
Private storage transfer preserves whole existing groups, presence tags and
|
||||
reference identities. Shifting must not unpack each public Array optional and
|
||||
repack/rebox every payload. Prepare potentially failing validation, packing,
|
||||
allocations, return carriers, scratch and publication operands before modifying
|
||||
observable storage. Then publish the complete selected slot/range and field
|
||||
changes without a fallible allocation, callback, scheduler or GC boundary.
|
||||
Transfer whole stored groups, presence tags and reference identities; do not
|
||||
unpack and rebox all existing elements during shifting. Prepare validation,
|
||||
next size, inserted values, candidates and optional return carriers before the
|
||||
first visible write. This preparation does not prove all later instructions
|
||||
infallible. Values/receiver/argument effects already evaluated are not rolled back.
|
||||
|
||||
Any refused attempt leaves size, backing reference, capacity, slots and roots
|
||||
unchanged. This includes insert/remove without growth and preparation of
|
||||
removeAt's optional result. Individually atomic Array instructions do not by
|
||||
themselves establish this guarantee. Previously evaluated argument effects are
|
||||
not rolled back. Unpublished candidates obey normal ownership and budgets.
|
||||
With growth, construct a private candidate and copy prefix/suffix directly into
|
||||
their final positions; store the new value privately, then install storage and
|
||||
length in sequence. Without growth, prepare the inserted stored group in a private
|
||||
one-slot array, shift with overlap-safe ARRAY_COPY, copy that complete prepared
|
||||
slot, then update length. Both copies retain scratch, validation and charging,
|
||||
including empty copies. This one-slot preparation is charged allocation, not a
|
||||
promise of allocation-free insertion or whole-array reconstruction.
|
||||
|
||||
Removal prepares its optional result, shifts the suffix, clears the old tail and
|
||||
updates length. Clear and in-capacity resize clear the selected interval in index
|
||||
order before assigning length. Growing resize prepares/copies a private candidate
|
||||
before installing storage and length. Reserve/trim prepare/copy candidates and
|
||||
replace storage only. Indexed replacement/clearAt alter a single checked position.
|
||||
|
||||
| Outcome | Guarantee |
|
||||
| --- | --- |
|
||||
| Logical rejection or preparation refusal before the first visible write | Preserve previous size, backing, capacity, slots and collection roots. Unpublished candidates obey normal ownership/quotas; immediate quota recovery is not promised. |
|
||||
| Successful return | All collection invariants, cleanup, groups, identity and snapshot contracts hold. |
|
||||
| Internal/resource fault after the first visible write | Propagate the fault; earlier writes can remain and collection invariants can be incomplete. No rollback, safe reuse, retry or automatic recovery is promised. |
|
||||
|
||||
The last row explicitly replaces the former whole-mutation refusal guarantee.
|
||||
Individual instruction failure still preserves its own entry operands/storage.
|
||||
No catch, poison flag or recovery API is introduced. The SDK inserts no user
|
||||
callbacks or explicit suspension during mutation updates. BudgetExhausted and
|
||||
pauses are resumable instruction boundaries, not faults or rollback. The host or
|
||||
debugger may observe intermediate state; a method is not an atomic region.
|
||||
|
||||
## Cursor protocol
|
||||
|
||||
@@ -168,9 +191,9 @@ through allocations and calls; provider quotas remain unchanged.
|
||||
Conformance must execute real PBS through common IR and PBX in the production VM.
|
||||
It covers every operation, constructor/type rule, logical bounds, exact growth,
|
||||
holes and full groups, aliases, the entire Cursor table, snapshot independence,
|
||||
shared object mutation, non-List producers, full-operation refusals with and without
|
||||
shared object mutation, non-List producers, refusals before and after visible mutation with and without
|
||||
growth, prefix reclamation, last-node retention, editor projections and installed
|
||||
SDK/spec/example distribution. Generic publication also requires non-PBS tests.
|
||||
SDK/spec/example distribution. Neutral storage/copy/terminal paths also require non-PBS tests.
|
||||
|
||||
Value search/removal, sorting, bulk APIs, new equality, public nodes, deep freezing,
|
||||
general effect/transaction syntax and Linked/Set/Map implementations are out of scope.
|
||||
|
||||
@@ -60,7 +60,7 @@ Presence must be checked using the Dynamic tag before extraction. `DYN_CAN_UNPAC
|
||||
|
||||
PBS optional values use private nullable Struct carriers: null denotes none and a private instance contains the full payload for some. Named tuples remain flattened at callable boundaries and use private storage carriers where a single Registry type is required. These private carriers are inaccessible to source programs. They preserve nested optional distinctions, tuple value behavior and reference aliases within payloads.
|
||||
|
||||
Lowering must keep complete receiver/index/value groups rooted across allocations, calls and collection operations. GC, native ownership, quota accounting, costs and atomic refusals remain runtime contracts. No failure may publish partially initialized handles or be suppressed as none; no quota may be relaxed to satisfy conformance.
|
||||
Lowering must keep complete receiver/index/value groups rooted across allocations, calls and collection operations. GC, native ownership, quota accounting, costs and per-instruction refusal preservation remain runtime contracts. No failure may publish partially initialized handles or be suppressed as none; no quota may be relaxed to satisfy conformance.
|
||||
|
||||
## Struct and contract integration
|
||||
|
||||
@@ -97,3 +97,9 @@ See [Runtime Random integration](runtime-random-integration.md) for opaque gener
|
||||
these contextual construction positions and storage rules. A generic T field can
|
||||
hold an optional value, but substituting an optional value type into array<T>
|
||||
remains invalid. Array's private packing does not become a generic argument ABI.
|
||||
|
||||
SDK collections add logical checks before physical Array operations and terminate
|
||||
logical refusals with TRAP_EXPLICIT. Their multi-instruction methods use the
|
||||
[List mutation-phase contract](sdk-list-and-cursor.md#mutation-preparation-visible-writes-and-faults)
|
||||
and [Linked contract](sdk-linked-and-cursor.md#mutation-phases-and-lifetime);
|
||||
per-instruction storage guarantees do not imply whole-method rollback.
|
||||
|
||||
@@ -204,10 +204,14 @@ The [Program Registry contract](../specs/runtime/02c-program-registry-and-pbx-v0
|
||||
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.
|
||||
|
||||
|
||||
## Atomic publication of multiple Struct instances
|
||||
## Typed array range copy
|
||||
|
||||
FIELDS_PUBLISH (0xAB) atomically publishes complete typed fields to multiple
|
||||
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).
|
||||
ARRAY_COPY (0xA9) copies complete groups between exact typed arrays with strict
|
||||
physical ranges and pre-attempt overlap semantics. Preparation reserves scratch
|
||||
before infallible commit; failures preserve operands/destinations and retain
|
||||
charged work. No callbacks, GC or scheduling occur inside the instruction.
|
||||
The [instruction contract](../specs/runtime/02-vm-instruction-set.md#typed-array-range-copy)
|
||||
defines encoding, fault order and early cost selection. ARRAY_LEN remains the
|
||||
physical query; producer algorithms own logical limits and multi-owner invariants.
|
||||
There is no transactional sequence of stores. Encodings 0xA7/0xA8/0xAA/0xAB are
|
||||
unsupported, including in dead code.
|
||||
|
||||
+109
-106
@@ -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
|
||||
|
||||
|
+24
-14
@@ -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
|
||||
@@ -191,19 +192,28 @@ STRUCT_NEW (0x00A0), STRUCT_GET (0x00A1), STRUCT_SET (0x00A2), ARRAY_NEW (0x00A3
|
||||
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.
|
||||
|
||||
|
||||
## Logical guards and atomic storage publication
|
||||
## Typed array range copy
|
||||
|
||||
INDEX_GUARD (0xA7), ARRAY_CHECK_LENGTH (0xA8), ARRAY_COPY (0xA9) and
|
||||
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](../specs/runtime/02-vm-instruction-set.md#logical-guards-and-atomic-storage-publication). No new Registry category, syscall, collection algorithm or safepoint is introduced.
|
||||
ARRAY_COPY (0xA9, Array TypeId u32) consumes source, sourceStart, target,
|
||||
targetStart, count without a result. Complete groups and owners survive overlap
|
||||
and failed preparation. Charge 4+2*N*W before ordinary validation for available
|
||||
Int64 count in 0..u32::MAX; other counts/underflow charge base 4. Checked cost
|
||||
overflow charges base and traps SizeOverflow. The
|
||||
[canonical contract](../specs/runtime/02-vm-instruction-set.md#typed-array-range-copy)
|
||||
defines fault precedence, scratch and commit. ARRAY_LEN (0xA4) and physical array
|
||||
checks remain. Encodings 0xA7/0xA8/0xAA/0xAB reject at load even in dead code;
|
||||
no replacement publication/guard or transaction is provided.
|
||||
|
||||
## Identity/hash and catalog schema 2
|
||||
|
||||
## Atomic publication of multiple Struct instances
|
||||
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.
|
||||
|
||||
FIELDS_PUBLISH (0xAB) atomically publishes complete typed fields to multiple
|
||||
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).
|
||||
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.
|
||||
|
||||
@@ -28,7 +28,7 @@ that the mirrors are synchronized. If the runtime repository is not available
|
||||
in the same checkout, synchronization evidence must be produced against the
|
||||
canonical runtime revision before merging.
|
||||
|
||||
Compiler-owned transformation contracts remain under `docs/specs/compiler`.
|
||||
Compiler-owned transformation contracts remain under `docs/compiler/general/specs`.
|
||||
Those specifications define `IRBackend -> IRVM -> PBX` emission, but they MUST
|
||||
conform to the runtime-owned PBX and ISA contracts and MUST NOT redefine runtime
|
||||
execution semantics.
|
||||
@@ -53,3 +53,10 @@ explicitly. Ordinary builds and local catalog tests never invoke this command.
|
||||
|
||||
The manual port and consumer requirements are defined in
|
||||
[Runtime catalog support](../compiler/general/specs/runtime-catalog-support.md).
|
||||
|
||||
The selected provider publishes intrinsic schema 2 (25 columns). Manual compiler
|
||||
metadata must retain every nullable bit, invocation/scratch/context profile and
|
||||
cost parameter, including entries without PBS source facades. Storage producer
|
||||
qualification uses the minimal ISA: ARRAY_LEN and ARRAY_COPY remain; 0xA7, 0xA8,
|
||||
0xAA and 0xAB are unsupported. Compiler/SDK conformance must be regenerated for
|
||||
the selected revision rather than reusing evidence from earlier providers.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
runtime.revision=57992cf214e8a5f9de53a40dba9aaa7fab038c91
|
||||
INTRINSICS.csv.sha256=0c1bb78a9b81d1e3480ef5713f3d70f0b06772a7dfab2fd00c1f0a6364f98daa
|
||||
runtime.revision=dcf6561ea73446e0a3e1cf1c73eda20923b38df0
|
||||
INTRINSICS.csv.sha256=7c1c363f5f0f941b3ab27cfc72af41e13e44cd4371c687db8300721288f47e63
|
||||
BUILTIN_CONSTANTS.csv.sha256=e407e4718127aa7ef7b1097b5b4b67d86dd979235e73a551a7c36b628cddc039
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ class PbsListCursorTest {
|
||||
if(name.startsWith("gc"))module=PbsStructuredValuesTest.withTestSafepoint(module);
|
||||
new BytecodePreloadVerifierService().verify(module);
|
||||
Files.createDirectories(directory());Files.write(directory().resolve("pbs-"+collection+"-"+name+".pbx"),module.serialize());
|
||||
if(!name.startsWith("gc")&&!name.startsWith("refusal-")) {
|
||||
if(!name.startsWith("gc")) {
|
||||
var optimized=new OptimizeIRVMService().optimize(new LowerToIRVMService().lower(backend));
|
||||
var optimizedModule=new BytecodeEmitter().emit(optimized.coherentEmissionPlan());
|
||||
new BytecodePreloadVerifierService().verify(optimizedModule);
|
||||
|
||||
+4
-78
@@ -1617,89 +1617,15 @@ final class PbsExecutableBodyLowerer {
|
||||
var operation=p.studio.compiler.pbs.PbsSdkCollections.argument(binding,"name");
|
||||
var span=function.span();
|
||||
switch(operation) {
|
||||
case "publishFields" -> {
|
||||
var owners = new java.util.ArrayList<IRRegistry.TypeRef>();
|
||||
int parameter = 0, offset = 0, pops = 0;
|
||||
while (parameter < function.parameters().size()) {
|
||||
var receiver = PbsRuntimeTypes.unwrap(function.parameters().get(parameter++).typeRef());
|
||||
var owner = receiver.kind() == PbsAst.TypeRefKind.OPTIONAL
|
||||
? PbsRuntimeTypes.unwrap(receiver.inner()) : receiver;
|
||||
var declaration = c.types().structs.get(owner.name());
|
||||
if (declaration == null) throw new IllegalArgumentException("Publication destination must be Struct");
|
||||
owners.add(c.types().registryType(owner));
|
||||
if (receiver.kind() == PbsAst.TypeRefKind.OPTIONAL) {
|
||||
var absent = c.nextLabel("absent_publication_destination");
|
||||
var ready = c.nextLabel("publication_destination_ready");
|
||||
optionalPresence(offset, receiver, span, c);
|
||||
emitJump(IRBackendExecutableFunction.InstructionKind.JMP_IF_FALSE, absent, span, c);
|
||||
unwrapOptional(offset, receiver, span, c);
|
||||
emitJump(IRBackendExecutableFunction.InstructionKind.JMP, ready, span, c);
|
||||
emitLabel(absent, span, c);
|
||||
emitDefault(c.types().registryType(owner), 1, span, c);
|
||||
emitLabel(ready, span, c);
|
||||
} else emitGetLocal(offset, span, c);
|
||||
offset += c.types().slots(receiver);
|
||||
pops++;
|
||||
for (var field : declaration.fields()) {
|
||||
if (parameter >= function.parameters().size()) throw new IllegalArgumentException("Missing publication field");
|
||||
var value = function.parameters().get(parameter++).typeRef();
|
||||
if (!c.types().key(value).equals(c.types().key(field.typeRef())))
|
||||
throw new IllegalArgumentException("Publication field type mismatch");
|
||||
int width = c.types().slots(value);
|
||||
emitLoadLocalSlots(offset, width, span, c);
|
||||
packStorage(value, span, c);
|
||||
offset += width;
|
||||
pops += storageWidth(value, c);
|
||||
}
|
||||
}
|
||||
registry(FIELDS_PUBLISH, c.types().publicationSchema(owners), 0, pops, 0, span, c);
|
||||
}
|
||||
case "indexGuard" -> {
|
||||
emitLoadLocalSlots(0,2,span,c);
|
||||
registry(INDEX_GUARD,null,0,2,0,span,c);
|
||||
}
|
||||
case "checkLength" -> {
|
||||
emitGetLocal(0,span,c);
|
||||
registry(ARRAY_CHECK_LENGTH,c.types().arrayStorage(),0,1,0,span,c);
|
||||
case "fail" -> {
|
||||
if (!function.parameters().isEmpty()) throw new IllegalArgumentException("SDK failure binding takes no operands");
|
||||
c.instructions().add(new IRBackendExecutableFunction.Instruction(IRBackendExecutableFunction.InstructionKind.TRAP,"",null,null,span));
|
||||
return;
|
||||
}
|
||||
case "copy" -> {
|
||||
emitLoadLocalSlots(0,5,span,c);
|
||||
registry(ARRAY_COPY,c.types().arrayStorage(),0,5,0,span,c);
|
||||
}
|
||||
case "publish" -> {
|
||||
var parameters=function.parameters();
|
||||
var optional=PbsRuntimeTypes.unwrap(parameters.get(7).typeRef());
|
||||
var payload=optional.inner();
|
||||
var owner=parameters.get(8).typeRef();
|
||||
var declaration=c.types().structs.get(owner.name());
|
||||
var firstName=p.studio.compiler.pbs.PbsSdkCollections.argument(binding,"first");
|
||||
var secondName=p.studio.compiler.pbs.PbsSdkCollections.argument(binding,"second");
|
||||
int first=-1,second=-1;
|
||||
for(int i=0;i<declaration.fields().size();i++) {
|
||||
if(declaration.fields().get(i).name().equals(firstName))first=i;
|
||||
if(declaration.fields().get(i).name().equals(secondName))second=i;
|
||||
}
|
||||
if(first<0||second<0)throw new IllegalArgumentException("Unresolved SDK storage fields");
|
||||
emitLoadLocalSlots(0,7,span,c);
|
||||
optionalPresence(7,optional,span,c);
|
||||
var absent=c.nextLabel("empty_storage_fill");var ready=c.nextLabel("storage_fill_ready");
|
||||
emitJump(IRBackendExecutableFunction.InstructionKind.JMP_IF_FALSE,absent,span,c);
|
||||
unwrapOptional(7,optional,span,c);
|
||||
packStorage(payload,span,c);
|
||||
registry(DYN_PACK,c.types().registryType(payload),0,storageWidth(payload,c),2,span,c);
|
||||
emitJump(IRBackendExecutableFunction.InstructionKind.JMP,ready,span,c);
|
||||
emitLabel(absent,span,c);emitDefault(c.types().dynamic(),2,span,c);
|
||||
emitLabel(ready,span,c);
|
||||
int offset=8,pops=9;
|
||||
for(int i=8;i<parameters.size();i++) {
|
||||
var type=parameters.get(i).typeRef();int width=c.types().slots(type);
|
||||
emitLoadLocalSlots(offset,width,span,c);packStorage(type,span,c);
|
||||
offset+=width;pops+=storageWidth(type,c);
|
||||
}
|
||||
c.instructions().add(new IRBackendExecutableFunction.Instruction(IRBackendExecutableFunction.InstructionKind.REGISTRY,
|
||||
null,"",null,null,null,"","",pops,0,span,
|
||||
new IRRegistryInstruction(STORAGE_PUBLISH,c.types().arrayStorage(),c.types().registryType(owner),null,first,second)));
|
||||
}
|
||||
default -> throw new IllegalArgumentException("Unknown private storage binding: "+operation);
|
||||
}
|
||||
c.instructions().add(new IRBackendExecutableFunction.Instruction(IRBackendExecutableFunction.InstructionKind.RET,"",null,null,span));
|
||||
|
||||
+2
-1
@@ -87,7 +87,7 @@ final class PbsExecutableStackAnalyzer {
|
||||
}
|
||||
outHeight = outHeight - argSlots + retSlots;
|
||||
}
|
||||
case HALT, LABEL, JMP, RET -> {
|
||||
case HALT, TRAP, LABEL, JMP, RET -> {
|
||||
}
|
||||
case JMP_IF_TRUE, JMP_IF_FALSE -> {
|
||||
if (outHeight <= 0) {
|
||||
@@ -99,6 +99,7 @@ final class PbsExecutableStackAnalyzer {
|
||||
|
||||
maxHeight = Math.max(maxHeight, outHeight);
|
||||
if (instruction.kind() == IRBackendExecutableFunction.InstructionKind.RET
|
||||
|| instruction.kind() == IRBackendExecutableFunction.InstructionKind.TRAP
|
||||
|| instruction.kind() == IRBackendExecutableFunction.InstructionKind.HALT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
-9
@@ -138,15 +138,6 @@ final class PbsRuntimeTypes {
|
||||
used.putIfAbsent(ref.declarationKey(), new IRRegistry.TypeDeclaration(ref, null, new IRRegistry.Array(element)));
|
||||
return ref;
|
||||
}
|
||||
IRRegistry.TypeRef publicationSchema(List<IRRegistry.TypeRef> owners) {
|
||||
var ref = new IRRegistry.TypeRef("pbs:field-publication:" + owners.stream()
|
||||
.map(IRRegistry.TypeRef::declarationKey).map(k -> k.length() + ":" + k)
|
||||
.collect(java.util.stream.Collectors.joining()));
|
||||
used.putIfAbsent(ref.declarationKey(), new IRRegistry.TypeDeclaration(ref, null,
|
||||
new IRRegistry.Struct(ReadOnlyList.wrap(owners.stream()
|
||||
.map(owner -> new IRRegistry.NamedType(owner, null)).toList()))));
|
||||
return ref;
|
||||
}
|
||||
IRRegistry.TypeRef builtin(int id) {
|
||||
var ref = IRRegistry.TypeRef.builtin(id);
|
||||
used.putIfAbsent(ref.declarationKey(),new IRRegistry.TypeDeclaration(ref,null,new IRRegistry.Builtin(id)));
|
||||
|
||||
+68
-72
@@ -1,19 +1,24 @@
|
||||
// Source algorithms own state, ranges, capacity policy and snapshot topology.
|
||||
// Only these private, origin-checked helpers bind generic storage instructions.
|
||||
[StoragePrimitive(name = "indexGuard")]
|
||||
fn _bounds(index: long, limit: long) {}
|
||||
[StoragePrimitive(name = "fail")]
|
||||
fn _fail() {}
|
||||
|
||||
[StoragePrimitive(name = "checkLength")]
|
||||
fn _checkLength(length: long) {}
|
||||
fn _bounds(index: long, limit: long) {
|
||||
if index < (0 as long) || index >= limit { _fail(); }
|
||||
}
|
||||
|
||||
fn _insertionBounds(index: long, length: long) {
|
||||
if index < (0 as long) || index > length { _fail(); }
|
||||
}
|
||||
|
||||
fn _checkLength(length: long) {
|
||||
let maximum: long = 4294967295;
|
||||
if length < (0 as long) || length > maximum { _fail(); }
|
||||
}
|
||||
|
||||
[StoragePrimitive(name = "copy")]
|
||||
fn _copy<T>(source: array<T>, sourceStart: long, target: array<T>, targetStart: long, count: long) {}
|
||||
|
||||
[StoragePrimitive(name = "publish", first = "storage", second = "length")]
|
||||
fn _publish<T>(source: array<T>, sourceStart: long, target: array<T>, targetStart: long,
|
||||
count: long, fillStart: long, fillCount: long, fill: optional T,
|
||||
owner: list<T>, storage: array<T>, length: long) {}
|
||||
|
||||
fn _grownCapacity(capacity: long, required: long) -> long {
|
||||
_checkLength(required);
|
||||
let maximum: long = 4294967295;
|
||||
@@ -32,6 +37,7 @@ declare struct list<T>(storage: array<T>, length: long) {
|
||||
this.length = 0;
|
||||
}
|
||||
ctor make(capacity: long) {
|
||||
_checkLength(capacity);
|
||||
this.storage = new array<T>(capacity);
|
||||
this.length = 0;
|
||||
}
|
||||
@@ -51,58 +57,75 @@ declare struct list<T>(storage: array<T>, length: long) {
|
||||
|
||||
fn add(value: T) { this.insert(this.length, value); }
|
||||
fn insert(index: long, value: T) {
|
||||
_bounds(index, this.length + 1);
|
||||
_insertionBounds(index, this.length);
|
||||
let required: long = this.length + 1;
|
||||
_checkLength(required);
|
||||
let target: array<T> = this.storage;
|
||||
if required > target.length {
|
||||
target = new array<T>(_grownCapacity(target.length, required));
|
||||
_copy<T>(this.storage, 0, target, 0, this.length);
|
||||
if required > this.storage.length {
|
||||
let target: array<T> = new array<T>(_grownCapacity(this.storage.length, required));
|
||||
_copy<T>(this.storage, 0, target, 0, index);
|
||||
_copy<T>(this.storage, index, target, index + 1, this.length - index);
|
||||
target[index] = value;
|
||||
this.storage = target;
|
||||
} else {
|
||||
// Prepare one complete stored group before shifting observable slots.
|
||||
let prepared: array<T> = new array<T>(1);
|
||||
prepared[0] = value;
|
||||
_copy<T>(this.storage, index, this.storage, index + 1, this.length - index);
|
||||
_copy<T>(prepared, 0, this.storage, index, 1);
|
||||
}
|
||||
_publish<T>(target, index, target, index + 1, this.length - index,
|
||||
index, 1, some(value), this, target, required);
|
||||
this.length = required;
|
||||
}
|
||||
fn clearAt(index: long) {
|
||||
_bounds(index, this.length);
|
||||
_publish<T>(this.storage, 0, this.storage, 0, 0,
|
||||
index, 1, none, this, this.storage, this.length);
|
||||
this.storage.clear(index);
|
||||
}
|
||||
fn removeAt(index: long) -> optional T {
|
||||
_bounds(index, this.length);
|
||||
let previous: optional T = this.storage[index];
|
||||
_publish<T>(this.storage, index + 1, this.storage, index, this.length - index - 1,
|
||||
this.length - 1, 1, none, this, this.storage, this.length - 1);
|
||||
let length: long = this.length - 1;
|
||||
_copy<T>(this.storage, index + 1, this.storage, index, length - index);
|
||||
this.storage.clear(length);
|
||||
this.length = length;
|
||||
return previous;
|
||||
}
|
||||
fn clear() {
|
||||
_publish<T>(this.storage, 0, this.storage, 0, 0,
|
||||
0, this.length, none, this, this.storage, 0);
|
||||
let index: long = 0;
|
||||
while index < this.length {
|
||||
this.storage.clear(index);
|
||||
index = index + 1;
|
||||
}
|
||||
this.length = 0;
|
||||
}
|
||||
fn resize(length: long) {
|
||||
_checkLength(length);
|
||||
let target: array<T> = this.storage;
|
||||
if length > target.length {
|
||||
target = new array<T>(_grownCapacity(target.length, length));
|
||||
if length > this.storage.length {
|
||||
let target: array<T> = new array<T>(_grownCapacity(this.storage.length, length));
|
||||
_copy<T>(this.storage, 0, target, 0, this.length);
|
||||
this.storage = target;
|
||||
} else {
|
||||
let start: long = this.length;
|
||||
let end: long = length;
|
||||
if length < this.length { start = length; end = this.length; }
|
||||
while start < end {
|
||||
this.storage.clear(start);
|
||||
start = start + 1;
|
||||
}
|
||||
}
|
||||
let start: long = this.length;
|
||||
let count: long = length - this.length;
|
||||
if length < this.length { start = length; count = this.length - length; }
|
||||
_publish<T>(target, 0, target, 0, 0, start, count, none, this, target, length);
|
||||
this.length = length;
|
||||
}
|
||||
fn reserve(capacity: long) {
|
||||
_checkLength(capacity);
|
||||
if capacity > this.storage.length {
|
||||
let target: array<T> = new array<T>(capacity);
|
||||
_copy<T>(this.storage, 0, target, 0, this.length);
|
||||
_publish<T>(target, 0, target, 0, 0, 0, 0, none, this, target, this.length);
|
||||
this.storage = target;
|
||||
}
|
||||
}
|
||||
fn trim() {
|
||||
if this.storage.length != this.length {
|
||||
let target: array<T> = new array<T>(this.length);
|
||||
_copy<T>(this.storage, 0, target, 0, this.length);
|
||||
_publish<T>(target, 0, target, 0, 0, 0, 0, none, this, target, this.length);
|
||||
this.storage = target;
|
||||
}
|
||||
}
|
||||
fn cursor() -> Cursor<T> {
|
||||
@@ -155,18 +178,6 @@ implements<T> Cursor<T> for _SnapshotCursor<T> using snapshot {
|
||||
fn current() -> optional T { return snapshot.current(); }
|
||||
}
|
||||
|
||||
// Complete-object publication is neutral; this source chooses the node topology.
|
||||
[StoragePrimitive(name = "publishFields")]
|
||||
fn _linkedPublish<T>(owner: linked<T>, head: optional _LinkedNode<T>, tail: optional _LinkedNode<T>, length: long,
|
||||
previous: optional _LinkedNode<T>, previousValue: T, previousPrevious: optional _LinkedNode<T>, previousNext: optional _LinkedNode<T>,
|
||||
next: optional _LinkedNode<T>, nextValue: T, nextPrevious: optional _LinkedNode<T>, nextNext: optional _LinkedNode<T>) {}
|
||||
|
||||
[StoragePrimitive(name = "publishFields")]
|
||||
fn _linkedEmpty<T>(owner: linked<T>, head: optional _LinkedNode<T>, tail: optional _LinkedNode<T>, length: long) {}
|
||||
|
||||
[StoragePrimitive(name = "publishFields")]
|
||||
fn _linkedReplace<T>(owner: _LinkedNode<T>, value: T, previous: optional _LinkedNode<T>, next: optional _LinkedNode<T>) {}
|
||||
|
||||
fn _linkedNextSize(length: long) -> long {
|
||||
// Check before adding; Linked does not inherit Array's u32 structural bound.
|
||||
let maximum: long = 9223372036854775807;
|
||||
@@ -228,13 +239,13 @@ declare struct linked<T>(head: optional _LinkedNode<T>, tail: optional _LinkedNo
|
||||
[SdkPrivate]
|
||||
fn _put(index: long, value: T) {
|
||||
if let node = this._node(index) {
|
||||
_linkedReplace<T>(node, value, node.previous, node.next);
|
||||
node.value = value;
|
||||
}
|
||||
}
|
||||
fn add(value: T) { this.insert(this.length, value); }
|
||||
fn addFirst(value: T) { this.insert(0, value); }
|
||||
fn insert(index: long, value: T) {
|
||||
if index != this.length { _bounds(index, this.length); }
|
||||
_insertionBounds(index, this.length);
|
||||
let required: long = _linkedNextSize(this.length);
|
||||
let next: optional _LinkedNode<T> = none;
|
||||
let previous: optional _LinkedNode<T> = this.tail;
|
||||
@@ -243,38 +254,19 @@ declare struct linked<T>(head: optional _LinkedNode<T>, tail: optional _LinkedNo
|
||||
if let node = next { previous = node.previous; }
|
||||
}
|
||||
let inserted: optional _LinkedNode<T> = some(new _LinkedNode<T>(value, previous, next));
|
||||
let head: optional _LinkedNode<T> = this.head;
|
||||
let tail: optional _LinkedNode<T> = this.tail;
|
||||
if index == (0 as long) { head = inserted; }
|
||||
if index == this.length { tail = inserted; }
|
||||
let previousValue: T = value;
|
||||
let previousPrevious: optional _LinkedNode<T> = none;
|
||||
let nextValue: T = value;
|
||||
let nextNext: optional _LinkedNode<T> = none;
|
||||
if let node = previous { previousValue = node.value; previousPrevious = node.previous; }
|
||||
if let node = next { nextValue = node.value; nextNext = node.next; }
|
||||
_linkedPublish<T>(this, head, tail, required,
|
||||
previous, previousValue, previousPrevious, inserted,
|
||||
next, nextValue, inserted, nextNext);
|
||||
if let node = previous { node.next = inserted; } else { this.head = inserted; }
|
||||
if let node = next { node.previous = inserted; } else { this.tail = inserted; }
|
||||
this.length = required;
|
||||
}
|
||||
fn removeAt(index: long) -> optional T {
|
||||
if let removed = this._node(index) {
|
||||
let removedValue: optional T = some(removed.value);
|
||||
let previous: optional _LinkedNode<T> = removed.previous;
|
||||
let next: optional _LinkedNode<T> = removed.next;
|
||||
let head: optional _LinkedNode<T> = this.head;
|
||||
let tail: optional _LinkedNode<T> = this.tail;
|
||||
if previous.hasNone() { head = next; }
|
||||
if next.hasNone() { tail = previous; }
|
||||
let previousValue: T = removed.value;
|
||||
let previousPrevious: optional _LinkedNode<T> = none;
|
||||
let nextValue: T = removed.value;
|
||||
let nextNext: optional _LinkedNode<T> = none;
|
||||
if let node = previous { previousValue = node.value; previousPrevious = node.previous; }
|
||||
if let node = next { nextValue = node.value; nextNext = node.next; }
|
||||
_linkedPublish<T>(this, head, tail, this.length - 1,
|
||||
previous, previousValue, previousPrevious, next,
|
||||
next, nextValue, previous, nextNext);
|
||||
let length: long = this.length - 1;
|
||||
if let node = previous { node.next = next; } else { this.head = next; }
|
||||
if let node = next { node.previous = previous; } else { this.tail = previous; }
|
||||
this.length = length;
|
||||
return removedValue;
|
||||
}
|
||||
return none;
|
||||
@@ -287,7 +279,11 @@ declare struct linked<T>(head: optional _LinkedNode<T>, tail: optional _LinkedNo
|
||||
if this.length == (0 as long) { return none; }
|
||||
return this.removeAt(this.length - 1);
|
||||
}
|
||||
fn clear() { _linkedEmpty<T>(this, none, none, 0); }
|
||||
fn clear() {
|
||||
this.head = none;
|
||||
this.tail = none;
|
||||
this.length = 0;
|
||||
}
|
||||
fn cursor() -> Cursor<T> {
|
||||
let captured: optional _SnapshotNode<T> = none;
|
||||
let source: optional _LinkedNode<T> = this.tail;
|
||||
|
||||
+2
-2
@@ -84,7 +84,7 @@ class PbsGateUSdkInterfaceConformanceTest {
|
||||
var copied=DiagnosticSink.empty();
|
||||
homonym.compileFile(new FileId(201),"""
|
||||
[SdkList] declare struct list<T>(value:T) {}
|
||||
[StoragePrimitive(name="indexGuard")] fn fake(index:long,limit:long) {}
|
||||
[StoragePrimitive(name="fail")] fn fake() {}
|
||||
""",copied,SourceKind.PROJECT);
|
||||
assertTrue(copied.hasErrors(),"Project attributes cannot acquire SDK bindings");
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class PbsGateUSdkInterfaceConformanceTest {
|
||||
var copied=DiagnosticSink.empty();
|
||||
new PbsFrontendCompiler().compileFile(new FileId(203),"""
|
||||
[SdkLinked] declare struct linked<T>(value:T) {}
|
||||
[StoragePrimitive(name="publishFields")] fn fake() {}
|
||||
[StoragePrimitive(name="copy")] fn fake() {}
|
||||
""",copied,SourceKind.PROJECT);
|
||||
assertTrue(copied.hasErrors());
|
||||
}
|
||||
|
||||
+12
-1
@@ -66,7 +66,7 @@ public class BytecodeEmitter {
|
||||
case REGISTRY -> {
|
||||
var instruction = Objects.requireNonNull(op.registryInstruction());
|
||||
writeOpNoImm(code,instruction.op().opcode());
|
||||
for(var value:new Integer[]{instruction.immediate(),instruction.secondImmediate(),instruction.thirdImmediate(),instruction.fourthImmediate()})
|
||||
for(var value:new Integer[]{instruction.immediate(),instruction.secondImmediate()})
|
||||
if(value!=null)code.writeBytes(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(value).array());
|
||||
spans.add(new BytecodeFunctionLayoutBuilder.InstructionSpan(pc, spanOrUnknown(op.span())));
|
||||
}
|
||||
@@ -74,6 +74,10 @@ public class BytecodeEmitter {
|
||||
writeOpNoImm(code, OP_HALT);
|
||||
spans.add(new BytecodeFunctionLayoutBuilder.InstructionSpan(pc, spanOrUnknown(op.span())));
|
||||
}
|
||||
case TRAP -> {
|
||||
writeOpNoImm(code, 0x05);
|
||||
spans.add(new BytecodeFunctionLayoutBuilder.InstructionSpan(pc, spanOrUnknown(op.span())));
|
||||
}
|
||||
case RET -> {
|
||||
writeOpNoImm(code, OP_RET);
|
||||
spans.add(new BytecodeFunctionLayoutBuilder.InstructionSpan(pc, spanOrUnknown(op.span())));
|
||||
@@ -351,6 +355,7 @@ public class BytecodeEmitter {
|
||||
public enum OperationKind {
|
||||
REGISTRY,
|
||||
HALT,
|
||||
TRAP,
|
||||
RET,
|
||||
PUSH_CONST,
|
||||
POP,
|
||||
@@ -414,6 +419,12 @@ public class BytecodeEmitter {
|
||||
return new Operation(OperationKind.HALT, 0, null, null, null, span);
|
||||
}
|
||||
|
||||
public static Operation trap() { return trap(null); }
|
||||
|
||||
public static Operation trap(final BytecodeModule.SourceSpan span) {
|
||||
return new Operation(OperationKind.TRAP, 0, null, null, null, span);
|
||||
}
|
||||
|
||||
public static Operation ret() {
|
||||
return ret(null);
|
||||
}
|
||||
|
||||
+2
-3
@@ -5,12 +5,11 @@ final class BytecodeOpcodeLayout {
|
||||
static int sizeForOpcode(int opcode) {
|
||||
return switch(opcode) {
|
||||
case 0x00,0x01,0x05,0x11,0x12,0x13,0x20,0x21,0x22,0x23,0x24,
|
||||
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x51,0x80,0xa7 -> 2;
|
||||
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x51,0x80 -> 2;
|
||||
case 0x16 -> 3;
|
||||
case 0x02,0x03,0x04,0x10,0x17,0x18,0x40,0x41,0x42,0x43,0x50,0x53,0x57,0x70,0x71,0x72,
|
||||
0x90,0x91,0x92,0xa0,0xa3,0xa4,0xa5,0xa6,0xa8,0xa9,0xab -> 6;
|
||||
0x90,0x91,0x92,0xa0,0xa3,0xa4,0xa5,0xa6,0xa9 -> 6;
|
||||
case 0x14,0x15,0x52,0x58,0x93,0x94,0x95,0x96,0xa1,0xa2 -> 10;
|
||||
case 0xaa -> 18;
|
||||
default -> throw new BytecodeMarshalingException(BytecodeMarshalingErrorCode.MARSHAL_VERIFY_PRECHECK_UNKNOWN_OPCODE,
|
||||
"unknown or retired opcode 0x%04X".formatted(opcode));
|
||||
};
|
||||
|
||||
+17
-30
@@ -29,7 +29,7 @@ public class BytecodePreloadVerifierService {
|
||||
for(int i=0;i<module.functions().size();i++)verifyFunction(module,registry,i,used);
|
||||
for(int i=0;i<used.length;i++)check(used[i],"unused syscall declaration "+i);
|
||||
}
|
||||
private record Instruction(int pc,int opcode,int first,int second,int third,int fourth,int next) {}
|
||||
private record Instruction(int pc,int opcode,int first,int second,int next) {}
|
||||
private void verifyFunction(BytecodeModule m,LinkedRegistry r,int index,boolean[] used) {
|
||||
var f=m.functions().get(index);byte[] code=m.code();int start=f.codeOffset(),end=start+f.codeLen();
|
||||
var instructions=new TreeMap<Integer,Instruction>();
|
||||
@@ -37,7 +37,7 @@ public class BytecodePreloadVerifierService {
|
||||
check(pc+2<=end,"truncated opcode");int op=u16(code,pc);
|
||||
if(op==0x70)throw new BytecodeMarshalingException(BytecodeMarshalingErrorCode.MARSHAL_LINKAGE_RAW_SYSCALL_IN_PRELOAD,"raw SYSCALL in producer image");int size=BytecodeOpcodeLayout.sizeForOpcode(op);check((long)pc+size<=end,"truncated instruction");
|
||||
int a=size>=6?i32(code,pc+2):0,b=size>=10?i32(code,pc+6):0;
|
||||
var instruction=new Instruction(pc,op,a,b,size>=18?i32(code,pc+10):0,size>=18?i32(code,pc+14):0,pc+size);instructions.put(pc,instruction);
|
||||
var instruction=new Instruction(pc,op,a,b,pc+size);instructions.put(pc,instruction);
|
||||
switch(op) {
|
||||
case 0x10 -> check(a>=0&&a<m.constPool().size(),"constant index");
|
||||
case 0x16 -> check(code[pc+2]==0||code[pc+2]==1,"Boolean immediate");
|
||||
@@ -58,12 +58,7 @@ public class BytecodePreloadVerifierService {
|
||||
case 0x93,0x94,0x95,0x96 -> {var src=type(r,a).body();var dst=type(r,b).body();check(src instanceof Struct||src instanceof Array||src instanceof Trait,"reference source category");check(op==0x94||op==0x95?dst instanceof Trait:dst instanceof Struct||dst instanceof Array,"reference target category");}
|
||||
case 0xa0 -> check(type(r,a).body() instanceof Struct,"Struct category");
|
||||
case 0xa1,0xa2 -> field(r,a,b);
|
||||
case 0xa3,0xa4,0xa5,0xa6,0xa8,0xa9 -> array(r,a);
|
||||
case 0xab -> {
|
||||
check(type(r,a).body() instanceof Struct,"Struct publication schema");
|
||||
for (var entry : ((Struct)type(r,a).body()).fields()) check(r.type(entry.type()).body() instanceof Struct,"Struct publication destination");
|
||||
}
|
||||
case 0xaa -> {array(r,a);field(r,b,instruction.third());field(r,b,instruction.fourth());check(instruction.third()!=instruction.fourth(),"publication fields must differ");}
|
||||
case 0xa3,0xa4,0xa5,0xa6,0xa9 -> array(r,a);
|
||||
default -> { }
|
||||
}
|
||||
pc+=size;
|
||||
@@ -153,7 +148,7 @@ public class BytecodePreloadVerifierService {
|
||||
case 0x71 -> {var decl=m.syscalls().get(a);pop(s,decl.argSlots());for(int n=0;n<decl.retSlots();n++)s.stack.add(Fact.UNKNOWN);}
|
||||
case 0x72 -> {
|
||||
var definition = IRVMIntrinsicRegistry.requireById(a);
|
||||
consume(s, intrinsicFacts(definition.argumentCarriers()), typed);
|
||||
consume(s, intrinsicArgumentFacts(definition), typed);
|
||||
produce(s, intrinsicFacts(definition.resultCarriers()), i.pc());
|
||||
}
|
||||
case 0x90 -> {
|
||||
@@ -171,24 +166,7 @@ public class BytecodePreloadVerifierService {
|
||||
case 0xa4 -> {consume(s,facts(r,type(r,a).identity()),typed);s.stack.add(carrier("i64"));}
|
||||
case 0xa5 -> {consume(s,List.of(carrier("i64")),typed);consume(s,facts(r,type(r,a).identity()),typed);produce(s,facts(r,array(r,a).element()),i.pc());}
|
||||
case 0xa6 -> {consume(s,facts(r,array(r,a).element()),typed);consume(s,List.of(carrier("i64")),typed);consume(s,facts(r,type(r,a).identity()),typed);}
|
||||
case 0xab -> {
|
||||
var expected=new ArrayList<Fact>();
|
||||
for(var entry:((Struct)type(r,a).body()).fields()) {
|
||||
expected.addAll(facts(r,entry.type()));
|
||||
for(var field:((Struct)r.type(entry.type()).body()).fields()) expected.addAll(facts(r,field.type()));
|
||||
}
|
||||
consume(s,expected,typed);
|
||||
}
|
||||
case 0xa7 -> consume(s,List.of(carrier("i64"),carrier("i64")),typed);
|
||||
case 0xa8 -> consume(s,List.of(carrier("i64")),typed);
|
||||
case 0xa9,0xaa -> {
|
||||
if(op==0xaa) {
|
||||
consume(s,facts(r,field(r,b,i.fourth()).type()),typed);
|
||||
consume(s,facts(r,field(r,b,i.third()).type()),typed);
|
||||
consume(s,facts(r,type(r,b).identity()),typed);
|
||||
consume(s,facts(r,array(r,a).element()),typed);
|
||||
consume(s,List.of(carrier("i64"),carrier("i64")),typed);
|
||||
}
|
||||
case 0xa9 -> {
|
||||
consume(s,List.of(carrier("i64"),carrier("i64")),typed);
|
||||
consume(s,facts(r,type(r,a).identity()),typed);
|
||||
consume(s,List.of(carrier("i64")),typed);
|
||||
@@ -218,9 +196,18 @@ public class BytecodePreloadVerifierService {
|
||||
}
|
||||
check(s.stack.size()<=f.maxStackSlots(),"maximum temporary slots exceeded (zero is literal)");
|
||||
}
|
||||
// Mirrors runtime registry_verifier/types.rs::abi_mask. Intrinsic String excludes a
|
||||
// proven null at load time even though builtins.rs::value_matches_abi_type accepts it.
|
||||
// Intrinsic arguments use per-entry schema-2 nullability; results retain ABI facts.
|
||||
// Reference/session identity is still validated by the runtime, not proved by these carrier facts.
|
||||
private static List<Fact> intrinsicArgumentFacts(p.studio.compiler.backend.irvm.IRVMIntrinsicDefinition definition) {
|
||||
var facts = new ArrayList<>(intrinsicFacts(definition.argumentCarriers()));
|
||||
for (int i=0; i<facts.size(); i++) {
|
||||
if (definition.argumentCarriers().get(i) == Carrier.STRING)
|
||||
facts.set(i, carrier(definition.nullableArguments().get(i) ? "string" : "string!"));
|
||||
else if (definition.argumentCarriers().get(i) == Carrier.RANDOM)
|
||||
facts.set(i, carrier(definition.nullableArguments().get(i) ? "ref|null" : "ref!"));
|
||||
}
|
||||
return facts;
|
||||
}
|
||||
private static List<Fact> intrinsicFacts(List<Carrier> carriers) {
|
||||
return carriers.stream().map(value -> carrier(switch (value) {
|
||||
case INT32 -> "i32";
|
||||
@@ -247,7 +234,7 @@ public class BytecodePreloadVerifierService {
|
||||
private static int mask(String carrier) {
|
||||
int result=0;
|
||||
for(String part:carrier.split("\\|"))result|=switch(part) {
|
||||
case "i32"->1;case "i64","color"->2;case "f64"->4;case "bool"->8;case "string!"->16;case "string"->16|64;case "ref"->32|64;case "null"->64;default->127;
|
||||
case "i32"->1;case "i64","color"->2;case "f64"->4;case "bool"->8;case "string!"->16;case "string"->16|64;case "ref!"->32;case "ref"->32|64;case "null"->64;default->127;
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
+5
-9
@@ -2,20 +2,16 @@ package p.studio.compiler.backend.irvm;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public record IRVMInstruction(IRVMOp op, Integer immediate, Integer secondImmediate,
|
||||
Integer thirdImmediate, Integer fourthImmediate) {
|
||||
public IRVMInstruction(IRVMOp op, Integer immediate) { this(op,immediate,null,null,null); }
|
||||
public IRVMInstruction(IRVMOp op, Integer immediate, Integer secondImmediate) {
|
||||
this(op,immediate,secondImmediate,null,null);
|
||||
}
|
||||
public record IRVMInstruction(IRVMOp op, Integer immediate, Integer secondImmediate) {
|
||||
public IRVMInstruction(IRVMOp op, Integer immediate) { this(op,immediate,null); }
|
||||
public IRVMInstruction {
|
||||
Objects.requireNonNull(op,"op");
|
||||
int count=(immediate==null?0:1)+(secondImmediate==null?0:1)+(thirdImmediate==null?0:1)+(fourthImmediate==null?0:1);
|
||||
int count=(immediate==null?0:1)+(secondImmediate==null?0:1);
|
||||
if(op.name().startsWith("REGISTRY_")) {
|
||||
if(count*4!=op.immediateSize() || (thirdImmediate!=null&&secondImmediate==null) || (fourthImmediate!=null&&thirdImmediate==null))
|
||||
if(immediate==null || count*4!=op.immediateSize())
|
||||
throw new IllegalArgumentException("registry operand count differs from opcode layout");
|
||||
} else {
|
||||
if(secondImmediate!=null||thirdImmediate!=null||fourthImmediate!=null)
|
||||
if(secondImmediate!=null)
|
||||
throw new IllegalArgumentException("unexpected extra immediate");
|
||||
if((op.immediateSize()>0)!=(immediate!=null))
|
||||
throw new IllegalArgumentException("immediate differs from opcode layout: "+op.name());
|
||||
|
||||
+123
-111
@@ -4,112 +4,117 @@ import java.util.Objects;
|
||||
|
||||
/** Manually maintained target contract. No runtime or CSV lookup occurs during compilation. */
|
||||
public enum IRVMIntrinsicDefinition {
|
||||
VEC2_DOT("vec2.dot", 1, 0x1000, "vec2", "dot", 4, 1, "Float|Float|Float|Float", "Float", true, false, "ax|ay|bx|by", 10, false, CostModel.FIXED, 0, 0),
|
||||
VEC2_LENGTH("vec2.length", 1, 0x1001, "vec2", "length", 2, 1, "Float|Float", "Float", true, false, "x|y", 40, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_FROM_RAW("color.from_raw", 1, 0x1100, "color", "from_raw", 1, 1, "Int64", "builtin:color", true, false, "raw", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_RGB("color.rgb", 1, 0x1101, "color", "rgb", 3, 1, "Int64|Int64|Int64", "builtin:color", true, false, "r|g|b", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_RGBA("color.rgba", 1, 0x1102, "color", "rgba", 4, 1, "Int64|Int64|Int64|Int64", "builtin:color", true, false, "r|g|b|a", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_HTML_RGBA("color.html_rgba", 1, 0x1103, "color", "html_rgba", 1, 1, "String", "builtin:color", true, false, "value", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_GRAY_SCALE("color.gray_scale", 1, 0x1104, "color", "gray_scale", 1, 1, "Int64", "builtin:color", true, false, "value", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_HEX("color.hex", 1, 0x1105, "color", "hex", 1, 1, "builtin:color", "Int64", true, false, "color", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_ALPHA("color.alpha", 1, 0x1106, "color", "alpha", 1, 1, "builtin:color", "Int64", true, false, "color", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_BLACK("color.black", 1, 0x1120, "color", "black", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_WHITE("color.white", 1, 0x1121, "color", "white", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_RED("color.red", 1, 0x1122, "color", "red", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_GREEN("color.green", 1, 0x1123, "color", "green", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_BLUE("color.blue", 1, 0x1124, "color", "blue", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_YELLOW("color.yellow", 1, 0x1125, "color", "yellow", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_ORANGE("color.orange", 1, 0x1126, "color", "orange", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_INDIGO("color.indigo", 1, 0x1127, "color", "indigo", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_GRAY("color.gray", 1, 0x1128, "color", "gray", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_CYAN("color.cyan", 1, 0x1129, "color", "cyan", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_MAGENTA("color.magenta", 1, 0x112A, "color", "magenta", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
COLOR_TRANSPARENT("color.transparent", 1, 0x112B, "color", "transparent", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_UP_PRESSED("input.pad.up.pressed", 1, 0x2100, "input.pad.up", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_UP_RELEASED("input.pad.up.released", 1, 0x2101, "input.pad.up", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_UP_DOWN("input.pad.up.down", 1, 0x2102, "input.pad.up", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_UP_HOLD("input.pad.up.hold", 1, 0x2103, "input.pad.up", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_DOWN_PRESSED("input.pad.down.pressed", 1, 0x2104, "input.pad.down", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_DOWN_RELEASED("input.pad.down.released", 1, 0x2105, "input.pad.down", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_DOWN_DOWN("input.pad.down.down", 1, 0x2106, "input.pad.down", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_DOWN_HOLD("input.pad.down.hold", 1, 0x2107, "input.pad.down", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_LEFT_PRESSED("input.pad.left.pressed", 1, 0x2108, "input.pad.left", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_LEFT_RELEASED("input.pad.left.released", 1, 0x2109, "input.pad.left", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_LEFT_DOWN("input.pad.left.down", 1, 0x210A, "input.pad.left", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_LEFT_HOLD("input.pad.left.hold", 1, 0x210B, "input.pad.left", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_RIGHT_PRESSED("input.pad.right.pressed", 1, 0x210C, "input.pad.right", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_RIGHT_RELEASED("input.pad.right.released", 1, 0x210D, "input.pad.right", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_RIGHT_DOWN("input.pad.right.down", 1, 0x210E, "input.pad.right", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_RIGHT_HOLD("input.pad.right.hold", 1, 0x210F, "input.pad.right", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_A_PRESSED("input.pad.a.pressed", 1, 0x2110, "input.pad.a", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_A_RELEASED("input.pad.a.released", 1, 0x2111, "input.pad.a", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_A_DOWN("input.pad.a.down", 1, 0x2112, "input.pad.a", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_A_HOLD("input.pad.a.hold", 1, 0x2113, "input.pad.a", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_B_PRESSED("input.pad.b.pressed", 1, 0x2114, "input.pad.b", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_B_RELEASED("input.pad.b.released", 1, 0x2115, "input.pad.b", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_B_DOWN("input.pad.b.down", 1, 0x2116, "input.pad.b", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_B_HOLD("input.pad.b.hold", 1, 0x2117, "input.pad.b", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_X_PRESSED("input.pad.x.pressed", 1, 0x2118, "input.pad.x", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_X_RELEASED("input.pad.x.released", 1, 0x2119, "input.pad.x", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_X_DOWN("input.pad.x.down", 1, 0x211A, "input.pad.x", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_X_HOLD("input.pad.x.hold", 1, 0x211B, "input.pad.x", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_Y_PRESSED("input.pad.y.pressed", 1, 0x211C, "input.pad.y", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_Y_RELEASED("input.pad.y.released", 1, 0x211D, "input.pad.y", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_Y_DOWN("input.pad.y.down", 1, 0x211E, "input.pad.y", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_Y_HOLD("input.pad.y.hold", 1, 0x211F, "input.pad.y", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_L_PRESSED("input.pad.l.pressed", 1, 0x2120, "input.pad.l", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_L_RELEASED("input.pad.l.released", 1, 0x2121, "input.pad.l", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_L_DOWN("input.pad.l.down", 1, 0x2122, "input.pad.l", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_L_HOLD("input.pad.l.hold", 1, 0x2123, "input.pad.l", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_R_PRESSED("input.pad.r.pressed", 1, 0x2124, "input.pad.r", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_R_RELEASED("input.pad.r.released", 1, 0x2125, "input.pad.r", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_R_DOWN("input.pad.r.down", 1, 0x2126, "input.pad.r", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_R_HOLD("input.pad.r.hold", 1, 0x2127, "input.pad.r", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_START_PRESSED("input.pad.start.pressed", 1, 0x2128, "input.pad.start", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_START_RELEASED("input.pad.start.released", 1, 0x2129, "input.pad.start", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_START_DOWN("input.pad.start.down", 1, 0x212A, "input.pad.start", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_START_HOLD("input.pad.start.hold", 1, 0x212B, "input.pad.start", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_SELECT_PRESSED("input.pad.select.pressed", 1, 0x212C, "input.pad.select", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_SELECT_RELEASED("input.pad.select.released", 1, 0x212D, "input.pad.select", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_SELECT_DOWN("input.pad.select.down", 1, 0x212E, "input.pad.select", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_PAD_SELECT_HOLD("input.pad.select.hold", 1, 0x212F, "input.pad.select", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_TOUCH_BUTTON_PRESSED("input.touch.button.pressed", 1, 0x2130, "input.touch.button", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_TOUCH_BUTTON_RELEASED("input.touch.button.released", 1, 0x2131, "input.touch.button", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_TOUCH_BUTTON_DOWN("input.touch.button.down", 1, 0x2132, "input.touch.button", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_TOUCH_BUTTON_HOLD("input.touch.button.hold", 1, 0x2133, "input.touch.button", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_TOUCH_X("input.touch.x", 1, 0x2134, "input.touch", "x", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
INPUT_TOUCH_Y("input.touch.y", 1, 0x2135, "input.touch", "y", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I32_MIN("math.i32.min", 1, 0x3000, "math.i32", "min", 2, 1, "Int32|Int32", "Int32", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I32_MAX("math.i32.max", 1, 0x3001, "math.i32", "max", 2, 1, "Int32|Int32", "Int32", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I32_CLAMP("math.i32.clamp", 1, 0x3002, "math.i32", "clamp", 3, 1, "Int32|Int32|Int32", "Int32", true, false, "value|min|max", 4, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I32_ABS("math.i32.abs", 1, 0x3003, "math.i32", "abs", 1, 1, "Int32", "Int32", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I64_MIN("math.i64.min", 1, 0x3004, "math.i64", "min", 2, 1, "Int64|Int64", "Int64", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I64_MAX("math.i64.max", 1, 0x3005, "math.i64", "max", 2, 1, "Int64|Int64", "Int64", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I64_CLAMP("math.i64.clamp", 1, 0x3006, "math.i64", "clamp", 3, 1, "Int64|Int64|Int64", "Int64", true, false, "value|min|max", 4, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I64_ABS("math.i64.abs", 1, 0x3007, "math.i64", "abs", 1, 1, "Int64", "Int64", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_MIN("mathf.min", 1, 0x3008, "mathf", "min", 2, 1, "Float|Float", "Float", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_MAX("mathf.max", 1, 0x3009, "mathf", "max", 2, 1, "Float|Float", "Float", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_CLAMP("mathf.clamp", 1, 0x300A, "mathf", "clamp", 3, 1, "Float|Float|Float", "Float", true, false, "value|min|max", 4, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_ABS("mathf.abs", 1, 0x300B, "mathf", "abs", 1, 1, "Float", "Float", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_FLOOR("mathf.floor", 1, 0x300C, "mathf", "floor", 1, 1, "Float", "Float", true, false, "value", 4, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_CEIL("mathf.ceil", 1, 0x300D, "mathf", "ceil", 1, 1, "Float", "Float", true, false, "value", 4, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_TRUNC("mathf.trunc", 1, 0x300E, "mathf", "trunc", 1, 1, "Float", "Float", true, false, "value", 4, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_ROUND("mathf.round", 1, 0x300F, "mathf", "round", 1, 1, "Float", "Float", true, false, "value", 4, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_SQRT("mathf.sqrt", 1, 0x3010, "mathf", "sqrt", 1, 1, "Float", "Float", true, false, "value", 16, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_SIN("mathf.sin", 1, 0x3011, "mathf", "sin", 1, 1, "Float", "Float", true, false, "angle", 32, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_COS("mathf.cos", 1, 0x3012, "mathf", "cos", 1, 1, "Float", "Float", true, false, "angle", 32, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_ATAN2("mathf.atan2", 1, 0x3013, "mathf", "atan2", 2, 1, "Float|Float", "Float", true, false, "y|x", 48, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I32_TO_I64("math.i32.to_i64", 1, 0x3014, "math.i32", "to_i64", 1, 1, "Int32", "Int64", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I64_TO_I32("math.i64.to_i32", 1, 0x3015, "math.i64", "to_i32", 1, 1, "Int64", "Int32", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I32_TO_FLOAT("math.i32.to_float", 1, 0x3016, "math.i32", "to_float", 1, 1, "Int32", "Float", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATH_I64_TO_FLOAT("math.i64.to_float", 1, 0x3017, "math.i64", "to_float", 1, 1, "Int64", "Float", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_TO_I32("mathf.to_i32", 1, 0x3018, "mathf", "to_i32", 1, 1, "Float", "Int32", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
MATHF_TO_I64("mathf.to_i64", 1, 0x3019, "mathf", "to_i64", 1, 1, "Float", "Int64", true, false, "value", 2, false, CostModel.FIXED, 0, 0),
|
||||
RANDOM_NEW("random.new", 1, 0x4000, "random", "new", 1, 1, "Int64", "builtin:Random", true, true, "seed", 32, true, CostModel.FIXED, 0, 0),
|
||||
RANDOM_NEXT("random.next", 1, 0x4001, "random", "next", 1, 1, "builtin:Random", "Int64", true, false, "rng", 8, true, CostModel.FIXED, 0, 0),
|
||||
RANDOM_NEXTF("random.nextf", 1, 0x4002, "random", "nextf", 1, 1, "builtin:Random", "Float", true, false, "rng", 12, true, CostModel.FIXED, 0, 0),
|
||||
RANDOM_RANGE("random.range", 1, 0x4003, "random", "range", 3, 1, "builtin:Random|Int64|Int64", "Int64", true, false, "rng|min|max", 4, true, CostModel.RANDOM_REJECTION_V1, 8, 64);
|
||||
VEC2_DOT("vec2.dot", 1, 0x1000, "vec2", "dot", 4, 1, "Float|Float|Float|Float", "Float", true, false, "ax|ay|bx|by", 10, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false|false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
VEC2_LENGTH("vec2.length", 1, 0x1001, "vec2", "length", 2, 1, "Float|Float", "Float", true, false, "x|y", 40, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_FROM_RAW("color.from_raw", 1, 0x1100, "color", "from_raw", 1, 1, "Int64", "builtin:color", true, false, "raw", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_RGB("color.rgb", 1, 0x1101, "color", "rgb", 3, 1, "Int64|Int64|Int64", "builtin:color", true, false, "r|g|b", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_RGBA("color.rgba", 1, 0x1102, "color", "rgba", 4, 1, "Int64|Int64|Int64|Int64", "builtin:color", true, false, "r|g|b|a", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false|false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_HTML_RGBA("color.html_rgba", 1, 0x1103, "color", "html_rgba", 1, 1, "String", "builtin:color", true, false, "value", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_GRAY_SCALE("color.gray_scale", 1, 0x1104, "color", "gray_scale", 1, 1, "Int64", "builtin:color", true, false, "value", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_HEX("color.hex", 1, 0x1105, "color", "hex", 1, 1, "builtin:color", "Int64", true, false, "color", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_ALPHA("color.alpha", 1, 0x1106, "color", "alpha", 1, 1, "builtin:color", "Int64", true, false, "color", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_BLACK("color.black", 1, 0x1120, "color", "black", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_WHITE("color.white", 1, 0x1121, "color", "white", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_RED("color.red", 1, 0x1122, "color", "red", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_GREEN("color.green", 1, 0x1123, "color", "green", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_BLUE("color.blue", 1, 0x1124, "color", "blue", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_YELLOW("color.yellow", 1, 0x1125, "color", "yellow", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_ORANGE("color.orange", 1, 0x1126, "color", "orange", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_INDIGO("color.indigo", 1, 0x1127, "color", "indigo", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_GRAY("color.gray", 1, 0x1128, "color", "gray", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_CYAN("color.cyan", 1, 0x1129, "color", "cyan", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_MAGENTA("color.magenta", 1, 0x112A, "color", "magenta", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
COLOR_TRANSPARENT("color.transparent", 1, 0x112B, "color", "transparent", 0, 1, "", "builtin:color", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_UP_PRESSED("input.pad.up.pressed", 1, 0x2100, "input.pad.up", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_UP_RELEASED("input.pad.up.released", 1, 0x2101, "input.pad.up", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_UP_DOWN("input.pad.up.down", 1, 0x2102, "input.pad.up", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_UP_HOLD("input.pad.up.hold", 1, 0x2103, "input.pad.up", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_DOWN_PRESSED("input.pad.down.pressed", 1, 0x2104, "input.pad.down", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_DOWN_RELEASED("input.pad.down.released", 1, 0x2105, "input.pad.down", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_DOWN_DOWN("input.pad.down.down", 1, 0x2106, "input.pad.down", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_DOWN_HOLD("input.pad.down.hold", 1, 0x2107, "input.pad.down", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_LEFT_PRESSED("input.pad.left.pressed", 1, 0x2108, "input.pad.left", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_LEFT_RELEASED("input.pad.left.released", 1, 0x2109, "input.pad.left", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_LEFT_DOWN("input.pad.left.down", 1, 0x210A, "input.pad.left", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_LEFT_HOLD("input.pad.left.hold", 1, 0x210B, "input.pad.left", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_RIGHT_PRESSED("input.pad.right.pressed", 1, 0x210C, "input.pad.right", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_RIGHT_RELEASED("input.pad.right.released", 1, 0x210D, "input.pad.right", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_RIGHT_DOWN("input.pad.right.down", 1, 0x210E, "input.pad.right", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_RIGHT_HOLD("input.pad.right.hold", 1, 0x210F, "input.pad.right", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_A_PRESSED("input.pad.a.pressed", 1, 0x2110, "input.pad.a", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_A_RELEASED("input.pad.a.released", 1, 0x2111, "input.pad.a", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_A_DOWN("input.pad.a.down", 1, 0x2112, "input.pad.a", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_A_HOLD("input.pad.a.hold", 1, 0x2113, "input.pad.a", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_B_PRESSED("input.pad.b.pressed", 1, 0x2114, "input.pad.b", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_B_RELEASED("input.pad.b.released", 1, 0x2115, "input.pad.b", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_B_DOWN("input.pad.b.down", 1, 0x2116, "input.pad.b", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_B_HOLD("input.pad.b.hold", 1, 0x2117, "input.pad.b", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_X_PRESSED("input.pad.x.pressed", 1, 0x2118, "input.pad.x", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_X_RELEASED("input.pad.x.released", 1, 0x2119, "input.pad.x", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_X_DOWN("input.pad.x.down", 1, 0x211A, "input.pad.x", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_X_HOLD("input.pad.x.hold", 1, 0x211B, "input.pad.x", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_Y_PRESSED("input.pad.y.pressed", 1, 0x211C, "input.pad.y", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_Y_RELEASED("input.pad.y.released", 1, 0x211D, "input.pad.y", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_Y_DOWN("input.pad.y.down", 1, 0x211E, "input.pad.y", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_Y_HOLD("input.pad.y.hold", 1, 0x211F, "input.pad.y", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_L_PRESSED("input.pad.l.pressed", 1, 0x2120, "input.pad.l", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_L_RELEASED("input.pad.l.released", 1, 0x2121, "input.pad.l", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_L_DOWN("input.pad.l.down", 1, 0x2122, "input.pad.l", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_L_HOLD("input.pad.l.hold", 1, 0x2123, "input.pad.l", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_R_PRESSED("input.pad.r.pressed", 1, 0x2124, "input.pad.r", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_R_RELEASED("input.pad.r.released", 1, 0x2125, "input.pad.r", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_R_DOWN("input.pad.r.down", 1, 0x2126, "input.pad.r", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_R_HOLD("input.pad.r.hold", 1, 0x2127, "input.pad.r", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_START_PRESSED("input.pad.start.pressed", 1, 0x2128, "input.pad.start", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_START_RELEASED("input.pad.start.released", 1, 0x2129, "input.pad.start", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_START_DOWN("input.pad.start.down", 1, 0x212A, "input.pad.start", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_START_HOLD("input.pad.start.hold", 1, 0x212B, "input.pad.start", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_SELECT_PRESSED("input.pad.select.pressed", 1, 0x212C, "input.pad.select", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_SELECT_RELEASED("input.pad.select.released", 1, 0x212D, "input.pad.select", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_SELECT_DOWN("input.pad.select.down", 1, 0x212E, "input.pad.select", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_PAD_SELECT_HOLD("input.pad.select.hold", 1, 0x212F, "input.pad.select", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_TOUCH_BUTTON_PRESSED("input.touch.button.pressed", 1, 0x2130, "input.touch.button", "pressed", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_TOUCH_BUTTON_RELEASED("input.touch.button.released", 1, 0x2131, "input.touch.button", "released", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_TOUCH_BUTTON_DOWN("input.touch.button.down", 1, 0x2132, "input.touch.button", "down", 0, 1, "", "Bool", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_TOUCH_BUTTON_HOLD("input.touch.button.hold", 1, 0x2133, "input.touch.button", "hold", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_TOUCH_X("input.touch.x", 1, 0x2134, "input.touch", "x", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
INPUT_TOUCH_Y("input.touch.y", 1, 0x2135, "input.touch", "y", 0, 1, "", "Int64", true, false, "", 1, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I32_MIN("math.i32.min", 1, 0x3000, "math.i32", "min", 2, 1, "Int32|Int32", "Int32", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I32_MAX("math.i32.max", 1, 0x3001, "math.i32", "max", 2, 1, "Int32|Int32", "Int32", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I32_CLAMP("math.i32.clamp", 1, 0x3002, "math.i32", "clamp", 3, 1, "Int32|Int32|Int32", "Int32", true, false, "value|min|max", 4, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I32_ABS("math.i32.abs", 1, 0x3003, "math.i32", "abs", 1, 1, "Int32", "Int32", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I64_MIN("math.i64.min", 1, 0x3004, "math.i64", "min", 2, 1, "Int64|Int64", "Int64", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I64_MAX("math.i64.max", 1, 0x3005, "math.i64", "max", 2, 1, "Int64|Int64", "Int64", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I64_CLAMP("math.i64.clamp", 1, 0x3006, "math.i64", "clamp", 3, 1, "Int64|Int64|Int64", "Int64", true, false, "value|min|max", 4, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I64_ABS("math.i64.abs", 1, 0x3007, "math.i64", "abs", 1, 1, "Int64", "Int64", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_MIN("mathf.min", 1, 0x3008, "mathf", "min", 2, 1, "Float|Float", "Float", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_MAX("mathf.max", 1, 0x3009, "mathf", "max", 2, 1, "Float|Float", "Float", true, false, "a|b", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_CLAMP("mathf.clamp", 1, 0x300A, "mathf", "clamp", 3, 1, "Float|Float|Float", "Float", true, false, "value|min|max", 4, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_ABS("mathf.abs", 1, 0x300B, "mathf", "abs", 1, 1, "Float", "Float", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_FLOOR("mathf.floor", 1, 0x300C, "mathf", "floor", 1, 1, "Float", "Float", true, false, "value", 4, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_CEIL("mathf.ceil", 1, 0x300D, "mathf", "ceil", 1, 1, "Float", "Float", true, false, "value", 4, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_TRUNC("mathf.trunc", 1, 0x300E, "mathf", "trunc", 1, 1, "Float", "Float", true, false, "value", 4, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_ROUND("mathf.round", 1, 0x300F, "mathf", "round", 1, 1, "Float", "Float", true, false, "value", 4, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_SQRT("mathf.sqrt", 1, 0x3010, "mathf", "sqrt", 1, 1, "Float", "Float", true, false, "value", 16, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_SIN("mathf.sin", 1, 0x3011, "mathf", "sin", 1, 1, "Float", "Float", true, false, "angle", 32, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_COS("mathf.cos", 1, 0x3012, "mathf", "cos", 1, 1, "Float", "Float", true, false, "angle", 32, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_ATAN2("mathf.atan2", 1, 0x3013, "mathf", "atan2", 2, 1, "Float|Float", "Float", true, false, "y|x", 48, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false|false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I32_TO_I64("math.i32.to_i64", 1, 0x3014, "math.i32", "to_i64", 1, 1, "Int32", "Int64", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I64_TO_I32("math.i64.to_i32", 1, 0x3015, "math.i64", "to_i32", 1, 1, "Int64", "Int32", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I32_TO_FLOAT("math.i32.to_float", 1, 0x3016, "math.i32", "to_float", 1, 1, "Int32", "Float", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATH_I64_TO_FLOAT("math.i64.to_float", 1, 0x3017, "math.i64", "to_float", 1, 1, "Int64", "Float", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_TO_I32("mathf.to_i32", 1, 0x3018, "mathf", "to_i32", 1, 1, "Float", "Int32", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
MATHF_TO_I64("mathf.to_i64", 1, 0x3019, "mathf", "to_i64", 1, 1, "Float", "Int64", true, false, "value", 2, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "host_buffered_v1", "existing_contract_v1", "host", null, 0)),
|
||||
RANDOM_NEW("random.new", 1, 0x4000, "random", "new", 1, 1, "Int64", "builtin:Random", true, true, "seed", 32, true, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "vm_owned_v1", "existing_contract_v1", "vm_state", null, 0)),
|
||||
RANDOM_NEXT("random.next", 1, 0x4001, "random", "next", 1, 1, "builtin:Random", "Int64", true, false, "rng", 8, true, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "true", "vm_owned_v1", "existing_contract_v1", "vm_state", null, 0)),
|
||||
RANDOM_NEXTF("random.nextf", 1, 0x4002, "random", "nextf", 1, 1, "builtin:Random", "Float", true, false, "rng", 12, true, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "true", "vm_owned_v1", "existing_contract_v1", "vm_state", null, 0)),
|
||||
RANDOM_RANGE("random.range", 1, 0x4003, "random", "range", 3, 1, "builtin:Random|Int64|Int64", "Int64", true, false, "rng|min|max", 4, true, CostModel.RANDOM_REJECTION_V1, 8, 64, new IRVMIntrinsicProfile(2, "true|false|false", "vm_owned_v1", "existing_contract_v1", "vm_state", null, 0)),
|
||||
|
||||
HASH_I64("hash.i64", 1, 0x4100, "hash", "i64", 1, 1, "Int64", "Int64", true, false, "value", 8, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "borrowed_inline_v1", "none", "none", null, 0)),
|
||||
HASH_FLOAT("hash.float", 1, 0x4101, "hash", "float", 1, 1, "Float", "Int64", true, false, "value", 8, false, CostModel.FIXED, 0, 0, new IRVMIntrinsicProfile(2, "false", "borrowed_inline_v1", "none", "none", null, 0)),
|
||||
HASH_STRING("hash.string", 1, 0x4102, "hash", "string", 1, 1, "String", "Int64", true, false, "value", 8, false, CostModel.ARGUMENT_UTF8_BYTES_V1, 0, 0, new IRVMIntrinsicProfile(2, "true", "borrowed_inline_v1", "none", "none", 0, 1));
|
||||
|
||||
private final IRVMIntrinsicProfile profile;
|
||||
private final String canonicalName;
|
||||
private final long canonicalVersion;
|
||||
private final int finalId;
|
||||
@@ -147,7 +152,8 @@ public enum IRVMIntrinsicDefinition {
|
||||
final boolean mutatesGuestState,
|
||||
final CostModel costModel,
|
||||
final long attemptCostCycles,
|
||||
final int maxAttempts) {
|
||||
final int maxAttempts,
|
||||
final IRVMIntrinsicProfile profile) {
|
||||
this.canonicalName = requireNonBlank(canonicalName, "canonicalName");
|
||||
this.canonicalVersion = requireNonNegative(canonicalVersion, "canonicalVersion");
|
||||
this.finalId = finalId;
|
||||
@@ -172,12 +178,14 @@ public enum IRVMIntrinsicDefinition {
|
||||
|| (parameterNames.isEmpty() ? 0 : parameterNames.split("\\|", -1).length) != argSlots) {
|
||||
throw new IllegalArgumentException("incoherent intrinsic definition: " + canonicalName);
|
||||
}
|
||||
if (costModel == CostModel.FIXED && (attemptCostCycles != 0 || maxAttempts != 0)
|
||||
|| costModel == CostModel.RANDOM_REJECTION_V1 && (attemptCostCycles == 0 || maxAttempts == 0)) {
|
||||
throw new IllegalArgumentException("incoherent cost model: " + canonicalName);
|
||||
}
|
||||
this.profile = Objects.requireNonNull(profile, "profile");
|
||||
profile.validate(argumentCarriers, costModel, deterministic, mayAllocate, mutatesGuestState,
|
||||
costCycles, attemptCostCycles, maxAttempts);
|
||||
}
|
||||
|
||||
public IRVMIntrinsicProfile profile() { return profile; }
|
||||
public java.util.List<Boolean> nullableArguments() { return profile.nullableArguments(); }
|
||||
|
||||
public String canonicalName() {
|
||||
return canonicalName;
|
||||
}
|
||||
@@ -248,10 +256,14 @@ public enum IRVMIntrinsicDefinition {
|
||||
}
|
||||
|
||||
public enum CostModel {
|
||||
FIXED("fixed"), RANDOM_REJECTION_V1("random_rejection_v1");
|
||||
FIXED("fixed"), RANDOM_REJECTION_V1("random_rejection_v1"), ARGUMENT_UTF8_BYTES_V1("argument_utf8_bytes_v1");
|
||||
private final String token;
|
||||
CostModel(String token) { this.token = token; }
|
||||
public String token() { return token; }
|
||||
public static CostModel fromToken(String token) {
|
||||
for (var model : values()) if (model.token.equals(token)) return model;
|
||||
throw new IllegalArgumentException("unsupported intrinsic cost model: " + token);
|
||||
}
|
||||
}
|
||||
|
||||
/** Explicit runtime ABI atoms, not source-language type aliases. */
|
||||
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
package p.studio.compiler.backend.irvm;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/** Explicit schema-2 invocation metadata; compilation never consults a runtime CSV. */
|
||||
public record IRVMIntrinsicProfile(int schemaVersion, String argNullable, String invocationModel,
|
||||
String scratchModel, String contextAccess, Integer costArgIndex, long costPerByte) {
|
||||
public IRVMIntrinsicProfile {
|
||||
if (schemaVersion != 2) throw new IllegalArgumentException("unsupported intrinsic schema: " + schemaVersion);
|
||||
Objects.requireNonNull(argNullable, "argNullable");
|
||||
parseNullable(argNullable);
|
||||
if (!Set.of("host_buffered_v1", "vm_owned_v1", "borrowed_inline_v1").contains(invocationModel)
|
||||
|| !Set.of("existing_contract_v1", "none").contains(scratchModel)
|
||||
|| !Set.of("host", "vm_state", "none").contains(contextAccess))
|
||||
throw new IllegalArgumentException("unsupported intrinsic invocation profile");
|
||||
boolean coherent = switch (invocationModel) {
|
||||
case "host_buffered_v1" -> scratchModel.equals("existing_contract_v1") && contextAccess.equals("host");
|
||||
case "vm_owned_v1" -> scratchModel.equals("existing_contract_v1") && contextAccess.equals("vm_state");
|
||||
case "borrowed_inline_v1" -> scratchModel.equals("none") && contextAccess.equals("none");
|
||||
default -> false;
|
||||
};
|
||||
if (!coherent || costArgIndex != null && costArgIndex < 0 || costPerByte < 0)
|
||||
throw new IllegalArgumentException("incoherent intrinsic invocation profile");
|
||||
}
|
||||
|
||||
public List<Boolean> nullableArguments() { return parseNullable(argNullable); }
|
||||
|
||||
private static List<Boolean> parseNullable(String mask) {
|
||||
if (mask.isEmpty()) return List.of();
|
||||
return Arrays.stream(mask.split("\\|", -1)).map(token -> switch (token) {
|
||||
case "true" -> true;
|
||||
case "false" -> false;
|
||||
default -> throw new IllegalArgumentException("invalid nullable bit: " + token);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
public void validate(List<IRVMIntrinsicDefinition.Carrier> arguments,
|
||||
IRVMIntrinsicDefinition.CostModel costModel, boolean deterministic, boolean mayAllocate,
|
||||
boolean mutatesGuestState, long baseCost, long attemptCost, int maxAttempts) {
|
||||
var nullable = nullableArguments();
|
||||
if (nullable.size() != arguments.size()) throw new IllegalArgumentException("nullable mask width mismatch");
|
||||
for (int i=0; i<arguments.size(); i++)
|
||||
if (nullable.get(i) && arguments.get(i) != IRVMIntrinsicDefinition.Carrier.STRING
|
||||
&& arguments.get(i) != IRVMIntrinsicDefinition.Carrier.RANDOM)
|
||||
throw new IllegalArgumentException("nullable non-reference intrinsic argument");
|
||||
if (invocationModel.equals("borrowed_inline_v1") && (!deterministic || mayAllocate || mutatesGuestState))
|
||||
throw new IllegalArgumentException("incoherent borrowed intrinsic effects");
|
||||
switch (costModel) {
|
||||
case FIXED -> {
|
||||
if (costArgIndex != null || costPerByte != 0 || attemptCost != 0 || maxAttempts != 0)
|
||||
throw new IllegalArgumentException("incoherent fixed cost model");
|
||||
}
|
||||
case RANDOM_REJECTION_V1 -> {
|
||||
if (!invocationModel.equals("vm_owned_v1") || costArgIndex != null || costPerByte != 0
|
||||
|| baseCost != 4 || attemptCost != 8 || maxAttempts != 64)
|
||||
throw new IllegalArgumentException("unsupported random rejection parameters");
|
||||
}
|
||||
case ARGUMENT_UTF8_BYTES_V1 -> {
|
||||
if (!invocationModel.equals("borrowed_inline_v1") || costArgIndex == null
|
||||
|| costArgIndex != 0 || arguments.size() != 1
|
||||
|| arguments.get(costArgIndex) != IRVMIntrinsicDefinition.Carrier.STRING
|
||||
|| costPerByte != 1 || baseCost != 8 || attemptCost != 0 || maxAttempts != 0)
|
||||
throw new IllegalArgumentException("unsupported UTF-8 argument cost parameters");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -11,6 +11,7 @@ public record IRVMOp(
|
||||
boolean internal) {
|
||||
|
||||
public static final IRVMOp HALT = new IRVMOp("HALT", 0x01, 0, 0, 0, false, true, false);
|
||||
public static final IRVMOp TRAP = new IRVMOp("TRAP", 0x05, 0, 0, 0, false, true, false);
|
||||
public static final IRVMOp RET = new IRVMOp("RET", 0x51, 0, 0, 0, false, true, false);
|
||||
public static final IRVMOp PUSH_CONST = new IRVMOp("PUSH_CONST", 0x10, 4, 0, 1, false, false, false);
|
||||
public static final IRVMOp POP = new IRVMOp("POP", 0x11, 0, 1, 0, false, false, false);
|
||||
|
||||
+2
@@ -10,6 +10,7 @@ public final class IRVMProfileFeatureGate {
|
||||
this(Map.of(
|
||||
"core-v1", Set.of(
|
||||
IRVMOp.HALT,
|
||||
IRVMOp.TRAP,
|
||||
IRVMOp.RET,
|
||||
IRVMOp.PUSH_CONST,
|
||||
IRVMOp.POP,
|
||||
@@ -42,6 +43,7 @@ public final class IRVMProfileFeatureGate {
|
||||
IRVMOp.PUSH_I32),
|
||||
"experimental-v1", Set.of(
|
||||
IRVMOp.HALT,
|
||||
IRVMOp.TRAP,
|
||||
IRVMOp.RET,
|
||||
IRVMOp.PUSH_CONST,
|
||||
IRVMOp.POP,
|
||||
|
||||
+3
@@ -94,6 +94,7 @@ public record IRVMProgram(
|
||||
}
|
||||
final var immediate = instruction.immediate() == null ? 0 : instruction.immediate();
|
||||
return switch (instruction.op().opcode()) {
|
||||
case 0x05 -> operation.kind() == BytecodeEmitter.OperationKind.TRAP;
|
||||
case 0x01 -> operation.kind() == BytecodeEmitter.OperationKind.HALT;
|
||||
case 0x51 -> operation.kind() == BytecodeEmitter.OperationKind.RET;
|
||||
case 0x10 -> operation.kind() == BytecodeEmitter.OperationKind.PUSH_CONST && operation.immediate() == immediate;
|
||||
@@ -179,6 +180,7 @@ public record IRVMProgram(
|
||||
if (instruction.op().name().startsWith("REGISTRY_")) return new BytecodeEmitter.Operation(BytecodeEmitter.OperationKind.REGISTRY, 0, null, null, null, null, instruction);
|
||||
final var immediate = instruction.immediate() == null ? 0 : instruction.immediate();
|
||||
return switch (instruction.op().opcode()) {
|
||||
case 0x05 -> BytecodeEmitter.Operation.trap();
|
||||
case 0x01 -> BytecodeEmitter.Operation.halt();
|
||||
case 0x51 -> BytecodeEmitter.Operation.ret();
|
||||
case 0x10 -> BytecodeEmitter.Operation.pushConst(immediate, null);
|
||||
@@ -258,6 +260,7 @@ public record IRVMProgram(
|
||||
return switch (operation.kind()) {
|
||||
case REGISTRY -> operation.registryInstruction();
|
||||
case HALT -> new IRVMInstruction(IRVMOp.HALT, null);
|
||||
case TRAP -> new IRVMInstruction(IRVMOp.TRAP, null);
|
||||
case RET -> new IRVMInstruction(IRVMOp.RET, null);
|
||||
case PUSH_CONST -> new IRVMInstruction(IRVMOp.PUSH_CONST, operation.immediate());
|
||||
case POP -> new IRVMInstruction(IRVMOp.POP, null);
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ public class IRVMValidator {
|
||||
final int outHeight,
|
||||
final HashMap<Integer, Integer> incomingHeights,
|
||||
final ArrayDeque<Integer> worklist) {
|
||||
if (instr.op() == IRVMOp.HALT || instr.op() == IRVMOp.RET) {
|
||||
if (instr.op() == IRVMOp.HALT || instr.op() == IRVMOp.TRAP || instr.op() == IRVMOp.RET) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -281,6 +281,11 @@ public class LowerToIRVMService {
|
||||
operations.add(BytecodeEmitter.Operation.halt(sourceSpan));
|
||||
functionPc += IRVMOp.HALT.immediateSize() + 2;
|
||||
}
|
||||
case TRAP -> {
|
||||
instructions.add(new IRVMInstruction(IRVMOp.TRAP, null));
|
||||
operations.add(BytecodeEmitter.Operation.trap(sourceSpan));
|
||||
functionPc += 2;
|
||||
}
|
||||
case RET -> {
|
||||
instructions.add(new IRVMInstruction(IRVMOp.RET, null));
|
||||
operations.add(BytecodeEmitter.Operation.ret(sourceSpan));
|
||||
|
||||
+1
-1
@@ -304,7 +304,7 @@ public class OptimizeIRVMService {
|
||||
}
|
||||
reachable[index] = true;
|
||||
final var instruction = instructions.get(index);
|
||||
if (instruction.op() == IRVMOp.HALT || instruction.op() == IRVMOp.RET) {
|
||||
if (instruction.op() == IRVMOp.HALT || instruction.op() == IRVMOp.TRAP || instruction.op() == IRVMOp.RET) {
|
||||
continue;
|
||||
}
|
||||
if (isJump(instruction.op())) {
|
||||
|
||||
+6
-22
@@ -13,7 +13,7 @@ public final class RegistryInstructionLowerer {
|
||||
public static IRVMInstruction lower(IRRegistryInstruction instruction, LinkedRegistry registry,
|
||||
IRBackendExecutableFunction current, ReadOnlyList<IRBackendExecutableFunction> functions, Map<CallableId,Integer> functionIds) {
|
||||
int first=instruction.type()==null?instruction.member():registry.id(instruction.type()).index();
|
||||
Integer second=null,third=null,fourth=null;int pops=0,pushes=0;
|
||||
Integer second=null;int pops=0,pushes=0;
|
||||
var body=instruction.type()==null?null:registry.type(instruction.type()).body();
|
||||
switch(instruction.kind()) {
|
||||
case MAKE_CLOSURE -> {
|
||||
@@ -51,25 +51,9 @@ public final class RegistryInstructionLowerer {
|
||||
pops=instruction.kind()==IRRegistryInstruction.Kind.STRUCT_SET?1+width:1;pushes=instruction.kind()==IRRegistryInstruction.Kind.STRUCT_GET?width:0;
|
||||
}
|
||||
}
|
||||
case FIELDS_PUBLISH -> {
|
||||
if (!(body instanceof Struct schema)) throw new IllegalArgumentException("Struct publication schema required");
|
||||
for (var entry : schema.fields()) {
|
||||
if (!(registry.type(entry.type()).body() instanceof Struct owner)) throw new IllegalArgumentException("Struct publication destination required");
|
||||
pops = Math.addExact(pops, 1);
|
||||
for (var field : owner.fields()) pops = Math.addExact(pops, registry.width(field.type()));
|
||||
}
|
||||
}
|
||||
case INDEX_GUARD -> pops=2;
|
||||
case ARRAY_CHECK_LENGTH,ARRAY_COPY,STORAGE_PUBLISH -> {
|
||||
if(!(body instanceof Array array))throw new IllegalArgumentException("Array category required");
|
||||
if(instruction.kind()==IRRegistryInstruction.Kind.ARRAY_CHECK_LENGTH)pops=1;
|
||||
else if(instruction.kind()==IRRegistryInstruction.Kind.ARRAY_COPY)pops=5;
|
||||
else {
|
||||
if(!(registry.type(instruction.targetType()).body() instanceof Struct owner))throw new IllegalArgumentException("Struct publication owner required");
|
||||
if(instruction.member()>=owner.fields().size()||instruction.secondMember()>=owner.fields().size())throw new IllegalArgumentException("publication field index");
|
||||
second=registry.id(instruction.targetType()).index();third=instruction.member();fourth=instruction.secondMember();
|
||||
pops=8+registry.width(array.element())+registry.width(owner.fields().get(third).type())+registry.width(owner.fields().get(fourth).type());
|
||||
}
|
||||
case ARRAY_COPY -> {
|
||||
if (!(body instanceof Array)) throw new IllegalArgumentException("Array category required");
|
||||
pops=5;
|
||||
}
|
||||
case ARRAY_NEW,ARRAY_LEN,ARRAY_GET,ARRAY_SET -> {
|
||||
if(!(body instanceof Array array))throw new IllegalArgumentException("Array category required");
|
||||
@@ -77,7 +61,7 @@ public final class RegistryInstructionLowerer {
|
||||
switch(instruction.kind()) {case ARRAY_NEW,ARRAY_LEN->{pops=1;pushes=1;}case ARRAY_GET->{pops=2;pushes=width;}case ARRAY_SET->pops=2+width;default->throw new AssertionError();}
|
||||
}
|
||||
}
|
||||
int bytes=instruction.kind()==IRRegistryInstruction.Kind.INDEX_GUARD?0:fourth!=null?16:second==null?4:8;
|
||||
return new IRVMInstruction(new IRVMOp("REGISTRY_"+instruction.kind(),instruction.kind().opcode(),bytes,pops,pushes,false,false,false),bytes==0?null:first,second,third,fourth);
|
||||
int bytes=second==null?4:8;
|
||||
return new IRVMInstruction(new IRVMOp("REGISTRY_"+instruction.kind(),instruction.kind().opcode(),bytes,pops,pushes,false,false,false),first,second);
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package p.studio.compiler.backend.irvm;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class IRVMInstructionTest {
|
||||
@Test void retainedRegistryImmediatesMustStartWithTheFirstOperand() {
|
||||
var arrayLen=new IRVMOp("REGISTRY_ARRAY_LEN",0xa4,4,1,1,false,false,false);
|
||||
assertThrows(IllegalArgumentException.class,()->new IRVMInstruction(arrayLen,null,7));
|
||||
assertThrows(IllegalArgumentException.class,()->new IRVMInstruction(arrayLen,null));
|
||||
assertEquals(6,new IRVMInstruction(arrayLen,7).encodedSize());
|
||||
var field=new IRVMOp("REGISTRY_STRUCT_GET",0xa1,8,1,1,false,false,false);
|
||||
assertThrows(IllegalArgumentException.class,()->new IRVMInstruction(field,7));
|
||||
assertEquals(10,new IRVMInstruction(field,7,2).encodedSize());
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package p.studio.compiler.backend.irvm;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import java.util.List;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static p.studio.compiler.backend.irvm.IRVMIntrinsicDefinition.Carrier.*;
|
||||
import static p.studio.compiler.backend.irvm.IRVMIntrinsicDefinition.CostModel.*;
|
||||
|
||||
class IRVMIntrinsicProfileTest {
|
||||
private static IRVMIntrinsicProfile borrowed(String mask,Integer index,long bytes) {
|
||||
return new IRVMIntrinsicProfile(2,mask,"borrowed_inline_v1","none","none",index,bytes);
|
||||
}
|
||||
@Test void perEntryStringAdmissionAndVariableCostsAreExplicit() {
|
||||
assertEquals(List.of(true),IRVMIntrinsicDefinition.HASH_STRING.nullableArguments());
|
||||
assertEquals(List.of(false),IRVMIntrinsicDefinition.COLOR_HTML_RGBA.nullableArguments());
|
||||
var profile=IRVMIntrinsicDefinition.HASH_STRING.profile();
|
||||
assertEquals(0,profile.costArgIndex()); assertEquals(1,profile.costPerByte());
|
||||
assertEquals(ARGUMENT_UTF8_BYTES_V1,IRVMIntrinsicDefinition.HASH_STRING.costModel());
|
||||
assertEquals(8,IRVMIntrinsicDefinition.HASH_STRING.costCycles());
|
||||
assertEquals("vm_owned_v1",IRVMIntrinsicDefinition.RANDOM_RANGE.profile().invocationModel());
|
||||
assertEquals("host_buffered_v1",IRVMIntrinsicDefinition.VEC2_DOT.profile().invocationModel());
|
||||
}
|
||||
@Test void unsupportedSchemaProfilesMasksAndModelsAreRefused() {
|
||||
for(int schema:new int[]{0,1,3})
|
||||
assertThrows(IllegalArgumentException.class,()->new IRVMIntrinsicProfile(schema,"false","borrowed_inline_v1","none","none",null,0));
|
||||
for(String mask:List.of("True","1","false|","|false"))
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed(mask,null,0));
|
||||
assertThrows(IllegalArgumentException.class,()->new IRVMIntrinsicProfile(2,"false","future","none","none",null,0));
|
||||
assertThrows(IllegalArgumentException.class,()->new IRVMIntrinsicProfile(2,"false","borrowed_inline_v1","existing_contract_v1","none",null,0));
|
||||
assertThrows(IllegalArgumentException.class,()->new IRVMIntrinsicProfile(2,"false","vm_owned_v1","existing_contract_v1","host",null,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("false",-1,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("false",null,-1));
|
||||
assertThrows(IllegalArgumentException.class,()->IRVMIntrinsicDefinition.CostModel.fromToken("future"));
|
||||
}
|
||||
@Test void incoherentWidthsNullabilityEffectsAndCostParametersAreRefused() {
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("",null,0).validate(List.of(INT64),FIXED,true,false,false,8,0,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("true",null,0).validate(List.of(INT64),FIXED,true,false,false,8,0,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("false",null,0).validate(List.of(INT64),FIXED,true,true,false,8,0,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("false",null,0).validate(List.of(INT64),FIXED,true,false,true,8,0,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("false",0,1).validate(List.of(STRING),FIXED,true,false,false,8,0,0));
|
||||
for(Integer index:new Integer[]{null,1})
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("true",index,1).validate(List.of(STRING),ARGUMENT_UTF8_BYTES_V1,true,false,false,8,0,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("false",0,1).validate(List.of(INT64),ARGUMENT_UTF8_BYTES_V1,true,false,false,8,0,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("true",0,0).validate(List.of(STRING),ARGUMENT_UTF8_BYTES_V1,true,false,false,8,0,0));
|
||||
assertThrows(IllegalArgumentException.class,()->borrowed("true",0,1).validate(List.of(STRING),ARGUMENT_UTF8_BYTES_V1,true,false,false,8,1,1));
|
||||
var random=IRVMIntrinsicDefinition.RANDOM_RANGE.profile();
|
||||
assertThrows(IllegalArgumentException.class,()->random.validate(List.of(RANDOM,INT64,INT64),RANDOM_REJECTION_V1,true,false,true,4,8,65));
|
||||
}
|
||||
}
|
||||
+8
-4
@@ -12,13 +12,13 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class IRVMIntrinsicRegistryParityTest {
|
||||
private static final String RESOURCE = "/runtime-catalog/compiler/";
|
||||
private static final String HEADER = "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";
|
||||
private static final String HEADER = "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";
|
||||
|
||||
@Test
|
||||
void completeManualDefinitionsMatchIndependentlyPublishedProviderRows() throws Exception {
|
||||
var lines = text("INTRINSICS.csv").lines().toList();
|
||||
assertEquals(HEADER, lines.getFirst());
|
||||
assertEquals(106, lines.size());
|
||||
assertEquals(109, lines.size());
|
||||
var actual = new ArrayList<String>();
|
||||
var ids = new HashSet<Integer>();
|
||||
var identities = new HashSet<String>();
|
||||
@@ -32,7 +32,11 @@ class IRVMIntrinsicRegistryParityTest {
|
||||
Integer.toString(d.argSlots()), Integer.toString(d.retSlots()), d.argLayout(), d.retLayout(),
|
||||
Boolean.toString(d.deterministic()), Boolean.toString(d.mayAllocate()), d.parameterNames(),
|
||||
Long.toString(d.costCycles()), Boolean.toString(d.mutatesGuestState()), d.costModel().token(),
|
||||
Long.toString(d.attemptCostCycles()), Integer.toString(d.maxAttempts())));
|
||||
Long.toString(d.attemptCostCycles()), Integer.toString(d.maxAttempts()),
|
||||
Integer.toString(d.profile().schemaVersion()), d.profile().argNullable(),
|
||||
d.profile().invocationModel(), d.profile().scratchModel(), d.profile().contextAccess(),
|
||||
d.profile().costArgIndex()==null?"":Integer.toString(d.profile().costArgIndex()),
|
||||
Long.toString(d.profile().costPerByte())));
|
||||
}
|
||||
assertEquals(lines.subList(1, lines.size()), actual);
|
||||
}
|
||||
@@ -77,7 +81,7 @@ class IRVMIntrinsicRegistryParityTest {
|
||||
assertNotNull(input);
|
||||
properties.load(input);
|
||||
}
|
||||
assertEquals("57992cf214e8a5f9de53a40dba9aaa7fab038c91", properties.getProperty("runtime.revision"));
|
||||
assertEquals("dcf6561ea73446e0a3e1cf1c73eda20923b38df0", properties.getProperty("runtime.revision"));
|
||||
for (var name : List.of("INTRINSICS.csv", "BUILTIN_CONSTANTS.csv")) {
|
||||
assertEquals(properties.getProperty(name + ".sha256"),
|
||||
HexFormat.of().formatHex(MessageDigest.getInstance("SHA-256").digest(bytes(name))));
|
||||
|
||||
+15
@@ -133,6 +133,21 @@ class RuntimeCatalogPipelineTest {
|
||||
assertThrows(BytecodeMarshalingException.class, () -> VERIFIER.verify(emit(badReference)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void nullableStringHashIsAdmittedPerEntryWithoutBroadeningOlderStringIntrinsics() throws Exception {
|
||||
for(boolean optimize:new boolean[]{false,true}) {
|
||||
var plan=new BytecodeEmitter.EmissionPlan(0,ReadOnlyList.from(new BytecodeModule.NullConstant()),null,
|
||||
ReadOnlyList.from(new BytecodeEmitter.FunctionPlan("main",0,0,0,1,ReadOnlyList.from(
|
||||
BytecodeEmitter.Operation.pushConst(0,null),
|
||||
BytecodeEmitter.Operation.intrinsic(0x4102,1,1,null),BytecodeEmitter.Operation.halt()))),REGISTRY);
|
||||
var program=new IRVMProgram(false,plan);
|
||||
if(optimize)program=new OptimizeIRVMService().optimize(program);
|
||||
var module=new BytecodeEmitter().emit(program.coherentEmissionPlan());
|
||||
VERIFIER.verify(module);
|
||||
fixture("catalog-null-hash"+(optimize?"-optimized":""),module);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void stringIntrinsicUsesTheProviderLoadTimeCarrierRule() throws Exception {
|
||||
for (var constant : List.of(new BytecodeModule.StringConstant("#AABBCCDD"), new BytecodeModule.NullConstant())) {
|
||||
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package p.studio.compiler.backend.registry;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import p.studio.compiler.backend.bytecode.*;
|
||||
import p.studio.compiler.backend.irvm.*;
|
||||
import p.studio.compiler.models.*;
|
||||
import p.studio.compiler.models.registry.*;
|
||||
import p.studio.compiler.models.registry.IRRegistry.*;
|
||||
import p.studio.compiler.source.identifiers.*;
|
||||
import p.studio.utilities.structures.ReadOnlyList;
|
||||
import java.nio.file.*;
|
||||
import java.util.ArrayList;
|
||||
import static p.studio.compiler.models.IRBackendExecutableFunction.InstructionKind.*;
|
||||
import static p.studio.compiler.models.registry.IRRegistryInstruction.Kind.*;
|
||||
|
||||
/** Neutral frontend fixtures with independent runtime cost/fault/storage oracles. */
|
||||
class ArrayCopyPipelineTest {
|
||||
@Test void completeGroupsEmptyRangesOverlapAndFaultsUseBothProducerPaths() throws Exception {
|
||||
for(String name:new String[]{"scalar","vec2","string","zero","bad-range","bad-empty-range",
|
||||
"null-source","null-zero","negative-count","huge-count","fault-order"}) generate(name);
|
||||
}
|
||||
private static void generate(String name) throws Exception {
|
||||
int builtin=name.equals("vec2")?2:name.equals("string")?0x14:0x10;
|
||||
var element=TypeRef.builtin(builtin);var array=new TypeRef("copy:array");var holder=new TypeRef("copy:holder");
|
||||
var registry=new IRRegistry(ReadOnlyList.from(new TypeDeclaration(element,null,new Builtin(builtin)),
|
||||
new TypeDeclaration(array,"CopyArray",new Array(element)),
|
||||
new TypeDeclaration(holder,"CopyHolder",new Struct(ReadOnlyList.from(new NamedType(array,"empty"))))),null);
|
||||
var code=new ArrayList<IRBackendExecutableFunction.Instruction>();
|
||||
class Emit {
|
||||
void plain(IRBackendExecutableFunction.InstructionKind kind,String value) {
|
||||
code.add(new IRBackendExecutableFunction.Instruction(kind,null,null,null,null,null,value,null,null,null,null));
|
||||
}
|
||||
void number(long value) {plain(PUSH_I64,Long.toString(value));}
|
||||
void local(IRBackendExecutableFunction.InstructionKind kind) {
|
||||
code.add(new IRBackendExecutableFunction.Instruction(kind,null,null,null,null,null,null,null,0,null,null));
|
||||
}
|
||||
void typed(IRRegistryInstruction.Kind kind,TypeRef type) {
|
||||
code.add(new IRBackendExecutableFunction.Instruction(REGISTRY,null,null,null,null,null,null,null,null,null,null,
|
||||
new IRRegistryInstruction(kind,type,null,null,0)));
|
||||
}
|
||||
}
|
||||
var emit=new Emit();emit.number(12);emit.typed(ARRAY_NEW,array);emit.local(SET_LOCAL);
|
||||
for(int i=0;i<12;i++) {
|
||||
emit.local(GET_LOCAL);emit.number(i);
|
||||
if(builtin==2) {emit.plain(PUSH_F64,Double.toString(i+1));emit.plain(PUSH_F64,Double.toString(-i-1));}
|
||||
else if(builtin==0x14)emit.plain(PUSH_CONST,"slot-"+i+"-Δ");
|
||||
else emit.plain(PUSH_I32,Integer.toString(i+1));
|
||||
emit.typed(ARRAY_SET,array);
|
||||
}
|
||||
if(name.startsWith("null-")||name.equals("fault-order")) {
|
||||
emit.typed(STRUCT_NEW,holder);emit.typed(STRUCT_GET,holder);
|
||||
} else emit.local(GET_LOCAL);
|
||||
emit.number(name.equals("bad-range")?3:name.equals("bad-empty-range")?13:name.equals("zero")?12:0);
|
||||
emit.local(GET_LOCAL);emit.number(name.equals("zero")||name.equals("bad-empty-range")?12:2);
|
||||
emit.number(name.equals("zero")||name.equals("null-zero")||name.equals("bad-empty-range")?0:
|
||||
name.equals("negative-count")||name.equals("fault-order")?-1:name.equals("huge-count")?4294967296L:10);
|
||||
emit.typed(ARRAY_COPY,array);emit.plain(HALT,null);
|
||||
var function=new IRBackendExecutableFunction(new FileId(0),new ModuleId(0),"main",new CallableId(0),0,0,0,1,0,5,
|
||||
ReadOnlyList.wrap(code),null,FunctionMetadata.empty());
|
||||
var backend=IRBackend.builder().entryPointModuleId(new ModuleId(0)).entryPointCallableName("main")
|
||||
.registry(registry).executableFunctions(ReadOnlyList.from(function)).build();
|
||||
for(boolean optimize:new boolean[]{false,true}) {
|
||||
var program=new LowerToIRVMService().lower(backend);
|
||||
if(optimize)program=new OptimizeIRVMService().optimize(program);
|
||||
var module=new BytecodeEmitter().emit(program.coherentEmissionPlan());
|
||||
new BytecodePreloadVerifierService().verify(module);
|
||||
var directory=Path.of("build/registry-conformance");Files.createDirectories(directory);
|
||||
Files.write(directory.resolve("common-copy-"+name+(optimize?"-optimized":"")+".pbx"),module.serialize());
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -63,6 +63,16 @@ class PbxRegistryConformanceTest {
|
||||
assertThrows(BytecodeMarshalingException.class,()->VERIFIER.verify(emptyFunction(hex("01 00 50 00 ff ff ff ff"),0)));
|
||||
for(int op:new int[]{0x54,0x55,0x56,0x70})assertThrows(RuntimeException.class,()->VERIFIER.verify(emptyFunction(new byte[]{1,0,(byte)op,0,0,0,0,0},0)));
|
||||
}
|
||||
@Test void retiredStorageOpcodesRejectEvenAfterHaltAndDataBytesRemainData() throws Exception {
|
||||
for(int opcode:new int[]{0xa7,0xa8,0xaa,0xab}) {
|
||||
var retired=emptyFunction(instructions(op(1),op(opcode,0,0,0,0)),0);
|
||||
assertThrows(BytecodeMarshalingException.class,()->VERIFIER.verify(retired));
|
||||
fixture("retired-storage-"+Integer.toHexString(opcode),retired);
|
||||
// The same value inside an Int32 immediate is not an instruction.
|
||||
var data=emptyFunction(instructions(op(0x17,opcode),op(0x11),op(1)),1);
|
||||
VERIFIER.verify(data);fixture("storage-immediate-"+Integer.toHexString(opcode),data);
|
||||
}
|
||||
}
|
||||
@Test void literalZeroAndExactReturnHeight() {
|
||||
assertThrows(BytecodeMarshalingException.class,()->VERIFIER.verify(emptyFunction(hex("17 00 00 00 00 00 11 00 51 00"),0)));
|
||||
assertThrows(BytecodeMarshalingException.class,()->VERIFIER.verify(emptyFunction(hex("17 00 00 00 00 00 51 00"),1)));
|
||||
|
||||
+43
-19
@@ -31,20 +31,18 @@ class StoragePublicationPipelineTest {
|
||||
}
|
||||
private void number(long value){literal(PUSH_I64,Long.toString(value));}
|
||||
|
||||
@Test void multiObjectFieldsPublishThroughNeutralOrdinaryAndOptimizedProducers() throws Exception {
|
||||
var schema = new TypeRef("synthetic:publication-schema");
|
||||
@Test void ordinaryFieldStoresUseNeutralOrdinaryAndOptimizedProducers() throws Exception {
|
||||
var registry = new IRRegistry(ReadOnlyList.from(
|
||||
new TypeDeclaration(INTEGER,null,new Builtin(0x10)),
|
||||
new TypeDeclaration(LONG,null,new Builtin(0x11)),
|
||||
new TypeDeclaration(OWNER,"State",new Struct(ReadOnlyList.from(
|
||||
new NamedType(LONG,"generation"),new NamedType(INTEGER,"answer")))),
|
||||
new TypeDeclaration(schema,null,new Struct(ReadOnlyList.from(
|
||||
new NamedType(OWNER,null),new NamedType(OWNER,null))))),null);
|
||||
new NamedType(LONG,"generation"),new NamedType(INTEGER,"answer"))))),null);
|
||||
typed(STRUCT_NEW,OWNER,0);local(SET_LOCAL,0);
|
||||
typed(STRUCT_NEW,OWNER,0);local(SET_LOCAL,1);
|
||||
local(GET_LOCAL,0);number(7);literal(PUSH_I32,"20");
|
||||
local(GET_LOCAL,1);number(9);literal(PUSH_I32,"42");
|
||||
typed(FIELDS_PUBLISH,schema,0);
|
||||
local(GET_LOCAL,0);number(7);typed(STRUCT_SET,OWNER,0);
|
||||
local(GET_LOCAL,0);literal(PUSH_I32,"20");typed(STRUCT_SET,OWNER,1);
|
||||
local(GET_LOCAL,1);number(9);typed(STRUCT_SET,OWNER,0);
|
||||
local(GET_LOCAL,1);literal(PUSH_I32,"42");typed(STRUCT_SET,OWNER,1);
|
||||
local(GET_LOCAL,1);typed(STRUCT_GET,OWNER,1);literal(RET,null);
|
||||
var function=new IRBackendExecutableFunction(new FileId(0),new ModuleId(0),"main",new CallableId(0),0,0,0,2,1,6,
|
||||
ReadOnlyList.wrap(instructions),null,new FunctionMetadata(new Signature(null,ReadOnlyList.from(INTEGER)),null,Role.NONE));
|
||||
@@ -60,21 +58,44 @@ class StoragePublicationPipelineTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test void guardsTransfersAndPublicationSurviveBothProducerPaths() throws Exception {
|
||||
@Test void terminalFailureKeepsEarlierStoresAndSourceSpanThroughBothProducerPaths() throws Exception {
|
||||
var registry=new IRRegistry(ReadOnlyList.from(
|
||||
new TypeDeclaration(INTEGER,null,new Builtin(0x10)),new TypeDeclaration(LONG,null,new Builtin(0x11)),
|
||||
new TypeDeclaration(OWNER,"State",new Struct(ReadOnlyList.from(
|
||||
new NamedType(LONG,"generation"),new NamedType(INTEGER,"answer"))))),null);
|
||||
typed(STRUCT_NEW,OWNER,0);local(SET_LOCAL,0);
|
||||
local(GET_LOCAL,0);literal(PUSH_I32,"20");typed(STRUCT_SET,OWNER,1);
|
||||
instructions.add(new IRBackendExecutableFunction.Instruction(TRAP,"",null,null,
|
||||
new p.studio.compiler.source.Span(new FileId(0),12,18)));
|
||||
var function=new IRBackendExecutableFunction(new FileId(0),new ModuleId(0),"main",new CallableId(0),0,18,0,1,1,2,
|
||||
ReadOnlyList.wrap(instructions),null,new FunctionMetadata(new Signature(null,ReadOnlyList.from(INTEGER)),null,Role.NONE));
|
||||
var backend=IRBackend.builder().entryPointModuleId(new ModuleId(0)).entryPointCallableName("main")
|
||||
.registry(registry).executableFunctions(ReadOnlyList.from(function)).build();
|
||||
for(boolean optimize:new boolean[]{false,true}) {
|
||||
var program=new LowerToIRVMService().lower(backend);
|
||||
if(optimize)program=new OptimizeIRVMService().optimize(program);
|
||||
assertTrue(program.module().functions().getFirst().instructions().getLast().op().terminator());
|
||||
var module=new BytecodeEmitter().emit(program.coherentEmissionPlan());
|
||||
new BytecodePreloadVerifierService().verify(module);
|
||||
assertTrue(module.debugInfo().pcToSpan().stream().anyMatch(s->s.span().start()==12&&s.span().end()==18));
|
||||
var directory=Path.of("build/registry-conformance");Files.createDirectories(directory);
|
||||
Files.write(directory.resolve("common-partial-fault"+(optimize?"-optimized":"")+".pbx"),module.serialize());
|
||||
}
|
||||
}
|
||||
|
||||
@Test void typedCopyAndOrdinaryStoresSurviveBothProducerPaths() throws Exception {
|
||||
var registry=new IRRegistry(ReadOnlyList.from(
|
||||
new TypeDeclaration(INTEGER,null,new Builtin(0x10)),new TypeDeclaration(LONG,null,new Builtin(0x11)),
|
||||
new TypeDeclaration(BUFFER,"Buffer",new Array(INTEGER)),
|
||||
new TypeDeclaration(OWNER,"State",new Struct(ReadOnlyList.from(new NamedType(LONG,"generation"),new NamedType(INTEGER,"answer"))))),null);
|
||||
number(3);typed(ARRAY_CHECK_LENGTH,BUFFER,0);
|
||||
number(3);typed(ARRAY_NEW,BUFFER,0);local(SET_LOCAL,0);
|
||||
typed(STRUCT_NEW,OWNER,0);local(SET_LOCAL,1);
|
||||
number(0);number(1);typed(INDEX_GUARD,null,0);
|
||||
for(int i=0;i<2;i++) {local(GET_LOCAL,0);number(i);literal(PUSH_I32,Integer.toString((i+1)*10));typed(ARRAY_SET,BUFFER,0);}
|
||||
local(GET_LOCAL,0);number(0);local(GET_LOCAL,0);number(1);number(2);typed(ARRAY_COPY,BUFFER,0);
|
||||
local(GET_LOCAL,0);number(1);local(GET_LOCAL,0);number(0);number(2);number(2);number(1);
|
||||
literal(PUSH_I32,"7");local(GET_LOCAL,1);number(9);literal(PUSH_I32,"42");
|
||||
instructions.add(new IRBackendExecutableFunction.Instruction(REGISTRY,null,null,null,null,null,null,null,null,null,null,
|
||||
new IRRegistryInstruction(STORAGE_PUBLISH,BUFFER,OWNER,null,0,1)));
|
||||
local(GET_LOCAL,0);number(1);local(GET_LOCAL,0);number(0);number(2);typed(ARRAY_COPY,BUFFER,0);
|
||||
local(GET_LOCAL,0);number(2);literal(PUSH_I32,"7");typed(ARRAY_SET,BUFFER,0);
|
||||
local(GET_LOCAL,1);number(9);typed(STRUCT_SET,OWNER,0);
|
||||
local(GET_LOCAL,1);literal(PUSH_I32,"42");typed(STRUCT_SET,OWNER,1);
|
||||
local(GET_LOCAL,1);typed(STRUCT_GET,OWNER,1);literal(RET,null);
|
||||
var function=new IRBackendExecutableFunction(new FileId(0),new ModuleId(0),"main",new CallableId(0),0,0,0,2,1,11,
|
||||
ReadOnlyList.wrap(instructions),null,new FunctionMetadata(new Signature(null,ReadOnlyList.from(INTEGER)),null,Role.NONE));
|
||||
@@ -83,14 +104,17 @@ class StoragePublicationPipelineTest {
|
||||
for(boolean optimize:new boolean[]{false,true}) {
|
||||
var program=new LowerToIRVMService().lower(backend);
|
||||
if(optimize)program=new OptimizeIRVMService().optimize(program);
|
||||
var publication=program.module().functions().getFirst().instructions().stream()
|
||||
.filter(i->i.op().opcode()==0xaa).findFirst().orElseThrow();
|
||||
assertEquals(18,publication.encodedSize());assertEquals(0,publication.thirdImmediate());assertEquals(1,publication.fourthImmediate());
|
||||
for (var instruction:program.module().functions().getFirst().instructions())
|
||||
assertFalse(java.util.Set.of(0xa7,0xa8,0xaa,0xab).contains(instruction.op().opcode()));
|
||||
var copy=program.module().functions().getFirst().instructions().stream()
|
||||
.filter(i->i.op().opcode()==0xa9).findFirst().orElseThrow();
|
||||
assertEquals(6,copy.encodedSize());
|
||||
var module=new BytecodeEmitter().emit(program.coherentEmissionPlan());
|
||||
new BytecodePreloadVerifierService().verify(module);
|
||||
var directory=Path.of("build/registry-conformance");Files.createDirectories(directory);
|
||||
Files.write(directory.resolve("common-storage"+(optimize?"-optimized":"")+".pbx"),module.serialize());
|
||||
}
|
||||
assertThrows(IllegalArgumentException.class,()->new IRRegistryInstruction(STORAGE_PUBLISH,BUFFER,OWNER,null,1,1));
|
||||
for (int opcode:new int[]{0xa7,0xa8,0xaa,0xab})
|
||||
assertFalse(java.util.Arrays.stream(IRRegistryInstruction.Kind.values()).anyMatch(k->k.opcode()==opcode));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -220,7 +220,7 @@ public class IRBackend implements IRBackendReader {
|
||||
instruction.expectedRetSlots(),
|
||||
instruction.span(), instruction.registryInstruction() == null ? null :
|
||||
new p.studio.compiler.models.registry.IRRegistryInstruction(instruction.registryInstruction().kind(), instruction.registryInstruction().type(), instruction.registryInstruction().targetType(),
|
||||
instruction.registryInstruction().function() == null ? null : remapCallableId(instruction.registryInstruction().function(), callableRemap, "Registry instruction"), instruction.registryInstruction().member(), instruction.registryInstruction().secondMember())));
|
||||
instruction.registryInstruction().function() == null ? null : remapCallableId(instruction.registryInstruction().function(), callableRemap, "Registry instruction"), instruction.registryInstruction().member())));
|
||||
}
|
||||
return new IRBackendExecutableFunction(
|
||||
function.fileId(),
|
||||
|
||||
+2
-1
@@ -385,7 +385,7 @@ public record IRBackendExecutableFunction(
|
||||
throw new IllegalArgumentException("CALL_INTRINSIC must not carry host metadata");
|
||||
}
|
||||
}
|
||||
case HALT, RET, POP, ADD, SUB, MUL, DIV, MOD, EQ, NEQ, LT, LTE, GT, GTE, AND, OR, NOT, NEG -> {
|
||||
case HALT, TRAP, RET, POP, ADD, SUB, MUL, DIV, MOD, EQ, NEQ, LT, LTE, GT, GTE, AND, OR, NOT, NEG -> {
|
||||
if (!calleeCallableName.isBlank() || calleeCallableId != null || hostCall != null || intrinsicCall != null) {
|
||||
throw new IllegalArgumentException(kind + " must not carry callsite metadata");
|
||||
}
|
||||
@@ -457,6 +457,7 @@ public record IRBackendExecutableFunction(
|
||||
NOT,
|
||||
NEG,
|
||||
HALT,
|
||||
TRAP,
|
||||
RET,
|
||||
CALL_FUNC,
|
||||
CALL_HOST,
|
||||
|
||||
+6
-11
@@ -5,32 +5,27 @@ import java.util.Objects;
|
||||
|
||||
/** Semantic Registry operands before image linking. No frontend syntax is exposed. */
|
||||
public record IRRegistryInstruction(Kind kind, IRRegistry.TypeRef type, IRRegistry.TypeRef targetType,
|
||||
CallableId function, int member, int secondMember) {
|
||||
public IRRegistryInstruction(Kind kind, IRRegistry.TypeRef type, IRRegistry.TypeRef targetType, CallableId function, int member) {
|
||||
this(kind,type,targetType,function,member,0);
|
||||
}
|
||||
CallableId function, int member) {
|
||||
public enum Kind {
|
||||
MAKE_CLOSURE(0x52), CALL_CLOSURE(0x53), GET_CAPTURE(0x57), CALL_TRAIT(0x58),
|
||||
DYN_PACK(0x90), DYN_UNPACK(0x91), DYN_CAN_UNPACK(0x92),
|
||||
REF_IS_EXACT(0x93), REF_IMPLEMENTS(0x94), REF_TO_TRAIT(0x95), REF_CAST(0x96),
|
||||
STRUCT_NEW(0xa0), STRUCT_GET(0xa1), STRUCT_SET(0xa2),
|
||||
ARRAY_NEW(0xa3), ARRAY_LEN(0xa4), ARRAY_GET(0xa5), ARRAY_SET(0xa6),
|
||||
INDEX_GUARD(0xa7), ARRAY_CHECK_LENGTH(0xa8), ARRAY_COPY(0xa9), STORAGE_PUBLISH(0xaa), FIELDS_PUBLISH(0xab);
|
||||
ARRAY_COPY(0xa9);
|
||||
private final int opcode;
|
||||
Kind(int opcode) { this.opcode=opcode; }
|
||||
public int opcode(){return opcode;}
|
||||
}
|
||||
public IRRegistryInstruction {
|
||||
Objects.requireNonNull(kind);
|
||||
if(member<0 || secondMember<0)throw new IllegalArgumentException("negative member index");
|
||||
if(kind!=Kind.GET_CAPTURE && kind!=Kind.INDEX_GUARD)Objects.requireNonNull(type,"type");
|
||||
if(kind!=Kind.STORAGE_PUBLISH && secondMember!=0)throw new IllegalArgumentException("unexpected second member");
|
||||
if(kind==Kind.STORAGE_PUBLISH && member==secondMember)throw new IllegalArgumentException("publication fields must differ");
|
||||
if(member<0)throw new IllegalArgumentException("negative member index");
|
||||
if(kind!=Kind.GET_CAPTURE)Objects.requireNonNull(type,"type");
|
||||
if(kind==Kind.MAKE_CLOSURE) {Objects.requireNonNull(function,"function");function.getIndex();}
|
||||
else if(function!=null)throw new IllegalArgumentException("unexpected function operand");
|
||||
boolean pair=(kind.opcode()>=0x93&&kind.opcode()<=0x96)||kind==Kind.STORAGE_PUBLISH;
|
||||
boolean pair=(kind.opcode()>=0x93&&kind.opcode()<=0x96);
|
||||
if(pair)Objects.requireNonNull(targetType,"targetType");
|
||||
else if(targetType!=null)throw new IllegalArgumentException("unexpected target type");
|
||||
if((kind==Kind.GET_CAPTURE||kind==Kind.INDEX_GUARD)&&type!=null)throw new IllegalArgumentException("capture index is not a TypeId");
|
||||
if(kind==Kind.GET_CAPTURE&&type!=null)throw new IllegalArgumentException("capture index is not a TypeId");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,71 +226,81 @@ The full harness also requires these fixtures. The driver uses an external
|
||||
runtime checkout without editing its sources or changing PBX, ISA or quotas.
|
||||
|
||||
|
||||
## SDK List, shared Cursor and generic storage
|
||||
## Minimal storage ISA, SDK collections and phase-aware refusals
|
||||
|
||||
Generate the source corpus and the language-neutral storage fixtures, then run:
|
||||
Generate common/source fixtures and the real installed-JAR examples, then run:
|
||||
|
||||
```sh
|
||||
./gradlew :prometeu-compiler:prometeu-build-pipeline:test :prometeu-architecture-tests:test :prometeu-app:installedKnowledgeTest
|
||||
python3 tools/pbx-conformance/run.py --runtime ../runtime --list-cursor-only
|
||||
CARGO_TARGET_DIR=/tmp/studio-pbx-conformance python3 tools/pbx-conformance/run.py --runtime ../runtime
|
||||
CARGO_TARGET_DIR=/tmp/studio-pbx-conformance python3 tools/pbx-conformance/run.py --runtime ../runtime --release
|
||||
```
|
||||
|
||||
The full harness also requires this corpus. Missing ordinary, optimized, quota,
|
||||
GC, import/reexport or installed-JAR fixtures fail explicitly. Two synthetic
|
||||
common-IR programs execute INDEX_GUARD, ARRAY_CHECK_LENGTH, ARRAY_COPY and
|
||||
STORAGE_PUBLISH through ordinary and optimized producer paths without PBS types.
|
||||
List source cases cover every mutator, exact growth, logical versus physical
|
||||
bounds, int/long arguments (including named application), holes, aliases,
|
||||
vec2/pixel/tuple/Fn/contract/reference groups and every state of a Cursor that remains on its last node.
|
||||
An independent producer distinguishes some(none) from an empty Cursor.
|
||||
Focused `--list-cursor-only` and `--linked-only` modes include mandatory neutral
|
||||
storage/copy/terminal/admission fixtures as well as their collection corpus. The
|
||||
complete run requires both. No runtime source, manifest, lockfile or target
|
||||
artifact is modified: the Cargo harness and target live outside that checkout.
|
||||
|
||||
Four source-generated mutation fixtures expose explicit before/completed markers.
|
||||
The harness lowers GuestBytes, HandleSlots, AuxiliaryBytes and TemporaryBytes from
|
||||
measured setup/success peaks. After each refused attempt it independently observes
|
||||
all List fields and complete backing groups, including reference generations and
|
||||
presence tags. Coverage gates require refusals in no-growth publication scratch,
|
||||
removeAt optional return allocation, candidate allocation, node construction and
|
||||
operand/frame preparation. Read-only resource diagnostics use non-owning storage
|
||||
observations outside guest execution; no observation introduces a GC root or write.
|
||||
The selected provider supports ARRAY_LEN and ARRAY_COPY, ordinary typed stores
|
||||
and terminal TRAP. Four dead-code fixtures prove that 0xA7/0xA8/0xAA/0xAB reject
|
||||
at real instruction positions; corresponding Int32-immediate fixtures must load.
|
||||
All producer-opcode checks decode instruction boundaries rather than scanning
|
||||
raw PBX bytes. Neutral ordinary/optimized programs qualify stores and copy without
|
||||
PBS types. A store followed by TRAP_EXPLICIT proves that terminal failure retains
|
||||
previous effects and source spans survive lowering/optimization.
|
||||
|
||||
The controlled safepoint fixture expects 1,200 nodes/objects initially, one after
|
||||
traversal, one after repeated next on the final node, and zero after releasing the
|
||||
Cursor. It also requires no live source/snapshot array. Shared payload fields stay
|
||||
observable; prefix roots and the final payload obey normal reachability and GC.
|
||||
The installed fixture is compiled by the isolated installDist JVM using the actual
|
||||
packaged spec/example/SDK, then loaded and executed by this production VM harness.
|
||||
Eleven paired neutral copy cases independently check scalar/vec2/String groups,
|
||||
snapshot overlap, empty ranges, bad ranges/receivers, negative/above-u32 counts
|
||||
and fault precedence. At the actual copy PC, zero budget executes nothing;
|
||||
positive budget admits a complete attempt with overshoot. N=10/W=1 costs 24,
|
||||
including receiver/range/scratch refusal; W=2 costs 44. Invalid or empty counts
|
||||
cost base 4 as defined by the provider. Refusals preserve the five operands and
|
||||
previous storage, release scratch and do not count a successful step. Native
|
||||
String owners release with the session. Checked cost-overflow defenses requiring
|
||||
synthetic internal widths are provider evidence, not an assertion that admitted
|
||||
consumer layouts can attain those widths.
|
||||
|
||||
Evidence prints compiler/provider source hashes, exact provider revision and dirty
|
||||
state, toolchain, platform/profile, capabilities, every default VM ceiling and each
|
||||
explicitly lowered refusal limit. Development runs against a dirty provider are
|
||||
identified as such; final catalog verification requires its clean selected commit.
|
||||
List source fixtures cover every mutator, exact growth, logical versus physical
|
||||
bounds, int/long and named evaluation, holes, aliases and complete native/tuple/
|
||||
Fn/contract/reference groups. Linked fixtures cover empty/single/multiple states,
|
||||
reciprocal links, nearest-end lookup, complete values and both snapshot orders.
|
||||
Logical SDK refusals now produce TRAP_EXPLICIT; physical instructions retain
|
||||
their own faults. No missing ordinary or optimized fixture is silently skipped.
|
||||
|
||||
Four List and ten Linked source-generated mutation boundaries have normal and
|
||||
optimized variants. GuestBytes, HandleSlots, AuxiliaryBytes and TemporaryBytes
|
||||
ceilings are lowered from measured setup/success peaks. Non-owning diagnostic
|
||||
observations inspect the original collection objects independently of guest code.
|
||||
Every instruction prefix is compared with the corresponding successful prefix.
|
||||
A refused instruction preserves its own observable entry state. Before visible
|
||||
mutation the entire old collection must remain unchanged; after mutation the
|
||||
previous successful writes remain, without a whole-method rollback or safe-reuse
|
||||
claim. Successful single-instruction-budget traversal also qualifies suspension
|
||||
and resumption in the middle of a source method. Snapshot capture failures must
|
||||
always preserve their source and expose no partial result.
|
||||
|
||||
## SDK Linked and multi-object publication
|
||||
No-growth insertion prepares a one-slot private array before shifting and copies
|
||||
that complete stored group into place; candidate/optional/result and operand/
|
||||
frame preparation remain charged. ARRAY_COPY scratch remains a mandatory observed
|
||||
refusal. Linked prepares nodes/results before its sequential link updates. The
|
||||
corpus retains explicit coverage requirements for these resource refusal paths;
|
||||
it does not rename old publication guarantees as new evidence.
|
||||
|
||||
```sh
|
||||
./gradlew :prometeu-compiler:prometeu-build-pipeline:test :prometeu-architecture-tests:test :prometeu-app:installedKnowledgeTest
|
||||
python3 tools/pbx-conformance/run.py --runtime ../runtime --linked-only
|
||||
```
|
||||
Normal GC safepoints qualify removed nodes and payloads, collection clear,
|
||||
snapshot independence, consumed-prefix reclamation and sticky final values.
|
||||
The Cursor fixture requires 1,200 -> 1 -> 1 -> 0 snapshot nodes/payloads, with no
|
||||
live source/snapshot array. Linked captures must not retain editable source nodes.
|
||||
The actual installed SDK/spec/example is compiled outside the checkout and its
|
||||
PBX is loaded/executed by the production VM; import/reexport fixtures also run.
|
||||
|
||||
The full harness requires this corpus too. Ordinary and optimized source programs
|
||||
exercise the complete Linked API, both snapshot orders, empty/single/multiple
|
||||
states, reciprocal links, identities and full native/tuple/contract/Fn groups,
|
||||
logical and long bounds, contextual construction and source/named evaluation.
|
||||
Neutral common-IR fixtures execute FIELDS_PUBLISH without PBS or collection types.
|
||||
Catalog schema 2 is imported with all 25 fields, per-entry nullable masks,
|
||||
explicit invocation/scratch/context profiles and cost parameters. Ordinary parity
|
||||
and rejection tests need no runtime checkout. Explicit exporter verification uses
|
||||
`tools/runtime-catalog/verify.py` and the selected clean SHA/digests. Nullable
|
||||
hash.string metadata is qualified independently of older non-nullable String
|
||||
entries; importing it does not deliver PBS hashing facades or Set/Map.
|
||||
|
||||
Ten explicit mutation boundaries qualify every mutation and both captures. The
|
||||
harness lowers resource ceilings around measured setup/success peaks and compares
|
||||
all prior Linked roots, optional-link carriers, nodes and complete groups after
|
||||
each refusal. Node allocation, optional removed-value preparation, snapshot-node
|
||||
allocation and frame/operand preparation must all produce observed refusals.
|
||||
Publication itself uses no allocation or scratch; provider tests prove it succeeds
|
||||
at already exhausted allocation ceilings and rejects late invalid groups before
|
||||
any write, including for null destinations and aliased targets.
|
||||
|
||||
Normal GC safepoints qualify removal/clear without snapshots (1,200 → 1,197 → 0
|
||||
nodes and payloads), and snapshot traversal (1,200 → 1 → 1 → 0). Fixtures introduce
|
||||
ordinary garbage pressure so every asserted round performs an actual collection.
|
||||
Snapshots retain no editable Linked nodes. Source imports/reexports and a separately
|
||||
compiled installed-JAR example must execute; its forward/reverse traversals retain
|
||||
final values 22/20 after later replacement and clear. Missing fixtures are failures.
|
||||
Evidence prints consumer/provider source hashes, selected revision and clean state,
|
||||
toolchain/platform/profile, lockfile/catalog hashes, capabilities, default ceilings
|
||||
and lowered refusal limits. Keep new qualification separate from historical List/
|
||||
Linked evidence; prior successful providers are not relabeled as the new target.
|
||||
|
||||
+150
-24
@@ -283,7 +283,7 @@ fn main() {
|
||||
fn verify_catalog_fixtures(root: &std::path::Path) {
|
||||
use prometeu_vm::LogicalFrameEndingReason as End;
|
||||
let mut random_cycles = None;
|
||||
for name in ["catalog-random-off", "catalog-random-on", "catalog-constants", "catalog-vec2-zero", "catalog-input", "catalog-string"] {
|
||||
for name in ["catalog-random-off", "catalog-random-on", "catalog-constants", "catalog-vec2-zero", "catalog-input", "catalog-string", "catalog-null-hash", "catalog-null-hash-optimized"] {
|
||||
let bytes = std::fs::read(root.join(format!("{name}.pbx"))).unwrap();
|
||||
let image = ValidatedProgramImage::load(&bytes, &mut LoadBudget::new(LoadLimits::default()), caps::NONE)
|
||||
.unwrap_or_else(|error| panic!("{name}: {error:?}"));
|
||||
@@ -309,6 +309,10 @@ fn verify_catalog_fixtures(root: &std::path::Path) {
|
||||
assert_eq!(vm.operand_stack_top(2), vec![Value::Float(0.0), Value::Float(0.0)]);
|
||||
} else if name == "catalog-string" {
|
||||
assert_eq!(vm.operand_stack_top(1), vec![Value::Int64(0xAABBCCDD)]);
|
||||
} else if name.starts_with("catalog-null-hash") {
|
||||
assert_eq!(vm.operand_stack_top(1),vec![Value::Int64(0)],"provider null hash vector");
|
||||
use prometeu_bytecode::isa::core::CoreOpCode as Op;
|
||||
assert_eq!(report.cycles_used,Op::PushConst.cycles()+8+Op::Halt.cycles());
|
||||
} else {
|
||||
let mut constants: Vec<_> = prometeu_vm::builtin_constant_catalog().collect();
|
||||
constants.sort_by_key(|constant| constant.key.key());
|
||||
@@ -1040,12 +1044,12 @@ fn verify_pbs_random_fixtures(root: &std::path::Path) {
|
||||
|
||||
fn verify_pbs_list_cursor_fixtures(root: &std::path::Path) {
|
||||
use prometeu_vm::{LogicalFrameEndingReason as End, resource_budget::{RuntimeLimits,RuntimeResource}};
|
||||
use prometeu_bytecode::{TRAP_OOB,TRAP_RESOURCE_LIMIT};
|
||||
use prometeu_bytecode::TRAP_EXPLICIT;
|
||||
let successful=["basic","construction","capacity","holes","structural-growth","cursor-empty","cursor-single",
|
||||
"cursor-many","snapshot","false-present","shared-optional","identity","tuple","nested-array","function","evaluation","vec2","pixel","contract"];
|
||||
let faults=[("fault-read",TRAP_OOB),("fault-write",TRAP_OOB),("fault-negative",TRAP_OOB),
|
||||
("fault-insert",TRAP_OOB),("fault-length",TRAP_OOB),("fault-overflow",TRAP_RESOURCE_LIMIT),
|
||||
("fault-long-index",TRAP_OOB),("fault-constructor",TRAP_OOB)];
|
||||
let faults=[("fault-read",TRAP_EXPLICIT),("fault-write",TRAP_EXPLICIT),("fault-negative",TRAP_EXPLICIT),
|
||||
("fault-insert",TRAP_EXPLICIT),("fault-length",TRAP_EXPLICIT),("fault-overflow",TRAP_EXPLICIT),
|
||||
("fault-long-index",TRAP_EXPLICIT),("fault-constructor",TRAP_EXPLICIT)];
|
||||
let cases=successful.into_iter().map(|n|(n,None)).chain(faults.into_iter().map(|(n,c)|(n,Some(c))))
|
||||
.flat_map(|(name,fault)|[(name.to_string(),fault),(format!("{name}-optimized"),fault)]);
|
||||
for (name,fault) in cases {
|
||||
@@ -1087,14 +1091,50 @@ fn list_storage(vm:&VirtualMachine,image:&ValidatedProgramImage)->(prometeu_vm::
|
||||
(object,array)
|
||||
}
|
||||
|
||||
// Non-owning diagnostic snapshots observe only objects reachable before the operation.
|
||||
// Compare every instruction prefix against a successful execution, so a refused
|
||||
// instruction preserves its own entry state without inventing method rollback.
|
||||
type ObservedStorage = Vec<prometeu_vm::resource_diagnostics::StorageObject>;
|
||||
type MutationPrefix = (usize, ObservedStorage);
|
||||
fn observe_originals(vm:&VirtualMachine, original:&ObservedStorage)->ObservedStorage {
|
||||
let objects=vm.heap().diagnostic_typed_storage();
|
||||
original.iter().filter_map(|old|objects.iter().find(|now|now.reference==old.reference).cloned()).collect()
|
||||
}
|
||||
fn trace_collection_attempt(vm:&mut VirtualMachine, original:&ObservedStorage, stop_pc:usize)
|
||||
->(prometeu_vm::BudgetReport, Vec<MutationPrefix>, bool) {
|
||||
use prometeu_vm::LogicalFrameEndingReason as End;
|
||||
let mut prefixes=Vec::new(); let mut mutated=false;
|
||||
for _ in 0..200_000 {
|
||||
let before=observe_originals(vm,original);
|
||||
mutated|=before!=*original;
|
||||
prefixes.push((vm.pc(),before.clone()));
|
||||
let report=vm.run_budget(1,&mut NoNative,&mut HostContext::new(None)).unwrap();
|
||||
let after=observe_originals(vm,original);
|
||||
if matches!(report.reason,End::Trap(_)) {
|
||||
assert_eq!(after,before,"refused instruction preserves its own observable entry state");
|
||||
}
|
||||
mutated|=after!=*original;
|
||||
if vm.pc()==stop_pc || !matches!(report.reason,End::BudgetExhausted) {return (report,prefixes,mutated);}
|
||||
}
|
||||
panic!("collection operation did not reach its completion marker");
|
||||
}
|
||||
fn assert_mutation_prefix(actual:&[MutationPrefix], successful:&[MutationPrefix]) {
|
||||
assert!(actual.len()<=successful.len(),"refusal must be a successful instruction prefix");
|
||||
for (index,(left,right)) in actual.iter().zip(successful).enumerate() {
|
||||
assert_eq!(left,right,"observable effects differ at source-operation instruction {index}");
|
||||
}
|
||||
}
|
||||
|
||||
fn verify_list_cursor_refusals(root:&std::path::Path) {
|
||||
use prometeu_vm::{LogicalFrameEndingReason as End, resource_budget::{RuntimeLimits,RuntimeResource as Q}};
|
||||
use prometeu_vm::resource_diagnostics::StorageValue as V;
|
||||
use prometeu_bytecode::{decode_next,TRAP_RESOURCE_LIMIT};
|
||||
use prometeu_bytecode::isa::core::CoreOpCode as Op;
|
||||
let mut publication_scratch=false;let mut return_carrier=false;let mut nodes=false;let mut candidate=false;let mut operand_preparation=false;
|
||||
let mut copy_scratch=false;let mut return_carrier=false;let mut nodes=false;let mut candidate=false;let mut operand_preparation=false;
|
||||
for name in ["insert","remove","growth","cursor"] {
|
||||
let bytes=std::fs::read(root.join(format!("pbs-list-refusal-{name}.pbx"))).expect("mandatory refusal fixture");
|
||||
for suffix in ["","-optimized"] {
|
||||
println!("PHASE CORPUS list {name}{suffix}");
|
||||
let bytes=std::fs::read(root.join(format!("pbs-list-refusal-{name}{suffix}.pbx"))).expect("mandatory refusal fixture");
|
||||
let image=ValidatedProgramImage::load(&bytes,&mut LoadBudget::new(LoadLimits::default()),caps::NONE).unwrap();
|
||||
let marker=|value:i32| {
|
||||
let mut pc=0;let mut found=Vec::new();
|
||||
@@ -1113,7 +1153,9 @@ fn verify_list_cursor_refusals(root:&std::path::Path) {
|
||||
assert!(matches!(baseline.run_budget(20_000_000,&mut NoNative,&mut HostContext::new(None)).unwrap().reason,End::Breakpoint));
|
||||
let before=baseline.resource_snapshot();let original=list_storage(&baseline,&image);
|
||||
baseline.remove_breakpoint(before_pc);
|
||||
assert!(matches!(baseline.run_budget(20_000_000,&mut NoNative,&mut HostContext::new(None)).unwrap().reason,End::Breakpoint));
|
||||
let watched=vec![original.0.clone(),original.1.clone()];
|
||||
let (completed_report,successful_prefix,_)=trace_collection_attempt(&mut baseline,&watched,after_pc);
|
||||
assert!(matches!(completed_report.reason,End::BudgetExhausted|End::Breakpoint) && baseline.pc()==after_pc,"operation completion: {completed_report:?}");
|
||||
let completed=baseline.resource_snapshot();let changed=list_storage(&baseline,&image);
|
||||
let expected_size=match name {"insert"|"growth"=>129,"remove"=>127,_=>128};
|
||||
assert_eq!(changed.0.groups[1],[V::Int64(expected_size)],"{name} logical size after success");
|
||||
@@ -1135,12 +1177,16 @@ fn verify_list_cursor_refusals(root:&std::path::Path) {
|
||||
assert!(matches!(setup.reason,End::Breakpoint),"{name} setup at {q:?}={limit}: {setup:?}");
|
||||
let state=list_storage(&vm,&image);
|
||||
vm.remove_breakpoint(before_pc);
|
||||
let report=vm.run_budget(20_000_000,&mut NoNative,&mut HostContext::new(None)).unwrap();
|
||||
let watched=vec![state.0.clone(),state.1.clone()];
|
||||
let (report,prefix,mutated)=trace_collection_attempt(&mut vm,&watched,after_pc);
|
||||
assert_mutation_prefix(&prefix,&successful_prefix);
|
||||
if let End::Trap(info)=report.reason {
|
||||
assert_eq!(info.code,TRAP_RESOURCE_LIMIT,"{name} at {q:?}={limit}: {info:?}");
|
||||
assert_eq!(list_storage(&vm,&image),state,"{name}: no partial slots/backing/size at {q:?}={limit}");
|
||||
if !mutated || name=="cursor" {
|
||||
assert_eq!(list_storage(&vm,&image),state,"{name}: failure before mutation preserves slots/backing/size");
|
||||
}
|
||||
let instruction=decode_next(info.pc as usize,image.code()).unwrap();
|
||||
publication_scratch|=q==Q::TemporaryBytes&&instruction.opcode==Op::StoragePublish;
|
||||
copy_scratch|=q==Q::TemporaryBytes&&instruction.opcode==Op::ArrayCopy;
|
||||
operand_preparation|=q==Q::AuxiliaryBytes;
|
||||
candidate|=name=="growth"&&instruction.opcode==Op::ArrayNew;
|
||||
if instruction.opcode==Op::StructNew {
|
||||
@@ -1155,15 +1201,16 @@ fn verify_list_cursor_refusals(root:&std::path::Path) {
|
||||
}
|
||||
}
|
||||
refusals+=1;
|
||||
println!("PBS LIST ATOMIC REFUSAL {name} resource={q:?} limit={limit} opcode={:?}",instruction.opcode);
|
||||
} else {assert!(matches!(report.reason,End::Breakpoint),"{name}: {report:?}");}
|
||||
println!("PBS LIST PHASE REFUSAL {name} mutated={mutated} resource={q:?} limit={limit} opcode={:?}",instruction.opcode);
|
||||
} else {assert!(matches!(report.reason,End::BudgetExhausted|End::Breakpoint) && vm.pc()==after_pc,"{name}: {report:?}");}
|
||||
drop(vm);
|
||||
for resource in [Q::GuestBytes,Q::HandleSlots,Q::AuxiliaryBytes,Q::TemporaryBytes] {assert_eq!(observer.used(resource),0);}
|
||||
}
|
||||
}
|
||||
assert!(refusals>0,"{name}: mandatory source refusals executed");
|
||||
}
|
||||
assert!(publication_scratch,"no-growth publication scratch refusal");
|
||||
}
|
||||
assert!(copy_scratch,"no-growth copy scratch refusal");
|
||||
assert!(return_carrier,"removeAt optional return allocation refusal");
|
||||
assert!(candidate,"growth candidate allocation refusal");
|
||||
assert!(nodes,"snapshot node allocation refusal");
|
||||
@@ -1197,8 +1244,64 @@ fn verify_collection_cursor_gc(root:&std::path::Path,collection:&str) {
|
||||
assert!(matches!(report.reason,End::Halted|End::EndOfRom));assert_eq!(vm.operand_stack_top(1),vec![Value::Int32(42)]);
|
||||
}
|
||||
|
||||
fn verify_copy_attempts(root:&std::path::Path) {
|
||||
use prometeu_vm::{LogicalFrameEndingReason as End,resource_budget::{RuntimeLimits,RuntimeResource as Q}};
|
||||
use prometeu_bytecode::{decode_next,isa::core::CoreOpCode as Op,TRAP_OOB,TRAP_NULL_REFERENCE,TRAP_RESOURCE_LIMIT};
|
||||
for base in ["scalar","vec2","string","zero","bad-range","bad-empty-range","null-source","null-zero","negative-count","huge-count","fault-order"] {
|
||||
for optimized in [false,true] {
|
||||
let name=format!("common-copy-{base}{}",if optimized{"-optimized"}else{""});
|
||||
let bytes=std::fs::read(root.join(format!("{name}.pbx"))).expect("mandatory copy oracle");
|
||||
let image=ValidatedProgramImage::load(&bytes,&mut LoadBudget::new(LoadLimits::default()),caps::NONE).unwrap();
|
||||
let mut pc=0;let mut copies=Vec::new();
|
||||
while pc<image.code().len() {
|
||||
let instruction=decode_next(pc,image.code()).unwrap();
|
||||
assert!(![0xa7,0xa8,0xaa,0xab].contains(&(instruction.opcode as u16)));
|
||||
if instruction.opcode==Op::ArrayCopy {copies.push(pc);} pc=instruction.next_pc;
|
||||
}
|
||||
assert_eq!(copies.len(),1);let copy_pc=copies[0];
|
||||
let prepare=|limits| {
|
||||
let mut vm=VirtualMachine::from_image(image.clone(),limits);vm.prepare_boot_call().unwrap();vm.insert_breakpoint(copy_pc);
|
||||
assert!(matches!(vm.run_budget(1_000_000,&mut NoNative,&mut HostContext::new(None)).unwrap().reason,End::Breakpoint));vm
|
||||
};
|
||||
let mut vm=prepare(RuntimeLimits::default());let observer=vm.resource_observer();
|
||||
let before=vm.heap().diagnostic_typed_storage();let operands=vm.operand_stack_top(5).to_vec();
|
||||
let scratch_floor=vm.resource_snapshot().budget.peaks[Q::TemporaryBytes as usize];
|
||||
let zero=vm.run_budget(0,&mut NoNative,&mut HostContext::new(None)).unwrap();
|
||||
assert_eq!((zero.cycles_used,zero.steps_executed,vm.pc()),(0,0,copy_pc));
|
||||
let report=vm.run_budget(1,&mut NoNative,&mut HostContext::new(None)).unwrap();
|
||||
let cycles=if base=="vec2"{44}else if ["zero","bad-empty-range","null-zero","negative-count","huge-count","fault-order"].contains(&base){4}else{24};
|
||||
assert_eq!(report.cycles_used,cycles,"{name}: precharged cost");
|
||||
let fault=if base.starts_with("null-")||base=="fault-order"{Some(TRAP_NULL_REFERENCE)}
|
||||
else if ["bad-range","bad-empty-range","negative-count","huge-count"].contains(&base){Some(TRAP_OOB)}else{None};
|
||||
if let Some(code)=fault {
|
||||
let End::Trap(info)=report.reason else {panic!("{name}: {report:?}")};
|
||||
assert_eq!(info.code,code);assert_eq!(report.steps_executed,0);
|
||||
assert_eq!(vm.operand_stack_top(5),operands);assert_eq!(vm.heap().diagnostic_typed_storage(),before);
|
||||
} else {
|
||||
assert!(matches!(report.reason,End::BudgetExhausted));assert_eq!(report.steps_executed,1);
|
||||
let mut expected=before.clone();
|
||||
if base!="zero" {for i in 0..10 {expected[0].groups[i+2]=before[0].groups[i].clone();}}
|
||||
assert_eq!(vm.heap().diagnostic_typed_storage(),expected,"{name}: snapshot overlap and complete native groups");
|
||||
}
|
||||
assert_eq!(observer.used(Q::TemporaryBytes),0,"copy releases provisional scratch");
|
||||
drop(vm);for resource in [Q::GuestBytes,Q::HandleSlots,Q::AuxiliaryBytes,Q::TemporaryBytes,Q::StringBytes,Q::StringAllocations] {assert_eq!(observer.used(resource),0);}
|
||||
if base=="scalar" {
|
||||
let mut refused=prepare(RuntimeLimits::default().lowered(Q::TemporaryBytes,scratch_floor).unwrap());
|
||||
let before=refused.heap().diagnostic_typed_storage();let operands=refused.operand_stack_top(5).to_vec();
|
||||
let report=refused.run_budget(1,&mut NoNative,&mut HostContext::new(None)).unwrap();
|
||||
assert!(matches!(report.reason,End::Trap(ref info) if info.code==TRAP_RESOURCE_LIMIT),"scratch refusal: {report:?}");
|
||||
assert_eq!((report.cycles_used,report.steps_executed),(24,0));
|
||||
assert_eq!(refused.heap().diagnostic_typed_storage(),before);assert_eq!(refused.operand_stack_top(5),operands);
|
||||
assert_eq!(refused.resource_observer().used(Q::TemporaryBytes),0);
|
||||
}
|
||||
println!("COMMON COPY COST/FAULT/GROUP PASS {name} cycles={cycles}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn verify_common_storage_fixtures(root:&std::path::Path) {
|
||||
use prometeu_vm::{LogicalFrameEndingReason as End,resource_budget::RuntimeLimits};
|
||||
verify_copy_attempts(root);
|
||||
for name in ["common-storage","common-storage-optimized","common-fields","common-fields-optimized"] {
|
||||
let bytes=std::fs::read(root.join(format!("{name}.pbx"))).expect("mandatory non-PBS storage fixture");
|
||||
let image=ValidatedProgramImage::load(&bytes,&mut LoadBudget::new(LoadLimits::default()),caps::NONE).unwrap();
|
||||
@@ -1207,7 +1310,23 @@ fn verify_common_storage_fixtures(root:&std::path::Path) {
|
||||
assert!(matches!(report.reason,End::Halted|End::EndOfRom),"{name}: {report:?}");
|
||||
assert_eq!(vm.operand_stack_top(1),vec![Value::Int32(42)]);
|
||||
println!("COMMON STORAGE SOURCE/LOAD/EXEC PASS {name}");
|
||||
} for opcode in [0xa7,0xa8,0xaa,0xab] {
|
||||
let bytes=std::fs::read(root.join(format!("retired-storage-{opcode:x}.pbx"))).expect("mandatory dead-opcode refusal");
|
||||
assert!(ValidatedProgramImage::load(&bytes,&mut LoadBudget::new(LoadLimits::default()),caps::NONE).is_err());
|
||||
let data=std::fs::read(root.join(format!("storage-immediate-{opcode:x}.pbx"))).unwrap();
|
||||
assert!(ValidatedProgramImage::load(&data,&mut LoadBudget::new(LoadLimits::default()),caps::NONE).is_ok());
|
||||
}
|
||||
for suffix in ["","-optimized"] {
|
||||
let bytes=std::fs::read(root.join(format!("common-partial-fault{suffix}.pbx"))).unwrap();
|
||||
let image=ValidatedProgramImage::load(&bytes,&mut LoadBudget::new(LoadLimits::default()),caps::NONE).unwrap();
|
||||
let mut vm=VirtualMachine::from_image(image,RuntimeLimits::default());vm.prepare_boot_call().unwrap();
|
||||
let report=vm.run_budget(100_000,&mut NoNative,&mut HostContext::new(None)).unwrap();
|
||||
assert!(matches!(report.reason,End::Trap(ref info) if info.code==prometeu_bytecode::TRAP_EXPLICIT));
|
||||
use prometeu_vm::resource_diagnostics::StorageValue as V;
|
||||
assert_eq!(vm.heap().diagnostic_typed_storage()[0].groups[1],[V::Int32(20)],"terminal fault does not undo prior store");
|
||||
println!("COMMON PARTIAL FAULT PASS {suffix}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fn verify_list_cursor_distribution(root:&std::path::Path) { verify_collection_distribution(root,"list",22); }
|
||||
@@ -1243,11 +1362,11 @@ fn verify_collection_distribution(root:&std::path::Path,collection:&str,last:i32
|
||||
|
||||
fn verify_pbs_linked_fixtures(root: &std::path::Path) {
|
||||
use prometeu_vm::{LogicalFrameEndingReason as End, resource_budget::{RuntimeLimits,RuntimeResource}};
|
||||
use prometeu_bytecode::TRAP_OOB;
|
||||
use prometeu_bytecode::TRAP_EXPLICIT;
|
||||
let successful=["basic","links","construction","long-size","empty-cursor","empty-reverseCursor",
|
||||
"single-cursor","single-reverseCursor","snapshot","false-present","optional-field","identity","tuple","nested-array","function","evaluation","vec2","pixel","contract"];
|
||||
let faults=[("fault-read",TRAP_OOB),("fault-write",TRAP_OOB),("fault-negative",TRAP_OOB),
|
||||
("fault-insert",TRAP_OOB),("fault-remove",TRAP_OOB),("fault-overflow",TRAP_OOB),("fault-long-index",TRAP_OOB)];
|
||||
let faults=[("fault-read",TRAP_EXPLICIT),("fault-write",TRAP_EXPLICIT),("fault-negative",TRAP_EXPLICIT),
|
||||
("fault-insert",TRAP_EXPLICIT),("fault-remove",TRAP_EXPLICIT),("fault-overflow",TRAP_EXPLICIT),("fault-long-index",TRAP_EXPLICIT)];
|
||||
let cases=successful.into_iter().map(|n|(n,None)).chain(faults.into_iter().map(|(n,c)|(n,Some(c))))
|
||||
.flat_map(|(name,fault)|[(name.to_string(),fault),(format!("{name}-optimized"),fault)]);
|
||||
for (name,fault) in cases {
|
||||
@@ -1301,7 +1420,9 @@ fn verify_linked_refusals(root:&std::path::Path) {
|
||||
use prometeu_bytecode::isa::core::CoreOpCode as Op;
|
||||
let mut node_allocation=false;let mut optional_return=false;let mut snapshot_allocation=false;let mut preparation=false;
|
||||
for name in ["insert","add","addFirst","remove","removeFirst","removeLast","replace","clear","cursor","reverseCursor"] {
|
||||
let bytes=std::fs::read(root.join(format!("pbs-linked-refusal-{name}.pbx"))).expect("mandatory Linked refusal fixture");
|
||||
for suffix in ["","-optimized"] {
|
||||
println!("PHASE CORPUS linked {name}{suffix}");
|
||||
let bytes=std::fs::read(root.join(format!("pbs-linked-refusal-{name}{suffix}.pbx"))).expect("mandatory Linked refusal fixture");
|
||||
let image=ValidatedProgramImage::load(&bytes,&mut LoadBudget::new(LoadLimits::default()),caps::NONE).unwrap();
|
||||
let marker=|value:i32| {
|
||||
let mut pc=0;let mut found=Vec::new();
|
||||
@@ -1318,7 +1439,8 @@ fn verify_linked_refusals(root:&std::path::Path) {
|
||||
assert!(matches!(baseline.run_budget(20_000_000,&mut NoNative,&mut HostContext::new(None)).unwrap().reason,End::Breakpoint));
|
||||
let before=baseline.resource_snapshot();let original=linked_state(&baseline,&image);
|
||||
baseline.remove_breakpoint(before_pc);
|
||||
assert!(matches!(baseline.run_budget(20_000_000,&mut NoNative,&mut HostContext::new(None)).unwrap().reason,End::Breakpoint));
|
||||
let (completed_report,successful_prefix,_)=trace_collection_attempt(&mut baseline,&original,after_pc);
|
||||
assert!(matches!(completed_report.reason,End::BudgetExhausted|End::Breakpoint) && baseline.pc()==after_pc,"operation completion: {completed_report:?}");
|
||||
let after=baseline.resource_snapshot();let changed=linked_state(&baseline,&image);
|
||||
let owner=changed.iter().find(|o|image.registry().declarations().types[o.type_id.0 as usize].name.as_deref()==Some("linked<int>")).unwrap();
|
||||
let expected=match name {"insert"|"add"|"addFirst"=>33,"remove"|"removeFirst"|"removeLast"=>31,"clear"=>0,_=>32};
|
||||
@@ -1334,10 +1456,13 @@ fn verify_linked_refusals(root:&std::path::Path) {
|
||||
let setup=vm.run_budget(20_000_000,&mut NoNative,&mut HostContext::new(None)).unwrap();
|
||||
assert!(matches!(setup.reason,End::Breakpoint),"{name} setup {q:?}={limit}: {setup:?}");
|
||||
let old=linked_state(&vm,&image);vm.remove_breakpoint(before_pc);
|
||||
let report=vm.run_budget(20_000_000,&mut NoNative,&mut HostContext::new(None)).unwrap();
|
||||
let (report,prefix,mutated)=trace_collection_attempt(&mut vm,&old,after_pc);
|
||||
assert_mutation_prefix(&prefix,&successful_prefix);
|
||||
if let End::Trap(info)=report.reason {
|
||||
assert_eq!(info.code,TRAP_RESOURCE_LIMIT,"{name} {q:?}={limit}: {info:?}");
|
||||
assert_eq!(linked_state(&vm,&image),old,"{name}: all original fields, groups and reciprocal links at {q:?}={limit}");
|
||||
if !mutated || name=="cursor" || name=="reverseCursor" {
|
||||
assert_eq!(linked_state(&vm,&image),old,"{name}: failure before mutation preserves original topology");
|
||||
}
|
||||
let instruction=decode_next(info.pc as usize,image.code()).unwrap();
|
||||
preparation|=q==Q::AuxiliaryBytes;
|
||||
if instruction.opcode==Op::StructNew {
|
||||
@@ -1351,12 +1476,13 @@ fn verify_linked_refusals(root:&std::path::Path) {
|
||||
}
|
||||
}
|
||||
}
|
||||
refused+=1;println!("PBS LINKED ATOMIC REFUSAL {name} resource={q:?} limit={limit} opcode={:?}",instruction.opcode);
|
||||
} else {assert!(matches!(report.reason,End::Breakpoint),"{name}: {report:?}");}
|
||||
refused+=1;println!("PBS LINKED PHASE REFUSAL {name} mutated={mutated} resource={q:?} limit={limit} opcode={:?}",instruction.opcode);
|
||||
} else {assert!(matches!(report.reason,End::BudgetExhausted|End::Breakpoint) && vm.pc()==after_pc,"{name}: {report:?}");}
|
||||
drop(vm);for resource in [Q::GuestBytes,Q::HandleSlots,Q::AuxiliaryBytes,Q::TemporaryBytes] {assert_eq!(observer.used(resource),0);}
|
||||
}
|
||||
}
|
||||
assert!(refused>0,"{name}: whole-source-operation refusals required");
|
||||
assert!(refused>0,"{name}: source-operation phase refusals required");
|
||||
}
|
||||
}
|
||||
assert!(node_allocation,"new Linked node refusal");assert!(optional_return,"optional removed-value refusal");
|
||||
assert!(snapshot_allocation,"snapshot node refusal");assert!(preparation,"frame/operand preparation refusal");
|
||||
|
||||
@@ -35,7 +35,7 @@ print("runtime working tree", subprocess.check_output(["git","-C",str(runtime),"
|
||||
for source in [pathlib.Path("prometeu-architecture-tests/src/test/java/p/studio/compiler/backend/irvm/PbsListCursorTest.java"),
|
||||
pathlib.Path("prometeu-architecture-tests/src/test/java/p/studio/compiler/backend/irvm/PbsLinkedTest.java"),
|
||||
pathlib.Path("prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/resources/game/stdlib/1/sdk/collections/main.pbs"),
|
||||
runtime / "crates/console/prometeu-vm/src/virtual_machine/storage_publication.rs"]:
|
||||
runtime / "crates/console/prometeu-vm/src/virtual_machine/array_copy.rs"]:
|
||||
print("sha256",source,hashlib.sha256(source.read_bytes()).hexdigest(),flush=True)
|
||||
print("platform", platform.platform(), "limits=default capabilities=NONE", flush=True)
|
||||
print("profile", "release" if args.release else "dev", "features=resource-diagnostics", flush=True)
|
||||
|
||||
Reference in New Issue
Block a user