Draft v0.1 · CC0
Request for Comment
Cross-Paradigm Relaxation Dialect
RELAX/1
Ten operations, an MLIR and NIR-style exchange form, and a lowering matrix across substrates.
Charlot Lab ecosystem · released CC0 for comment
EFA-RFC-002: RELAX/1
A relaxation dialect and cross-paradigm exchange for energy-native computing
| Status | Draft v0.1, for public comment |
| Date | 2026-08-02 |
| License | CC0 1.0: adopt, fork, or absorb without permission |
| Companion | EFA-RFC-001 (OER/1 receipts + DRIFT/1 benchmark); every executing op in this dialect emits an OER receipt stub |
| Intended audience | MLIR community · NIR maintainers · Intel Lava · Extropic thrml · Ferric · UXL Foundation · vendors of settling, sampling, annealing, crossbar, and neuromorphic hardware · GPU-simulation implementers |
RFC 2119 keywords apply.
1. Motivation
Every portability layer in production (Triton, StableHLO/IREE, SYCL, Mojo/MAX, CANN, MUSA, Vulkan compute, ggml) shares one assumption: the primitive of computation is a kernel applied to tensors on a clock. Searching the public dialect and op registries of those eight projects as of 2 August 2026, this review did not locate a first-class representation for a thermodynamic sampling unit, an Ising annealer, a memristor crossbar doing in-situ writes, or a ternary settling fabric. The eight projects searched and the search date are named above; a reader who locates one should treat this RFC's motivation as correspondingly weakened. A kernel-and-clock IR has no way to express relax until stable, so a matmul lowered onto a settling device arrives as a simulation of a clock rather than as the device's native dynamics, paying for the substrate's advantage without collecting it. This RFC does not compute that penalty for any substrate; doing so for the two reference backends is a v1.0 requirement (§9). The consequence is structural: The portability layers this review located target GPU-class hardware, and this review did not locate a shared compiler target for the energy-native paradigm; where none exists, each new substrate carries the cost of its own stack. The first neuromorphic wave sits on the same trajectory and is instructive rather than cautionary: it did not end, it fragmented across per-chip toolchains, and NIR is the measured change that moved that boundary, one spiking model now runs across Loihi 2, SpiNNaker2, Xylo and Speck..
One shipping counterexample shows the shape of a fix, in an adjacent paradigm: NIR, the Neuromorphic Intermediate Representation, runs one spiking model across Loihi 2, SpiNNaker2, Xylo, Speck, and simulators, because its primitives match the physics (stateful neurons and spikes, not kernels). RELAX/1 is the analogous object for relaxation and sampling computation: a small op set whose primitives are settle, sample, anneal, local write, verify, certify (declarative about what equilibrium or distribution is sought, silent about how the substrate reaches it). It is specified as (a) an MLIR dialect (relax) so it lands inside the compiler commons the industry already runs, and (b) a JSON graph-exchange form (mirroring NIR) for runtimes without MLIR.
Design goal: a model expressed once in RELAX/1 runs today on a GPU in simulation, tomorrow on any conforming physical substrate, and produces an OER/1 receipt either way, with the provenance axes telling you which one you got.
2. Design principles
- Physics-neutral semantics. Ops define fixed points, distributions, and update rules mathematically; substrates satisfy them by any means (gradient descent, analog dynamics, thermal noise, optical interference).
- Mandatory simulation lowering. Every op MUST have a reference GPU/CPU lowering (via StableHLO/Triton). This is the adoption strategy (no exotic hardware required to use the dialect) and the correctness oracle for physical targets. Simulated executions are auto-tagged
provenance: simulated × emulation. - Energy-typed execution. Every executing op takes a budget (joules, steps, seconds, or a temperature schedule) and MUST either satisfy it or refuse; refusal is a first-class, receipted outcome.
- Receipts native. Executing ops emit OER/1 receipt stubs; the runtime completes and signs them. Compilation without receipts is legal; execution without receipts is nonconforming above RELAX-C1.
- Stochasticity in the type system. Sampling ops are effectful and seeded where the substrate permits; native-thermal sources declare non-reproducibility explicitly rather than faking seeds.
- Small on purpose. Ten core ops. Anything expressible as composition stays out of the core.
3. Core abstractions
- Energy (
!relax.energy<form, state_type, N>): a scalar function over states. Forms:ising(pairwise couplings + biases),hopfield(dense/ternary associative),factor_graph(sparse local factors),ebm_net(learned neural E_θ, carried as a StableHLO/ONNX sub-module),composite(sum/min of energies). - State (
!relax.state<domain, N>):binary,ternary,continuous<fN>,spiking(bridged to/from NIR). - Budget (
!relax.budget<joules|steps|seconds|schedule>): compile-time-checked where static; runtime-metered otherwise. - FastWeights (
!relax.fastweights<N, M>): inference-time-mutable coupling store, the Hebbian target; on crossbar substrates this is physical memory. - Certificate, Receipt: as defined in RFC-001.
4. Op set (v0.1 core)
| Op | Signature (informal) | Semantics |
|---|---|---|
relax.define_energy |
attrs(form, params/URI) → energy |
Declare/bind an energy landscape |
relax.encode / relax.decode |
tensor ⇄ state |
Move between tensor world and state world |
relax.settle |
(energy, state, budget, tol) → (state, receipt) | Reach a local fixed point: E non-increasing along the trajectory; stop at tol or budget; MAY refuse |
relax.sample |
(energy, n, temp, method, seed?) → (states, receipt) | Draw n samples ~ e^(−E/T); method ∈ gibbs | langevin | metropolis | native_thermal |
relax.anneal |
(energy, schedule, budget) → (state, receipt) | Settle under a declared temperature path; the op where the coupled-chain/annealing question is answered on hardware |
relax.local_write |
(fastweights, x, y?, rule, α, gate?) → fastweights′ | Gradient-free write: rule ∈ hebbian(αxxᵀ) | delta | decay | surprise_gated; the native crossbar/settle×2 op |
relax.nudge |
(energy, target, β) → energy′ | Clamp/bias toward a target (EqProp phase two) |
relax.eqprop_grad |
(x_free, x_nudged) → local Δcouplings | Learning signal from two relaxations |
relax.verify |
(energy, state, τ) → (bool, margin, receipt) | Energy-as-verifier: accept iff E(x) ≤ τ |
relax.certify |
(energy, region, type) → certificate | type ∈ energy_monotone | contraction_region; populates OER certificate |
relax.compose |
(E₁, E₂, mode) → energy | mode ∈ sum (conjunction) | min (disjunction); zero-shot compositionality |
Illustrative MLIR-style listing (drift-benchmark inner loop, RFC-001 task D-A):
%E = relax.define_energy ising couplings(@W_world) : !relax.energy<ising, ternary, 4096>
%z = relax.encode %obs : tensor<4096xf32> -> !relax.state<ternary, 4096>
// think: K-step settle under a joule budget: may refuse
%z*, %r1 = relax.settle %E, %z budget(#relax.budget<joules 2.0e-6>) tol(1.0e-4)
// plan: sample candidate futures, verify with the same energy
%cands, %r2 = relax.sample %E_goal, 64 temp(0.8) method(metropolis) seed(17)
%ok, %m, %r3 = relax.verify %E_goal, %best threshold(0.12)
// adapt on surprise: gradient-free write to fast weights (native crossbar op)
%Z1 = relax.local_write %Z, %z* rule(hebbian) alpha(0.02) gate(surprise > 0.7)
// receipts %r1..%r3 aggregate under RFC-001 §3.3 min-grade composition
5. Lowering targets (v0.1 matrix)
| Substrate family | settle |
sample |
anneal |
local_write |
Notes |
|---|---|---|---|---|---|
| gpu_sim (reference, REQUIRED) | unrolled descent (Triton/StableHLO) | Gibbs/Langevin kernels | scheduled Langevin | tensor update | Correctness oracle; auto-tag simulated×emulation |
| fpga_settling (ternary settling fabric) | native | via settle+noise inject | clocked schedule | settle×2 / direct SRAM write | First physical conformance target; receipts via frequency-sweep (OER-L1) |
tsu_pbit (Extropic-class; thrml bridge) |
zero-T limit: relax.sample with the temperature driven to zero concentrates on the energy minimum, so settle is sample with T pinned at 0. The substrate's intrinsic noise floor sets the lowest T actually reachable, so a conforming backend MUST declare that floor; where it exceeds the tol requested, the op MUST refuse rather than return a sample as a fixed point. | native_thermal | native schedule control | host-side | DTM = chained relax.sample; seedless native sampling declared |
| ising_annealer (SBM / DA / CIM / D-Wave) | zero-T anneal | repeated anneal reads | native | n/a (couplings reload) | Sub-microsecond-class time-to-solution on the problem sizes its vendors publish; this RFC does not verify the records claimed and names no comparison substrate. QUBO adapter. |
| cim_crossbar (memristor/PCM) | analog matvec iteration | + noise | scheduled | in-situ outer product, native | The write IS the physics. Status: designed, not implemented. No endurance figure has been measured by this program; the endurance budget is a field a conforming backend MUST declare, not a number this RFC supplies. |
| neuromorphic_snn (via NIR bridge) | attractor nets | stochastic neurons | intrinsic | on-chip plasticity rules | state<spiking> round-trips through NIR |
| photonic | iterative optical loop (exp.) | optical noise (exp.) | exp. | n/a | Marked experimental in v0.1 |
A conforming physical backend implements ≥1 column natively and MAY delegate the rest to gpu_sim with correct provenance tags; mixed executions compose under RFC-001 min-grade rules.
6. Exchange form and interop
- JSON graph (NIR-mirroring): nodes = ops above; edges = states/energies; energies-by-reference (URI + hash) so learned E_θ travels as ONNX/StableHLO payload.
- ONNX: custom domain
org.efa.relaxfor the ten ops (opset 1). - NIR bridge:
state<spiking>encode/decode is specified against NIR node types; a spiking policy can be verified by arelax.verifyenergy and vice versa. thrml/ Lava adapters: thin mappings published as reference code; neither project need change to be targeted.- Receipts: every runtime boundary above is an OER emission point (RFC-001 §5).
7. Conformance
| Level | Meaning |
|---|---|
| RELAX-C0 | Dialect-valid programs run on gpu_sim reference lowering |
| RELAX-C1 | ≥1 op lowered to a physical substrate, oracle-checked against gpu_sim |
| RELAX-C2 | C1 + OER-L1 receipts emitted on every executing op |
| RELAX-C3 | C2 + relax.certify implemented for actuation-class workloads; DRIFT/1-eligible |
8. Anti-goals
Not a kernel language (Triton/Mojo remain the right tools inside ebm_net). Not a spiking format (NIR owns that; we bridge). Not a quantum IR (annealers enter only through their classical interface). Not a scheduler. Placement/routing across substrates is the runtime’s job (flowg-class systems), for which this dialect is the instruction set.
9. Reference-implementation plan before v1.0
JSON-Schema + MLIR dialect definition (TableGen); gpu_sim lowerings for all ten ops; two physical backends on dissimilar substrates (one settling fabric, one sampler); the RFC-001 D-A task expressed end-to-end with receipts; conformance test suite with oracle tolerances.
Acknowledgments
Primitive set distilled from: EBT descent-as-thinking (Gladstone/Du); EqProp (Scellier–Bengio); fast-weight/delta-rule lineage (Schmidhuber; Ba; Yang; Behrouz); EFA’s unified readings (settle/verify/certify/write) and published negatives; NIR’s proof that paradigm-matched primitives portabilize; Extropic’s DTM as chained sampling. CC0: the point is adoption, not attribution. Drafted with AI assistance (Claude, Anthropic) at the direction of the EFA program.