Skip to main content

Module ir

Module ir 

Source

Re-exports§

pub use q42_bridge::deserialize_graph;
pub use q42_bridge::graph_merkle_root;
pub use q42_bridge::opcode_of;
pub use q42_bridge::serialize_graph;

Modules§

builtin
capabilities
core
graph
Compute-graph IR (a typed DAG) — the backend-portable representation the forge lowers to every target in one pass. See docs/plans/dag-ir-forge.md().
intrinsics
q42_bridge
q42 substrate binding (plan §5 / Phase 6) — serialize a ComputeGraph to and from 48-byte NQuin records, so a compute DAG persists in the same Merkle-DAG quin store as the rest of QualiaDB (zero-copy, page-aligned), with provenance.

Structs§

BufferSpec
ComputeGraph
A directed acyclic compute graph. Acyclic by construction: ComputeGraph::push only accepts inputs that reference already-added nodes (or EXTERNAL), so insertion order is a valid topological order. nodes[i].out.producer == NodeId(i).
GraphNode
One node of a ComputeGraph: an op, its input edges, its single output edge, and a per-node Schedule.
HardwareCapabilityMatrix
KernelSpec
LoweringContext
NodeId
Arena index of a node within a ComputeGraph. NodeId::EXTERNAL marks a graph input (a TensorRef produced outside the graph).
P64GpuWords64
64-byte aligned GPU descriptor container for P64 weight records.
Shape
Fixed-rank (≤4) tensor shape — no Vec, so a TensorRef stays Copy. A dim of 0 means “runtime-parameterized” (resolved from a params buffer at dispatch — e.g. GEMM’s M/N/K), which is how the dimension-independent WGSL kernels are represented.
SharedMemorySpec
TensorRef
A typed data-flow edge: the tensor-th output of producer, with its shape/dtype.

Enums§

BufferAccess
BufferElement
BuiltinKernel
DType
Element type of a tensor edge.
Intrinsic
IntrinsicClass
IntrinsicSupport
Outcome of checking one Intrinsic against the local hardware (plan §6).
Layout
Storage layout of a tensor edge (row-major dense for now).
LoweringPolicy64Bit
How a 64-bit value would be lowered for a given adapter.
Op
OpNode
An op-CLASS and its compile-time payload — the node label of the compute DAG (plan §2; Slice/Rope added for the real decode layer). Seed arms (Elementwise/MatMul/Gemv/ Fft) have a real lowering today; the rest are declared so the vocabulary is fixed, and lower to an explicit Err until their phase builds them.
ScalarType
SharedLen
SubgroupReduceOp

Traits§

Lowerer
A backend code generator. lower_graph calls exactly one method per node, in topological order. Op-classes a backend has not implemented yet use the default methods, which return an explicit Err (never a silent no-op).

Functions§

lower_graph
Walk the graph in topological (insertion) order and dispatch each node to its Lowerer method. The single, backend-agnostic lowering driver — every backend is a Lowerer impl, so there are no per-kernel.id branches.