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:
+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.
|
||||
|
||||
Reference in New Issue
Block a user