Expand description
ONNX typed input (IR ≤ v13) (ADR-023 amended by ADR-060).
Protobuf v3 admits many byte-representations of the same logical
message; this realization defines a canonical form — a flat
skeleton — that collapses that freedom. Two ONNX models that decode
to the same logical content (regardless of protobuf field order, node
ordering among valid topological orderings, or whether tensor data is
stored in raw_data or the typed-data fields) canonicalize to
byte-identical skeletons and therefore to the same κ-label.
LE_i64(ir_version)
── opset imports, sorted by (domain, version) ──
for op: sha256(domain) || LE_i64(version)
── graph (recursive) ──
sha256(graph_name)
nodes in Kahn-topological order (lex (name, op_type, domain) tie-break):
sha256(name) || sha256(op_type) || sha256(domain) || sha256(overload)
|| LE_u32(n_in) || (sha256(input_name) × n_in)
|| LE_u32(n_out) || (sha256(output_name) × n_out)
|| attributes, sorted by name (GRAPH/GRAPHS recurse inline)
initializers (#5), sorted by name, each a canonical TensorProto record
graph input (#11) / output (#12) / value_info (#13), sorted by name
── model metadata ──
sha256(producer_name) || sha256(producer_version) || sha256(domain)
|| LE_i64(model_version) || metadata_props sorted by keyUnder ADR-060 the full skeleton flows through the pipeline as a
[TermValue::Borrowed] carrier and ψ₉ folds it through the σ-axis —
there is no two-level commitment, no carrier ceiling, and no node /
attribute / initializer / IO count cap. Variable-length leaves (tensor
data bytes, strings, opaque sub-message payloads) are still replaced by
their sha256(...) digest so the skeleton stays bounded by structure
size, not data size, while still binding every weight byte into the
κ-label.
OnnxValue (the owned parsed value, alloc-gated) holds the
skeleton; OnnxCarrier is the borrowed model-input handle the
pipeline binds.
Structs§
- Onnx
Carrier - Borrowed canonical-skeleton input handle (ADR-060 borrowed carrier). A
thin,
Copyborrow of the skeleton bytes produced bycanonicalize;as_binding_valuereturns theBorrowedcarrier zero-copy. - Onnx
Value - A parsed, canonicalized ONNX
ModelProto. The stored bytes are the flat canonical skeleton (see module docs).alloc-gated — the pipeline binds the borrowedOnnxCarrier.
Functions§
- canonicalize
- Canonical skeleton as an owned
Vec<u8>.