pub enum Numerics {
Exact,
Fast,
}Expand description
The numerics posture of an execution scope: the fidelity it demands of every kernel.
Exact demands the bit-identity fidelity — the reference bits, in
every build. Today no offer-dispatched kernel meets it, so chain
work computes on the built-in reference paths, while the fused
cells serve under both postures: the reduce-window walk answers
the reference bits outright, and the composed cells honor the
demand by composing on the reference paths. Fast demands only
the envelope fidelity: the chain as compiled, backends engaging
above their per-task thresholds, which are cost heuristics inside
this posture, never correctness boundaries.
The posture is a value, not a build flag: it rides an
Entry onto every executor’s runs — interpreted
or lowered — so an exact oracle result and a fast result are
comparable in one process. The default — for entries and for
host-side payload calls outside any run — is Fast: enabling a
backend feature keeps meaning “use it”, and features change
speed, never behavior classes. The one road that consults no
default is Network::forward:
whole-spec evaluation is the proving road and always runs
Exact, so its bits are the same in every build.
Variants§
Exact
Only bit-certified kernels serve: the reference bits, the same in every build.
Fast
The compiled backend chain above its cost thresholds.
Implementations§
Source§impl Numerics
impl Numerics
Sourcepub fn exactly<Output>(body: impl FnOnce() -> Output) -> Output
pub fn exactly<Output>(body: impl FnOnce() -> Output) -> Output
Runs body with the Exact posture installed for the current
thread, restoring the previous posture on return or panic.
It is the direct-call road to the reference bits: a payload
operation outside any run consults the ambient posture, so
Numerics::exactly(|| a.matmul(&b)) compares a direct call
against the reference without compiling a plan. Runs keep
their own posture regardless: an entry’s numerics override
the ambient one for the whole run.