pub struct RunMetrics {
pub cache_hits: AtomicU64,
pub cache_misses: AtomicU64,
pub cache_hit_tokens: AtomicU64,
pub last_entropy: AtomicU32,
pub low_entropy_tokens: AtomicU64,
pub total_sampled_tokens: AtomicU64,
pub baseline_free_bytes: AtomicUsize,
pub kernel_audit: Mutex<Vec<(String, String, bool, &'static Location<'static>)>>,
/* private fields */
}Expand description
The process’s single run mailbox.
Seven separate statics across three modules became one, because they were
always one thing: the numbers a reader gets when it asks what the running
model is doing. Splitting them meant reset_for_new_run had to reach into
three modules and could silently miss one — the failure being a counter
that keeps a dead model’s value while its neighbours restart.
Fields§
§cache_hits: AtomicU64§cache_misses: AtomicU64§cache_hit_tokens: AtomicU64§last_entropy: AtomicU32Most recent per-token entropy, f32 bits for a lock-free read.
low_entropy_tokens: AtomicU64§total_sampled_tokens: AtomicU64§baseline_free_bytes: AtomicUsizeFree device memory at GPU-context init, before this run allocated
anything. Lets KV sizing measure this process’s own footprint as
baseline - free_now, excluding co-tenants automatically. 0 =
unset (the mock backend in tests) and callers fall back.
kernel_audit: Mutex<Vec<(String, String, bool, &'static Location<'static>)>>(module, func, loaded, dispatch site) for every kernel lookup this run
made. The site is the Location of the .kernel(…) / try_kernel(…)
call, carried in through #[track_caller]: a bare module::func list
is not actionable when the same module is looked up from a dozen
constructors and the fix is always “go to that line”.