[PR #958] d3d12_xs: retain queue and fence wrappers through forwarded calls #996

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/958
Author: @Kadamitas
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: restore/queue-child-lifetime


📝 Commits (3)

  • 8cfbfe0 d3d12_xs: keep child proxies alive during queue calls
  • 41a1065 d3d12_xs: avoid full registry walks when unwrapping objects
  • fe9ee37 xs proxy mock: check queue and fence ownership during forwarding

📊 Changes

2 files changed (+113 additions, -11 deletions)

View changed files

📝 runtime/shims/d3d12_xs_device.cpp (+96 -8)
📝 runtime/test/xs_proxy_mock_test.cpp (+17 -3)

📄 Description

Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136476546

What and why

Restore two changes originally proposed in ItsNotRexed/Leonida PR 9475. A forwarded queue operation now keeps its wrapper alive until the backend returns. Signal and Wait also retain the fence wrapper while using its underlying object. The live-child index uses 256 address buckets and performs identity checks without allocating during lookup. The registry lock is released before calling the backend or releasing an underlying COM object.

The rebase preserves current main's command-list unwrapping and presentation routes. The mock samples the queue and fence ownership counts inside Signal and Wait, then checks that both return to their initial counts. Credit to VibeClauding for reviewing the original change and identifying the need to check ownership during the call.

The claim uses the unlisted-work route in CONTRIBUTING.md. A board ID can be added if the maintainers assign one.

Tested

On Windows 11 Pro 25H2 (26200.9974), Visual Studio 2022 MSVC toolset 14.36.32532, x64. All six existing mock modes passed on 8106179d6, including the new in-call ownership assertions. The default run also checked presentation and command-list forwarding.

The normal CMake target stopped in the separate CRT timed-wait shim on this older toolset. The proxy mock's two source files compiled directly from an x64 developer prompt:

cl /nologo /std:c++20 /EHsc /O2 /MD /utf-8 /permissive- /DWIN32_LEAN_AND_MEAN /DNOMINMAX runtime/test/xs_proxy_mock_test.cpp runtime/shims/d3d12_xs_device.cpp /Fe:xs_proxy_mock_test.exe

Ran the executable with no arguments and with each of --fail-virtualalloc, --fail-virtualprotect, --fail-veh, --env-slots, and --env-slots-invalid. The repository content guard and git diff --check also passed.

GPUs tested: n/a, synthetic COM backend.
AI-assisted: yes.

Checklist

  • Based on current main (a28927849).
  • Focused on queue/fence lifetime and the corresponding mock coverage.
  • Contains source code only.

🔄 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/958 **Author:** [@Kadamitas](https://github.com/Kadamitas) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `restore/queue-child-lifetime` --- ### 📝 Commits (3) - [`8cfbfe0`](https://github.com/ubiquitarianism/leonida/commit/8cfbfe0d11e8f821f2daa55f904195ffe97f3bbd) d3d12_xs: keep child proxies alive during queue calls - [`41a1065`](https://github.com/ubiquitarianism/leonida/commit/41a106595894b56e18f1f3d3ce195a9c0777a4d1) d3d12_xs: avoid full registry walks when unwrapping objects - [`fe9ee37`](https://github.com/ubiquitarianism/leonida/commit/fe9ee374a0bd824b601c959c723aef5cc1809396) xs proxy mock: check queue and fence ownership during forwarding ### 📊 Changes **2 files changed** (+113 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_xs_device.cpp` (+96 -8) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+17 -3) </details> ### 📄 Description Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136476546 ### What and why Restore two changes originally proposed in ItsNotRexed/Leonida PR 9475. A forwarded queue operation now keeps its wrapper alive until the backend returns. Signal and Wait also retain the fence wrapper while using its underlying object. The live-child index uses 256 address buckets and performs identity checks without allocating during lookup. The registry lock is released before calling the backend or releasing an underlying COM object. The rebase preserves current main's command-list unwrapping and presentation routes. The mock samples the queue and fence ownership counts inside Signal and Wait, then checks that both return to their initial counts. Credit to VibeClauding for reviewing the original change and identifying the need to check ownership during the call. The claim uses the unlisted-work route in CONTRIBUTING.md. A board ID can be added if the maintainers assign one. ### Tested On Windows 11 Pro 25H2 (26200.9974), Visual Studio 2022 MSVC toolset 14.36.32532, x64. All six existing mock modes passed on 8106179d6, including the new in-call ownership assertions. The default run also checked presentation and command-list forwarding. The normal CMake target stopped in the separate CRT timed-wait shim on this older toolset. The proxy mock's two source files compiled directly from an x64 developer prompt: ``` cl /nologo /std:c++20 /EHsc /O2 /MD /utf-8 /permissive- /DWIN32_LEAN_AND_MEAN /DNOMINMAX runtime/test/xs_proxy_mock_test.cpp runtime/shims/d3d12_xs_device.cpp /Fe:xs_proxy_mock_test.exe ``` Ran the executable with no arguments and with each of `--fail-virtualalloc`, `--fail-virtualprotect`, `--fail-veh`, `--env-slots`, and `--env-slots-invalid`. The repository content guard and `git diff --check` also passed. GPUs tested: n/a, synthetic COM backend. AI-assisted: yes. ### Checklist - [x] Based on current main (a28927849). - [x] Focused on queue/fence lifetime and the corresponding mock coverage. - [x] Contains source code only. --- <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#996
No description provided.