Repository navigation
Conversation
The retail executable calls fence slot 12, one past ID3D12Fence1, as (value, descriptor, flags) and reads the return as a pointer to the fence's 64-bit completed value: it compares it with ~0 and subtracts the value it waits for. The proxy refused it with E_NOTIMPL, which the title then dereferenced. Each fence now gets a mirror on its first slot 12 call. A wait-thread callback reads the real fence's completed value into it and re-arms SetEventOnCompletion(value + 1), so it follows every completion without another call; slot 12 and the CPU Signal refresh it at once, under a lock. After device removal it holds ~0 and nothing is re-armed. The release of the proxy unregisters the wait before the real fence goes. The descriptor's code pointer is not called. Tests: xs_proxy_mock_test (mock fences now keep a completed value and arm one event) and queue_proxy_test (a real queue signal reaches the mirror). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refresh the slot 12 mirror when the completion wait times out. Keep the existing pending fence event so a rewind cannot accumulate duplicate registrations. The mock test covers a CPU rewind followed by progress below the old threshold and a rewind from outside the proxy. Original fails and patched passes in five runs each on Wine 11.20. AI-assisted.
|
Independent Windows + GPU test of Setup: Windows 11 x64, MSVC 19.44.35220 (
AI-assisted review/test. |
|
Tested Built No game files. AI-assisted (Claude Code). |
|
Tested
No game files. AI-assisted (Claude Code). |
o-psi
left a comment
There was a problem hiding this comment.
Recommend keeping #7290 at d5fa829 and closing #7653. Independently rechecked source 0cb3d3b: its complete tree and rewind patch are identical to the authored cherry-pick 04fdf37. Both complete five-file merge-base diffs were compared; the current replacement preserves every source test, documentation change and rewind path, adding only the separate fence-event lifetime change and test. No unique contribution remains. Both heads are still open and unchanged. Git/source comparison on Linux; no new runtime/GPU tests. AI-assisted QA (Codex via T3).
|
Thanks for this fix, @rison1337. From the PR cleanup in #8919: the rewind commit here, agent: yes |
|
Tested 0cb3d3b under Wine: Proton Experimental (wine 11),
AI-assisted run (Claude Code); no game files used. |
Claimed in the coordination issue.
Depends on: #7290. The base PR introduces the slot 12 mirror. This follow-up adds one commit on top of
5ac4deaa,0cb3d3b.Problem
The mirror can become stale after a D3D12 fence rewind. After completion at 40, the callback arms an event for 41. A CPU signal to 3 updates the mirror. A subsequent signal to 15 on the underlying fence never reaches 41, so the address returned by slot 12 still reads 3. Original review and reproduction.
Change
Use a thread-pool wait with a 10 ms timeout. The completion event still wakes the callback as before. A timeout refreshes the mirror without registering another completion event. Teardown cancels the wait and drains callbacks before releasing the fence and event.
Verification
CachyOS x86-64, Wine 11.20, clang/llvm-mingw, synthetic COM objects. The stock mock test passes on #7290. With the added test, #7290 failed five of five runs and this revision passed five of five. The regression covers CPU and external rewinds, progress below the outstanding threshold, and a later signal that satisfies the original event.
git diff --checkand the game-data scan passed. The documentation link suite reports the same existing broken anchor indocs/dev-tools.mdon the base and this branch. No retail run, native Windows run, or polling-overhead measurement. AI-assisted.