mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[GH-ISSUE #506] With LEONIDA_VK_VALIDATION=1 on main: 7 validation errors in d3d12_clear (depth clear outside [0,1]) and d3d12_mesh (pipeline statistics over a mesh draw) #12
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @dcastell1 on GitHub (Nov 24, 2026).
Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/506
On
main@8f481cf16, thed3d12_*suite is green without validation (301 of 303 pass, the two known ones) but trips seven Vulkan validation errors when it is switched on. Both tests report the errors themselves and fail, soctest -R '^d3d12_'goes 113/117 withLEONIDA_VK_VALIDATION=1:Windows 11 10.0.26300, NVIDIA GeForce RTX 5090, driver 621.24, MSVC 14.44.35207, RelWithDebInfo.
d3d12_clear: depth clear outside[0, 1](4 errors)The test is deliberately exercising D3D12's
ClearDepthStencilViewwith1.5,-0.5and NaN, which the host accepts. Vulkan only accepts them withVK_EXT_depth_range_unrestricted; the layer does not enable it (no use of it inruntime/), so the Vulkan call is out of spec even though the driver takes it. Enabling the extension where the device offers it, or clamping and documenting the difference, would close it.#307covers a narrower AMD behaviour (NaN canonicalised to 1.0) and does not cover the range check itself.d3d12_mesh: pipeline statistics incompatible with mesh draws (3 errors)Queries 1 and 3 of the pool. A D3D12 pipeline-statistics query that includes the clipping counters is legal across a mesh draw; the Vulkan equivalent must not have those bits in the pool when
vkCmdDrawMeshTasksEXTruns, so the layer needs to end/switch the query (or drop those bits for mesh pipelines) instead of recording the draw with the query active.Neither error needs game files; both come from the synthetic tests in
runtime/test.@sodove commented on GitHub (Nov 24, 2026):
I reproduced the four d3d12_clear validation errors on RTX 5070 Ti. #516 fixes the depth-clear half and passes both extension-enabled and restricted-depth tests with Vulkan validation enabled.
I also reproduced all three mesh errors and verified a separate candidate change on
c023a365. With this change and #516 applied together, d3d12_clear, d3d12_clear_restricted_depth and d3d12_mesh passed with validation enabled. The mesh segment contributed pixel and compute invocations. Clipping was counted in regular draw segments. In a native comparison, WARP and hardware D3D12 each reported one clipping invocation and one primitive for one mesh triangle.I closed my duplicate PR #527 because Mby159 had already claimed D3D-291. The measurements above are available for that work.
Follow-up on the exact #540 head
c9f4a569. d3d12_mesh passed with validation enabled on RTX 5070 Ti. With #516 applied over it, all three tests covering this issue passed. Test report@whoalin1 commented on GitHub (Nov 25, 2026):
Status check on current
main(b4b7756e8, merge of #403),ctest -C RelWithDebInfo -R "d3d12_clear|d3d12_mesh"withLEONIDA_VK_VALIDATION=1. Both halves of this issue have merged fixes: #516 (depth clear range, merge3f203947) and #540 (mesh statistics pool drops the clipping counters, merge3bb46d65), plus #577's mesh-primitives clipping counter (47c651174).NVIDIA GeForce RTX 4070 SUPER (
VK_LOADER_DRIVERS_SELECT=*nv-vk* LEONIDA_VK_DEVICE=4070): all four matched tests pass with validation on —d3d12_clear,d3d12_clear_restricted_depth,d3d12_mesh,d3d12_clear_formats. The tests fail on any reported validation error, so none of the 7 original VUIDs (VkClearDepthStencilValue-depth-00022x4,vkCmdDrawMeshTasksEXT-pipelineStatistics-07076x3) reproduce.AMD Radeon iGPU (
VK_LOADER_DRIVERS_SELECT=*amd-vulkan* LEONIDA_VK_DEVICE=radeon LEONIDA_PC_TAIL_UBO=1):d3d12_clear_restricted_depthandd3d12_clear_formatspass;d3d12_clearfails only on the known AMD NaN→1.0 canonicalization quirk (#787/#307 — 15 NaN texels read back 1.0) with nodepth-00022VUID;d3d12_meshfails before any draw because the test shaders need 144 bytes of push constants and the device reportsmaxPushConstantsSize 128(the known 128B pushconst limit) — the mesh-draw statistics path can't be exercised on this iGPU, but no validation errors were emitted up to that point.Verdict: fixed on NVIDIA; the depth-clear half is fixed on AMD too (the remaining
d3d12_clearfailure there is the separate #787 quirk, not this issue). The mesh half is verified on NVIDIA only — the AMD iGPU cannot rund3d12_meshdue to the push-constant limit, so it stays unverifiable on that device until #1449-class work lands.Environment note for whoever runs this next: the tests need
TMP/TEMP/TMPDIRandCOMSPECset — under a stripped agent shellstd::filesystem::temp_directory_path()resolves toC:\Windows,create_directoriesfails, and the test dies with0xc0000409before printing anything (looks like a crash, isn't one).AI-assisted: yes (Devin).
@efeekrb commented on GitHub (Nov 25, 2026):
Both causes reported here have fixes merged on main since this was opened:
673dd15d, D3D-CLEAR-DEPTH-RANGE, "use legal Vulkan depth clear values")916dbc61, D3D-291, "the mesh statistics pool enables no forbidden counter")Could you rerun d3d12_clear and d3d12_mesh with LEONIDA_VK_VALIDATION=1 on current main? If both come out clean, this can be closed. (I could not run them: they are Windows-only.)
@sodove commented on GitHub (Nov 25, 2026):
Retested the two requested cases on native Windows 11 build 26100, MSVC 19.44 RelWithDebInfo, at main
bcaa13dad. Each run selected its adapter explicitly. Both tests reported validation on and the Vulkan loader confirmed the Khronos 1.4.369 layer was active.d3d12_cleard3d12_meshLEONIDA_PC_TAIL_UBO=1d3d12_mesh_test.cpp:688Neither originally reported VUID reproduced on either GPU. On this iGPU the mesh test reached the mixed-query readback. A second run failed at the same assertion, again with no VUID. The assertion checks several counters together, so this run does not identify which counter differed.
Synthetic fixtures only. AI-assisted: yes (OpenAI Codex).
@BubsMcgee commented on GitHub (Nov 25, 2026):
Verified on current
main0d80bc5df, with the Khronos validation layer actually active.Environment:
VK_LAYER_KHRONOS_validation, "Khronos Validation Layer", api 1.4.363), installed via winget.d3d12_mesh_testneedsglslangValidator, so it was built for this run.Command:
Result: 4/4 passed, 0 failed
d3d12_cleard3d12_clear_restricted_depthd3d12_meshd3d12_clear_formatsThese tests fail on any reported validation error, so none of the seven original VUIDs (
VkClearDepthStencilValue-depth-00022x4,vkCmdDrawMeshTasksEXT-pipelineStatistics-07076x3) reproduce here. The depth-clear half (#516) and the mesh-statistics half (#540/#577) are on main.Note this run covers the original Windows/NVIDIA validation VUIDs only; the separate AMD failures (e.g. NaN depth canonicalization) are a different problem and are not exercised here. On this evidence the issue looks closeable.
AI-assisted.
@BubsMcgee commented on GitHub (Nov 25, 2026):
The seven original VUIDs no longer reproduce on current main (verified on
0d80bc5dfwith the Khronos validation layer, above), and #516/#540/#577 are merged. This can be closed; the separate AMD NaN-depth failures are a different problem. (AI-assisted.)@BubsMcgee commented on GitHub (Nov 25, 2026):
Both validation errors have merged fixes on main: the depth clear outside [0, 1] by
673dd15d0(D3D-CLEAR-DEPTH-RANGE, merged in #516) and the mesh pipeline-statistics case by #540 (3bb46d658). Both are ancestors oforigin/mainat9e7720c9e. A rerun withLEONIDA_VK_VALIDATION=1should show 0 ind3d12_clear; anything left would be new.@ZroIsHere commented on GitHub (Nov 26, 2026):
The seven reported Vulkan validation errors are resolved on current main: depth clear range in #516 and the mesh statistics pool/counter handling in #540/#577. Follow-up runs with the Khronos validation layer active report all original VUIDs absent. Remaining AMD NaN-depth and push-constant-limit failures are separate issues, so closing this report.
@ZroIsHere commented on GitHub (Nov 26, 2026):
Checked the current source and follow-up reports: the original seven VUIDs are fixed on main by #516 (depth clear) and #540/#577 (mesh statistics). Runs with Khronos validation active report none of those VUIDs. The AMD NaN-depth and mesh push-constant-limit failures mentioned in later reports are separate. I attempted to close this resolved report, but GitHub denied the account the
CloseIssuepermission, so it remains open for a maintainer to close.