Skip to main content

Overview

A THRINDEX backend is a Rust struct that implements the Backend trait from thrindex-backend-api. Once registered, it can be used with thx.compile(target=name) and thrindex run --target name. To earn the THRINDEX Certified [v0] badge, the backend must pass the conformance harness against CONFORMANCE_ENVELOPE_V0 on the frozen 120-sample fixture set.

Step 1: Implement the Backend trait

run_batch contract:
  • Input: inputs[s][t][n] — sample s, timestep t, neuron n. Values are 0.0 or 1.0 (binary spike).
  • Output: result[s][t][n] — same indexing. Values must be exactly 0.0 or 1.0.
  • Output shape: result[s] must be [T, N_out] where T and N_out come from the artifact, not from the input.
Violating the output shape contract produces E0203 in the conformance harness.

Step 2: Declare the Capability

The Capability struct tells the compiler what the backend can do:

Step 3: Register the backend

In Python:

Step 4: Run the conformance suite

The fixture set is the frozen 120-sample SHD set, CRC32 e2ebd845. If your backend does not have access to the full fixture set, start with --n-samples 10 for debugging (this produces a structural demo, not a certification run).

Step 5: Interpret the report

Exit code 0 = PASS. Submit this report alongside your backend registration PR.

Common failure modes

T_max too high: a small number of samples produce neurons with large spike-count divergence. Typically a fixed-point overflow or a rounding boundary in the accumulator. Check for saturation in the multiply-accumulate path. P_pred too low: the backend makes wrong classification decisions even when T_mean is acceptable. This usually indicates a systematic bias in one weight or one neuron that dominates the argmax. Enable verbose logging on failing samples to identify the pattern. E0206: your run_batch returns the wrong output shape. Check that you are using T and N_out from the artifact, not from the input tensor shape.

Maintenance

A backend must be re-certified when:
  • CONFORMANCE_ENVELOPE_V0 is superseded by a new version
  • The backend’s firmware or driver changes in a way that affects computation
  • The reference model used in the fixture set changes
The V0 badge is retained in published history but marked superseded once re-certification under V1 completes.