1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! The one process-wide switch between the optimized product route and the f32 reference.
//!
//! The optimized route (int8 projections, the SLEEF SnakeBeta, the worker team) is the DEFAULT
//! everywhere — library and binary alike. Two things override it:
//!
//! - **Environment**: `FTTS_INT8=0` (or `off`/`false`) selects the reference route for a run;
//! the finer-grained `FTTS_INT8_CODEC` / `FTTS_FAST_SNAKE` variables tune individual pieces.
//! - **[`pin_reference`]**: a programmatic, first-call-wins pin used by the conformance
//! harness, so every oracle-parity test measures the reference numerics no matter what the
//! surrounding environment says. A parity suite that silently tested the optimized route
//! would be comparing the wrong thing against the oracle.
//!
//! The pin is sticky for the process (OnceLock): parity test binaries pin once, product
//! processes never call it.
use OnceLock;
static REFERENCE_PIN: = new;
/// Pins this process to the f32 reference route, regardless of environment defaults.
///
/// First call wins and the pin never lifts; call it before any synthesis or decode work so
/// no armed route has cached its decision yet.
/// Whether [`pin_reference`] has been called.
/// The shared default rule for optimized-route switches.
///
/// Returns `false` (reference) when the process is pinned or `variable` is set to a disabling
/// value; returns `true` otherwise — including when the variable is unset, which is what makes
/// the optimized route the default everywhere.