Sarek_interp.Sarek_ir_interp_evalPositional tuple-field index for a synthesized _tup_* record: "_0" -> Some 0, "_12" -> Some 12, any other name -> None. Used to resolve tuple-element field access without a record-registry entry.
val eval_intrinsic :
Sarek_ir_interp_value.thread_state ->
string list ->
string ->
Sarek_ir_interp_value.value list ->
Sarek_ir_interp_value.valueMain intrinsic dispatcher - tries each category in order
val eval_intrinsic_by_type :
string list ->
string ->
Sarek_ir_interp_value.value list ->
Sarek_ir_interp_value.valueTry type-specific intrinsics based on path
val eval_array_expr :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.expr ->
Sarek_ir_interp_value.valueArray expression evaluation
val eval_composite_expr :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.expr ->
Sarek_value.valueRecord and variant expression evaluation
val eval_control_flow :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.expr ->
Sarek_ir_interp_value.valueControl flow expression evaluation
val eval_special_expr :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.expr ->
Sarek_ir_interp_value.valueCast and intrinsic expression evaluation
val eval_expr :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.expr ->
Sarek_ir_interp_value.valueMain expression evaluator - dispatches to specialized handlers
val get_array :
Sarek_ir_interp_value.env ->
string ->
Sarek_ir_interp_value.value arrayval eval_app :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.expr ->
Sarek_ir_types.expr list ->
Sarek_ir_interp_value.valueval exec_stmt :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.stmt ->
unitThe interpreter is the ORACLE every backend is checked against, so this is not a courtesy implementation: test_vulkan_coopmat_ir_e2e compares the GLSL backend's output against these numbers bit for bit, and a skip here would let a coopmat kernel "agree" with an interpreter that never computed the product.
Every invocation holds the whole matrix and performs the whole operation; see Sarek_ir_interp_value.env.coopmats for why that is exact rather than approximate.
Only the INTEGER configurations are evaluated. Float accumulation is refused, and refused HERE rather than left to produce a plausible number, because the interpreter cannot honestly model it: SPV_KHR_cooperative_matrix leaves the ORDER of the k+1 additions to the implementation, so there is no single value a strict oracle could compare against (design document §5.1). Integer accumulation has no such freedom — the specification states it is exact at the precision of the result type — which is the entire reason the integer path lands under Sarek's existing strict contract.
val coopmat_zero :
Sarek_coopmat_types.component_type ->
Sarek_ir_interp_value.valueval coopmat_refuse_float : 'a. Sarek_coopmat_types.component_type -> 'aval coopmat_narrow : Sarek_coopmat_types.component_type -> int32 -> int32Narrow an accumulated Int32 to the declared component type.
This is what makes the interpreter a faithful oracle for the 8-bit operand types rather than merely a plausible one: a value loaded into a u8 fragment from a buffer holding 300 is 44 on the device, and an oracle that kept 300 would disagree with correct hardware.
val get_coopmat :
Sarek_ir_interp_value.env ->
string ->
Sarek_ir_interp_value.value arrayval exec_coopmat :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.coopmat_op ->
unitval read_lvalue :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.lvalue ->
Sarek_ir_interp_value.valueval assign_lvalue :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.lvalue ->
Sarek_ir_interp_value.value ->
unitval exec_stmt_for_return :
Sarek_ir_interp_value.thread_state ->
Sarek_ir_interp_value.env ->
Sarek_ir_types.stmt ->
Sarek_ir_interp_value.valueval run_block :
Sarek_ir_interp_value.env ->
Sarek_ir_types.stmt ->
(int * int * int) ->
(int * int * int) ->
(int * int * int) ->
unitRun all threads in a block with BSP barrier synchronization
val run_grid_sequential :
Sarek_ir_interp_value.env ->
Sarek_ir_types.stmt ->
(int * int * int) ->
(int * int * int) ->
unitRun all blocks in a grid (sequential)