uor_addr/onnx/shapes/bounds.rs
1//! ONNX spec-pinned constants.
2//!
3//! ADR-060 removed the fixed-width two-level commitment
4//! (`ONNX_CANON_MAX_BYTES` / `ONNX_CANON_BYTES`) and the
5//! application-policy capacity profile (`OnnxHostBounds` /
6//! `OnnxAddrBounds`) with its node-count / initializer-count /
7//! attribute-count / IO-count / tensor-data ceilings. The realization now
8//! emits the **full flat canonical skeleton** (the `ModelProto` structure
9//! emitted inline, with variable-length leaves — tensor data, strings,
10//! opaque sub-message payloads — replaced by their SHA-256 digests) as an
11//! unbounded `alloc` buffer that flows through the pipeline as a borrowed
12//! carrier. Every count and width is unbounded.
13//!
14//! What remains are ONNX **spec / policy constants** (the admitted IR
15//! version range, the default-domain opset-version minimum) plus one
16//! native-stack-overflow guard on the recursive subgraph descent.
17
18/// The highest ONNX IR version this realization admits — `onnx.proto`'s
19/// current `Version::IR_VERSION` (`= 13`, 2026). The realization accepts
20/// any `ir_version` in `1..=ONNX_IR_VERSION_MAX`: the canonical skeleton
21/// is IR-version-agnostic (the field numbers it reads are stable across
22/// IR revisions; IR-v10+ `NodeProto.overload` simply reads empty on older
23/// models), and the `ir_version` value itself is bound into the skeleton,
24/// so two IR revisions of the same logical model canonicalize distinctly.
25/// Admitting the range lets the realization content-address real-world
26/// models (published exports are predominantly IR 6–10) rather than only
27/// the latest revision.
28pub const ONNX_IR_VERSION_MAX: i64 = 13;
29
30/// Policy: the minimum opset version accepted for the default domain `""`.
31/// ONNX mandates no minimum (`= 1` accepts any opset); raise per
32/// application policy. Inlined from the pre-ADR-060 `OnnxAddrBounds`
33/// profile (`ONNX_OPSET_VERSION_MIN = 1`).
34pub const ONNX_OPSET_VERSION_MIN: i64 = 1;
35
36/// Native-stack-overflow guard on the recursive subgraph descent
37/// (`If` / `Loop` / `Scan` bodies via `GRAPH` / `GRAPHS` attributes).
38/// Guards the call stack against pathologically-nested subgraphs; it is
39/// not a ceiling on node / attribute count at any level.
40pub const ONNX_SUBGRAPH_DEPTH_MAX: usize = 64;