startup: retain present signature copies on device removal #3024

Manually merged
github merged 1 commit from github-bot/gh-3024 into gh-pr/3024/base 2026-11-27 07:25:06 +00:00 AGit
Owner

@⁠chadhyatt on GitHub · 2026-11-27 07:04 UTC · original
chadhyatt:backport/present-signature-removed-fence → main · +292 −32 · 3 files · 1 commits · merged 2026-11-27 07:22 UTC

AI-assisted backport patch from x2w-microlift.

The present signature sampler must not treat GetCompletedValue() == UINT64_MAX as successful completion. Keep the in-flight source and copy objects retained and publish no sample on removal. During teardown, re-observe a pending fence after the bounded wait so verified completion still releases normally.

The authored held-source fixture exercises prior-sample preservation and deterministic pending-to-completed/removal observations through an actual queue and forwarding fence. No game files or title-specific input.

Verified on Apple Silicon against upstream main c09145a7d and patch head 7d1f443de3:

  • x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only -Isrc -Itests tests/startup_present_signature.cpp passed.
  • c++ -std=c++17 -Isrc tests/startup_present_readback_check.cpp and its executable passed the pending, stale event, completion, failed signal, removal and ownership retirement controls.

Windows WARP/debug-layer execution of ctest --preset dev --no-tests=error -R "^startup_present_signature" remains unverified on this host.

**@⁠chadhyatt** on GitHub · 2026-11-27 07:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3024) `chadhyatt:backport/present-signature-removed-fence` → `main` · +292 −32 · 3 files · 1 commits · merged 2026-11-27 07:22 UTC AI-assisted backport patch from x2w-microlift. The present signature sampler must not treat `GetCompletedValue() == UINT64_MAX` as successful completion. Keep the in-flight source and copy objects retained and publish no sample on removal. During teardown, re-observe a pending fence after the bounded wait so verified completion still releases normally. The authored held-source fixture exercises prior-sample preservation and deterministic pending-to-completed/removal observations through an actual queue and forwarding fence. No game files or title-specific input. Verified on Apple Silicon against upstream main c09145a7d and patch head 7d1f443de3: - `x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only -Isrc -Itests tests/startup_present_signature.cpp` passed. - `c++ -std=c++17 -Isrc tests/startup_present_readback_check.cpp` and its executable passed the pending, stale event, completion, failed signal, removal and ownership retirement controls. Windows WARP/debug-layer execution of `ctest --preset dev --no-tests=error -R "^startup_present_signature"` remains unverified on this host.
Treat removed fence values as non-completion; re-observe pending fences after teardown waits.
Extend authored sampler lifetime controls for completion and removal.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 07:07:19 +00:00
github-bot changed target branch from main to gh-pr/3024/base 2026-11-27 07:25:04 +00:00
github manually merged commit 7d1f443de3 into gh-pr/3024/base 2026-11-27 07:25:06 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 07:21 UTC · original · approved these changes

Independent review of 7d1f443d on current main c09145a7. The sampler now distinguishes pending, completed and removed. On the removal sentinel it leaves the prior sample published, maps no readback and retains the copy resources. Teardown also re-observes the fence after its bounded wait. The sentinel matches the D3D12 fence contract.

I rebuilt startup_present_signature, startup_present_readback_check and d3d12_xs_shim and ran ctest --preset <dev|release> --no-tests=error -V -R '^startup_present_(signature|readback)'. Debug and Release /O2 each passed 4/4 without skips on Windows 11 build 26200.9974 and WARP 10.0.26100.9818. The held-source case had zero debug-layer errors and the unheld control produced the expected release-while-in-use error. The removal test injects the fence sentinel through a forwarding fence on a real WARP queue. Hosted Windows, Linux Python and gfx1013 checks passed. The hosted /O2 job skipped and the local /O2 retest passed.

**@⁠R0Y00** on GitHub · 2026-11-27 07:21 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3024#pullrequestreview-6084763019) · **approved these changes** Independent review of `7d1f443d` on current `main` `c09145a7`. The sampler now distinguishes pending, completed and removed. On the removal sentinel it leaves the prior sample published, maps no readback and retains the copy resources. Teardown also re-observes the fence after its bounded wait. The sentinel matches [the D3D12 fence contract](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12fence-getcompletedvalue). I rebuilt `startup_present_signature`, `startup_present_readback_check` and `d3d12_xs_shim` and ran `ctest --preset <dev|release> --no-tests=error -V -R '^startup_present_(signature|readback)'`. Debug and Release `/O2` each passed 4/4 without skips on Windows 11 build 26200.9974 and WARP 10.0.26100.9818. The held-source case had zero debug-layer errors and the unheld control produced the expected release-while-in-use error. The removal test injects the fence sentinel through a forwarding fence on a real WARP queue. Hosted Windows, Linux Python and gfx1013 checks passed. The hosted `/O2` job skipped and the local `/O2` retest passed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.