euv-core 0.47.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
use super::*;

/// Compact 28-byte intrusive doubly-linked edge connecting a reactive source to a subscriber in O(1).
#[derive(Clone, Copy, CustomDebug, Data)]
pub(crate) struct ReactiveEdge {
    /// Packed source tag (`bit 31`: `0` = signal, `1` = memo; low 31 bits = arena index; `EDGE_NONE` when free).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) source_tag: u32,
    /// Packed subscriber tag (`bit 31`: `0` = memo, `1` = effect; low 31 bits = arena index).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) sub_tag: u32,
    /// Previous edge index in the source's subscriber doubly-linked list (`EDGE_NONE` at head).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) prev_sub: u32,
    /// Next edge index in the source's subscriber doubly-linked list (`EDGE_NONE` at tail).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) next_sub: u32,
    /// Previous edge index in the subscriber's dependency doubly-linked list (`EDGE_NONE` at head).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) prev_dep: u32,
    /// Next edge index in the subscriber's dependency doubly-linked list (`EDGE_NONE` at tail).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) next_dep: u32,
    /// Subscriber tracking epoch stamped on the most recent visit of this edge.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) epoch: u32,
}

/// Active observer tracking frame pushed onto `ReactiveRuntime::observer_stack` for epoch mark-and-sweep tracking.
#[derive(Clone, Copy, CustomDebug, Data)]
pub(crate) struct ObserverFrame {
    /// Packed subscriber tag (`bit 31`: `0` = memo, `1` = effect; low 31 bits = arena index).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) sub_tag: u32,
    /// Generation snapshot verifying the subscriber slot was not recycled mid-execution.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) generation: u32,
    /// Current tracking epoch; edges not stamped with `epoch` are detached in `finish_tracking`.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) epoch: u32,
    /// Next expected dependency edge index along the subscriber's intrusive list (`EDGE_NONE` at end).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) cursor_edge: u32,
    /// Most recently visited edge index enabling O(1) deduplication of consecutive reads.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) last_edge: u32,
    /// Count of distinct edges stamped with `epoch` during this pass (`== dep_count` skips sweep in O(1)).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) visited_count: u32,
}

/// Storage entry for a small-buffer-optimized signal inside the reactive arena.
#[derive(CustomDebug, Data)]
pub(crate) struct SignalEntry {
    /// Generation counter for this slot.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) generation: u32,
    /// Monotonic version counter incremented on every write.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) version: u64,
    /// Type-erased 24-byte SBO signal payload; empty when slot is free.
    #[debug(skip)]
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) value: SignalSlot,
    /// Head edge index of this signal's intrusive subscriber list (`EDGE_NONE` when empty).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) sub_head: u32,
    /// Tail edge index of this signal's intrusive subscriber list (`EDGE_NONE` when empty).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) sub_tail: u32,
    /// Active subscriber count for O(1) degree checks.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) sub_count: u32,
}

/// Storage entry for a lazy memoized derived computation inside the reactive arena.
#[derive(CustomDebug, Data)]
pub(crate) struct MemoEntry {
    /// Generation counter for this slot.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) generation: u32,
    /// Monotonic version counter incremented when computed value changes.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) version: u64,
    /// Current push-pull evaluation state.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) state: NodeState,
    /// Cached 24-byte SBO computed value; empty when uninitialized or freed.
    #[debug(skip)]
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) value: SignalSlot,
    /// Type-erased recomputation closure returning `changed`.
    #[debug(skip)]
    #[get(skip)]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) compute: Option<MemoComputeFn>,
    /// Head edge index of this memo's intrusive dependency list (`EDGE_NONE` when empty).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_head: u32,
    /// Tail edge index of this memo's intrusive dependency list (`EDGE_NONE` when empty).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_tail: u32,
    /// Active upstream dependency count.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_count: u32,
    /// Monotonic dependency-tracking epoch incremented on every recomputation.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_epoch: u32,
    /// Whether this memo's dependencies are mirrored in `ReactiveRuntime::edge_index`.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_indexed: bool,
    /// Head edge index of this memo's intrusive subscriber list (`EDGE_NONE` when empty).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) sub_head: u32,
    /// Tail edge index of this memo's intrusive subscriber list (`EDGE_NONE` when empty).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) sub_tail: u32,
    /// Active downstream subscriber count.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) sub_count: u32,
    /// Topological depth level used to evaluate memos before effects in order.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) depth: u32,
}

