d3d12_xs: retain queue and fence wrappers through forwarded calls #958
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/958"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by Kadamitas on 2026-11-24T15:42:48Z.
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 main's command-list, presentation, and queue-order routes. It retains the fence in the shifted Signal and Wait slots and in SignalX. The mock checks both reference counts during forwarding and after return. A reentrant AddRef or Release can observe the internal reference in its return count. 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
43a9d562d: all nine CMakexs_proxy_mockcases passed on Windows, including original and shifted Signal/Wait plus SignalX ownership checks.Earlier verification:
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:
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 andgit diff --checkalso passed.GPUs tested: n/a, synthetic COM backend.
AI-assisted: yes.
Checklist
43a9d562d.Imported from ubiquitarianism/leonida. Originally posted by Snooozs on 2026-11-24T17:39:21Z.
Independent check: all six
xs_proxy_mock*CTests pass; the new test withmain'sd3d12_xs_device.cppfails at line 1216 (observed_queue_refs == 2 && observed_fence_refs == 2), so it does check the pins. It also merges with #968, and the combined tree passesxs_proxy_mock*andxmem(7/7).Reading note, not a blocker: the comment says the pins do not change the guest-visible counters. A
Releasethat re-enters during a forwarded call still returns the count including the pin (1 instead of 0 for the caller's last reference), and the same forAddRef. Nothing here depends on it, but the comment could say so.Windows 10 Pro 22H2 (19045), VS 2022 RelWithDebInfo, merged onto
main32950551ewithout conflicts, targets rebuilt, CPU only, no game files. AI-assisted (Claude Code): I read the whole diff and ran this on that machine.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T09:51:58Z.
Red/green: the PR's test fails on main and passes with this PR (checked by OreoFR).
Runtime batch of 20 PRs tested by OreoFR (full build, ctest without the game, Python suite, translator): same results as main
09c153948, RTX 4070 Laptop / Windows 11.AI-assisted (Claude Code, Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:45:38Z.
Verified by OreoFR
09c153948+ PR head53ed711b8; integration package 1 of 6 (20 PRs, merged without conflict)AI-assisted (Claude Code, Claude Opus 5.5).