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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Instrumented transformation counts backing the probabilistic error oracle.
//!
//! The a-priori bounds of the test suite (`tests/ops/backward_error.rs`) are
//! taken at iteration caps, which makes them vacuous for the iterative
//! routines in `F16`/`Bf16`. The probabilistic oracle
//! (`tests/ops/backward_error.rs`, `gamma_tilde`) evaluates the same
//! per-entry rounding counts at the *actual* transformation counts instead,
//! which this module records: total Francis steps per [`schur`](crate::application::linalg::schur::schur())
//! / [`eigenvalues`](crate::application::linalg::eigenvalues::eigenvalues()) run and the `dbdsqr` sweeps and
//! negligible-diagonal chases per SVD run (split: chases cost fewer
//! roundings per entry than sweeps).
//!
//! Thread-local `Cell`s: the kernels are single-threaded (SIMD is
//! intra-thread; no `parallel` branch exists on these paths), so the count a
//! test takes after its own call is exactly that call's, under both `cargo
//! test` (threads) and nextest (processes). Cost is one thread-local write
//! per routine call plus one increment per Francis step — nanoseconds
//! against millisecond runs — so recording is unconditional, with no
//! feature gate and no behavior change.
//!
//! Discipline: take immediately after the call whose count is needed; `take`
//! resets to zero, so a take without a preceding call yields `0` (a bound
//! for a run that did nothing — an assert against it fails loudly, never
//! silently).
use Cell;
thread_local!
/// Record the total Francis steps of a completed [`schur`](crate::application::linalg::schur::schur()) /
/// [`eigenvalues`](crate::application::linalg::eigenvalues::eigenvalues()) run (`francis::run`).
pub
/// Record the `dbdsqr` sweeps and negligible-diagonal chases
/// (`qr_iterate`'s return) of a completed SVD run.
pub
/// Take the recorded Francis steps since the last take (zero when no
/// [`schur`](crate::application::linalg::schur::schur()) / [`eigenvalues`](crate::application::linalg::eigenvalues::eigenvalues()) ran since).
/// Take the recorded `(sweeps, chases)` since the last take (both zero when
/// no SVD ran since).
/// Record the implicit-QL sweeps of a completed symmetric eigendecomposition.
pub
/// Take the recorded QL sweeps since the last take (zero when no symmetric
/// eigendecomposition ran since).