uor_addr/bounds.rs
1//! `AddrBounds` — the single `HostBounds` capacity profile shared by
2//! every UOR-ADDR realization (ADR-037), and the foundation-derived
3//! inline-carrier width [`ADDR_INLINE_BYTES`] (ADR-060).
4//!
5//! ADR-060 removed the fixed per-ψ-stage byte-width ceilings
6//! (`TERM_VALUE_MAX_BYTES`, `AXIS_OUTPUT_BYTES_MAX`,
7//! `ROUTE_INPUT_BUFFER_BYTES`, …): a realization's canonical form flows
8//! through the pipeline as a source-polymorphic [`prism::operation::TermValue`]
9//! carrier (`Borrowed` / `Stream`) with no size cap. The remaining
10//! `HostBounds` constants are structural-count / catamorphism-trace caps.
11//! [`AddrBounds`] (FP_MAX = 32) serves the four 32-byte axes; [`AddrBounds64`]
12//! (FP_MAX = 64) serves the `Sha512Hasher` axis — foundation 0.5.2
13//! generalized the resolver tower over the fingerprint-width const generic,
14//! so a 64-byte σ-axis composes. The two profiles differ only in the
15//! fingerprint ceiling and the site-count ceilings (sized to the widest
16//! κ-label geometry each admits: keccak256's 74 sites vs sha512's 135).
17
18use prism::uor_foundation::pipeline::carrier_inline_bytes;
19use prism::vocabulary::HostBounds;
20
21/// The shared capacity profile. Every realization's `PrismModel` binds
22/// this `B`.
23#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
24pub struct AddrBounds;
25
26impl HostBounds for AddrBounds {
27 const FINGERPRINT_MIN_BYTES: usize = 32;
28 const FINGERPRINT_MAX_BYTES: usize = 32;
29 const TRACE_MAX_EVENTS: usize = 256;
30 const WITT_LEVEL_MAX_BITS: u32 = 32;
31
32 const FOLD_UNROLL_THRESHOLD: usize = 8;
33 const BETTI_DIMENSION_MAX: usize = 74;
34 const NERVE_CONSTRAINTS_MAX: usize = 128;
35 const NERVE_SITES_MAX: usize = 74;
36 const JACOBIAN_SITES_MAX: usize = 74;
37 const RECURSION_TRACE_DEPTH_MAX: usize = 16;
38 const OP_CHAIN_DEPTH_MAX: usize = 8;
39 const AFFINE_COEFFS_MAX: usize = 80;
40 const CONJUNCTION_TERMS_MAX: usize = 128;
41 const UNFOLD_ITERATIONS_MAX: usize = 256;
42}
43
44/// The foundation-derived inline-carrier width for [`AddrBounds`]
45/// (ADR-060). For the SHA-256 σ-axis this is the κ-label ASCII width
46/// (`sha256:` + 64 hex = 71) rounded up by the hasher-identifier header —
47/// large enough for the Inline κ-label ψ₉ emits, and unrelated to input
48/// size (large inputs flow as `Borrowed` / `Stream`).
49pub const ADDR_INLINE_BYTES: usize = carrier_inline_bytes::<AddrBounds>();
50
51/// The 64-byte-fingerprint capacity profile, bound by the `Sha512Hasher`
52/// σ-axis (`Hasher<64>`). Identical to [`AddrBounds`] except the doubled
53/// fingerprint ceiling and the site-count ceilings widened to admit
54/// sha512's 135-site κ-label geometry (`sha512:` + 128 hex).
55#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
56pub struct AddrBounds64;
57
58impl HostBounds for AddrBounds64 {
59 const FINGERPRINT_MIN_BYTES: usize = 32;
60 const FINGERPRINT_MAX_BYTES: usize = 64;
61 const TRACE_MAX_EVENTS: usize = 256;
62 const WITT_LEVEL_MAX_BITS: u32 = 32;
63
64 const FOLD_UNROLL_THRESHOLD: usize = 8;
65 const BETTI_DIMENSION_MAX: usize = 135;
66 const NERVE_CONSTRAINTS_MAX: usize = 256;
67 const NERVE_SITES_MAX: usize = 135;
68 const JACOBIAN_SITES_MAX: usize = 135;
69 const RECURSION_TRACE_DEPTH_MAX: usize = 16;
70 const OP_CHAIN_DEPTH_MAX: usize = 8;
71 const AFFINE_COEFFS_MAX: usize = 144;
72 const CONJUNCTION_TERMS_MAX: usize = 256;
73 const UNFOLD_ITERATIONS_MAX: usize = 256;
74}
75
76/// The foundation-derived inline-carrier width for [`AddrBounds64`]
77/// (ADR-060): `HASHER_IDENTIFIER_BYTES + 1 + 2 × 64 = 161`, large enough
78/// for the 135-byte `sha512:<128hex>` Inline κ-label.
79pub const ADDR_INLINE_BYTES_64: usize = carrier_inline_bytes::<AddrBounds64>();