From f402b37e1ba38c5efe9012db6459a237188fea1b Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Sat, 14 Nov 2026 00:31:15 -0400 Subject: [PATCH] tests: test-hrx-buffer expects clear() to keep the lifetime counts, as #356 made it (engine#2393) #356 changed HostWeightCache::clear() to zero only the live gauges (allocation_count, resident_bytes) and keep hits/misses, matching AMD's hrx-buffer-test. Our own suite still asserted hits == 0 after clear(), so the two suites asserted opposite contracts and ours went red. Co-Authored-By: Claude Opus 5.5 --- tests/test-hrx-buffer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test-hrx-buffer.cpp b/tests/test-hrx-buffer.cpp index 8628b4a9e1f9..92e5448c5183 100644 --- a/tests/test-hrx-buffer.cpp +++ b/tests/test-hrx-buffer.cpp @@ -345,10 +345,11 @@ static void run_host_weight_cache_checks(ggml_backend_hrx_context * context) { REQUIRE(transfer_stats.uploads == 3); REQUIRE(transfer_stats.upload_bytes == 96); + // engine#2393 / #356: clear() zeroes the live gauges and keeps the lifetime counts weights.clear(); weight_stats = weights.stats(); - REQUIRE(weight_stats.hits == 0); - REQUIRE(weight_stats.misses == 0); + REQUIRE(weight_stats.hits == 1); + REQUIRE(weight_stats.misses == 3); REQUIRE(weight_stats.allocation_count == 0); REQUIRE(weight_stats.resident_bytes == 0); }