pub struct ThreadLocalState {
pub steps_count: AtomicU64,
pub nodes_visited: AtomicU64,
pub rewrites_applied: AtomicU64,
}Expand description
Per-thread telemetry for staged simplification.
Tracks three per-thread metrics (parallel_review §3.1):
steps_count— total simplification rounds performed by this threadnodes_visited— total DAG nodes inspected during traversalrewrites_applied— total rewrite rules that fired (pattern matches)
The 128-byte repr(align) was removed: cache-line padding guards against
false-sharing only when different threads write to adjacent memory. A
thread_local! value lives in per-thread storage — no other thread can
touch it — so over-alignment is pure waste.
Fields§
§steps_count: AtomicU64Total simplification steps (one per run_staged_simplification round).
nodes_visited: AtomicU64Total DAG nodes visited across all steps. Useful for throughput profiling.
rewrites_applied: AtomicU64Total rewrite rules that fired. Non-zero means the expression changed.
Implementations§
Source§impl ThreadLocalState
impl ThreadLocalState
Sourcepub fn record_nodes_visited(&self, n: u64)
pub fn record_nodes_visited(&self, n: u64)
Records that n additional DAG nodes were visited.
Sourcepub fn record_rewrites(&self, n: u64)
pub fn record_rewrites(&self, n: u64)
Records that n rewrite rules fired.
Sourcepub fn get_nodes_visited(&self) -> u64
pub fn get_nodes_visited(&self) -> u64
Returns the total number of nodes visited.
Sourcepub fn get_rewrites_applied(&self) -> u64
pub fn get_rewrites_applied(&self) -> u64
Returns the total number of rewrites applied.
Trait Implementations§
Source§impl Debug for ThreadLocalState
impl Debug for ThreadLocalState
Auto Trait Implementations§
impl !Freeze for ThreadLocalState
impl RefUnwindSafe for ThreadLocalState
impl Send for ThreadLocalState
impl Sync for ThreadLocalState
impl Unpin for ThreadLocalState
impl UnsafeUnpin for ThreadLocalState
impl UnwindSafe for ThreadLocalState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more