Expand description
Zero-table assembler from Dc-WASM (Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program"
and wasm_routine) to standard binary WebAssembly (.wasm).
Re-exports§
pub use super::wasm_quota::CTB_CAPABILITY_YIELD_EXPORT;pub use super::wasm_quota::CTB_EXHAUSTED_EXPORT;pub use super::wasm_quota::CTB_HOST_CAPABILITY_IMPORT_NAME;pub use super::wasm_quota::CTB_HOST_IMPORT_MODULE;pub use super::wasm_quota::CTB_HOST_SUSPEND_IMPORT_NAME;pub use super::wasm_quota::CTB_INTERRUPTED_OP_EXPORT;pub use super::wasm_quota::CTB_MAX_MEM_PAGES_EXPORT;pub use super::wasm_quota::CTB_MAX_TABLE_ELEMS_EXPORT;pub use super::wasm_quota::CTB_OP_ORDINAL_EXPORT;pub use super::wasm_quota::CTB_PHYS_MAX_MEM_PAGES_EXPORT;pub use super::wasm_quota::CTB_PHYS_MAX_TABLE_ELEMS_EXPORT;pub use super::wasm_quota::CTB_QUOTA_CONSUMED_EXPORT;pub use super::wasm_quota::CTB_QUOTA_REMAINING_EXPORT;pub use super::wasm_quota::CTB_REQUIRED_COST_EXPORT;pub use super::wasm_quota::CTB_RESUME_TARGET_OP_EXPORT;pub use super::wasm_quota::CTB_TOTAL_MEM_PAGES_EXPORT;pub use super::wasm_quota::CTB_TOTAL_TABLE_ELEMS_EXPORT;pub use super::wasm_quota::CTB_WASM_START_EXPORT;pub use super::wasm_quota::InstrumentedWasmModule;pub use super::wasm_quota::instrument_wasm_module_bytes;
Structs§
- DcRoutine
Profile Entry - Aggregated call statistics and return tokens recorded for a Dc routine invocation
when opt-in profiling (
set_dc_routine_profiling_enabled) is active. - DcWasm
Resource Limits - Resource budgets enforced on a
DcWasmSessionfor portable compute quota, linear memory growth, table element capacity, single-step output slice length, cumulative session output bytes, capability request/response payloads, and trace retention. - DcWasm
Session - Pure-compute WebAssembly execution state machine (
step() -> StatusCode) backed by eithertinywasm(with portable bytecode compute-quota instrumentation) or a bit-for-bit equivalent Guix-style compiled safe-Rust substitute. - DcWasm
Watchdog Limits - Emergency host watchdog bounds that protect the host process from runaway execution or supervisor faults, distinct from the System supervisor’s logical resource policy.
- Wasm
Start Section Trap - Non-resource WebAssembly trap raised while executing the hoisted module
startfunction.
Enums§
- DcWasm
Execution Backend - Execution backend selection for instantiating a
DcWasmSession. - Wasm
Resource Interruption - External resource interruption raised when a
DcWasmSessionexceeds a compute or memory/output budget. - Wasm
Step Outcome - Outcome of a single
DcWasmSession::stepinvocation, pairing theWasmStepStatuswith theDcMstringdecoded from the WASM instance’s output slice in linear memory. - Wasm
Step Status - Status code returned by a pure-compute WebAssembly
step()quantum.
Constants§
- DC_
WASM_ MAILBOX_ HEADER_ LEN - Total byte length (
32) of the standard linear-memory mailbox header at0..32. - DC_
WASM_ MAILBOX_ INPUT_ LEN - Linear-memory byte offset (
4..8) holding theu32little-endian input slice byte length. - DC_
WASM_ MAILBOX_ INPUT_ PTR - Linear-memory byte offset (
0..4) holding theu32little-endian input slice pointer. - DC_
WASM_ MAILBOX_ MOST_ RECENT_ NODE_ ID - Linear-memory byte offset (
16..32) holding theu128little-endianDc 641 "Global graph system block most recent node ID at time of document creation". - DC_
WASM_ MAILBOX_ OUTPUT_ LEN - Linear-memory byte offset (
12..16) holding theu32little-endian output slice byte length. - DC_
WASM_ MAILBOX_ OUTPUT_ PTR - Linear-memory byte offset (
8..12) holding theu32little-endian output slice pointer. - DC_
WASM_ MIN_ IO_ BUFFER_ OFFSET - Minimum default linear-memory byte offset (
256) where the host places input/output slices, leaving0..32for the mailbox header and32..256for scratch state or small data segments. - DEFAULT_
MAX_ PURE_ CONVERSION_ STEPS - Default maximum number of
step()quanta allowed in a one-shot pure conversion. - DEFAULT_
MAX_ WASM_ CAPABILITY_ PAYLOAD_ BYTES - Default maximum byte length permitted for a single capability request or response payload (1 MiB).
- DEFAULT_
MAX_ WASM_ INSTRUCTIONS_ PER_ STEP - Default maximum number of portable WASM compute quota units permitted in a
DcWasmSession. - DEFAULT_
MAX_ WASM_ MEMORY_ PAGES - Default maximum number of 64 KiB linear memory pages permitted for a
DcWasmSession(16 MiB). - DEFAULT_
MAX_ WASM_ SESSION_ OUTPUT_ BYTES - Default maximum cumulative output bytes permitted across a
DcWasmSession(16 MiB). - DEFAULT_
MAX_ WASM_ STEP_ OUTPUT_ BYTES - Default maximum byte length permitted for a single step’s output mailbox slice (4 MiB).
- DEFAULT_
MAX_ WASM_ TABLE_ ELEMENTS - Default maximum number of table elements permitted across a
DcWasmSessionstore. - DEFAULT_
MAX_ WASM_ TRACE_ BYTES - Default maximum cumulative byte length permitted for a retained execution trace buffer (16 MiB).
- WASM_
RESOURCE_ ACCOUNTING_ VERSION - Version identifier for the portable WebAssembly resource-accounting rule set.
- WASM_
STEP_ STATUS_ COMPLETE step()return status code0: execution or conversion completed.- WASM_
STEP_ STATUS_ REQUEST_ CAPABILITY step()return status code2: capability requested; provide response and callstep()again.- WASM_
STEP_ STATUS_ YIELD_ FRAME step()return status code1: streaming frame yielded; callstep()again to continue.
Functions§
- assemble_
wasm_ instructions - Assembles a raw sequence of Dc-WASM instructions (
[wasm_instr]*) into WebAssembly instruction bytes (without a module header or trailing function0x0B). - compile_
graph_ substitute_ snapshot_ wasm_ bytes - Lowers and assembles the uninstrumented canonical
.wasmbytes for a discoveredctb_formats_dcdata::seed_graph::GraphWasmSubstituteSnapshotreconstructed atsnapshot.pin_node_idfrom an orderedLedgerNodeslice. - compile_
graph_ substitute_ snapshot_ wasm_ bytes_ with_ cache - Like
compile_graph_substitute_snapshot_wasm_bytes, reusing reconstructedSeedGraphIndex+DatasetRuleResolversnapshots across calls that sharepin_node_id. - compile_
system_ subject_ wasm_ bytes - Lowers and assembles the uninstrumented canonical
.wasmbytes for a System-graph substitute target identified by itsctb_storage_minimal::shorthand::DcShorthand. - compile_
system_ substitute_ target_ wasm_ bytes - Lowers and assembles the uninstrumented canonical
.wasmbytes for a discoveredctb_formats_dcdata::seed_graph::SystemWasmSubstituteTarget. - dcmstring_
to_ wasm - Converts a Dc-WASM document (
Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program"or a standalonewasm_routine) into a standard binary.wasmmodule using the default system graph syntax resolver. - dcmstring_
to_ wasm_ with_ resolver - Converts a Dc-WASM document (
Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program"or a standalonewasm_routine) into a standard binary.wasmmodule using the suppliedSyntaxRuleResolver. - dcstring_
to_ wasm - Converts a
DcStrcontaining a Dc-WASM program orwasm_routineinto a standard binary.wasmmodule using the default system graph syntax resolver. - dcstring_
to_ wasm_ with_ resolver - Converts a
DcStrcontaining a Dc-WASM program orwasm_routineinto a standard binary.wasmmodule using the suppliedSyntaxRuleResolver. - expand_
graph_ wasm_ shorthands_ to_ dcmstring - Expands a slice of
ctb_storage_minimal::shorthand::DcShorthandgraph WASM tokens (resolving nested helper shorthands and standaloneRoutineentities) into an executableDcMstringDc-WASM document. - is_
dc_ routine_ profiling_ enabled - Returns
truewhen opt-in Dc routine invocation profiling is enabled. - record_
dc_ routine_ invocation_ profile - Records a single Dc routine invocation into the opt-in profiler table.
- run_
active_ converter_ step_ on_ dc_ slice_ with_ quota - Executes a single
ctb_formats_dcdata::seed_graph::ActiveConverterStepfromsg(either a Stage 0.WASMconverter or a Stage 1 StageL Token-Dc converter compiled via the active StageL-to-WASM converter) oninput_tokensundershared_quota. - run_
dc_ wasm_ pure_ conversion - Runs a pure-compute Dc-WASM conversion (
Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program"orwasm_routine) overinputusing the default syntax resolver. - run_
dc_ wasm_ pure_ conversion_ with_ resolver - Runs a pure-compute Dc-WASM conversion (
Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program"orwasm_routine) overinputusing the suppliedSyntaxRuleResolver. - run_
dc_ wasm_ pure_ conversion_ with_ resolver_ and_ quota - Runs a pure-compute Dc-WASM conversion (
Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program"orwasm_routine) overinputusingresolverand an optionalSharedWasmTaskQuota. - run_
graph_ converter_ chain_ on_ dc_ slice_ with_ quota - Executes an ordered multi-step chain of
ctb_formats_dcdata::seed_graph::ActiveConverterSteps sequentially oninput_tokensunder a sharedSharedWasmTaskQuota. - run_
graph_ stager_ dc_ 2608_ with_ quota - Executes the System-graph StageR 3 implementation of
Dc 2608(Convert Dc string to WASM) viaDcWasmSessionwith Option B capability support (Dc 1939/Dc 1940), charging runtime execution toshared_quota. - run_
graph_ stager_ dcs_ routine_ with_ quota - Executes a System-graph StageR 3
(dcs -> dcs)routine (routine_dc, such asDc 2608 "Convert Dc string to WASM"orf19 "Semantic Dcs to text") viaDcWasmSessionwith Option B capability support (Dc 1939/Dc 1940), charging runtime execution toshared_quota. - run_
graph_ wasm_ tokens_ on_ dc_ slice - Runs a pure-compute Dc-WASM conversion from a slice of
ctb_storage_minimal::shorthand::DcShorthandtokens (such as a.WASMdefinition stored in the system graph) overinput_tokens. - run_
graph_ wasm_ tokens_ on_ dc_ slice_ with_ quota - Runs a pure-compute Dc-WASM conversion from a slice of
ctb_storage_minimal::shorthand::DcShorthandtokens overinput_tokensusing an optionalSharedWasmTaskQuota. - run_
wasm_ bytes_ pure_ conversion_ with_ quota - Runs a pure-compute WebAssembly conversion from pre-assembled
.wasmbytes overinputusing an optionalSharedWasmTaskQuota. - set_
dc_ routine_ profiling_ enabled - Enables or disables opt-in Dc routine invocation profiling for harvesting frequent and expensive pure routine calls.
- take_
dc_ routine_ profile_ snapshot - Drains and returns all recorded
DcRoutineProfileEntryitems sorted by descending cumulative execution time (total_duration_ns).