Model-zoo verification: corpus, matrix harness and gates (#73)
Model-zoo harness, corpus and gates for #73, phases 1–3.
Status: corpus, thresholds and placement rule approved. The program is frozen at 25e58d6 (hashes in freeze.json). Two measured runs are recorded (2026-12-01, RTX 5070 host). The first failed verdictTruthfulness on a LinML defect in output extraction, since fixed in #85. The second passes every gate. Anything run before the freeze is rehearsal data. This PR merged as 25b770f (15:25 UTC) while the second run was still in progress, and this description was updated after the merge.
What's in it
All under verification/model-zoo/, Python 3.10+, standard library only:
corpus.json: 8 models at pinned revisions. Each has a SHA-256, size, license basis (from the model's own README or card at that revision), exporter, coverage axes and input bindings.- mobilenetv2-7, resnet50-v1-12, resnet50-v1-12-qdq, all-MiniLM-L6-v2 (float and dynamic int8), yolov4 (MIT), bertsquad-12, and convnext-tiny-opset18, the only opset-17+ model (observed opset 18).
- Known gaps: no control-flow model and no KV-cache decoder.
thresholds.json: the provider list, repetitions (1), and the six RFC gates in machine-readable form. The placement-honesty decision (strict, no shape-subgraph exemption) is recorded in the file.zoo.py:admit,run,gate,freeze.admitfetches into a store outside the repo and refuses any size or hash mismatch.runexecutes model × provider × {run-cold, compile-strict, compile-partial, run-warm}, plus one zero-config cell per model. Each child process gets its own cache root.run --measuredrefuses to start unless the freeze matches.gaterefuses measured results unless they are judged by their frozen thresholds snapshot.
- Tests: 36 harness tests against a scriptable fake
linml, run in CI next to the Python binding tests. - Docs:
docs/compatibility.mdpoints here.
Design choices
- Cold is cold. Each (model, provider) pair has its own
XDG_CACHE_HOME, emptied throughlinml cache clear. The operator's~/.cache/linmlis never touched. - Every planned cell gets a record.
plan.jsonis written first. A cell isskiponly when LinML's own error line says the provider can't run on this host. Exit code 3 alone, and forwarded exception text, never make a skip; they are failures to triage.unsupportedis LinML's "claimed none of the model's nodes" run error. A launch failure isharness-error. - Compile has three outcomes. A passthrough artifact (success with nothing compiled) never counts as compiled.
- Placement honesty uses profiled kernel events, not node counts, because fusions and TensorRT partitions make node counts incomparable. A selected provider that ran no profiled kernel is flagged, whatever other providers ran.
- Missing evidence never passes. A passing non-CPU run with no profiled placements is a violation.
- Repetitions must agree on status, selected provider, which providers ran kernels, and the fallback chain. Otherwise the cell is
flaky.
Review rounds
- Round 1: cold-leg chain stop, separate cache errors, evaluator split, fake-CLI arguments, complexity cleanup for CodeFactor.
- Round 2: exit 3 is no longer a host skip; missing placement evidence fails; repetitions must agree; measured re-gating uses the frozen snapshot; relative paths anchored; per-model licenses (yolov4 is MIT).
- Round 3: host skips read only LinML's own error line; launch failures are
harness-error; the CLI is resolved from PATH once, up front;nominal_onlycovers kernels on other providers;env.jsonis required for gating.
The unsupported marker is checked against EpGraphAssignment.cs and a verbatim fixture from the 2026-12-01 GPU run.
Rehearsal (not evidence)
Run on RTX 5070 / WSL2 Ubuntu with an earlier build, --only mobilenetv2-7 all-minilm-l6-v2-quantized, all 7 providers. It is kept as the reference for the rules above, and it re-gates identically under the current harness.
- Harness survivability: 58/58 cells recorded, 0 harness errors.
- mobilenetv2-7: clean. trt-rtx strict-compiled and ran warm with every kernel on the provider.
- Findings the harness surfaced, both fixed on
main:
First measured run
First measured run, 2026-12-01, RTX 5070 on WSL2 Ubuntu. linml 0.7.2 built from 8c25263, the merge of main (2a697b9, with #82, #83, #84) into this branch, with source identical to that main commit (an earlier version of this text called it a main commit); harness at 25e58d6, frozen, zoo.py hash unchanged from the freeze record. env.json records rehearsal: false. 232 of 232 planned cells recorded, 0 harness errors, 1349 s.
| Gate | Result |
|---|---|
| Harness survivability | pass (232/232 recorded) |
| Verdict truthfulness | fail: 1 unwaived violation, bertsquad-12/trt-rtx (see below) |
| Placement honesty | pass (0 violations; no waivers used) |
| Selection correctness | pass |
| No silent degradation | pass |
| Failure classification | pass (15 failing items classified, 0 unknown) |
Cells: 61 pass, 14 fail, 54 unsupported, 24 skip, 79 not-run.
What passed. mobilenetv2-7, resnet50-v1-12, all-MiniLM-L6-v2 (float), convnext-tiny-opset18 and yolov4 ran on cpu, cuda, trt and trt-rtx. Zero-config selections agreed with the explicit runs for the seven models that passed at least one run. The quantized MiniLM on trt-rtx is now reported as unsupported (claimed no nodes) instead of silently running on CPU, which was the rehearsal finding (#82).
Warm legs are not equal. The trt-rtx warm legs (five models) loaded a strict-compiled artifact with no rejection, but run --json does not report artifact use, so use is not observable. The five TensorRT warm legs, for the same five models, loaded a passthrough artifact that ORT rejects, so each fell back to the original model. Those passes are not warm-cache evidence.
Failures and triage (triage.json, evidence per item):
- bertsquad-12, 9 fail cells, no provider passes:
linml-defect. After ORT returns,OnnxInferenceSession.RuncallsAsTensor<float>()on every output (src/LinML.Runtime.Onnx/OnnxInferenceSession.cs, lines 61–64). bertsquad-12 has an int64 output (unique_ids:0). Confirmed afterwards: a Debug-build run of the #85 regression test throws attensor.Dimensions, so the cast returned null. Under--require-providerthe message reaches the user asObject reference not set…; otherwise it is hidden behindAll providers failed at execution. Fixed in #85. - all-MiniLM-L6-v2-quantized on TensorRT, 3 fail cells:
ort-ep-limitation. ORT's TensorRT EP refuses the graph:TensorRT input: /embeddings/position_embeddings/Gather_output_0 has no shape specified. Please run shape inference…. - all-MiniLM-L6-v2-quantized on TensorRT-RTX, compile-strict:
ort-ep-limitation. The TensorRT-RTX ONNX parser rejectsMatMulInteger(node 610) andDynamicQuantizeLinear(node 619). - resnet50-v1-12-qdq on TensorRT-RTX, compile-strict:
ort-ep-limitation. The parser rejectsCast -> data_quantized(node 9). - Verdict violation,
bertsquad-12/trt-rtx: the strict compile passed, and the warm run hit the same NullReference. Classifiedlinml-defectand not waived.
Skips (24, host only): MIGraphX (libmigraphx_c.so not loadable, 8 cells), OpenVINO (no EP devices, 8), QNN (linux-arm64 only, 8). The not-run cells follow from those skips, or from a strict compile that already produced an artifact.
Results and triage stay on the host, not in the repo: ~/zoo-results/measured-2026-12-01/ (gates.json, gates.untriaged.json, triage.json).
First run triage.json, as gated (the AsTensor cause was confirmed afterwards)
{
"entries": {
"bertsquad-12/auto/run-auto": {
"class": "linml-defect",
"evidence": "Zero-config run: every provider in the chain (NvTensorRTRTX, Tensorrt, CUDA, OpenVINO, CPU) threw the same System.NullReferenceException during Run. Without --require-provider the exception is caught and reported only as 'All providers failed at execution' (InferencePipeline.cs:158-174), so the text does not show. Mechanism and reproduction: see bertsquad-12/cpu/run-cold."
},
"bertsquad-12/cpu/run-cold": {
"class": "linml-defect",
"evidence": "LinML output extraction throws NullReferenceException after the ORT run returns. OnnxInferenceSession.Run (src/LinML.Runtime.Onnx/OnnxInferenceSession.cs:61-64) calls result.AsTensor<float>() on every output and dereferences tensor.Dimensions. bertsquad-12 has an int64 output, unique_ids:0 (linml inspect --json), so the cast yields no tensor. Reproduced on CPU by hand with the frozen inputs: with --require-provider the message is 'Error: Object reference not set to an instance of an object.'; without it, 'All providers failed at execution: CPUExecutionProvider'. The float-only corpus models do not hit this. Not yet confirmed against ORT 1.32 source that AsTensor<float> returns null for a non-float value; a regression test with an int64 output will confirm it."
},
"bertsquad-12/cpu/run-warm": {
"class": "linml-defect",
"evidence": "Same LinML output-extraction NullReferenceException as bertsquad-12/cpu/run-cold (OnnxInferenceSession.cs:61-64; int64 output unique_ids:0). The CPU compile leg was passthrough, so the warm leg ran the original model."
},
"bertsquad-12/cuda/run-cold": {
"class": "linml-defect",
"evidence": "Same LinML output-extraction NullReferenceException as bertsquad-12/cpu/run-cold (OnnxInferenceSession.cs:61-64; int64 output unique_ids:0)."
},
"bertsquad-12/cuda/run-warm": {
"class": "linml-defect",
"evidence": "Same LinML output-extraction NullReferenceException as bertsquad-12/cpu/run-cold (OnnxInferenceSession.cs:61-64; int64 output unique_ids:0)."
},
"bertsquad-12/trt/run-cold": {
"class": "linml-defect",
"evidence": "Same LinML output-extraction NullReferenceException as bertsquad-12/cpu/run-cold (OnnxInferenceSession.cs:61-64; int64 output unique_ids:0). The TensorRT session loaded and ran; the exception comes after the run."
},
"bertsquad-12/trt/run-warm": {
"class": "linml-defect",
"evidence": "Two observations. (1) ORT rejected the compiled artifact (compile-partial reported 'no nodes compiled; passthrough artifact') with 'com.microsoft:TRTKernel_graph_tf2onnx_... is not a registered function/op', so LinML fell back to the original model as designed. (2) The fallback then hit the same output-extraction NullReferenceException as bertsquad-12/cpu/run-cold (OnnxInferenceSession.cs:61-64). Reproduced on mobilenetv2-7 outside the results tree: compile-partial writes a 495-byte passthrough artifact containing TRTKernel_graph_main_... nodes, which ORT rejects on warm load. Open follow-up: LinML reports 'no nodes compiled' for a file that references TRTKernel nodes."
},
"bertsquad-12/trt-rtx/run-cold": {
"class": "linml-defect",
"evidence": "Same LinML output-extraction NullReferenceException as bertsquad-12/cpu/run-cold (OnnxInferenceSession.cs:61-64; int64 output unique_ids:0). The strict compile for this provider passed (see the verdictTruthfulness violation), so the cold run is not affected by artifact state."
},
"bertsquad-12/trt-rtx/run-warm": {
"class": "linml-defect",
"evidence": "Same LinML output-extraction NullReferenceException as bertsquad-12/cpu/run-cold (OnnxInferenceSession.cs:61-64; int64 output unique_ids:0). The artifact from bertsquad-12/trt-rtx/compile-strict loaded; the exception comes after the warm run returns."
},
"gate:verdictTruthfulness:bertsquad-12/trt-rtx": {
"class": "linml-defect",
"evidence": "The strict compile (bertsquad-12/trt-rtx/compile-strict) passed, so an artifact exists, and the warm run failed with the output-extraction NullReferenceException (OnnxInferenceSession.cs:61-64; int64 output unique_ids:0). The fault is in LinML, not in the artifact or in TensorRT-RTX. Not waived: this entry sets no reclassify flag, so the violation still counts against the gate."
},
"resnet50-v1-12-qdq/trt-rtx/compile-strict": {
"class": "ort-ep-limitation",
"evidence": "TensorRT-RTX ONNX parser fails on node 9, Cast -> data_quantized (tensorrt_rtx_execution_provider.h:201; ModelImporter.cpp:140 'While parsing node number 9'; ModelImporter.cpp:559 parseNode). Compile exits 1. The same model's trt-rtx run legs report unsupported (LinML: claimed none of the model's nodes), so the failure is at parsing, not at placement."
},
"all-minilm-l6-v2-quantized/trt-rtx/compile-strict": {
"class": "ort-ep-limitation",
"evidence": "TensorRT-RTX ONNX parser rejects MatMulInteger (node 610, /encoder/layer.5/intermediate/dense/MatMul; onnxOpCheckers.cpp:1140 checkMatMulInteger) and then DynamicQuantizeLinear (node 619). Compile exits 1. The same model's trt-rtx run legs report unsupported (claimed none of the model's nodes), consistent with the parser refusing the quantized ops."
},
"all-minilm-l6-v2-quantized/trt/compile-strict": {
"class": "ort-ep-limitation",
"evidence": "ORT TensorRT EP fails during GetSupportedList (tensorrt_execution_provider.cc:2344): 'TensorRT input: /embeddings/position_embeddings/Gather_output_0 has no shape specified. Please run shape inference on the onnx model first.' The admitted model file does not carry shape info for that tensor. Open question: whether LinML should run shape inference before handing the model to ORT. Not tested here."
},
"all-minilm-l6-v2-quantized/trt/compile-partial": {
"class": "ort-ep-limitation",
"evidence": "Same ORT TensorRT EP failure as all-minilm-l6-v2-quantized/trt/compile-strict (GetSupportedList, 'has no shape specified ... run shape inference'). Also fails on its own, so --allow-partial cannot route around it."
},
"all-minilm-l6-v2-quantized/trt/run-cold": {
"class": "ort-ep-limitation",
"evidence": "Same ORT TensorRT EP failure as all-minilm-l6-v2-quantized/trt/compile-strict ('TensorRT input: /embeddings/position_embeddings/Gather_output_0 has no shape specified ... run shape inference'). Surfaces as exit 3 under --require-provider: 'Required provider TensorrtExecutionProvider unavailable: ...'. LinML's wording 'unavailable' is misleading here: the provider is installed and fails on this model. Noted as a LinML message follow-up."
}
}
}
Second measured run
2026-12-01, same host, same frozen harness (25e58d6; the three pinned hashes are unchanged). linml 0.7.2 built from the #85 branch at dd7ecca, before it merged; provenance.json records that. env.json records rehearsal: false. 232 of 232 cells recorded, 0 harness errors, 1311 s.
| Gate | Result |
|---|---|
| Harness survivability | pass (232/232 recorded) |
| Verdict truthfulness | pass (0 violations) |
| Placement honesty | pass (0 violations; no waivers used) |
| Selection correctness | pass |
| No silent degradation | pass |
| Failure classification | pass (5 failing cells classified, 0 unknown) |
Cells: 70 pass, 5 fail, 54 unsupported, 24 skip, 79 not-run. Gate: pass.
Compared cell by cell with the first run (status, selected provider, providers with profiled kernels, fallback, artifact use), only the 9 bertsquad-12 cells changed, all from fail to pass: zero-config, and cold and warm runs on cpu, cuda, trt and trt-rtx. unique_ids:0 comes back as Int64. The 5 remaining failures show the same error lines as before and are classified ort-ep-limitation. CLI tests for #85 ran on the same host during part of this run and may have shared the GPU; the comparison found no difference outside bertsquad-12.
What this pass does not cover
- Six TensorRT warm legs loaded a passthrough artifact that ORT rejected and fell back to the original model (
artifactUse: rejected). They pass, but they are not warm-cache evidence, and no gate checks this. - The measured binary is not the merged code. After
dd7ecca, #85 changed a comment and limited integer outputs to ±16,777,216. The only non-float output in the corpus is bertsquad'sunique_ids, which is 0 with these inputs, so no result is expected to differ. No run onmainhas confirmed that. - No control-flow or KV-cache decoder model; QNN, OpenVINO and MIGraphX do not run on this host.
Second run triage.json
{
"entries": {
"resnet50-v1-12-qdq/trt-rtx/compile-strict": {
"class": "ort-ep-limitation",
"evidence": "TensorRT-RTX ONNX parser fails on node 9, Cast -> data_quantized (tensorrt_rtx_execution_provider.h:201; ModelImporter.cpp:140 'While parsing node number 9'; ModelImporter.cpp:559 parseNode). Compile exits 1. The same model's trt-rtx run legs report unsupported (LinML: claimed none of the model's nodes), so the failure is at parsing, not at placement. Same error line as the first measured run."
},
"all-minilm-l6-v2-quantized/trt-rtx/compile-strict": {
"class": "ort-ep-limitation",
"evidence": "TensorRT-RTX ONNX parser rejects MatMulInteger (node 610, /encoder/layer.5/intermediate/dense/MatMul; onnxOpCheckers.cpp:1140 checkMatMulInteger) and then DynamicQuantizeLinear (node 619). Compile exits 1. The same model's trt-rtx run legs report unsupported (claimed none of the model's nodes), consistent with the parser refusing the quantized ops. Same error line as the first measured run."
},
"all-minilm-l6-v2-quantized/trt/compile-strict": {
"class": "ort-ep-limitation",
"evidence": "ORT TensorRT EP fails during GetSupportedList (tensorrt_execution_provider.cc:2344): 'TensorRT input: /embeddings/position_embeddings/Gather_output_0 has no shape specified. Please run shape inference on the onnx model first.' Same error line as the first measured run. Checked outside the run: a shape-inferred copy of the model (ORT symbolic_shape_infer) removes this error, and the TensorRT EP then claims none of the 458 nodes, so shape inference does not make the model run on TensorRT."
},
"all-minilm-l6-v2-quantized/trt/compile-partial": {
"class": "ort-ep-limitation",
"evidence": "Same ORT TensorRT EP failure as all-minilm-l6-v2-quantized/trt/compile-strict (GetSupportedList, 'has no shape specified ... run shape inference'). It also fails on its own, so --allow-partial cannot route around it. Same error line as the first measured run."
},
"all-minilm-l6-v2-quantized/trt/run-cold": {
"class": "ort-ep-limitation",
"evidence": "Same ORT TensorRT EP failure as all-minilm-l6-v2-quantized/trt/compile-strict. Surfaces as exit 3 under --require-provider: 'Required provider TensorrtExecutionProvider unavailable: ...'. LinML's wording 'unavailable' is misleading here: the provider is installed and fails on this model. Noted as a LinML message follow-up. Same error line as the first measured run."
}
}
}
Open items
- TensorRT passthrough artifacts are unusable.
compile --allow-partialreports "no nodes compiled; passthrough artifact", butOnnxCompiler.csdecides that only from the absence ofEPContextoperators and still moves the file into the cache. For TensorRT the file holdsTRTKernel_graph_…nodes that ORT cannot load. It needs a LinML fix and a gate rule for rejected warm artifacts; the gate rule means a new freeze. - Shape inference does not help quantized MiniLM on TensorRT (checked outside the runs). A shape-inferred copy removes the "no shape specified" error, and TensorRT then claims none of its 458 nodes. The copy's CPU outputs also differed from the original's by up to 0.03 (inference tool from ORT 1.22).
- LinML's exit-3 message says "unavailable" for a provider that loads but fails on this model.
- Without
--require-provider, LinML reports a run exception only asAll providers failed at execution. - Input
datais parsed as float32, so an int64 input of 16777217 is silently read as 16777216.
Second run results stay on the host in ~/zoo-results/measured-2026-12-01-r2/.
Checklist
- Corpus approved (2026-12-01).
- Per-model licenses, each from that model's README or card.
- Opset-17+ model admitted (
convnext-tiny-opset18). - Thresholds approved:
unknownbudget 10%, repetitions 1. - Placement-honesty gate strict, no shape-subgraph exemption (2026-12-01). Revisit after the first measured run if waivers keep citing the same kernels.
- Frozen at
25e58d6(2026-12-01). - First measured run on the RTX host, results gated and posted (2026-12-01). Gate fails on
verdictTruthfulnessforbertsquad-12/trt-rtx, a LinML defect; see First measured run. - Second measured run on the #85 fix (
dd7ecca), 2026-12-01: every gate passes.
Candidate first finding (not fixed here)
linml run logs a successful AOT-artifact load at Information, below the CLI's Warning threshold. Only a rejected artifact shows up on stderr, so a warm run that used the artifact can't be told apart from one that silently fell back to the original model. Cells record artifactUse: rejected | not-observable. Cache-state honesty can't be proven until run --json reports artifact use. That would be a small follow-up PR in LinML.
🤖 Generated with Claude Code
Summary by CodeRabbit
- Documentation
- Added guidance for the model verification program, including its pinned model corpus, admission and evaluation criteria, and requirements for recording measured results. The corpus and thresholds are approved but not frozen, and no matrix results are recorded.
- Tests
- Added automated CI checks for model-zoo verification, covering model admission, run and compile outcomes, cache isolation, evaluation gates, and failure handling.