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
//! Per-recalc pre-image-count instrumentation (issue #991, Design A).
//!
//! `Workbook::recalc_incremental_measured` used to snapshot every formula
//! cell's value up front (the deleted `snapshot_formula_values`) before an
//! incremental recalc could touch any of them. It now accumulates the
//! pre-image of only the cells it actually writes, lazily, from
//! `recompute`'s own returned change list. Wall clock cannot prove the win an
//! O(1) edit gets from this — it is a difference in *how many cells were
//! recorded*, not in how long anything took. This module holds an exact count
//! of the last incremental call's pre-image-map size so a test can assert it
//! directly, the same rationale [`crate::graph_cache`] and
//! [`crate::spill_anchor_cache`] give for their own build counters.
//!
//! Deliberately holds only the **last** call's count, not a running total:
//! "how many pre-images did the call I just made record" is the question a
//! caller asks after a single edit, and a cumulative counter would force
//! every test to account for every earlier recalc in the same workbook's
//! history instead of just the one under test.
/// The workbook's pre-image-count instrumentation slot.
///
/// A field of [`Workbook`](crate::Workbook), so it must not disturb the
/// workbook's value-object contract: skipped by serde, ignored by
/// `PartialEq`, contributes nothing to `Hash` (see the `graph_cache` and
/// `spill_anchor_cache` module docs for why derived/instrumentation state
/// must not affect either).
pub
/// Every instance compares equal to every other: this is derived
/// instrumentation, not document content (schema spec §8 — the document is
/// the value).
/// Hashes to nothing, for the same reason [`PartialEq`] ignores it: `a == b`
/// must imply `hash(a) == hash(b)`.