Reuse the D3D12 device across e64 pixel cases and retain per-case failure attribution #502

Merged
descent81 merged 1 commit from upstream-pr/508 into main 2026-11-22 09:31:05 +00:00
descent81 commented 2026-11-22 08:32:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by descent81 on 2026-11-22T08:32:19Z.


Related to #448. Its measurements identified repeated D3D12 device creation as a major cost. This PR implements a bounded first consumer on main at a46dac3: the e64 pixel suite has six compiled shaders and many reference inputs per shader.

Execution and isolation

offscreen_check <backend> --check-pixel-batch <shader> <case> [<case> ...] opens one device and runs the existing readback path once per input. Each case keeps its own draw resources. The output associates the reference path with an index and reports an ordered pass, pixel mismatch or error. The aggregate exit code is 1 if any case fails. The fixture validates every status, including expected failures. Each arithmetic batch also repeats a correct reference after its negative controls. The debug queue is reported and cleared per case, and the runner checks device health before and after each draw.

Measured wall time

Three alternating baseline/changed runs per backend, same renderer binary and DXC, debug layer enabled. Times include shader compilation and readback. Baseline uses the parent Python fixture. The updated fixture performs two extra recovery draws.

Backend Individual draws (s) Batched (s) Median before → after
RTX 4060 11.37, 11.38, 12.46 3.74, 3.86, 3.90 11.38 → 3.86 s
Microsoft WARP 2.83, 3.83, 3.04 1.11, 1.08, 1.07 3.04 → 1.08 s

Renderer launches for the e64 suite fall from 35 to 6. Existing single-case commands remain available. Other pixel suites can be migrated independently.

Failure controls and verification

  • Both backends passed the e64 fixture, including matching references after intentional mismatches.
  • In a local WARP control build, injecting a D3D12 debug error during the middle of three matching draws gave pass/error/pass, debug error counts 0/1/0, and exit 1.
  • In a separate WARP control build, calling ID3D12Device5::RemoveDevice before case two gave pass/error/error and exit 1. Both remaining cases reported HRESULT 0x887a0005.
  • The control injections were removed. The four local hardware/WARP core and e64 CTest entries passed, and both e64 entries passed again after rebuilding the final source.

This measures the e64 suite on one PC. The rest of #448 remains open.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6540302833 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/508). Originally posted by [descent81](https://github.com/descent81) on 2026-11-22T08:32:19Z. --- Related to #448. Its measurements identified repeated D3D12 device creation as a major cost. This PR implements a bounded first consumer on main at `a46dac3`: the e64 pixel suite has six compiled shaders and many reference inputs per shader. ## Execution and isolation `offscreen_check <backend> --check-pixel-batch <shader> <case> [<case> ...]` opens one device and runs the existing readback path once per input. Each case keeps its own draw resources. The output associates the reference path with an index and reports an ordered pass, pixel mismatch or error. The aggregate exit code is 1 if any case fails. The fixture validates every status, including expected failures. Each arithmetic batch also repeats a correct reference after its negative controls. The debug queue is reported and cleared per case, and the runner checks device health before and after each draw. ## Measured wall time Three alternating baseline/changed runs per backend, same renderer binary and DXC, debug layer enabled. Times include shader compilation and readback. Baseline uses the parent Python fixture. The updated fixture performs two extra recovery draws. | Backend | Individual draws (s) | Batched (s) | Median before → after | | --- | --- | --- | --- | | RTX 4060 | 11.37, 11.38, 12.46 | 3.74, 3.86, 3.90 | 11.38 → 3.86 s | | Microsoft WARP | 2.83, 3.83, 3.04 | 1.11, 1.08, 1.07 | 3.04 → 1.08 s | Renderer launches for the e64 suite fall from 35 to 6. Existing single-case commands remain available. Other pixel suites can be migrated independently. ## Failure controls and verification - Both backends passed the e64 fixture, including matching references after intentional mismatches. - In a local WARP control build, injecting a D3D12 debug error during the middle of three matching draws gave pass/error/pass, debug error counts 0/1/0, and exit 1. - In a separate WARP control build, calling `ID3D12Device5::RemoveDevice` before case two gave pass/error/error and exit 1. Both remaining cases reported HRESULT 0x887a0005. - The control injections were removed. The four local hardware/WARP core and e64 CTest entries passed, and both e64 entries passed again after rebuilding the final source. This measures the e64 suite on one PC. The rest of #448 remains open.
upstream-sync closed this pull request 2026-11-24 06:43:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
R0Y00/Xbox2Windows!502
No description provided.