d3d12: name compute modules for selective GPU validation #2072

Closed
GGandCo wants to merge 3 commits from upstream-pr/2072 into main
GGandCo commented 2026-11-25 19:33:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GGandCo on 2026-11-25T19:33:41Z.


Claim: RT-COMPUTE-GPUAV-SELECTION — https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172186259

Selective GPU-assisted validation matches shader-module debug names. The layer's compute modules had no such names, so selecting a library entry instrumented nothing. Name each compute module with its shader-library entry before pipeline creation, when VK_EXT_debug_utils and its naming entry point are available. Shader code and execution are unchanged.

The compute fixture now forwards its enabled debug-utils capability. An opt-in standard-library Python check runs that synthetic fixture with a matching and an unmatched GPUAV selector, verifies modified before/after SPIR-V dumps, and requires the existing compute readback checks to pass. Its caches and dumps stay in temporary directories. This adds no default CTest dependency on GPUAV.

Validation on Windows 11, Intel UHD Graphics (i5-1334U), driver 32.0.101.6314, Vulkan SDK 1.4.363.1, MSVC RelWithDebInfo, based on main 75a41f5dc:

  • Built d3d12_compute_test from this contribution tree.
  • New opt-in check: matching cs_user_data selects 4 module instances; unmatched name selects 0; all compute readback checks pass.
  • Negative control before the naming hunk, with the same fixture debug-utils forwarding: compute checks pass but the matching selector produces 0 instrumented dumps.
  • d3d12_compute passes with ordinary Vulkan validation and with validation disabled.
  • Separately, 15 targeted runtime/CPU/GPU tests pass in the existing private integration tree. This is additional integration coverage, not an isolated-main full-suite result.
  • git diff --check and check_no_game_data.py pass for all four changed files.

No title files or shader content are included. No playability claim. Full CTest was not run.

