From 74ff7adfbe7abe399de951c513cdfe19fc9fe032 Mon Sep 17 00:00:00 2001 From: Christopher Sundeby Date: Wed, 25 Nov 2026 17:17:20 +0100 Subject: [PATCH] d3d12_xs: the releaser watchdog does not wrap to 2^64 - 1 ms (RT-RELEASER-STALL-WRAP) release_loop stores the start of a gate Signal as GetTickCount64() | 1 so that 0 can mean "not inside a Signal". On an even tick that start is 1 ms ahead of the clock, and watch_releaser reading it in the same millisecond computed GetTickCount64() - since = 2^64 - 1. It then logged "has been inside one gate Signal ... for 18446744073709551615 ms", counted a stall in release_stalls and set stall_logged_, so a real stall of that Signal was never reported. Clamp the elapsed time at 0. Co-Authored-By: Claude Opus 5.5 --- runtime/shims/d3d12_xs_list_values.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/shims/d3d12_xs_list_values.h b/runtime/shims/d3d12_xs_list_values.h index 2a30b4b964..f848f87da8 100644 --- a/runtime/shims/d3d12_xs_list_values.h +++ b/runtime/shims/d3d12_xs_list_values.h @@ -602,7 +602,10 @@ class Pump { stall_logged_ = false; return; } - const std::uint64_t ms = GetTickCount64() - since; + // release_loop stores the start with its low bit set, so on an even tick it is 1 ms ahead of the clock: read + // in that millisecond, the difference would wrap to 2^64 - 1 and report a stall that has not happened. + const std::uint64_t now = GetTickCount64(); + const std::uint64_t ms = now > since ? now - since : 0; if (ms < kStallMs || stall_logged_) return; stall_logged_ = true; bump(counters().release_stalls);