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

Open
opened 2026-11-26 21:19:31 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1944
Author: @Christopher-Sundeby
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/releaser-stall-wrap


📝 Commits (1)

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

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 runtime/shims/d3d12_xs_list_values.h (+4 -1)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1944 **Author:** [@Christopher-Sundeby](https://github.com/Christopher-Sundeby) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/releaser-stall-wrap` --- ### 📝 Commits (1) - [`74ff7ad`](https://github.com/ubiquitarianism/leonida/commit/74ff7adfbe7abe399de951c513cdfe19fc9fe032) d3d12_xs: the releaser watchdog does not wrap to 2^64 - 1 ms (RT-RELEASER-STALL-WRAP) ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_xs_list_values.h` (+4 -1) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1953
No description provided.