Expand description
Bytecode execution engine.
Runs a compiled mini_parser program against a &[NQuin] database
slice, writing every matching Quin into a caller-supplied output buffer.
No heap allocation is performed inside this module.
§Return value
execute_program returns Ok((match_count, vm_cycles)):
match_count— number of Quins written toout[..match_count].vm_cycles— total VM opcodes decoded across all Quin evaluations. The daemon exposes this asX-Qualia-Compute-Cost.
For richer diagnostics use execute_program_with_stats which returns an
ExecutionStats breakdown distinguishing topological-pointer ops (MSB=1,
did:q42 coordinates) from plain dictionary/lexicon hash ops (MSB=0).
§Error contract
Err(VmError::OutputBufferFull)—outwas exhausted; return HTTP 413.Err(VmError::InvalidProgram)— malformed bytecode.
§MSB dispatch convention
Operand bit 63 encodes the evaluation path for every MATCH_* opcode:
- MSB = 1 → operand is a
did:q42topological pointer (physical byte-offset coordinate produced bycrate::identifier::parse_did_q42). The VM takes the direct jump path: the value is compared as a raw hardware address with no lexicon indirection. - MSB = 0 → operand is a plain FNV-1a dictionary hash. The VM takes the lexicon lookup path: standard equality against the stored Quin field.
Structs§
- Execution
Stats - Per-execution breakdown returned by
execute_program_with_stats. - Guardianship
Context
Enums§
Functions§
- execute_
program - Execute
programagainst every Quin indb, collecting matches intoout. - execute_
program_ simd - Scalar fallback used on non-wasm32 targets or when
wasm_simdis not enabled. - execute_
program_ with_ stats - Execute
programagainst every Quin indb, returning fullExecutionStats.