From f34b99581cca3346fcb230f0b9545501d9066855 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Fri, 13 Nov 2026 21:56:16 -0400 Subject: [PATCH] hrx: HostWeightCacheStats names its lifetime counters and live gauges (engine#2393) Review of #356: the split clear() relies on was only in the PR body. The struct now groups and documents the two kinds, so a new field states which it is. Field order changed (duplicate_warnings moved up with the counters); nothing initialises the struct positionally. Co-Authored-By: Claude Opus 5.5 --- ggml/src/ggml-hrx/runtime/host-memory.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-hrx/runtime/host-memory.h b/ggml/src/ggml-hrx/runtime/host-memory.h index b852dacc662d..5438d444344b 100644 --- a/ggml/src/ggml-hrx/runtime/host-memory.h +++ b/ggml/src/ggml-hrx/runtime/host-memory.h @@ -70,14 +70,20 @@ struct HostWeightSource { }; // Residency counts cache-owned representations, not buffers retained after an explicit clear. +// Two kinds of field (engine#2393). Lifetime counters (hits, misses, evictions, materialized_bytes, duplicate_warnings) +// only grow, and HostWeightCache::clear() keeps them. Live gauges (allocation_count, resident_bytes) describe the +// entries resident now, and clear() zeroes them with the entries. A new field must say which it is, and clear() must +// follow. struct HostWeightCacheStats { + // lifetime counters uint64_t hits = 0; uint64_t misses = 0; uint64_t evictions = 0; size_t materialized_bytes = 0; + uint64_t duplicate_warnings = 0; + // live gauges size_t allocation_count = 0; size_t resident_bytes = 0; - uint64_t duplicate_warnings = 0; }; // The pairing every pooled allocation in this file needs (engine #1711/#1823): charge before the allocation, return