d3d12_xs: the releaser watchdog does not wrap to 2^64 - 1 ms (RT-RELEASER-STALL-WRAP) #1944

Closed
Christopher-Sundeby wants to merge 1 commit from upstream-pr/1944 into main
Christopher-Sundeby commented 2026-11-25 16:24:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Christopher-Sundeby on 2026-11-25T16:24:42Z.


Claimed in the coordination issue as: RT-RELEASER-STALL-WRAP

What and why

release_loop stores the start of a gate Signal as GetTickCount64() | 1, so that 0 can mean "not inside a Signal" (runtime/shims/d3d12_xs_list_values.h:636). On an even tick that start is 1 ms ahead of the clock. When watch_releaser reads it in that same millisecond, GetTickCount64() - since wraps to 2^64 - 1. The watchdog then:

  • logs the releaser ... has been inside one gate Signal (value 1) for 18446744073709551615 ms for a Signal that has just started,
  • counts it in release_stalls, and
  • sets stall_logged_, so a real stall of that same Signal is never reported.

This happened on a retail boot here (RTX 3060 Ti, main b0f3d3998, run described in the finding). The fix clamps the elapsed time at 0. Nothing else reads signal_since_ms_ as a time.

Tested

  • Windows 11, MSVC 14.44 (VS 2022 Build Tools), Ninja, RelWithDebInfo: gta6rt and xs_proxy_mock_test build. No new warnings come from the changed file.
  • xs_proxy_mock_test: PASS, including section 14 (list memory writes and waits, the pump and the releaser).
  • No unit test for the wrap itself: it depends on a 1 ms timing window inside the pump thread, and the watchdog is private to ListValuePump.

GPUs tested: n/a (CPU-side change; the run that showed the message was on an RTX 3060 Ti, NVIDIA 621.24)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5495051217 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1944). Originally posted by [Christopher-Sundeby](https://github.com/Christopher-Sundeby) on 2026-11-25T16:24:42Z. --- Claimed in the coordination issue as: RT-RELEASER-STALL-WRAP ### What and why `release_loop` stores the start of a gate Signal as `GetTickCount64() | 1`, so that 0 can mean "not inside a Signal" (`runtime/shims/d3d12_xs_list_values.h:636`). On an even tick that start is 1 ms ahead of the clock. When `watch_releaser` reads it in that same millisecond, `GetTickCount64() - since` wraps to 2^64 - 1. The watchdog then: - logs `the releaser ... has been inside one gate Signal (value 1) for 18446744073709551615 ms` for a Signal that has just started, - counts it in `release_stalls`, and - sets `stall_logged_`, so a real stall of that same Signal is never reported. This happened on a retail boot here (RTX 3060 Ti, `main` b0f3d3998, run described in the [finding](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167719574)). The fix clamps the elapsed time at 0. Nothing else reads `signal_since_ms_` as a time. ### Tested - Windows 11, MSVC 14.44 (VS 2022 Build Tools), Ninja, RelWithDebInfo: `gta6rt` and `xs_proxy_mock_test` build. No new warnings come from the changed file. - `xs_proxy_mock_test`: PASS, including section 14 (list memory writes and waits, the pump and the releaser). - No unit test for the wrap itself: it depends on a 1 ms timing window inside the pump thread, and the watchdog is private to `ListValuePump`. GPUs tested: n/a (CPU-side change; the run that showed the message was on an RTX 3060 Ti, NVIDIA 621.24) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Christopher-Sundeby commented 2026-11-25 16:47:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Christopher-Sundeby on 2026-11-25T16:47:47Z.


More evidence: the inside one gate Signal ... for 18446744073709551615 ms line showed up in 3 of 3 further retail boots on this machine (RTX 3060 Ti, main b0f3d3998), with different switches each time (run notes). A real stall cannot be that long, so each was the wrap this pull request fixes. Each one also set stall_logged_ for that Signal, so a real stall of it would not have been reported.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7168544855 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1944#issuecomment-7168544855). Originally posted by [Christopher-Sundeby](https://github.com/Christopher-Sundeby) on 2026-11-25T16:47:47Z. --- More evidence: the `inside one gate Signal ... for 18446744073709551615 ms` line showed up in 3 of 3 further retail boots on this machine (RTX 3060 Ti, `main` b0f3d3998), with different switches each time ([run notes](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7168540607)). A real stall cannot be that long, so each was the wrap this pull request fixes. Each one also set `stall_logged_` for that Signal, so a real stall of it would not have been reported.
MSedgeMC commented 2026-11-25 17:09:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-25T17:09:43Z.

Review: APPROVED


Verified against source: release_loop stores signal_since_ms_ = GetTickCount64() | 1 (line 636). On an even tick the stored value is the next millisecond, so watch_releaser's GetTickCount64() - since can wrap to 2^64-1 and trip the stall counter. The fix clamps to 0 when now <= since, which is the correct minimal handling and preserves normal timing. No game data, no GPU needed for the review.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6061801208 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1944#pullrequestreview-6061801208). Originally posted by [MSedgeMC](https://github.com/MSedgeMC) on 2026-11-25T17:09:43Z. **Review:** APPROVED --- Verified against source: release_loop stores signal_since_ms_ = GetTickCount64() | 1 (line 636). On an even tick the stored value is the next millisecond, so watch_releaser's GetTickCount64() - since can wrap to 2^64-1 and trip the stall counter. The fix clamps to 0 when now <= since, which is the correct minimal handling and preserves normal timing. No game data, no GPU needed for the review.
Christopher-Sundeby commented 2026-11-27 18:36:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Christopher-Sundeby on 2026-11-27T18:36:39Z.


Closing this one: the same fix is on main through #2098 (commit 9f98dcc61). watch_releaser in runtime/shims/d3d12_xs_list_values.h now computes now > since ? now - since : 0, which is exactly this change, so after resolving the conflict nothing but a comment would be left. Thanks to everyone who looked at it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7225672420 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1944#issuecomment-7225672420). Originally posted by [Christopher-Sundeby](https://github.com/Christopher-Sundeby) on 2026-11-27T18:36:39Z. --- Closing this one: the same fix is on `main` through #2098 (commit 9f98dcc61). `watch_releaser` in `runtime/shims/d3d12_xs_list_values.h` now computes `now > since ? now - since : 0`, which is exactly this change, so after resolving the conflict nothing but a comment would be left. Thanks to everyone who looked at it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1944
No description provided.