Expand description
Wire format for the host ↔ guest “run this PVM program” RPC.
Personality-agnostic: the host pre-publishes each state object it
wants the guest to see via the FN_ID_NUB_PUT_CAP RPC — the
payload is opaque bytes whose encoding the guest personality
defines (JAVM: an rkyv-archived javm_cap::Cap landing in
javm-guest-x86’s heap-resident directory) — then ships a
fixed-size InvokePacket referencing the published root object
by hash on every call. The invoke packet is #[repr(C)] bytes (no
codec); the response is rkyv-archived (InvocationResult).
Structs§
- Archived
Invocation Result - An archived
InvocationResult - Invocation
Result - Invocation result. Both backends produce this shape on completion; rkyv-archived on the wire from the cached path’s response.
- Invocation
Result Resolver - The resolver for an archived
InvocationResult - Invoke
Packet - Fixed-layout invocation packet. Sent as raw
#[repr(C)]bytes via the existing rkyvRequestenvelope (itspayloadfield). The guest reads the bytes directly withcore::ptr::read_unaligned. - Parallel
Invoke Slot - One host<->guest invoke slot. Slots are addressed by lane index at
parallel_slot_base + lane * PARALLEL_INVOKE_SLOT_BYTES.
Constants§
- FN_
ID_ NUB_ EVICT_ JIT_ ALL fn_idfor the bench-only “evict the entire JIT compile cache” RPC. Empty payload; empty response. Used byjavm-benchto force each criterion iteration to pay the recompile cost (otherwise the JIT cache turns the loop into pure warm-cache execute, which isn’t what we want to measure for PolkaVM-shaped workloads).- FN_
ID_ NUB_ HEAP_ STATS fn_idfor thenub_heap_statsdiagnostic. Payload is empty; response is 32 bytes packing four LE u64s (allocated_bytes, allocation_count, fragment_count, available_bytes).- FN_
ID_ NUB_ INVOKE_ CACHED fn_idfor the cache-based RPC. Payload is aInvokePacket(host-side#[repr(C)]bytes, no rkyv); the guest dereferences cache VAs byroot_hashlookup, runs the JIT, and replies with rkyv-archivedInvocationResult.- FN_
ID_ NUB_ INVOKE_ WORKER fn_idfor a long-lived per-vCPU invoke worker. Payload is a little-endianu32lane index. The function does not use the legacy rkyv response ring; it polls that lane’sParallelInvokeSlotin scratch memory, runs invokes withrun_top_on_lane, and writes results back into the same slot.- FN_
ID_ NUB_ PUT_ CAP fn_idfor the “publish a state object” RPC.- MAX_
EXECUTION_ LANES - Maximum fixed execution lanes the guest runtime can address. The production default vCPU pool is capped lower, but host configuration must not exceed this ABI-visible lane table size.
- PARALLEL_
INVOKE_ SLOT_ BYTES - PARALLEL_
INVOKE_ STATUS_ DONE - PARALLEL_
INVOKE_ STATUS_ EMPTY - PARALLEL_
INVOKE_ STATUS_ EVICT_ JIT_ READY - PARALLEL_
INVOKE_ STATUS_ READY - PARALLEL_
INVOKE_ STATUS_ RUNNING - PARALLEL_
INVOKE_ STATUS_ STARTING - PARALLEL_
INVOKE_ STATUS_ STOP - SCRATCHPAD_
HEAD_ LEN - Bytes of the running Instance’s scratchpad (
slot[0]) region surfaced at the top-level HALT — a fixed-size head of the returned DataCap’s effective content. The guest writes its result into the scratchpad-mapped memory region during the run (CoW into the cap); at top HALT the engine reads the region’s effective bytes back out here, so the host observes the full, uncompressed result without a separate data-flow event.
Type Aliases§
- CapHash
- 32-byte content hash of a published state object (the legacy name
from when the only personality was the JAVM cap system — matches
nub_kernel::ObjHashand, byte-wise,javm_cap::CapHash; kept as a local alias so this crate stays dependency-free).