Validate by equality, not tolerance. Wrap any run in a certificate. Anyone with the inputs can re-run it on any supported machine and confirm every output bit for bit, or see exactly which values differ.
Create one
import optionvalley as ov
ov.init(); ov.load_cert_key("option-valley-cert.key") # issued by Riptide with your licence
with ov.Certificate("EOD IV 2026-12-02", save_inputs="run_inputs.npz", save_outputs="run_outputs.npz") as c:
sigma, g = ov.iv_european(price, F, K, T, is_call, greeks=True)
d, m = ov.greeks_european(S, K, T, r, q, sigma, nvars=5, order=2)
c.save("run.ovcert.json"); c.save_html("run.html"); c.save_pdf("run.pdf")
C: ov_cert_begin(label) … batch calls … ov_cert_end(buf, cap, &len). Recording is per thread.
What it records
| result_digest | SHA-256 over every call's function, result-relevant parameters, input hashes and output hashes. It does not depend on the machine, CPU path, thread count or GPU. |
| dataset_sha256, output_sha256 | Digests of all input and all output hashes, in call order. |
| calls[] | Per call: function, n, parameters, SHA-256 per input and output array, and an output hash per block of 4,096 elements. |
| engine, machine | Version, ABI, SHA-256 of the engine binary; CPU model, architecture, CPU path, threads, machine id, and where each call ran (CPU path or CUDA device). |
| started, finished, licence | UTC times; licence id and licensee. |
| signer, signature | Ed25519 signature by your certificate key. Your key is endorsed by the Option Valley certificate root, which is separate from the licence key. |
Matching digests need matching engine inputs. Let the engine do the transcendental work (for example pass spot, rate and yield to iv_european_spot / iv_american rather than computing forwards and discount factors with a vectorised library exp, whose last bits can differ between CPUs).
Canonical form for hashing: binary64 or int32 little-endian bytes, with every NaN written as 0x7ff8000000000000.
Verify
python -m optionvalley.verify run.ovcert.json --inputs run_inputs.npz --outputs run_outputs.npz --report verify.json
The verifier checks the signature and the key's endorsement, re-runs every call, and compares the inputs against the dataset hashes and the outputs against the output hashes. It prints IDENTICAL or lists the call, the output and the differing 4,096-element blocks; with --outputs it also gives the exact indices and both values.
For model-risk files
The HTML and PDF versions are readable without the engine installed. Together with the JSON they give a validator a fixed record: these inputs, this engine build and these parameters gave these outputs. Any machine can confirm it again by equality.