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