feral_amd/stats.rs
1//! Diagnostic counters exposed alongside the permutation.
2
3/// Diagnostic counters collected during AMD ordering.
4///
5/// In release builds only `ncmpa` has non-zero cost; the other
6/// populated fields add no branches to the hot loop. In debug builds
7/// every field is populated except `n_clear_flag`, which is a
8/// not-yet-wired constant `0` (see its field doc).
9#[derive(Debug, Default, Clone, PartialEq, Eq)]
10pub struct AmdStats {
11 /// Number of garbage-collection compactions fired.
12 pub ncmpa: u32,
13 /// Number of mark-array generation-counter resets.
14 ///
15 /// Currently always `0`: not wired to a backing counter. The reset
16 /// it would count (`clear_flag`) only fires when the generation
17 /// counter `wflg` reaches `wbig = i32::MAX - n`, which during
18 /// elimination requires `n` on the order of tens of thousands, so
19 /// the true count is `0` on every practically testable input.
20 pub n_clear_flag: u32,
21 /// Number of variables absorbed by mass elimination
22 /// (Slice B).
23 pub n_mass_elim: u32,
24 /// Number of supervariable merges detected (Slice B).
25 pub n_supervar_merge: u32,
26 /// Number of variables placed into the dense-deferred bucket
27 /// at initialization.
28 pub n_dense_deferred: u32,
29 /// Flop counter: divisions (faer amd.rs:547-566).
30 pub ndiv: u64,
31 /// Flop counter: LU multiply-subtracts.
32 pub nms_lu: u64,
33 /// Flop counter: LDLáµ multiply-subtracts.
34 pub nms_ldl: u64,
35}