A graph numerical certificate #
This example certifies a four-node scalar graph:
x in [1, 2] c in [0.5, 1]
\ /
y = x + c
|
z = y * c
The source intervals are executable binary32 endpoints. The checker propagates them with directed
rounding, rejects non-finite intermediate intervals, and records the backend capsules selected when
the portable CPU profile replans the graph. The resulting range trace is an executable check; a
ProvedRealEnclosure supplies the separate proof that an exact-real execution is enclosed. Larger
graphs use the same artifact-generation and replay path.
The example uses scalar nodes so the interval endpoints remain easy to inspect. The certificate machinery itself stores only one scalar hull per tensor and is independent of tensor rank.
Instances For
Build a binary32 interval from two bit patterns.
Every source range in this file is written in hexadecimal rather than as a decimal literal. That keeps the certificate an exact artifact: no decimal-to-binary conversion sits between what is written here and what the checker sees.
Instances For
Input and constant assumptions. Hexadecimal endpoints preserve the exact binary32 artifact.
Instances For
Generate and replay the range trace and the selected kernel plan.
Instances For
Concrete payload used for bit-level replay. The constant is 0.75, which lies in the declared
constant range $[0.5,1]$.
Instances For
A concrete input (1.25) inside the declared input interval.
Instances For
Replay the same graph using the bit-level IEEE32 interpreter and check every intermediate.
Instances For
Deliberately replace the addition range with $[0,0]$. This models a corrupted or optimistic external artifact; replay must not accept it merely because $[0,0]$ is itself a valid interval.
Instances For
Check the deliberately corrupted artifact against the canonical graph transfers.
Instances For
A complete model pass #
The small graph above makes each range easy to inspect. This graph runs the same machinery over a two-layer MLP with matrix weights and explicit bias tensors:
input [1,2]
-> matmul [2,3]
-> add bias [1,3]
-> ReLU
-> matmul [3,1]
-> add bias [1,1]
Nothing in certificate generation is told that this is an MLP. The checker sees ten ordinary IR
nodes and obtains each transfer from GraphRangeRegistry. Kernel selection independently chooses
a capsule for every operation. The final replay executes the stored graph with bit-level binary32
semantics and checks all ten intermediate tensors against the regenerated ranges.
A two-layer matrix MLP expressed only in the canonical operation IR.
Instances For
Source ranges cover inputs, both weight matrices, and both bias tensors. A single enclosure per tensor is sufficient for this certificate format; the graph walk remains independent of rank.
Instances For
Constant payloads use the IR's canonical flat storage ABI; node shapes recover the typed matrix view during evaluation. The explicit order below is row-major.
Instances For
First bias, flat.
Instances For
Second weight matrix [3, 1], flat.
Instances For
Output bias, a single value.
Instances For
Concrete parameters are payloads of the constant nodes, not special fields in the checker.
Instances For
The concrete [1, 2] input the full-model replay runs on.
Instances For
Generate the operation-local range trace and bind it to the checked CPU capsule plan.
Instances For
Execute the stored graph in the bit-level binary32 interpreter and check every node.
Instances For
Help text for the certificate example.