Backend method inventory (T1.2)

May 19, 2026 · View on GitHub

Cross-reference between device.Backend embedded interface methods and ir.RequiredOperationIDs(). Machine-checkable source of truth: pkg/backend/device/inventory.go, inventory_links.go, validated by pkg/backend/device/inventory_test.go.

CPU per-domain dispatch registration (T1.3): docs/cpu-dispatch-matrix.md (pkg/backend/device/cpu/dispatchaudit/).

Metal / CUDA / XLA tensor backend matrix (T1.4): docs/device-backend-matrix.md (pkg/backend/device/backendaudit/).

Combined ISA/backend coverage (T1.5): backend-coverage.md (pkg/backend/device/coverageaudit/).

Summary (2026-05-19)

ItemCount
device.Backend methods (25 embedded interfaces)151
ir.RequiredOperationIDs() entries119
Required ops → direct Backend method74
Required ops → composite Backend methods3
Required ops → kernel registry (not on Backend)32
Required ops → graph-only (no compute kernel)10
Backend methods with no required-op ID88

Embedded surfaces

SurfaceMethods
Activation55
Physics9
Causal10
Elementwise11
PosPop5
VSA5
Losses6
Hawkes5
Pool4
Convolution4
ActiveInference4
PredictiveCoding4
Masking3
Attention3
Sampling3
Normalization3
Reduction5
LayerNorm2
RoPE2
Embedding2
Dequant2
Dot1
Matmul1
Dropout1
Quant1

Direct (74)

Each required operation ID maps to a single Surface.Method on device.Backend. Examples: math.addElementwise.Add, convolution.conv2dConvolution.Conv2D, train.loss.mseLosses.MSE.

Composite (3)

Operation IDBackend methods
attention.mqaAttention.MultiHeadAttention, Attention.FlashAttention
attention.gqaAttention.MultiHeadAttention, Attention.FlashAttention
projection.fused_qkvMatmul.Matmul, Attention.MultiHeadAttention

Kernel registry (32)

Implemented under CPU/Metal/CUDA kernel registries, not as device.Backend methods:

  • Shape (9): shape.reshape, shape.transpose, shape.concat, shape.split, shape.upsample_nearest2d, shape.view_as_heads, shape.merge_heads, shape.last_token, shape.slicepkg/backend/device/cpu/shape
  • Optimizers (12): train.optimizer.*pkg/backend/device/cpu/optimizer, pkg/backend/device/metal optimizer kernels (not on Backend)
  • Training grads (4): train.loss.*_grad, train.grad.* → losses kernel registry
  • Math helpers (4): math.sin, math.cos, math.outer, math.sign → elementwise/matmul registries
  • Other (3): math.logsumexp, hawkes.simulate, math.inv_sqrt_dim_scale

Graph-only (10)

Operation IDNote
OpInputGraph input binding
OpFusedFusion pass composite
bench.accuracy, bench.perplexity, bench.f1Metric nodes
bench.metric.accuracy, bench.metric.perplexity, bench.metric.f1Metric nodes
model.graft, model.freezeModel-editing graph ops

Backend-only methods (88)

Methods on device.Backend not referenced by any ir.RequiredOperationIDs() entry. Includes extended activations (Activation.Exp, Activation.GeluTanh, gated tensor variants), PosPop, Physics, Sampling, Dequant/Quant, duplicate Elementwise.ReLU, and most of the Activation parametric variants.

Use device.BackendMethodsWithoutRequiredOperation() for the authoritative list.

Gaps for R1

  • Optimizer steps are required IR ops but are not on device.Backend; they live in per-backend kernel registries.
  • Shape ops are required IR ops but are not on device.Backend.
  • 88 Backend methods have no required-op ID (extended/specialized surfaces).