/// Storage entry for a reactive side effect inside the reactive arena.
#[derive(CustomDebug, Data)]
pub(crate) struct EffectEntry {
    /// Generation counter for this slot.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) generation: u32,
    /// Whether this effect is currently alive.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) alive: bool,
    /// Whether this effect is queued for execution.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) scheduled: bool,
    /// Type-erased side-effect closure.
    #[debug(skip)]
    #[get(skip)]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) callback: Option<Rc<RefCell<dyn FnMut()>>>,
    /// Head edge index of this effect's intrusive dependency list (`EDGE_NONE` when empty).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_head: u32,
    /// Tail edge index of this effect's intrusive dependency list (`EDGE_NONE` when empty).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_tail: u32,
    /// Active upstream dependency count.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_count: u32,
    /// Monotonic dependency-tracking epoch incremented on every effect run.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_epoch: u32,
    /// Whether this effect's dependencies are mirrored in `ReactiveRuntime::edge_index`.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dep_indexed: bool,
    /// Execution priority depth so parent effects run before nested ones.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) depth: u32,
    /// Active freeze nesting depth (`> 0` suspends execution while tracking dirty notifications).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) frozen_depth: u32,
    /// Whether upstream signals or memos dirtied this effect while frozen.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) pending_while_frozen: bool,
}

/// Ownership scope entry that disposes all owned reactive resources together.
#[derive(CustomDebug, Data)]
pub(crate) struct ScopeEntry {
    /// Generation counter for this scope slot.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) generation: u32,
    /// Whether this scope is alive.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) alive: bool,
    /// Whether this scope is currently frozen (`PageRetention::Freeze`).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) frozen: bool,
    /// Optional parent scope identifier for O(depth) zero-allocation ancestry and freeze queries.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) parent: Option<ScopeId>,
    /// Signals owned by this scope.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) signals: Vec<SignalId>,
    /// Memos owned by this scope.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) memos: Vec<MemoId>,
    /// Effects owned by this scope.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) effects: Vec<EffectId>,
    /// Child scopes owned by this scope.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) children: Vec<ScopeId>,
    /// Cleanup callbacks invoked when this scope is disposed.
    #[debug(skip)]
    #[get(skip)]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) cleanups: Vec<Box<dyn FnOnce()>>,
}

/// Thread-local arena storing all reactive signals, memos, effects, scopes, and O(1) intrusive dependency edges.
#[derive(CustomDebug, Data)]
pub struct ReactiveRuntime {
    /// Signal slot arena.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) signals: Vec<SignalEntry>,
    /// Free-list indices for recycled signal slots.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) free_signals: Vec<u32>,
    /// Memo slot arena.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) memos: Vec<MemoEntry>,
    /// Free-list indices for recycled memo slots.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) free_memos: Vec<u32>,
    /// Effect slot arena.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) effects: Vec<EffectEntry>,
    /// Free-list indices for recycled effect slots.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) free_effects: Vec<u32>,
    /// Scope slot arena.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) scopes: Vec<ScopeEntry>,
    /// Free-list indices for recycled scope slots.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) free_scopes: Vec<u32>,
    /// Intrusive doubly-linked dependency edge slab enabling O(1) subscribe and unsubscribe.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) edges: Vec<ReactiveEdge>,
    /// Free-list indices for recycled edge slab slots.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) free_edges: Vec<u32>,
    /// Lazy O(1) edge lookup index populated only for subscribers exceeding `EDGE_INDEX_THRESHOLD` dependencies.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) edge_index: HashMap<u64, u32>,
    /// Monotonic counter of total edges linked (diagnostic metric for verifying zero edge thrash).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) edge_alloc_count: u64,
    /// Stack of currently executing observers and their epoch-tracking frames.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) observer_stack: Vec<Option<ObserverFrame>>,
    /// Stack of active ownership scopes.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) scope_stack: Vec<ScopeId>,
    /// Pending effects awaiting flush.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) pending_effects: Vec<EffectId>,
    /// Reusable scratch queue storing `(packed_sub_tag, target_state)` for zero-allocation dirty propagation.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dirty_queue: Vec<(u32, NodeState)>,
    /// Reusable cursor-sliced scratch stack for zero-allocation `NodeState::Check` verification of >4 memo deps.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) check_scratch: Vec<MemoId>,
    /// Reusable scratch buffer holding `(depth, EffectId)` batches across `flush_effects` runs.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) flush_batch_scratch: Vec<(u32, EffectId)>,
    /// Reusable DFS stack for zero-allocation scope disposal and freeze/resume traversals.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) scope_stack_scratch: Vec<ScopeId>,
    /// Reusable scratch list of effects collected during `dispose_scope_collect`.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dispose_effects_scratch: Vec<EffectId>,
    /// Reusable scratch list of memos collected during `dispose_scope_collect`.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dispose_memos_scratch: Vec<MemoId>,
    /// Reusable scratch list of signals collected during `dispose_scope_collect`.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) dispose_signals_scratch: Vec<SignalId>,
    /// Active batch nesting depth; flush executes only when returning to zero.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) batch_depth: u32,
    /// Guard flag preventing recursive flush loops.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) flushing: bool,
    /// Global version clock incremented on every reactive write.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) clock: u64,
    /// Type-keyed root-lifetime global state signal registry.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) global_states: HashMap<TypeId, SignalId>,
    /// String-keyed root-lifetime named global state signal registry.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) named_global_states: HashMap<String, SignalId>,
    /// Type-keyed cross-component custom event channel signals.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) event_channels: HashMap<TypeId, SignalId>,
}

