Impulse Graph Bytecode Virtual Machine Engine & Instruction Set Specification. More...
#include "impulse_graph.h"#include "impulse_math_ops.h"#include <stdint.h>#include <stddef.h>#include <stdbool.h>#include <stdalign.h>

Go to the source code of this file.
Classes | |
| struct | impulse_vm_input_keys |
| struct | impulse_column_desc |
| struct | impulse_execution_result |
Typedefs | |
| typedef struct impulse_vm_context | impulse_vm_context_t |
| typedef struct impulse_column_desc | impulse_column_desc_t |
| typedef struct impulse_execution_result | impulse_execution_result_t |
| typedef struct impulse_stmt | impulse_stmt_t |
Functions | |
| static uint64_t | impulse_make_active_mask_u64 (uint32_t k) |
| UB-free 64-bit active lane mask constructor for K in [0..64+]. | |
| struct | __attribute__ ((aligned(8))) |
| Fixed 64-bit Instruction Structure Layout. | |
| struct | __attribute__ ((aligned(64))) |
| VM Execution State Frame (640 bytes, 64-byte aligned). | |
| impulse_vm_context_t * | impulse_vm_context_create (const impulse_snapshot_t *snapshot) |
| void | impulse_vm_context_destroy (impulse_vm_context_t *ctx) |
| void | impulse_vm_context_reset (impulse_vm_context_t *ctx) |
| size_t | impulse_vm_context_get_vector_size (const impulse_vm_context_t *ctx) |
| const uint64_t * | impulse_vm_context_get_collected_nodes (const impulse_vm_context_t *ctx, size_t *out_count) |
| const float * | impulse_vm_context_get_float_vector (const impulse_vm_context_t *ctx, size_t handle) |
| size_t | impulse_vm_context_float_vector_size (const impulse_vm_context_t *ctx, size_t handle) |
| const double * | impulse_vm_context_get_double_vector (const impulse_vm_context_t *ctx, size_t handle) |
| size_t | impulse_vm_context_double_vector_size (const impulse_vm_context_t *ctx, size_t handle) |
| int | impulse_vm_context_acquire_bitset (impulse_vm_context_t *ctx) |
| void | impulse_vm_context_release_bitset (impulse_vm_context_t *ctx, size_t handle) |
| void | impulse_vm_context_bitset_add (impulse_vm_context_t *ctx, size_t handle, uint64_t node_id) |
| void | impulse_vm_context_bitset_remove (impulse_vm_context_t *ctx, size_t handle, uint64_t node_id) |
| bool | impulse_vm_context_bitset_test (const impulse_vm_context_t *ctx, size_t handle, uint64_t node_id) |
| void | impulse_vm_context_bitset_fill (impulse_vm_context_t *ctx, size_t handle, uint64_t count) |
| uint64_t | impulse_vm_context_bitset_get_word (const impulse_vm_context_t *ctx, size_t handle, size_t word_idx) |
| size_t | impulse_vm_context_get_bitset_word_count (const impulse_vm_context_t *ctx) |
| const uint64_t * | impulse_vm_context_get_bitset_words (const impulse_vm_context_t *ctx, size_t handle) |
| int | impulse_vm_context_acquire_float_vector (impulse_vm_context_t *ctx) |
| void | impulse_vm_context_release_float_vector (impulse_vm_context_t *ctx, size_t handle) |
| void | impulse_vm_context_float_vector_set (impulse_vm_context_t *ctx, size_t handle, size_t index, float val) |
| int | impulse_vm_context_acquire_double_vector (impulse_vm_context_t *ctx) |
| void | impulse_vm_context_release_double_vector (impulse_vm_context_t *ctx, size_t handle) |
| void | impulse_vm_context_double_vector_set (impulse_vm_context_t *ctx, size_t handle, size_t index, double val) |
| void | impulse_vm_context_bind_inline_data (impulse_vm_context_t *ctx, const void *data_ptr, size_t bytes) |
| int | impulse_vm_context_acquire_node_vector (impulse_vm_context_t *ctx) |
| void | impulse_vm_context_release_node_vector (impulse_vm_context_t *ctx, size_t handle) |
| const uint64_t * | impulse_vm_context_get_node_vector (const impulse_vm_context_t *ctx, size_t handle) |
| int | impulse_vm_context_acquire_string_vector (impulse_vm_context_t *ctx) |
| void | impulse_vm_context_release_string_vector (impulse_vm_context_t *ctx, size_t handle) |
| void | impulse_vm_context_string_vector_add (impulse_vm_context_t *ctx, size_t handle, const char *str) |
| size_t | impulse_vm_context_string_vector_size (const impulse_vm_context_t *ctx, size_t handle) |
| const char * | impulse_vm_context_string_vector_get (const impulse_vm_context_t *ctx, size_t handle, size_t index) |
| void | impulse_vm_context_set_fuel (impulse_vm_context_t *ctx, uint64_t fuel) |
| int | impulse_vm_context_acquire_value_map (impulse_vm_context_t *ctx) |
| void | impulse_vm_context_release_value_map (impulse_vm_context_t *ctx, size_t handle) |
| size_t | impulse_vm_context_value_map_size (const impulse_vm_context_t *ctx, size_t handle) |
| const char * | impulse_vm_context_value_map_get_key (const impulse_vm_context_t *ctx, size_t handle, size_t index) |
| float | impulse_vm_context_value_map_get_value (const impulse_vm_context_t *ctx, size_t handle, size_t index) |
| void | impulse_vm_context_node_vector_set (impulse_vm_context_t *ctx, size_t handle, const uint64_t *values, size_t count) |
| size_t | impulse_vm_context_node_vector_size (const impulse_vm_context_t *ctx, size_t handle) |
| int | impulse_vm_context_acquire_lane_frontier (impulse_vm_context_t *ctx) |
| void | impulse_vm_context_release_lane_frontier (impulse_vm_context_t *ctx, size_t handle) |
| uint32_t | impulse_vm_context_lane_frontier_num_lanes (const impulse_vm_context_t *ctx, size_t handle) |
| uint32_t | impulse_vm_context_lane_frontier_width (const impulse_vm_context_t *ctx, size_t handle) |
| uint64_t | impulse_vm_context_lane_frontier_active_mask (const impulse_vm_context_t *ctx, size_t handle) |
| size_t | impulse_vm_context_lane_frontier_node_count (const impulse_vm_context_t *ctx, size_t handle) |
| const uint64_t * | impulse_vm_context_lane_frontier_data (const impulse_vm_context_t *ctx, size_t handle) |
| void | impulse_vm_context_mock_csr (impulse_vm_context_t *ctx, uint16_t relation_index, const uint32_t *csr_offsets, const uint32_t *csr_targets, uint64_t node_count, uint64_t edge_count) |
| void | impulse_vm_context_mock_csr_typed (impulse_vm_context_t *ctx, uint16_t relation_index, const void *csr_offsets, const void *csr_targets, uint64_t node_count, uint64_t edge_count, uint8_t node_id_width, uint8_t edge_index_width) |
| void | impulse_vm_context_mock_csc (impulse_vm_context_t *ctx, uint16_t relation_index, const uint32_t *csc_offsets, const uint32_t *csc_targets) |
| void | impulse_vm_context_mock_csc_typed (impulse_vm_context_t *ctx, uint16_t relation_index, const void *csc_offsets, const void *csc_targets, uint8_t node_id_width, uint8_t edge_index_width) |
| impulse_vm_status_t | impulse_vm_validate (const impulse_instruction_t *bytecode, size_t instruction_count) |
| Execute a sequence of VM bytecode instructions against a VM state frame. | |
| impulse_vm_status_t | impulse_vm_execute (const impulse_instruction_t *bytecode, size_t instruction_count, impulse_vm_state_t *vm_state, uint64_t input_param) |
| int | impulse_vm_state_hash (const impulse_vm_state_t *state, int32_t status, uint8_t hash_out[32]) |
| Computes deterministic SHA-256 state hash of VM state and execution context. | |
| int | impulse_vm_state_hash_hex (const impulse_vm_state_t *state, int32_t status, char hex_out[65]) |
| Computes deterministic SHA-256 state hash as a 64-character lowercase hexadecimal string. | |
| size_t | impulse_vm_get_required_buffer_size (const impulse_snapshot_t *snapshot, uint16_t domain_id) |
| impulse_vm_status_t | impulse_vm_execute_to_buffer (const impulse_instruction_t *bytecode, size_t instruction_count, impulse_vm_state_t *vm_state, uint64_t input_param, uint16_t target_domain_id, uint16_t result_reg, uint64_t *out_words, size_t out_words_capacity, size_t *out_words_written) |
| impulse_status_t | impulse_compile_query (const impulse_snapshot_t *snapshot, const char *script, impulse_language_t lang, impulse_instruction_t *out_instructions, size_t out_capacity, size_t *out_count) |
| Compiles a DSL query string into physical 8-byte VM instructions using snapshot catalog statistics. | |
| impulse_status_t | impulse_compile_to_impas (const impulse_snapshot_t *snapshot, const char *script, impulse_language_t lang, char *out_impas_buffer, size_t out_capacity, size_t *out_bytes_written) |
| Compiles a DSL query string into human-readable ImpAsm (.impas) assembly text. | |
| impulse_vm_status_t | impulse_compile_and_execute (const impulse_snapshot_t *snapshot, const char *script, impulse_language_t lang, impulse_vm_state_t *state, uint64_t input_seed) |
| Compiles and directly executes a DSL query string against a snapshot. | |
| impulse_status_t | impulse_stmt_prepare (const impulse_snapshot_t *snapshot, const char *query_text, impulse_stmt_t **out_stmt) |
| size_t | impulse_stmt_buffer_size (const impulse_stmt_t *stmt) |
| void | impulse_stmt_finalize (impulse_stmt_t *stmt) |
| impulse_status_t | impulse_stmt_bind_node (impulse_stmt_t *stmt, const char *param, uint64_t node_id) |
| impulse_status_t | impulse_stmt_bind_nodes (impulse_stmt_t *stmt, const char *param, const uint64_t *node_ids, size_t count) |
| impulse_status_t | impulse_stmt_bind_bitset (impulse_stmt_t *stmt, const char *param, const uint64_t *words, size_t word_count) |
| impulse_status_t | impulse_stmt_bind_roaring (impulse_stmt_t *stmt, const char *param, const uint8_t *bytes, size_t len) |
| impulse_status_t | impulse_stmt_bind_int (impulse_stmt_t *stmt, const char *param, int64_t val) |
| impulse_status_t | impulse_stmt_bind_uint (impulse_stmt_t *stmt, const char *param, uint64_t val) |
| impulse_status_t | impulse_stmt_bind_float (impulse_stmt_t *stmt, const char *param, double val) |
| impulse_status_t | impulse_stmt_bind_str (impulse_stmt_t *stmt, const char *param, const char *str) |
| impulse_status_t | impulse_stmt_bind_uuid (impulse_stmt_t *stmt, const char *param, const uint8_t uuid_bytes[16]) |
| impulse_status_t | impulse_stmt_bind_vector (impulse_stmt_t *stmt, const char *param, const float *data, size_t dim) |
| impulse_status_t | impulse_stmt_execute (impulse_stmt_t *stmt, void *buffer, size_t buffer_size) |
| size_t | impulse_stmt_row_count (const impulse_stmt_t *stmt) |
| uint32_t | impulse_stmt_column_count (const impulse_stmt_t *stmt) |
| const char * | impulse_stmt_column_name (const impulse_stmt_t *stmt, uint32_t col_idx) |
| uint8_t | impulse_stmt_column_type (const impulse_stmt_t *stmt, uint32_t col_idx) |
| uint32_t | impulse_stmt_column_dim (const impulse_stmt_t *stmt, uint32_t col_idx) |
| const void * | impulse_stmt_column_data (const impulse_stmt_t *stmt, uint32_t col_idx) |
| bool | impulse_stmt_column_is_null (const impulse_stmt_t *stmt, uint32_t col_idx, size_t row_idx) |
| impulse_status_t | impulse_exec (const impulse_snapshot_t *snapshot, const char *query_text, uint64_t seed_node, impulse_execution_result_t *out_result) |
| One-line convenience wrapper: prepare, bind $seed, execute, and finalize. | |
Variables | |
| impulse_instruction_t | |
| impulse_vm_state_t | |
Impulse Graph Bytecode Virtual Machine Engine & Instruction Set Specification.
Defines raw 64-bit opcode instructions (impulse_instruction_t), hardware registers (R0..R63), VM execution frame layout (impulse_vm_state_t), off-heap context handle pools, and native execution APIs.
| #define BINARY_OP_ADD 0 |
| #define BINARY_OP_AND 4 |
| #define BINARY_OP_ARGMAX 7 |
| #define BINARY_OP_ARGMIN 6 |
| #define BINARY_OP_MAX 3 |
| #define BINARY_OP_MIN 2 |
| #define BINARY_OP_MUL 1 |
| #define BINARY_OP_OR 5 |
| #define IMPULSE_ALIGN | ( | x | ) |
| #define IMPULSE_VM_FLAG_EQ (1ULL << 3) |
Equal Flag: set if src1 == src2
| #define IMPULSE_VM_FLAG_GT (1ULL << 2) |
Greater Than Flag: set if src1 > src2
| #define IMPULSE_VM_FLAG_LT (1ULL << 1) |
Less Than Flag: set if src1 < src2
| #define IMPULSE_VM_FLAG_ST (1ULL << 4) |
Stable Flag: set by repeat checks when set generation converged
| #define IMPULSE_VM_FLAG_ZF (1ULL << 0) |
Zero Flag: set if candidate set or arithmetic result is empty / 0
| #define IMPULSE_VM_MAGIC 0x494D5042 |
Little-Endian VM Magic: 'I' 'M' 'P' 'B' (0x494D5042)
| #define IMPULSE_VM_OP_FLAG_ACCUMULATE 0x04 |
Accumulate destination bitset
| #define IMPULSE_VM_OP_FLAG_HALT_ON_EMPTY 0x01 |
Early exit: jump to halt if output bitset is empty
| #define IMPULSE_VM_OP_FLAG_INPUT_SEED 0x02 |
Seed inlined: source is query input seed node
| #define IMPULSE_VM_OP_FLAG_INVERT 0x08 |
Invert filter condition
| #define IMPULSE_VM_OP_FLAG_OFFHEAP 0x10 |
Off-heap mode
| #define OP_ADAPTIVE_WALK 0x1D |
| #define OP_ALLOC_SCRATCH 0x73 |
| #define OP_ASSERT 0x5B |
| #define OP_ASSERT_FINITE 0x2A |
| #define OP_ASSERT_SCRATCH_BYTES 0x74 |
| #define OP_BRANDES_BACKWARD 0x49 |
| #define OP_BRANDES_FORWARD 0x48 |
| #define OP_BRIN_ZONE_SKIP 0x83 |
| #define OP_CALL 0x55 |
| #define OP_CC_AFFOREST 0x40 |
| #define OP_CC_HOOK_COMPRESS 0x46 |
| #define OP_CLEAR_REG 0x71 |
| #define OP_COALESCE 0x3B |
| #define OP_COLLECT_ARRAY 0x91 |
| #define OP_COLLECT_BITSET 0x90 |
| #define OP_COLLECT_VALUE_MAP 0x93 |
| #define OP_COO_WALK 0x86 |
| #define OP_COO_WALK_DIRECT_STORE 0x8D |
| #define OP_COO_WALK_FILTERED 0x8B |
| #define OP_COO_WALK_REDUCE 0x8C |
| #define OP_COO_WALK_STREAM 0xA0 |
| #define OP_CREATE_SCRATCH_INDEX 0x1E |
| #define OP_CSC_WALK 0x18 |
| #define OP_CSC_WALK_DIRECT_STORE 0x87 |
| #define OP_CSC_WALK_STREAM 0xAA |
| #define OP_CSR_DEGREE 0x12 |
| #define OP_CSR_WALK 0x10 |
| #define OP_CSR_WALK_2HOP 0x0E |
| #define OP_CSR_WALK_DENSE_STREAM 0x85 |
| #define OP_CSR_WALK_DIRECT_STORE 0x84 |
| #define OP_CSR_WALK_FILTERED 0x11 |
| #define OP_CSR_WALK_PREDICATE 0x13 |
| #define OP_CSR_WALK_REDUCE 0x17 |
| #define OP_CSR_WALK_REDUCE_SUM 0x16 |
| #define OP_CSR_WALK_STATE 0x0F |
| #define OP_CSR_WALK_STREAM 0xA9 |
| #define OP_DELTA_STEP_RELAX 0x4A |
| #define OP_DENSE_WALK 0x8E |
| #define OP_DENSE_WALK_BITMATRIX 0x8F |
| #define OP_DENSE_WALK_DIRECT_STORE 0x95 |
| #define OP_DENSE_WALK_REDUCE 0x94 |
| #define OP_DROP_SCRATCH_INDEX 0x1F |
| #define OP_ENTER_FRAME 0x57 |
| #define OP_EWISE_ADD 0x43 |
| #define OP_EWISE_MULT 0x44 |
| #define OP_EXTRACT_VALIDITY 0x3C |
| #define OP_FIXPOINT_KLEENE_STAR 0x88 |
| #define OP_FLOAT_VECTOR_SCALE 0x38 |
| #define OP_FRONTIER_DIFF 0x8A |
| #define OP_GATHER_EDGE_ATTR 0x82 |
| #define OP_GATHER_NODE_ATTR 0x81 |
| #define OP_GRAPH_ISOMORPHISM 0x6A |
| #define OP_HALT 0x00 |
Opcodes Definitions.
| #define OP_HAS_COO 0x1B |
| #define OP_HAS_CSC 0x1A |
| #define OP_HAS_CSR 0x19 |
| #define OP_HAS_KEY_CATALOG 0x1C |
| #define OP_INIT_INPUT_NODE 0x02 |
| #define OP_INIT_INPUT_SET 0x03 |
| #define OP_INIT_MOCK_EDGE_ATTR 0x0C |
| #define OP_INIT_MOCK_GRAPH 0x09 |
| #define OP_INIT_MOCK_NODE_ATTR 0x0B |
| #define OP_ISLAND_DETECT 0x65 |
| #define OP_JMP 0x50 |
| #define OP_JNZ 0x52 |
| #define OP_JZ 0x51 |
| #define OP_KCORE_DECOMPOSITION 0x68 |
| #define OP_L1_NORM_DIFF 0x39 |
| #define OP_LANE_CSC_WALK 0xC4 |
| #define OP_LANE_CSR_WALK 0xC3 |
| #define OP_LANE_FILTER_QUORUM 0xC6 |
| #define OP_LANE_INIT_GROUPS 0xC1 |
| #define OP_LANE_INIT_SEEDS 0xC0 |
| #define OP_LANE_PRUNE_MASK 0xC5 |
| #define OP_LANE_REDUCE_AND 0xC7 |
| #define OP_LANE_REDUCE_ATTR 0xC8 |
| #define OP_LANE_SET_COVER 0xC9 |
| #define OP_LANE_SET_EDGE_MASK 0xC2 |
| #define OP_LEAVE_FRAME 0x58 |
| #define OP_LOAD_COLUMN_VECTOR 0x80 |
| #define OP_LOAD_CONST_FLOAT 0x06 |
| #define OP_LOAD_CONST_INT 0x04 |
| #define OP_LOAD_CONST_STR_PREFIX 0x07 |
| #define OP_LOAD_INDIRECT 0x72 |
| #define OP_LOAD_INLINE_ARRAY 0x08 |
| #define OP_LOAD_INLINE_SET 0x0A |
| #define OP_LOOP_DECR 0x53 |
| #define OP_LOUVAIN_MODULARITY 0x67 |
| #define OP_MAP_DENSE_TO_KEYS 0x92 |
| #define OP_MAP_KEYS_TO_DENSE 0x05 |
| #define OP_MASK_AND 0x24 |
| #define OP_MASK_NOT 0x26 |
| #define OP_MASK_OR 0x25 |
| #define OP_MOTIF_MATCH_3 0x69 |
| #define OP_MOV 0x70 |
| #define OP_MXV 0x41 |
| #define OP_NODE_FILTER 0x14 |
| #define OP_NODE_FILTER_STR_PREFIX 0x15 |
| #define OP_NOP 0x01 |
| #define OP_PROJECT_STATE 0x3A |
| #define OP_RANDOM_WALK 0x61 |
| #define OP_READ_EDGE_WEIGHT 0x4B |
| #define OP_REBAC_CHECK 0x63 |
| #define OP_REDUCE 0x45 |
| #define OP_RESERVED_0D 0x0D |
| #define OP_RESERVED_28 0x28 |
| #define OP_RESERVED_29 0x29 |
| #define OP_RESERVED_2B 0x2B |
| #define OP_RESERVED_2C 0x2C |
| #define OP_RESERVED_3E 0x3E |
| #define OP_RESERVED_3F 0x3F |
| #define OP_RESERVED_4C 0x4C |
| #define OP_RESERVED_4D 0x4D |
| #define OP_RESERVED_4E 0x4E |
| #define OP_RESERVED_4F 0x4F |
| #define OP_RESERVED_59 0x59 |
| #define OP_RESERVED_5D 0x5D |
| #define OP_RESERVED_5E 0x5E |
| #define OP_RESERVED_5F 0x5F |
| #define OP_RESERVED_6D 0x6D |
| #define OP_RESERVED_6E 0x6E |
| #define OP_RESERVED_6F 0x6F |
| #define OP_RESERVED_76 0x76 |
| #define OP_RESERVED_77 0x77 |
| #define OP_RESERVED_78 0x78 |
| #define OP_RESERVED_79 0x79 |
| #define OP_RESERVED_7A 0x7A |
| #define OP_RESERVED_7B 0x7B |
| #define OP_RESERVED_7C 0x7C |
| #define OP_RESERVED_7D 0x7D |
| #define OP_RESERVED_7E 0x7E |
| #define OP_RESERVED_7F 0x7F |
| #define OP_RET 0x56 |
| #define OP_ROARING_BITMAP_AND 0x64 |
| #define OP_ROARING_BITMAP_AND_NOT 0x6C |
| #define OP_ROARING_BITMAP_OR 0x6B |
| #define OP_SAMPLE_NEIGHBORS 0x60 |
| #define OP_SCATTER_GATHER 0x62 |
| #define OP_SET_CARDINALITY 0x33 |
| #define OP_SET_DIFFERENCE 0x32 |
| #define OP_SET_INTERSECT 0x31 |
| #define OP_SET_MAX_DOP 0x75 |
| #define OP_SET_UNION 0x30 |
| #define OP_SPARSE_MATVEC 0x66 |
| #define OP_STABLE_CHECK 0x54 |
| #define OP_STREAM_CMP_EQ 0xB0 |
| #define OP_STREAM_CMP_GT 0xB2 |
| #define OP_STREAM_CMP_LT 0xB3 |
| #define OP_STREAM_CMP_NEQ 0xB1 |
| #define OP_STREAM_FILTER 0xA7 |
| #define OP_STREAM_FUNC_BEGIN 0xA1 |
| #define OP_STREAM_FUNC_END 0xA2 |
| #define OP_STREAM_LOAD_CONST 0xBD |
| #define OP_STREAM_LOAD_EDGE 0xA4 |
| #define OP_STREAM_LOAD_EDGE_ID 0xBC |
| #define OP_STREAM_LOAD_SRC 0xA3 |
| #define OP_STREAM_LOAD_SRC_ID 0xBA |
| #define OP_STREAM_LOAD_TGT 0xAB |
| #define OP_STREAM_LOAD_TGT_ID 0xBB |
| #define OP_STREAM_LOGIC_AND 0xB4 |
| #define OP_STREAM_LOGIC_NOT 0xB6 |
| #define OP_STREAM_LOGIC_OR 0xB5 |
| #define OP_STREAM_MATH_ADD 0xA5 |
| #define OP_STREAM_MATH_DIV 0xA6 |
| #define OP_STREAM_MATH_MOD 0xAE |
| #define OP_STREAM_MATH_MUL 0xAD |
| #define OP_STREAM_MATH_SUB 0xAC |
| #define OP_STREAM_MATH_UNARY 0xAF |
| #define OP_STREAM_REDUCE 0xA8 |
| #define OP_STREAM_REDUCE_ARGMAX 0xB9 |
| #define OP_STREAM_REDUCE_ARGMIN 0xB8 |
| #define OP_STREAM_SCATTER_REDUCE 0xBF |
| #define OP_STREAM_SELECT 0xB7 |
| #define OP_STREAM_YIELD 0xBE |
| #define OP_SWAP_REG 0x89 |
| #define OP_TC_SWEEP_BATCH 0x47 |
| #define OP_THROW 0x5A |
| #define OP_TRAP 0x5C |
| #define OP_VEC_BLEND 0x27 |
| #define OP_VEC_CMP_BETWEEN 0x23 |
| #define OP_VEC_CMP_EQ 0x20 |
| #define OP_VEC_CMP_GT 0x21 |
| #define OP_VEC_CMP_LT 0x22 |
| #define OP_VEC_MATH_BINARY 0x2E |
| #define OP_VEC_MATH_TERNARY 0x2F |
| #define OP_VEC_MATH_UNARY 0x2D |
| #define OP_VECTOR_ANN_SEARCH 0xCA |
| #define OP_VECTOR_DIV 0x36 |
| #define OP_VECTOR_MUL_ATTR 0x34 |
| #define OP_VECTOR_REDUCE_SUM 0x35 |
| #define OP_VECTOR_RERANK_DOT 0xCB |
| #define OP_VECTOR_STR_CONCAT 0x37 |
| #define OP_VECTOR_TIME_VALID_AT 0x3D |
| #define OP_VXM 0x42 |
| #define SEMIRING_BOOL 3 |
| #define SEMIRING_MAX_MIN 2 |
| #define SEMIRING_MIN_PLUS 1 |
| #define SEMIRING_PLUS_TIMES 0 |
| #define TYPE_FLOAT64 TYPE_DOUBLE |
| typedef struct impulse_column_desc impulse_column_desc_t |
| typedef struct impulse_execution_result impulse_execution_result_t |
| typedef struct impulse_stmt impulse_stmt_t |
Opaque Statement Handle
| typedef struct impulse_vm_context impulse_vm_context_t |
| enum impulse_lane_width_t |
| enum impulse_language_t |
Supported DSL frontend dialects for the unified C++20 in-kernel compiler.
| enum impulse_vm_status_t |
VM Execution Status Codes.
| struct __attribute__ | ( | (aligned(64)) | ) |
VM Execution State Frame (640 bytes, 64-byte aligned).
Matches the layout of the Java 25 FFM MemorySegment representation.
< Program Counter offset (0)
< Alignment padding (4)
< Status flags register (ZF, LT, GT, EQ, ST) (8)
< 64-bit registers R0..R63 (16..527)
< Type tags for registers R0..R63 (528..591)
< Pointer to off-heap execution context (592..599)
< Subroutine return stack (600..631)
< Subroutine stack depth (632..635)
< Padding to exactly 640 bytes (636..639)
| struct __attribute__ | ( | (aligned(8)) | ) |
Fixed 64-bit Instruction Structure Layout.
< Opcode byte (0x00..0xFF)
< Instruction modifier flags
< Destination register index (R0..R63)
< Payload data (source register, relation ID, jump offset, or scalar constant)
| impulse_vm_status_t impulse_compile_and_execute | ( | const impulse_snapshot_t * | snapshot, |
| const char * | script, | ||
| impulse_language_t | lang, | ||
| impulse_vm_state_t * | state, | ||
| uint64_t | input_seed ) |
Compiles and directly executes a DSL query string against a snapshot.
| snapshot | Snapshot handle. |
| script | Source query text. |
| lang | Language dialect. |
| state | VM execution state frame. |
| input_seed | Initial seed node ID (placed in R0). |
| impulse_status_t impulse_compile_query | ( | const impulse_snapshot_t * | snapshot, |
| const char * | script, | ||
| impulse_language_t | lang, | ||
| impulse_instruction_t * | out_instructions, | ||
| size_t | out_capacity, | ||
| size_t * | out_count ) |
Compiles a DSL query string into physical 8-byte VM instructions using snapshot catalog statistics.
| snapshot | Snapshot handle (can be NULL for snapshot-less compilation). |
| script | Source query text. |
| lang | Language dialect (ImpLog, ImpK, ImpScheme, Cypher, CEL). |
| out_instructions | Output buffer for compiled impulse_instruction_t bytecode. |
| out_capacity | Capacity of out_instructions buffer. |
| out_count | Pointer to store actual count of generated instructions. |
| impulse_status_t impulse_compile_to_impas | ( | const impulse_snapshot_t * | snapshot, |
| const char * | script, | ||
| impulse_language_t | lang, | ||
| char * | out_impas_buffer, | ||
| size_t | out_capacity, | ||
| size_t * | out_bytes_written ) |
Compiles a DSL query string into human-readable ImpAsm (.impas) assembly text.
| snapshot | Snapshot handle (can be NULL). |
| script | Source query text. |
| lang | Language dialect. |
| out_impas_buffer | Output buffer to write assembly text string. |
| out_capacity | Capacity of out_impas_buffer. |
| out_bytes_written | Pointer to store written byte count (including null terminator). |
| impulse_status_t impulse_exec | ( | const impulse_snapshot_t * | snapshot, |
| const char * | query_text, | ||
| uint64_t | seed_node, | ||
| impulse_execution_result_t * | out_result ) |
One-line convenience wrapper: prepare, bind $seed, execute, and finalize.
|
inlinestatic |
UB-free 64-bit active lane mask constructor for K in [0..64+].
| impulse_status_t impulse_stmt_bind_bitset | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| const uint64_t * | words, | ||
| size_t | word_count ) |
| impulse_status_t impulse_stmt_bind_float | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| double | val ) |
| impulse_status_t impulse_stmt_bind_int | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| int64_t | val ) |
| impulse_status_t impulse_stmt_bind_node | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| uint64_t | node_id ) |
| impulse_status_t impulse_stmt_bind_nodes | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| const uint64_t * | node_ids, | ||
| size_t | count ) |
| impulse_status_t impulse_stmt_bind_roaring | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| const uint8_t * | bytes, | ||
| size_t | len ) |
| impulse_status_t impulse_stmt_bind_str | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| const char * | str ) |
| impulse_status_t impulse_stmt_bind_uint | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| uint64_t | val ) |
| impulse_status_t impulse_stmt_bind_uuid | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| const uint8_t | uuid_bytes[16] ) |
| impulse_status_t impulse_stmt_bind_vector | ( | impulse_stmt_t * | stmt, |
| const char * | param, | ||
| const float * | data, | ||
| size_t | dim ) |
| size_t impulse_stmt_buffer_size | ( | const impulse_stmt_t * | stmt | ) |
| uint32_t impulse_stmt_column_count | ( | const impulse_stmt_t * | stmt | ) |
| const void * impulse_stmt_column_data | ( | const impulse_stmt_t * | stmt, |
| uint32_t | col_idx ) |
| uint32_t impulse_stmt_column_dim | ( | const impulse_stmt_t * | stmt, |
| uint32_t | col_idx ) |
| bool impulse_stmt_column_is_null | ( | const impulse_stmt_t * | stmt, |
| uint32_t | col_idx, | ||
| size_t | row_idx ) |
| const char * impulse_stmt_column_name | ( | const impulse_stmt_t * | stmt, |
| uint32_t | col_idx ) |
| uint8_t impulse_stmt_column_type | ( | const impulse_stmt_t * | stmt, |
| uint32_t | col_idx ) |
| impulse_status_t impulse_stmt_execute | ( | impulse_stmt_t * | stmt, |
| void * | buffer, | ||
| size_t | buffer_size ) |
| void impulse_stmt_finalize | ( | impulse_stmt_t * | stmt | ) |
| impulse_status_t impulse_stmt_prepare | ( | const impulse_snapshot_t * | snapshot, |
| const char * | query_text, | ||
| impulse_stmt_t ** | out_stmt ) |
| size_t impulse_stmt_row_count | ( | const impulse_stmt_t * | stmt | ) |
| int impulse_vm_context_acquire_bitset | ( | impulse_vm_context_t * | ctx | ) |
| int impulse_vm_context_acquire_double_vector | ( | impulse_vm_context_t * | ctx | ) |
| int impulse_vm_context_acquire_float_vector | ( | impulse_vm_context_t * | ctx | ) |
| int impulse_vm_context_acquire_lane_frontier | ( | impulse_vm_context_t * | ctx | ) |
| int impulse_vm_context_acquire_node_vector | ( | impulse_vm_context_t * | ctx | ) |
| int impulse_vm_context_acquire_string_vector | ( | impulse_vm_context_t * | ctx | ) |
| int impulse_vm_context_acquire_value_map | ( | impulse_vm_context_t * | ctx | ) |
| void impulse_vm_context_bind_inline_data | ( | impulse_vm_context_t * | ctx, |
| const void * | data_ptr, | ||
| size_t | bytes ) |
| void impulse_vm_context_bitset_add | ( | impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| uint64_t | node_id ) |
| void impulse_vm_context_bitset_fill | ( | impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| uint64_t | count ) |
| uint64_t impulse_vm_context_bitset_get_word | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| size_t | word_idx ) |
| void impulse_vm_context_bitset_remove | ( | impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| uint64_t | node_id ) |
| bool impulse_vm_context_bitset_test | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| uint64_t | node_id ) |
| impulse_vm_context_t * impulse_vm_context_create | ( | const impulse_snapshot_t * | snapshot | ) |
| void impulse_vm_context_destroy | ( | impulse_vm_context_t * | ctx | ) |
| void impulse_vm_context_double_vector_set | ( | impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| size_t | index, | ||
| double | val ) |
| size_t impulse_vm_context_double_vector_size | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_float_vector_set | ( | impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| size_t | index, | ||
| float | val ) |
| size_t impulse_vm_context_float_vector_size | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| size_t impulse_vm_context_get_bitset_word_count | ( | const impulse_vm_context_t * | ctx | ) |
| const uint64_t * impulse_vm_context_get_bitset_words | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| const uint64_t * impulse_vm_context_get_collected_nodes | ( | const impulse_vm_context_t * | ctx, |
| size_t * | out_count ) |
| const double * impulse_vm_context_get_double_vector | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| const float * impulse_vm_context_get_float_vector | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| const uint64_t * impulse_vm_context_get_node_vector | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| size_t impulse_vm_context_get_vector_size | ( | const impulse_vm_context_t * | ctx | ) |
| uint64_t impulse_vm_context_lane_frontier_active_mask | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| const uint64_t * impulse_vm_context_lane_frontier_data | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| size_t impulse_vm_context_lane_frontier_node_count | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| uint32_t impulse_vm_context_lane_frontier_num_lanes | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| uint32_t impulse_vm_context_lane_frontier_width | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_mock_csc | ( | impulse_vm_context_t * | ctx, |
| uint16_t | relation_index, | ||
| const uint32_t * | csc_offsets, | ||
| const uint32_t * | csc_targets ) |
| void impulse_vm_context_mock_csc_typed | ( | impulse_vm_context_t * | ctx, |
| uint16_t | relation_index, | ||
| const void * | csc_offsets, | ||
| const void * | csc_targets, | ||
| uint8_t | node_id_width, | ||
| uint8_t | edge_index_width ) |
| void impulse_vm_context_mock_csr | ( | impulse_vm_context_t * | ctx, |
| uint16_t | relation_index, | ||
| const uint32_t * | csr_offsets, | ||
| const uint32_t * | csr_targets, | ||
| uint64_t | node_count, | ||
| uint64_t | edge_count ) |
| void impulse_vm_context_mock_csr_typed | ( | impulse_vm_context_t * | ctx, |
| uint16_t | relation_index, | ||
| const void * | csr_offsets, | ||
| const void * | csr_targets, | ||
| uint64_t | node_count, | ||
| uint64_t | edge_count, | ||
| uint8_t | node_id_width, | ||
| uint8_t | edge_index_width ) |
| void impulse_vm_context_node_vector_set | ( | impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| const uint64_t * | values, | ||
| size_t | count ) |
| size_t impulse_vm_context_node_vector_size | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_release_bitset | ( | impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_release_double_vector | ( | impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_release_float_vector | ( | impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_release_lane_frontier | ( | impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_release_node_vector | ( | impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_release_string_vector | ( | impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_release_value_map | ( | impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| void impulse_vm_context_reset | ( | impulse_vm_context_t * | ctx | ) |
| void impulse_vm_context_set_fuel | ( | impulse_vm_context_t * | ctx, |
| uint64_t | fuel ) |
| void impulse_vm_context_string_vector_add | ( | impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| const char * | str ) |
| const char * impulse_vm_context_string_vector_get | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| size_t | index ) |
| size_t impulse_vm_context_string_vector_size | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| const char * impulse_vm_context_value_map_get_key | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| size_t | index ) |
| float impulse_vm_context_value_map_get_value | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle, | ||
| size_t | index ) |
| size_t impulse_vm_context_value_map_size | ( | const impulse_vm_context_t * | ctx, |
| size_t | handle ) |
| impulse_vm_status_t impulse_vm_execute | ( | const impulse_instruction_t * | bytecode, |
| size_t | instruction_count, | ||
| impulse_vm_state_t * | vm_state, | ||
| uint64_t | input_param ) |
| impulse_vm_status_t impulse_vm_execute_to_buffer | ( | const impulse_instruction_t * | bytecode, |
| size_t | instruction_count, | ||
| impulse_vm_state_t * | vm_state, | ||
| uint64_t | input_param, | ||
| uint16_t | target_domain_id, | ||
| uint16_t | result_reg, | ||
| uint64_t * | out_words, | ||
| size_t | out_words_capacity, | ||
| size_t * | out_words_written ) |
| size_t impulse_vm_get_required_buffer_size | ( | const impulse_snapshot_t * | snapshot, |
| uint16_t | domain_id ) |
| int impulse_vm_state_hash | ( | const impulse_vm_state_t * | state, |
| int32_t | status, | ||
| uint8_t | hash_out[32] ) |
Computes deterministic SHA-256 state hash of VM state and execution context.
Hashes PC, flags, status, call stack, registers R0..R63, and recursively hashes the semantic contents of all referenced off-heap bitsets, vectors, lane frontiers, and value maps.
| state | Pointer to VM state frame. |
| status | VM execution status code. |
| hash_out | 32-byte buffer receiving SHA-256 digest. |
| int impulse_vm_state_hash_hex | ( | const impulse_vm_state_t * | state, |
| int32_t | status, | ||
| char | hex_out[65] ) |
Computes deterministic SHA-256 state hash as a 64-character lowercase hexadecimal string.
| state | Pointer to VM state frame. |
| status | VM execution status code. |
| hex_out | Buffer of at least 65 bytes receiving null-terminated hex string. |
| impulse_vm_status_t impulse_vm_validate | ( | const impulse_instruction_t * | bytecode, |
| size_t | instruction_count ) |
Execute a sequence of VM bytecode instructions against a VM state frame.
| bytecode | Pointer to array of impulse_instruction_t instructions. |
| instruction_count | Number of instructions in array. |
| vm_state | Pointer to aligned VM state frame. |
| input_param | Input seed node ID or parameter value. |
Ahead-of-Time Bytecode Type & Register Validator. Performs single-pass abstract type propagation across registers R0..R63. Guarantees zero runtime type tag branch mispredictions in SIMD execution loops.
| bytecode | Pointer to array of impulse_instruction_t instructions. |
| instruction_count | Number of instructions in array. |
| impulse_instruction_t |
| impulse_vm_state_t |