Repository navigation
impl(011): runtime loading, the platform table and the ONNX encoder (3.6, 3.9.1) - #493
Conversation
AI review (findings)Reviewing the new ONNX runtime loading and encoder implementation.
In the let environment = ort::init_from(path)
.map_err(|e| refusal(C::RuntimeVersionMismatch, "runtime_path", &e.to_string()))?At this point the version has already been verified correct;
The new test let passing: Vec<String> = record
.verdict
.iter()
.filter(|(_, v)| v["verdict"] == "pass")
.map(|(k, _)| k.clone())
.collect();
let table: Vec<String> = rustev_backend_embed_linear::runtime::QUALIFIED_PLATFORMS
.iter()
.map(|p| serde_json::to_value(p).unwrap().as_str().unwrap().to_owned())
.collect();
assert_eq!(table, passing, "3.6.3: the table is the record's");
{"head": "26899638196d6565f681e87137bdee13960cd90d", "verdict": "findings", "findings": [{"path": "backends/rustev-backend-embed-linear/src/runtime.rs", "line": 237, "summary": "ort::init_from failure after a successful probe is mapped to RuntimeVersionMismatch; the failure here is an OS-level loading error, not a version mismatch, so RuntimeMissing is the correct code."}, {"path": "backends/rustev-backend-embed-linear/tests/feasibility_record.rs", "line": 155, "summary": "assert_eq!(table, passing) is order-sensitive but `passing` is collected from record.verdict whose iteration order is map-dependent; both vectors must be sorted before comparison or the test will fail spuriously when any platform is qualified."}]}Subject: f1f08cd...2689963, diff digest a42f20f2bec07f4a79c7d6449d2d0027c2ce371dbfe4d178774f8acf4a13a702, 1 call(s). An AI comment is not an approval. |
2689963 to
9ca8e3a
Compare
AI review (findings)Reviewing the new ONNX runtime loader and encoder implementation.
After let environment = ort::init_from(path)
.map_err(|e| refusal(C::RuntimeVersionMismatch, "runtime_path", &e.to_string()))?The version was already confirmed by No other concrete defects found. The TOCTOU between hash and load is explicitly acknowledged in the module doc and in the spec (3.6.5). The {"head": "9ca8e3ab98bc05083c51c4d4cd6428e248c4fdc6", "verdict": "findings", "findings": [{"path": "backends/rustev-backend-embed-linear/src/runtime.rs", "line": 177, "summary": "ort::init_from failure after a successful probe is mapped to RuntimeVersionMismatch rather than RuntimeMissing; the loading failure is unrelated to version and the error code is misleading."}]}Subject: f1f08cd...9ca8e3a, diff digest 313ab2d5cc0eca748d86fc35705b3f93f1f50ef9d8aa33c01542dbcf6cbf32ab, 1 call(s). An AI comment is not an approval. |
9ca8e3a to
960a3e3
Compare
AI review (no-findings)Reviewing the diff for bugs, security defects, and inconsistencies against the spec and governance rules.
No concrete defects found. {"head": "960a3e3fc90cbcab0970967f97a9066a40bcc231", "verdict": "no-findings", "findings": []}Subject: f1f08cd...960a3e3, diff digest f2788afcf20d777475567552fc38f7dbdc4937e8e76fd1540b18bfd2f23e6ec7, 1 call(s). An AI comment is not an approval. |
960a3e3 to
1d72471
Compare
AI review (no-findings)Reviewing the diff carefully for bugs, security problems, and inconsistencies across
The
Cancellation pattern: the The
The graph bytes are correctly zeroed ( Tests
Spec history The 2026-11-03 entry accurately describes the implementation: qualified-platform table empty, No concrete defect found. {"head": "1d72471a667320565794f0550bd5e0eea584316c", "verdict": "no-findings", "findings": []}Subject: 5d9923e...1d72471, diff digest 9271bfc5b986619bd283d9387648c508b1c4084813e9533efe143bcdc99ed98a, 1 call(s). An AI comment is not an approval. |
Spec 011: runtime loading, the qualified-platform table and the ONNX encoder (3.6, 3.8.3, 3.8.4, 3.9.1)
This is the "after the gate" code path of 011's Implementation record. The PR is based on main and is independent of #485 and #490.
Runtime and platforms (
src/runtime.rs)QUALIFIED_PLATFORMS, the committed feasibility record'spassverdicts. The record has none, so the table is empty.tests/feasibility_record.rschecks that the table and the record agree. Anonnxbundle is refusedunqualified_platformbefore its runtime path is read.runtime_missing.runtime_digest_mismatch).runtime_conflict(3.6.2). An equal digest reuses the loaded runtime, but only for the version it reported.ORT_DYLIB_PATHor any search path.ort::util::probereports the minor number of a 1.x library. It is the only safe reader, and the workspace forbidsunsafe. The patch number is bound by the digest, whose full version the record observed. A library reporting no version or another version is refusedruntime_version_mismatch. A manifest naming anotherortthan the pinned2.0.0-rc.15ismanifest_invalid.Encoder (
src/onnx.rs)allmaps toORT_ENABLE_ALL.graph_rejected,graph_signature_mismatch).input_ids,attention_maskand, when declared,token_type_idsof zeros.ortneeds&mut Session.RunOptions(3.12.2), using a waker registered on the signal.Tests
tests/runtime/mod.rs):runtime_missing(none, relative, absent, a directory),runtime_digest_mismatch(wrong digest, no entry for the platform),runtime_version_mismatch(a synthetic non-library file with a matching digest; a non-1.x version), andmanifest_invalidfor anotherort. Also the platform key and the empty table, and anonnxbundle refused before its runtime path is read. A unit test covers the conflict decision.tests/runtime/hand.rs, ignored; setRUSTEV_EMBED_CHECKPOINTandRUSTEV_EMBED_RUNTIME). It assembles anonnxbundle from the pinned graph and tokenizer with one generated head. Run on 2026-11-03 on macos-aarch64 with the record's library (sha2562a50a63e...), it passed:text_emptyand onetoo_many_tokens.runtime_version_mismatch,runtime_conflict,graph_rejectedandgraph_signature_mismatchwith the real library.Boundaries
ortkeepsdefault-features = falsewithstd,load-dynamic,api-31, so no download feature is enabled. The crate graph andCargo.tomlare unchanged.Not done here
local-embedbuild on the platform's native matrix target (3.2.3).onnxbundle's cache evidence (3.14.3).011inmake verify.