/// Snapshot of runtime diagnostic statistics for telemetry and benchmarking.
#[derive(Clone, Copy, Debug, Default, Eq, Getter, Hash, New, Ord, PartialEq, PartialOrd)]
pub struct ReactiveStats {
    /// Total live signals in the current thread runtime.
    #[get(type(copy))]
    pub(crate) live_signals: usize,
    /// Total live memos in the current thread runtime.
    #[get(type(copy))]
    pub(crate) live_memos: usize,
    /// Total live effects in the current thread runtime.
    #[get(type(copy))]
    pub(crate) live_effects: usize,
    /// Total live ownership scopes in the current thread runtime.
    #[get(type(copy))]
    pub(crate) live_scopes: usize,
    /// Global reactive write clock.
    #[get(type(copy))]
    pub(crate) clock: u64,
}

/// Snapshot of intrusive edge slab and arena capacity metrics for reactive graph diagnostics.
#[derive(Clone, Copy, Debug, Default, Eq, Getter, Hash, New, Ord, PartialEq, PartialOrd)]
pub struct ReactiveGraphMetrics {
    /// Number of currently linked dependency edges in the intrusive slab.
    #[get(type(copy))]
    pub(crate) live_edges: usize,
    /// Monotonic count of edge allocations since runtime initialization.
    #[get(type(copy))]
    pub(crate) edge_alloc_count: u64,
    /// Allocated capacity of the signal arena vector.
    #[get(type(copy))]
    pub(crate) signals_capacity: usize,
    /// Allocated capacity of the memo arena vector.
    #[get(type(copy))]
    pub(crate) memos_capacity: usize,
    /// Allocated capacity of the effect arena vector.
    #[get(type(copy))]
    pub(crate) effects_capacity: usize,
    /// Allocated capacity of the scope arena vector.
    #[get(type(copy))]
    pub(crate) scopes_capacity: usize,
}

/// Panic-safe RAII guard that pops an active tracking frame from `observer_stack` on unwind.
#[derive(Debug)]
pub(crate) struct TrackingGuard {
    /// Remains `true` until normal completion disarms the guard before committing.
    pub(crate) active: bool,
}

/// Panic-safe RAII guard tracking nested shared `RefCell::try_borrow()` depth and flushing deferred reads on exit.
#[derive(Debug)]
pub(crate) struct RefBorrowGuard {
    /// Nesting depth prior to entering this shared read borrow.
    pub(crate) prev_depth: u32,
}

/// Panic-safe RAII guard temporarily suspending dependency tracking inside `untracked(...)`.
#[derive(Debug)]
pub(crate) struct UntrackedGuard {
    /// Previous `TRACKING_ACTIVE` flag restored on drop.
    pub(crate) prev_active: bool,
    /// Whether a `None` sentinel frame was pushed onto `observer_stack`.
    pub(crate) pushed_frame: bool,
}