Repository navigation
test(runtime): verify root-signature rebind preserves arguments and switch resets them (TEST-280) - #1884
Conversation
6076981 to
b99c2ae
Compare
Serrambi
left a comment
There was a problem hiding this comment.
Reviewed b99c2aeb and tested on NVIDIA GeForce RTX 5070 Ti (driver 610.88, Windows 11 Pro, MSVC 19.50.35719.0, Vulkan SDK 1.4.363.0): approve.
Code review (runtime/test/d3d12_compute_test.cpp)
- Cleanly covers TEST-280 across three dispatches: rebinding the active
held_rootafter settings0preservess0while updatings1(dispatch 1:7 + 3 * i),SetGraphicsRootSignature/SetGraphicsRoot32BitConstantdo not clobber compute root state, and switching to a distinct root signature (root.p != held_root) clears previously bound compute arguments to zero (s0drops from100to0, dispatch 3:5 * i), while rebindingroot.pafterward keepss1 = 5. - Also resets
pso67before the final device reference-count check (note:#1898touches the same cleanup block if both merge).
Checks on b99c2aeb
d3d12_compute_test.exe(default): passed (64 elements matched in each of three dispatches)d3d12_compute_test.exe(LEONIDA_VK_VALIDATION=1): passed, 0 Vulkan validation errorsctest --test-dir runtime/build --output-on-failure -R "^(d3d12_compute|d3d12_set0_compute)$": passed 2/2
acb96be to
343d771
Compare
…witch resets them (TEST-280) Extend d3d12_compute_test across its three dispatches to verify: - Rebinding the already-active compute root signature (SetComputeRootSignature with the same ID3D12RootSignature*) preserves previously bound root constants (s0 = 7) while allowing subsequent updates (s1 = 3). - Calling SetGraphicsRootSignature and SetGraphicsRoot32BitConstant does not clobber compute root arguments. - Switching to a distinct ID3D12RootSignature* instance resets bound compute root arguments to zero (s0 drops from 100 to 0 in the third dispatch), and rebinding that new root signature afterward preserves arguments bound after the switch (s1 = 5).
343d771 to
c22cb58
Compare
0xTehuti
left a comment
There was a problem hiding this comment.
Reviewed b99c2ae on Windows 11 24H2, MSVC 19.44 (VS 2022 Community), Ninja RelWithDebInfo: pass
- Code inspection: Clean regression test covering root signature preservation on compute re-bind and argument resets on root signature switch (dispatches 1, 2, and 3), as well as fixing the
pso67ref-count leak ind3d12_compute_test.cpp. - Build & Standards: Zero game files, synthetic tests only. Compiles cleanly with MSVC.
No game data used or added. AI-assisted.
|
Tested c22cb58 on NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), NVIDIA 621.01 (Vulkan 1.4.357), Windows 11 Pro 26300: pass. Runtime built from this head (based on
A note on the third dispatch: D3D12 leaves root arguments undefined after a switch to another root signature, so AI-assisted run (Claude Code). |
|
Tested acb96be (on
AI-assisted (Claude Code). |
|
Tested c22cb58 on AMD Radeon RX 7600 (RDNA3), AMD 26.11.2 (LLPC), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8: d3d12_compute_test passes.
AI-assisted (Claude Code, reviewed with Codex). No game files. |
Summary
Implements TEST-280 (regression test follow-up for D3D-99) and fixes the
pso67ref-count leak ind3d12_compute_test.cppintroduced byaf236e19(#1714):runtime/test/d3d12_compute_test.cpp:out_a): sets root constant offset 0 (s0 = 7), re-binds the same compute root signature (SetComputeRootSignature(held_root)), sets offset 1 (s1 = 3), the root UAV (va_a) and the descriptor table (gpu), re-bindsheld_rootagain, and binds/re-binds a graphics root signature (SetGraphicsRootSignature(root.p)with graphics root constants), verifying that re-binding the same root signature preserves already-bound arguments and that graphics root-signature bindings do not disturb compute root arguments.out_b): partially updatess0 = 100andva_b, verifyings1 = 3andgpuremain bound.out_c): binds a differentID3D12RootSignature*object (SetComputeRootSignature(root.p)whereroot.p != held_root), sets onlys1 = 5at offset 1 (va_candgpu), and re-bindsroot.p, verifying that switching to a different root-signature object resets previously bound arguments (s0cleared from100to0) while re-binding the new signature preservess1 = 5,va_c, andgpu.pso67(created via device slot 67 inaf236e19) alongsidepsobeforeEXPECT(rt::d3d12_xs::device_proxy_ref_count(device.p) == 1).Verification
LEONIDA_VK_VALIDATION=1 .\runtime\build\d3d12_compute_test.exe: passed (0validation errors, all 64 elements matched in each of 3 dispatches + 4 CBV dispatches).