Verification (B04 / RFC 0007)¶
Proof-carrying verification: theorem-facing certificates
(PASS / FAIL / INCONCLUSIVE), certified halo contracts, and the
opt-in source-native backend contract. This is deliberately separate from
the raster benchmark metrics — see
rfcs/0007
for the design.
openlithohub.verify.types
¶
Typed proof-carrying verification records for B04 / RFC 0007.
This module deliberately keeps theorem-facing status separate from the existing raster benchmark metrics. A PASS is a statement about an explicit certificate and its dependencies, not about foundry sign-off.
openlithohub.verify.boundary
¶
Validated one-dimensional boundary-root isolation primitives.
The caller supplies interval oracles for f([a,b]) and f'([a,b]). This keeps this module independent of a particular interval arithmetic backend while making the proof obligation explicit.
isolate_roots_on_segment(f_interval, df_interval, *, lo=0.0, hi=1.0, max_depth=40, min_width=1e-12, root_width=1e-06)
¶
Certify root-free pieces or isolate unique transverse roots.
A root bracket is accepted only when f' excludes zero on the whole subinterval and the endpoint point-enclosures have strict opposite signs. If any subinterval remains undecided at the resource limit, the result is INCONCLUSIVE even if other roots were isolated.
Source code in src/openlithohub/verify/boundary.py
openlithohub.verify.spatial
¶
Coverage and curvature-scale completeness helpers for B04.
openlithohub.verify.halo
¶
Certified halo contracts for proof-carrying lithography verification.
This module is deliberately separate from workflow.halo. The workflow
helper chooses a practical overlap from node OIR and model receptive field;
this module only emits CERTIFIED_SUFFICIENT when an explicit error tail has
been proved for a theorem-facing core/loaded-region geometry.
CoreHaloGeometry
dataclass
¶
Explicit theorem geometry; do not infer this from workflow overlap.
Source code in src/openlithohub/verify/halo.py
socs_absolute_tail_upper(weights, mode_l1, mode_tail_l1)
¶
Sufficient intensity error bound for arbitrary |delta mask| <= 1.
Source code in src/openlithohub/verify/halo.py
unrestricted_binary_tail_lower(weights, mode_tail_l1_lower)
¶
Necessary worst-case lower bound for arbitrary binary exterior masks.
For one coherent mode with tail coefficients a_r, averaging the positive part of Re(exp(-i theta) a_r) over theta shows that some binary selector has coherent amplitude at least sum|a_r|/pi. SOCS positivity then gives w_j*(T_j/pi)^2 for that mode.
Source code in src/openlithohub/verify/halo.py
openlithohub.verify.full_chip
¶
Streaming-friendly aggregation of proof-carrying tile certificates.
aggregate_full_chip_status(records)
¶
Aggregate without storing dense full-chip raster output.
Acceptance rule
any certified load-bearing FAIL -> global FAIL; else any load-bearing INCONCLUSIVE -> global INCONCLUSIVE; else if all load-bearing tiles PASS -> global PASS.
Source code in src/openlithohub/verify/full_chip.py
openlithohub.verify.certifier
¶
Proof gates for B04 continuous-focus verification.
The central firewall is intentionally asymmetric: - certified upper bounds may prove PASS; - FAIL requires an independently certified violation lower bound; - everything else is INCONCLUSIVE.
openlithohub.verify.replay
¶
Replay helpers for theorem-facing B04 proof artifacts.
openlithohub.verify.source_snapshot
¶
B04 source-native verification snapshot (prompt §B04-B, RFC 0007).
A source snapshot freezes the discrete model a verifier will actually
evaluate — not a high-level configuration record. Everything here is the
realized discrete model: exact source-bin indices, normalized weights,
pupil-support bits, grid conventions, and content hashes. IEEE-754
floats belonging to the realized model may be imported as exact dyadic
rationals (:func:dyadic_from_float) so downstream interval evaluation
is outward-rounded rather than heuristic.
SourceSnapshot
dataclass
¶
Frozen realized discrete Hopkins/SOCS model.
source_bin_indices / source_weights are the full discrete
source: weights are already normalized and NO dynamic top-K spectral
branch selection is applied on this path. pupil_support_bits is
the flattened binary pupil support (1 = pass). mask_sha256 pins
the input mask bytes; git_commit pins the implementation.
Source code in src/openlithohub/verify/source_snapshot.py
is_topk_truncated
property
¶
True only if the caller explicitly built a truncated snapshot.
The source-native path freezes the full discrete source; a truncated top-K representation must carry an explicit truncation/equivalence error bound before its numbers may be promoted to a continuous certificate (prompt §B04-A).
dyadic_from_float(value)
¶
Exact dyadic-rational import of an IEEE-754 double.
Returns (numerator, denominator) with denominator a power of
two — the exact rational the float represents. Outward rounding of
downstream evaluation then has a well-defined exact starting point
instead of a heuristic re-interpolation.
Source code in src/openlithohub/verify/source_snapshot.py
outward_round_interval(lo, hi)
¶
Widen an interval by one ULP outward on each side.
Source code in src/openlithohub/verify/source_snapshot.py
freeze_source_snapshot(*, source_bin_indices, source_weights, pupil_support, pupil_shape, wavelength_nm, na_x, na_y, pixel_size_nm, grid_shape, mask_bytes, git_commit, process_parameters=None)
¶
Freeze a snapshot, normalizing weights and hashing the mask bytes.
Source code in src/openlithohub/verify/source_snapshot.py
openlithohub.verify.source_native
¶
Source-native theorem-facing verification backend contract (prompt §10A).
The backend is opt-in and non-default: the shipped truncated-SOCS /
top-K benchmark path stays untouched, and theorem-facing verification is
encouraged to consume the full discrete Hopkins operator frozen in a
:class:openlithohub.verify.source_snapshot.SourceSnapshot. A truncated
representation may only back a certificate when it ships an explicit
truncation/equivalence error bound; otherwise its numbers stay at
benchmark level.
First-version backends are deterministic CPU interval / outward-rounded evaluators; GPU interval arithmetic is explicitly not required.
ProcessBox
dataclass
¶
Continuous process-parameter box (e.g. a focus/dose rectangle).
Source code in src/openlithohub/verify/source_native.py
FieldEnclosure
dataclass
¶
Outward-rounded enclosure of the aerial field over a region.
sup_process_perturbation is the certified box width δ_B:
sup_theta ||I(.,theta) - I_0||_inf <= delta.
Source code in src/openlithohub/verify/source_native.py
SpatialDerivativeEnclosure
dataclass
¶
Outward-rounded gradient enclosure plus a Hessian budget.
Source code in src/openlithohub/verify/source_native.py
SourceNativeVerificationBackend
¶
Bases: Protocol
Contract for a theorem-facing, source-native evaluation backend.
Source code in src/openlithohub/verify/source_native.py
OutwardRoundedCPUBackend
¶
Minimal deterministic CPU backend over the frozen discrete model.
Encloses the field by outward-rounded evaluation of the snapshot's
per-bin intensity contributions over spatial_region — the full
discrete source, no dynamic top-K branch. This is a foundation for
real interval backends, not a substitute for them.