GPUs tested: Intel UHD Graphics, 32.0.101.6314, Windows 11.
AI-assisted: OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5497844354 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2072). Originally posted by [GGandCo](https://github.com/GGandCo) on 2026-11-25T19:33:41Z. --- Claim: RT-COMPUTE-GPUAV-SELECTION — https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172186259 Selective GPU-assisted validation matches shader-module debug names. The layer's compute modules had no such names, so selecting a library entry instrumented nothing. Name each compute module with its shader-library entry before pipeline creation, when VK_EXT_debug_utils and its naming entry point are available. Shader code and execution are unchanged. The compute fixture now forwards its enabled debug-utils capability. An opt-in standard-library Python check runs that synthetic fixture with a matching and an unmatched GPUAV selector, verifies modified before/after SPIR-V dumps, and requires the existing compute readback checks to pass. Its caches and dumps stay in temporary directories. This adds no default CTest dependency on GPUAV. Validation on Windows 11, Intel UHD Graphics (i5-1334U), driver 32.0.101.6314, Vulkan SDK 1.4.363.1, MSVC RelWithDebInfo, based on main 75a41f5dc: - Built d3d12_compute_test from this contribution tree. - New opt-in check: matching cs_user_data selects 4 module instances; unmatched name selects 0; all compute readback checks pass. - Negative control before the naming hunk, with the same fixture debug-utils forwarding: compute checks pass but the matching selector produces 0 instrumented dumps. - d3d12_compute passes with ordinary Vulkan validation and with validation disabled. - Separately, 15 targeted runtime/CPU/GPU tests pass in the existing private integration tree. This is additional integration coverage, not an isolated-main full-suite result. - git diff --check and check_no_game_data.py pass for all four changed files. No title files or shader content are included. No playability claim. Full CTest was not run. GPUs tested: Intel UHD Graphics, 32.0.101.6314, Windows 11. AI-assisted: OpenAI Codex.
GGandCo commented 2026-11-26 07:09:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GGandCo on 2026-11-26T07:09:17Z.


Updated onto main a73a57e133 in e27fcb385. The conflict came from the shared build_compute_pipeline refactor: module naming now happens immediately after vkCreateShaderModule in that shared function, preserving the new helper/journal/driver-turn paths.

Rebuilt d3d12_compute_test from this contribution tree on Windows 11, Intel UHD Graphics 32.0.101.6314, MSVC. The opt-in GPUAV selection check passes again: matching selector instruments 4 module instances, unmatched selector 0, and compute readbacks pass. git diff --check and check_no_game_data.py pass for the four PR files.

I also read both failed checks on the previous head. linux-gpu-tools failed to build vk_null_descriptor_test when LEONIDA_TEST_NULL_DESCRIPTORS_SPV was undefined (existing fix #2055). Windows failed vk_xdxr_postbuild_readback because the runner's no-device exit 77 was counted as failure (existing fix #1418). Those paths are outside this PR; this update does not claim those CI failures are fixed. No full-suite result claimed.

AI-assisted: OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7185152827 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2072#issuecomment-7185152827). Originally posted by [GGandCo](https://github.com/GGandCo) on 2026-11-26T07:09:17Z. --- Updated onto main a73a57e1339be072baf5522351c8ec7f1482b56b in e27fcb385. The conflict came from the shared build_compute_pipeline refactor: module naming now happens immediately after vkCreateShaderModule in that shared function, preserving the new helper/journal/driver-turn paths. Rebuilt d3d12_compute_test from this contribution tree on Windows 11, Intel UHD Graphics 32.0.101.6314, MSVC. The opt-in GPUAV selection check passes again: matching selector instruments 4 module instances, unmatched selector 0, and compute readbacks pass. git diff --check and check_no_game_data.py pass for the four PR files. I also read both failed checks on the previous head. linux-gpu-tools failed to build vk_null_descriptor_test when LEONIDA_TEST_NULL_DESCRIPTORS_SPV was undefined (existing fix #2055). Windows failed vk_xdxr_postbuild_readback because the runner's no-device exit 77 was counted as failure (existing fix #1418). Those paths are outside this PR; this update does not claim those CI failures are fixed. No full-suite result claimed. AI-assisted: OpenAI Codex.
ammonium231 commented 2026-11-26 09:26:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ammonium231 on 2026-11-26T09:26:14Z.


RTX 3090 / 621.40, this PR merged onto current main a73a57e13: check_compute_gpuav_selection.py passes (matching cs_user_data selects 4 modules, unmatched name selects 0, compute readback checks pass). On unpatched main the same script reports 0 instrumented dumps for the matching selector. d3d12_compute with ordinary validation passes on both, 0 VUID.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7187986804 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2072#issuecomment-7187986804). Originally posted by [ammonium231](https://github.com/ammonium231) on 2026-11-26T09:26:14Z. --- RTX 3090 / 621.40, this PR merged onto current main a73a57e13: check_compute_gpuav_selection.py passes (matching cs_user_data selects 4 modules, unmatched name selects 0, compute readback checks pass). On unpatched main the same script reports 0 instrumented dumps for the matching selector. d3d12_compute with ordinary validation passes on both, 0 VUID.
zmasi commented 2026-11-29 02:25:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T02:25:00Z.


Windows 11 + RTX 3090 Khronos GPU-AV Verification (e27fcb3854 merged with origin/main 02944d4ca1)

  • Environment: Windows 11 (10.0.26200), MSVC 19.44.35228 (Release), physical NVIDIA GeForce RTX 3090 + Khronos Vulkan Validation Layer (VK_LAYER_KHRONOS_validation 1.4.363.1 with selective GPU-AV & SPIR-V instrumentation dumps), Python 3.12.10 (-I -B), clean merge onto origin/main (0 conflicts).
  • Red -> Green:
    • Red (origin/main d3d12_vulkan_device.cpp & d3d12_compute_test.cpp): python -I -B scripts/check_compute_gpuav_selection.py <build>/d3d12_compute_test.exe failed (rc=1, RuntimeError: named selection produced no instrumented module; check module naming and the installed validation layer).
    • Green (origin/main + #2072):
      • d3d12_compute_test (LEONIDA_VK_VALIDATION=1 on RTX 3090): rc=0 (2.35s, 0 validation errors) — 64 buffer reads and 64 null controls matched, CreateConstantBufferView: 64/64 dwords matched, CreateShaderResourceView(buffer) raw/structured/typed + negative controls matched, and 64 elements matched in each of three dispatches.
      • python -I -B scripts/check_compute_gpuav_selection.py <build>/d3d12_compute_test.exe: PASS: selected 4 module(s), unmatched 0; compute readback checks passed (rc=0, 3.30s), confirming vkSetDebugUtilsObjectNameEXT names compute VkShaderModules before vkCreateComputePipelines so VK_LAYER_GPUAV_SHADERS_TO_INSTRUMENT=cs_user_data instruments the 4 matching SPIR-V modules while __leonida_no_matching_shader__ instruments 0.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249413867 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2072#issuecomment-7249413867). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T02:25:00Z. --- ### Windows 11 + RTX 3090 Khronos GPU-AV Verification (`e27fcb3854` merged with `origin/main` `02944d4ca1`) - **Environment**: Windows 11 (`10.0.26200`), MSVC `19.44.35228` (`Release`), physical **NVIDIA GeForce RTX 3090** + Khronos Vulkan Validation Layer (`VK_LAYER_KHRONOS_validation` `1.4.363.1` with selective GPU-AV & SPIR-V instrumentation dumps), `Python 3.12.10` (`-I -B`), clean merge onto `origin/main` (`0` conflicts). - **Red -> Green**: - **Red (`origin/main` `d3d12_vulkan_device.cpp` & `d3d12_compute_test.cpp`)**: `python -I -B scripts/check_compute_gpuav_selection.py <build>/d3d12_compute_test.exe` failed (`rc=1`, `RuntimeError: named selection produced no instrumented module; check module naming and the installed validation layer`). - **Green (`origin/main + #2072`)**: - `d3d12_compute_test` (`LEONIDA_VK_VALIDATION=1` on RTX 3090): **`rc=0` (`2.35s`, `0` validation errors)** — `64 buffer reads and 64 null controls matched`, `CreateConstantBufferView: 64/64 dwords matched`, `CreateShaderResourceView(buffer)` raw/structured/typed + negative controls matched, and `64 elements matched in each of three dispatches`. - `python -I -B scripts/check_compute_gpuav_selection.py <build>/d3d12_compute_test.exe`: **`PASS: selected 4 module(s), unmatched 0; compute readback checks passed`** (`rc=0`, `3.30s`), confirming `vkSetDebugUtilsObjectNameEXT` names compute `VkShaderModule`s before `vkCreateComputePipelines` so `VK_LAYER_GPUAV_SHADERS_TO_INSTRUMENT=cs_user_data` instruments the 4 matching SPIR-V modules while `__leonida_no_matching_shader__` instruments `0`. AI-assisted.
OreoFR commented 2026-11-29 05:47:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T05:47:26Z.


Verified by OreoFR — READY

  • Base: main c8bf0e7b6 + this PR (head e27fcb385) merged with --no-ff
  • Red (main + only this PR's tests): the PR's opt-in scripts/check_compute_gpuav_selection.py (Vulkan SDK 1.4.363 validation layer, GPU-AV), run against main's d3d12_compute_test, fails with named selection produced no instrumented module. The change to d3d12_compute_test.cpp itself only passes debug_utils through.
  • Green (merge): python -I scripts/check_compute_gpuav_selection.py <build>/d3d12_compute_test.exe: PASS: selected 4 module(s), unmatched 0; compute readback checks passed; ctest (Ninja RelWithDebInfo, all targets, gta6rt launchers excluded) in package p4 = main + #2593 + #2072 (no shared files): 494 tests, new failures vs main: none; an xmem working-set check failed once in the package as it does on main, and passed 5/5 when re-run alone (main alone: 494 tests, 5 failures: loader, xs_proxy_mock, xmem_no_write_watch, api_ref_state timeout, xbox_present; xbox_present fails in every package as on main)
  • gta6rt.exe links without the XMA decoder (LEONIDA_CARGO=OFF, LEONIDA_XMA2_DECODER_LIB empty), main + this PR alone; imports unchanged vs main (25 DLLs, 655 functions, no WS2_32)
  • Diff read: no issue. The name function is loaded only with debug_utils and called only after vkCreateShaderModule succeeds, and the script uses only the standard library.
  • Other runs: Confirms zmasi's GPU-AV run.
  • Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44

AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7251461217 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2072#issuecomment-7251461217). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T05:47:26Z. --- **Verified by OreoFR** — READY - Base: main c8bf0e7b6 + this PR (head e27fcb385) merged with --no-ff - Red (main + only this PR's tests): the PR's opt-in `scripts/check_compute_gpuav_selection.py` (Vulkan SDK 1.4.363 validation layer, GPU-AV), run against main's `d3d12_compute_test`, fails with `named selection produced no instrumented module`. The change to `d3d12_compute_test.cpp` itself only passes `debug_utils` through. - Green (merge): `python -I scripts/check_compute_gpuav_selection.py <build>/d3d12_compute_test.exe`: `PASS: selected 4 module(s), unmatched 0; compute readback checks passed`; ctest (Ninja RelWithDebInfo, all targets, gta6rt launchers excluded) in package p4 = main + #2593 + #2072 (no shared files): 494 tests, new failures vs main: none; an xmem working-set check failed once in the package as it does on main, and passed 5/5 when re-run alone (main alone: 494 tests, 5 failures: loader, xs_proxy_mock, xmem_no_write_watch, api_ref_state timeout, xbox_present; xbox_present fails in every package as on main) - gta6rt.exe links without the XMA decoder (`LEONIDA_CARGO=OFF`, `LEONIDA_XMA2_DECODER_LIB` empty), main + this PR alone; imports unchanged vs main (25 DLLs, 655 functions, no WS2_32) - Diff read: no issue. The name function is loaded only with `debug_utils` and called only after `vkCreateShaderModule` succeeds, and the script uses only the standard library. - Other runs: Confirms zmasi's GPU-AV run. - Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44 AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
GGandCo commented 2026-11-29 17:47:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GGandCo on 2026-11-29T17:47:25Z.


Fixed the PR-owned stdlib-tests-linux failure in fabcf3c4f: the integration checker's main block now configures stdout with errors="replace", as required by test_tool_stdout_encoding.py.

Validation on Windows: python -I tests/test_tool_stdout_encoding.py passes (4 tests); checker --help, git diff --check, and check_no_game_data.py pass. This change only touches Python entry-point output handling; no new GPU run or full-CI success is claimed.

I also inspected the previous failed job logs. Other failures include the LLVM DPP encoding tests, the export replacement-failure fixture, the missing LEONIDA_TEST_NULL_DESCRIPTORS_SPV definition, and cs_imgatomic_ext. They are not claimed fixed by this two-line change.

AI-assisted: OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259966370 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2072#issuecomment-7259966370). Originally posted by [GGandCo](https://github.com/GGandCo) on 2026-11-29T17:47:25Z. --- Fixed the PR-owned stdlib-tests-linux failure in fabcf3c4f: the integration checker's __main__ block now configures stdout with errors="replace", as required by test_tool_stdout_encoding.py. Validation on Windows: python -I tests/test_tool_stdout_encoding.py passes (4 tests); checker --help, git diff --check, and check_no_game_data.py pass. This change only touches Python entry-point output handling; no new GPU run or full-CI success is claimed. I also inspected the previous failed job logs. Other failures include the LLVM DPP encoding tests, the export replacement-failure fixture, the missing LEONIDA_TEST_NULL_DESCRIPTORS_SPV definition, and cs_imgatomic_ext. They are not claimed fixed by this two-line change. AI-assisted: OpenAI Codex.
aslan2142 commented 2026-12-01 17:24:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:24:57Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7319262342 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2072#issuecomment-7319262342). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T17:24:57Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

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
ProjectLeonida/mandy!2072
No description provided.