# Backend qualification Backend qualification measures one saved deployment artifact on one declared backend. The artifact is a persistent candidate whose every reload verification passed (see `docs/PERSISTENT_CANDIDATES.md`), named by its manifest id. A support claim covers exactly the (artifact, backend) pairs that qualified. ```bash obliteratus experiments qualify run sha256: --run ./observations/ \ --pack ./packs/qualification --revision sha256: --role select \ --device cuda:0 --dtype float16 --cache cached obliteratus experiments qualify matrix --run ./observations/ \ --backend '{"device": "cuda", "dtype": "bfloat16", "cache": "cached"}' ``` ```python from obliteratus.experiments.backend_qualify import qualify from obliteratus.experiments.backend_matrix import support_matrix record = qualify(run, candidate, {"device": "cuda:0", "dtype": "float16", "cache": "cached"}, {"pack": "packs/qualification", "revision": revision, "role": "select"}) matrix = support_matrix(run, backends=[{"device": "cpu", "dtype": "bfloat16", "cache": "uncached"}]) ``` ## Backend descriptor | Field | Values | Default | | --- | --- | --- | | `device` | `cpu`, `cuda[:N]` | required | | `dtype` | `float32`, `float16`, `bfloat16` | required | | `cache` | `cached`, `uncached` (generation `use_cache`) | required | | `quantization` | `none`, `bnb-int8`, `bnb-nf4` | `none` | | `attention` | `default`, or an implementation the loader provides (`eager`, `sdpa`) | `default` | | `tokenizer` | the tokenizer stored with the artifact and its vocabulary digest | the parent's digest | The backend id is the SHA-256 of the canonical descriptor: two backends that differ in any field are separate rows. Native (`quantization: none`) and quantized backends are therefore never merged. ## What a run does 1. Refuses a candidate that is not `selected`, a descriptor missing a required field, unknown tolerances, and rows that overlap discovery or any registered confirmation set. 2. Records `unsupported` without loading anything when the combination cannot run: an unknown device type, dtype, cache mode or quantization format, a bitsandbytes format off CUDA or on a loader without a quantized load, LoRA on a quantized base, an attention implementation the loader does not provide, or a model whose cache mode cannot be enforced. Nothing is replaced by another device, dtype or format. 3. Refuses with nothing recorded when this host lacks the device or package (the pair stays `untested`). 4. Records `failed` without loading when the artifact files no longer match the manifest. 5. Otherwise loads the saved artifact from disk twice into fresh objects, on the CPU float32 reference backend (`cached`, default attention) and on the declared backend: the edited copy for a weight edit, or the parent (whose file digests are re-checked) with the saved adapter attached. Both run the frozen recipe's tasks with greedy decoding on the same rows. The backend side qualifies when every check passes against the reference side: * `realized_device`, `realized_dtype` (or `realized_quantization`), `realized_attention`: the loaded model runs the declared settings; * `tokenizer_identity`: both loaded tokenizers have the declared vocabulary digest; * `target_effect_parity`: target success rates within `target_rate`; * `completion_agreement`: at least `agreement` of completions are equal; * `probe_logits`, `probe_activations`: final-token logits and the edited site's final-token output for the recipe's probe prompts within `logit_atol` and `activation_atol`; * `collateral_endpoints`: every collateral task and the target's invalid-output endpoint are `PASS` at the dossier's collateral margin. Tolerances default to the candidate's declared tolerances (`activation_atol` defaults to `logit_atol`); overrides are recorded with the result. ## Evaluation bundle Each attempt is written once to `/backend-qualification///NNNN/`: `qualification.json` plus the generations of both sides under `reference/` and `backend/`. The record holds the descriptor, the reference descriptor, the dataset and independence basis, what was loaded (artifact and parent digests), the comparison, the paired scorecard, every check and the status. `evaluation_sha256` covers all of it except `host` (load and generation seconds, row count, peak process RSS or peak CUDA memory, platform), `provenance` and the attempt number. ## Support matrix `support_matrix` (schema `obliteratus.backend-support-matrix`, version 1) has one row per (candidate, backend id) with status: * `qualified`: every stored attempt qualified; * `failed`: any attempt failed, a stored record no longer reproduces its `evaluation_sha256`, or the artifact changed afterwards; a later passing attempt does not clear a failure; * `unsupported`: the latest attempt was an unsupported combination; * `untested`: a declared backend without an attempt. Rows carry evidence references (path, attempt, status, digest). `qualified_pairs` lists exactly the qualified rows, also split into `claim.native` and `claim.quantized`; `claim.blocked` lists each artifact's failed backends, which rule out any claim beyond its qualified pairs. ## Limits Only `cpu` and `cuda` devices and bitsandbytes formats are supported; GGUF, GPTQ, AWQ and other formats are `unsupported`. The bitsandbytes path requires the transformers loader and a CUDA device. Cached-versus-uncached trace parity is a separate check (`docs/TEMPORAL_TRACES.md`); here the cache mode is a backend setting compared against the reference execution. Pull-request CI covers the CPU paths; the CUDA tests run in the conditional CUDA gate.