d3d12: validate CreateUnorderedAccessView descriptors for buffers and textures (OLD-5327) #578

Closed
Taffyyy-ops wants to merge 2 commits from upstream-pr/578 into main
Taffyyy-ops commented 2026-11-24 08:56:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T08:56:21Z.


Claimed in the coordination issue as: OLD-5327 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126487215)

What and why

Carried over from the closed upstream ItsNotRexed/Leonida PR #5327 and rebased cleanly onto ubiquitarianism/leonida main (0e888f03b, 5f82c7282).

Validates CreateUnorderedAccessView descriptors for buffers and textures in runtime/shims/d3d12_vulkan_device.cpp so malformed or unsupported views leave a null descriptor rather than crashing or aliasing invalid ranges/formats:

  • Buffer UAVs: reject unsupported D3D12_BUFFER_UAV_FLAGS, raw flag without DXGI_FORMAT_R32_TYPELESS, non-zero StructureByteStride on non-structured views, zero NumElements, overflow-safe element-range bounds (FirstElement / NumElements), and overflow-safe counter offset bounds (CounterOffsetInBytes).
  • Texture UAVs: reject multisampled textures, sRGB (is_srgb_format) / typeless / depth-stencil / block-compressed / 96-bit / B8G8R8X8 view formats, invalid dimensions and mip/plane/array slice bounds (including D3D12_UAV_DIMENSION_TEXTURE2DARRAY with ArraySize == UINT_MAX), and check storage layer bounds in write_image_descriptor (returning false and skipping note_shader_image when refused, including unregistered bindless storage images).
  • Coexists with main's mutable R9G9B9E5_SHAREDEXP, B5G5R5A1_UNORM, and 8-bit sRGB UAV resource backing (57d08d2fd, 0dc7f58e5).
  • Adds runtime/test/d3d12_uav_validation_test.cpp (d3d12_uav_validation in runtime/CMakeLists.txt).

Tested

Built cleanly with MSVC 19.44 / Ninja (cmake --build runtime/build, 0 new /W4 warnings on modified files) and tested on Windows 11 + NVIDIA GeForce RTX 5060 Laptop GPU (driver 621.24, validation off locally):

  • d3d12_uav_validation -> Passed (0.73 s)
  • d3d12_uav_clear -> Passed
  • d3d12_b5g5r5a1_uav -> Passed (0.55 s)
  • d3d12_srgb_uav -> Passed (0.71 s)
  • d3d12_r9g9b9e5_uav -> Passed
  • d3d12_descriptor -> Passed (0.47 s; sampling shader skipped: no glslangValidator)
  • d3d12_texture1d -> Passed (1.22 s)
  • python -I scripts/check_no_game_data.py -> exit 0
  • git diff --check upstream/main..HEAD -> exit 0

GPUs tested: NVIDIA GeForce RTX 5060 Laptop GPU (driver 621.24, Windows 11, validation layers not installed locally)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5469060849 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/578). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-24T08:56:21Z. --- Claimed in the coordination issue as: OLD-5327 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126487215) ### What and why Carried over from the closed upstream `ItsNotRexed/Leonida` PR #5327 and rebased cleanly onto `ubiquitarianism/leonida` `main` (`0e888f03b`, `5f82c7282`). Validates `CreateUnorderedAccessView` descriptors for buffers and textures in `runtime/shims/d3d12_vulkan_device.cpp` so malformed or unsupported views leave a null descriptor rather than crashing or aliasing invalid ranges/formats: - Buffer UAVs: reject unsupported `D3D12_BUFFER_UAV_FLAGS`, raw flag without `DXGI_FORMAT_R32_TYPELESS`, non-zero `StructureByteStride` on non-structured views, zero `NumElements`, overflow-safe element-range bounds (`FirstElement` / `NumElements`), and overflow-safe counter offset bounds (`CounterOffsetInBytes`). - Texture UAVs: reject multisampled textures, sRGB (`is_srgb_format`) / typeless / depth-stencil / block-compressed / 96-bit / `B8G8R8X8` view formats, invalid dimensions and mip/plane/array slice bounds (including `D3D12_UAV_DIMENSION_TEXTURE2DARRAY` with `ArraySize == UINT_MAX`), and check storage layer bounds in `write_image_descriptor` (returning `false` and skipping `note_shader_image` when refused, including unregistered bindless storage images). - Coexists with `main`'s mutable `R9G9B9E5_SHAREDEXP`, `B5G5R5A1_UNORM`, and 8-bit sRGB UAV resource backing (`57d08d2fd`, `0dc7f58e5`). - Adds `runtime/test/d3d12_uav_validation_test.cpp` (`d3d12_uav_validation` in `runtime/CMakeLists.txt`). ### Tested Built cleanly with MSVC 19.44 / Ninja (`cmake --build runtime/build`, 0 new `/W4` warnings on modified files) and tested on Windows 11 + NVIDIA GeForce RTX 5060 Laptop GPU (driver 621.24, validation off locally): - `d3d12_uav_validation` -> Passed (0.73 s) - `d3d12_uav_clear` -> Passed - `d3d12_b5g5r5a1_uav` -> Passed (0.55 s) - `d3d12_srgb_uav` -> Passed (0.71 s) - `d3d12_r9g9b9e5_uav` -> Passed - `d3d12_descriptor` -> Passed (0.47 s; sampling shader skipped: no `glslangValidator`) - `d3d12_texture1d` -> Passed (1.22 s) - `python -I scripts/check_no_game_data.py` -> exit 0 - `git diff --check upstream/main..HEAD` -> exit 0 GPUs tested: NVIDIA GeForce RTX 5060 Laptop GPU (driver 621.24, Windows 11, validation layers not installed locally) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
Taffyyy-ops commented 2026-11-24 20:09:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T20:09:07Z.


Rebased onto upstream/main (6293c1c4f, 0 conflicts) to pick up #892 (SHADER-1266 TFE fixture expectations) and ce9bf43c5 (test_tool_stdout_encoding.py), which caused the prior stale-base failures in linux-gpu-tools, macos, macos-python, and stdlib-tests-linux (while check hit the 15m timeout and windows already passed).

Local verification after rebase (upstream/main @ 6293c1c4f, 100% synthetic tests)

  • Full runtime build (cmake --build runtime/build, MSVC 19.44 + Ninja): 403/403 steps succeeded, 0 errors, 0 warnings in runtime/shims/d3d12_vulkan_device.cpp or runtime/test/d3d12_uav_validation_test.cpp.
  • NVIDIA GeForce RTX 5060 Laptop GPU (driver 32.0.16.2124 / 621.24, Windows 11): 7/7 targeted CTests passed (16.65s) — d3d12_uav_validation, d3d12_uav_clear, d3d12_b5g5r5a1_uav, d3d12_srgb_uav, d3d12_r9g9b9e5_uav, d3d12_vulkan_device, crt_timed_wait.
  • Intel(R) RaptorLake-S Mobile Graphics Controller (driver 32.0.101.7026, Windows 11): 6/7 targeted CTests passed — d3d12_uav_validation, d3d12_uav_clear, d3d12_b5g5r5a1_uav, d3d12_r9g9b9e5_uav, d3d12_vulkan_device, and crt_timed_wait all passed; in d3d12_srgb_uav, both UAV clears matched WARP with 0 validation errors (the 2 RTV clears differed by 1 LSB on Intel 0xbb vs WARP 0xbc, a pre-existing Intel RTV sRGB rounding difference unrelated to CreateUnorderedAccessView).
  • Python & hygiene checks: python -I tests/test_ctest_registration.py (4/4 OK), python -I tests/test_tool_stdout_encoding.py (4/4 OK), python -I scripts/check_no_game_data.py (exit 0), git diff --check upstream/main..HEAD (exit 0).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143112814 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/578#issuecomment-7143112814). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-24T20:09:07Z. --- Rebased onto `upstream/main` (`6293c1c4f`, 0 conflicts) to pick up `#892` (`SHADER-1266` TFE fixture expectations) and `ce9bf43c5` (`test_tool_stdout_encoding.py`), which caused the prior stale-base failures in `linux-gpu-tools`, `macos`, `macos-python`, and `stdlib-tests-linux` (while `check` hit the 15m timeout and `windows` already passed). ### Local verification after rebase (`upstream/main` @ `6293c1c4f`, 100% synthetic tests) - **Full runtime build (`cmake --build runtime/build`, MSVC 19.44 + Ninja):** `403/403` steps succeeded, `0` errors, `0` warnings in `runtime/shims/d3d12_vulkan_device.cpp` or `runtime/test/d3d12_uav_validation_test.cpp`. - **NVIDIA GeForce RTX 5060 Laptop GPU (driver `32.0.16.2124` / `621.24`, Windows 11):** `7/7` targeted CTests passed (`16.65s`) — `d3d12_uav_validation`, `d3d12_uav_clear`, `d3d12_b5g5r5a1_uav`, `d3d12_srgb_uav`, `d3d12_r9g9b9e5_uav`, `d3d12_vulkan_device`, `crt_timed_wait`. - **Intel(R) RaptorLake-S Mobile Graphics Controller (driver `32.0.101.7026`, Windows 11):** `6/7` targeted CTests passed — `d3d12_uav_validation`, `d3d12_uav_clear`, `d3d12_b5g5r5a1_uav`, `d3d12_r9g9b9e5_uav`, `d3d12_vulkan_device`, and `crt_timed_wait` all passed; in `d3d12_srgb_uav`, both UAV clears matched WARP with `0` validation errors (the 2 RTV clears differed by 1 LSB on Intel `0xbb` vs WARP `0xbc`, a pre-existing Intel RTV sRGB rounding difference unrelated to `CreateUnorderedAccessView`). - **Python & hygiene checks:** `python -I tests/test_ctest_registration.py` (`4/4` OK), `python -I tests/test_tool_stdout_encoding.py` (`4/4` OK), `python -I scripts/check_no_game_data.py` (`exit 0`), `git diff --check upstream/main..HEAD` (`exit 0`).
Taffyyy-ops commented 2026-11-25 10:01:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T10:01:42Z.


Rebased onto upstream/main (3de22a19047b168d28a7a11152bf05d18ed0062e) at ebc26f9cc (7dc12126f + ebc26f9cc), resolving the merge conflicts in runtime/shims/d3d12_vulkan_device.cpp and updating runtime/test/d3d12_uav_validation_test.cpp:

  • Buffer UAVs (write_buffer_uav / write_buffer_uav_at): Kept the split with write_buffer_uav_at (used by Xbox device slot 71) and applied the descriptor checks (D3D12_BUFFER_UAV_FLAG_RAW validation, non-structured StructureByteStride == 0, non-zero NumElements, overflow-safe bounds against width, and overflow-safe counter validation requiring structured non-RAW views).
  • Texture UAVs (CreateUnorderedAccessView / write_image_descriptor): Kept ImageViewUse (sampled, storage, depth_stencil_uav), D3D12_UAV_DIMENSION_TEXTURE1DARRAY, D3D12_UAV_DIMENSION_TEXTURE3D, and Xbox depth-stencil UAVs (depth_uav), applying multisampled/sRGB/typeless/compressed/96-bit/B8G8R8X8 rejections and TEXTURE1D/TEXTURE2D/TEXTURE2DARRAY bounds/plane checks on color textures while making write_image_descriptor return bool.
  • Tests (d3d12_uav_validation_test.cpp): Passed vk.robust_image_access / vk.sliced_3d_uav, updated default TEXTURE1DARRAY/TEXTURE3D checks to positive controls with out-of-range TEXTURE1DARRAY/TEXTURE3D rejections, and retained TEXTURE2DARRAY ArraySize == UINT_MAX rejection checks.

Local Verification (AI-assisted, Windows 11)

  • Build: MSVC 19.44 (vcvars64.bat + Ninja), 742/742 targets built (0 errors, 0 new /W4 warnings in PR files).
  • NVIDIA GeForce RTX 5060 Laptop GPU (driver 32.0.16.2124): 10/10 targeted CTests passed (d3d12_vulkan_device, d3d12_uav_clear, d3d12_uav_validation, d3d12_b5g5r5a1_uav, d3d12_srgb_uav, d3d12_r9g9b9e5_uav, d3d12_existing_heap, d3d12_texture_uav, xbox_depth_storage, crt_timed_wait; 27.26s).
  • Intel RaptorLake-S Mobile Graphics Controller (driver 32.0.101.7026): 8/10 targeted CTests passed (d3d12_uav_validation, d3d12_texture_uav, d3d12_uav_clear, d3d12_b5g5r5a1_uav, d3d12_r9g9b9e5_uav, xbox_depth_storage, d3d12_vulkan_device, crt_timed_wait). The 2 failures are pre-existing/unrelated (d3d12_srgb_uav 1-LSB Intel RTV clear rounding while UAV clears match WARP; d3d12_existing_heap slot-133 buffer 0x400/0x200 VK_ERROR_DEVICE_LOST while its placed texture UAV check passes).
  • Python & hygiene: test_ctest_registration.py (5/5 OK), test_vulkan_extension_guards.py (3/3 OK), check_no_game_data.py (exit 0), git diff --check upstream/main..HEAD (exit 0). (test_tool_stdout_encoding.py has 1 pre-existing failure on upstream/main's tools/compute_heap_layout_census.py from c8f7515e2.)
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7159124408 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/578#issuecomment-7159124408). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-25T10:01:42Z. --- Rebased onto `upstream/main` (`3de22a19047b168d28a7a11152bf05d18ed0062e`) at `ebc26f9cc` (`7dc12126f` + `ebc26f9cc`), resolving the merge conflicts in `runtime/shims/d3d12_vulkan_device.cpp` and updating `runtime/test/d3d12_uav_validation_test.cpp`: - **Buffer UAVs (`write_buffer_uav` / `write_buffer_uav_at`):** Kept the split with `write_buffer_uav_at` (used by Xbox device slot 71) and applied the descriptor checks (`D3D12_BUFFER_UAV_FLAG_RAW` validation, non-structured `StructureByteStride == 0`, non-zero `NumElements`, overflow-safe bounds against `width`, and overflow-safe counter validation requiring structured non-RAW views). - **Texture UAVs (`CreateUnorderedAccessView` / `write_image_descriptor`):** Kept `ImageViewUse` (`sampled`, `storage`, `depth_stencil_uav`), `D3D12_UAV_DIMENSION_TEXTURE1DARRAY`, `D3D12_UAV_DIMENSION_TEXTURE3D`, and Xbox depth-stencil UAVs (`depth_uav`), applying multisampled/sRGB/typeless/compressed/96-bit/`B8G8R8X8` rejections and `TEXTURE1D`/`TEXTURE2D`/`TEXTURE2DARRAY` bounds/plane checks on color textures while making `write_image_descriptor` return `bool`. - **Tests (`d3d12_uav_validation_test.cpp`):** Passed `vk.robust_image_access` / `vk.sliced_3d_uav`, updated default `TEXTURE1DARRAY`/`TEXTURE3D` checks to positive controls with out-of-range `TEXTURE1DARRAY`/`TEXTURE3D` rejections, and retained `TEXTURE2DARRAY` `ArraySize == UINT_MAX` rejection checks. ### Local Verification (AI-assisted, Windows 11) - **Build:** MSVC 19.44 (`vcvars64.bat` + Ninja), `742/742` targets built (`0` errors, `0` new `/W4` warnings in PR files). - **NVIDIA GeForce RTX 5060 Laptop GPU (driver `32.0.16.2124`):** `10/10` targeted CTests passed (`d3d12_vulkan_device`, `d3d12_uav_clear`, `d3d12_uav_validation`, `d3d12_b5g5r5a1_uav`, `d3d12_srgb_uav`, `d3d12_r9g9b9e5_uav`, `d3d12_existing_heap`, `d3d12_texture_uav`, `xbox_depth_storage`, `crt_timed_wait`; `27.26s`). - **Intel RaptorLake-S Mobile Graphics Controller (driver `32.0.101.7026`):** `8/10` targeted CTests passed (`d3d12_uav_validation`, `d3d12_texture_uav`, `d3d12_uav_clear`, `d3d12_b5g5r5a1_uav`, `d3d12_r9g9b9e5_uav`, `xbox_depth_storage`, `d3d12_vulkan_device`, `crt_timed_wait`). The `2` failures are pre-existing/unrelated (`d3d12_srgb_uav` 1-LSB Intel RTV clear rounding while UAV clears match WARP; `d3d12_existing_heap` slot-133 buffer `0x400`/`0x200` `VK_ERROR_DEVICE_LOST` while its placed texture UAV check passes). - **Python & hygiene:** `test_ctest_registration.py` (`5/5` OK), `test_vulkan_extension_guards.py` (`3/3` OK), `check_no_game_data.py` (exit `0`), `git diff --check upstream/main..HEAD` (exit `0`). (`test_tool_stdout_encoding.py` has `1` pre-existing failure on `upstream/main`'s `tools/compute_heap_layout_census.py` from `c8f7515e2`.)
zmasi commented 2026-11-29 02:35:42 +00:00 (Migrated from github.com)

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


Verification Report (ebc26f9cc3 merged into main c8bf0e7b6)

  • Environment: Windows 11, MSVC 19.44 (Ninja Release), NVIDIA GeForce RTX 3090 (Ampere, driver 610.88, subgroup 32..32, robustImageAccess & imageSlicedViewOf3D enabled), Vulkan SDK 1.4.363.1 (LEONIDA_VK_VALIDATION=1 with VK_LAYER_KHRONOS_validation). No game data used (check_no_game_data.py rc=0).
  • Diff & Merge Audit: Merged ebc26f9cc3 cleanly into origin/main (c8bf0e7b6, 0 conflicts; 3 files changed: runtime/CMakeLists.txt, runtime/shims/d3d12_vulkan_device.cpp, runtime/test/d3d12_uav_validation_test.cpp). Audited:
    • Buffer UAV validation: rejects unknown D3D12_BUFFER_UAV_FLAGS bits, RAW without R32_TYPELESS, non-zero StructureByteStride on raw/typed views, zero NumElements, overflow-safe FirstElement / NumElements bounds, and non-structured or misaligned/out-of-bounds UAV counters.
    • Texture UAV validation: rejects MSAA (SampleDesc.Count > 1), TYPELESS / sRGB (is_srgb_format) / depth-stencil / block-compressed / 96-bit / B8G8R8X8 effective formats, dimension mismatches, non-zero color PlaneSlice, out-of-range MipSlice, and FirstArraySlice / ArraySize (0 or UINT_MAX sentinel on TEXTURE2DARRAY) without silently clamping or leaking bindless 2D image slots (write_image_descriptor returns bool before calling note_shader_image).

Red -> Green Results

Target Base main d3d12_vulkan_device.cpp + #578 test Merged main + #578 (ebc26f9cc3, LEONIDA_VK_VALIDATION=1)
d3d12_uav_validation_test (RTX 3090) RED (rc=1: FAIL: expected null descriptor for invalid UAV (buffer unknown flag bit on structured)) GREEN (rc=0: d3d12_uav_validation_test: PASS (buffer & texture UAV validation + GPU clear readback), 0 validation errors, 0 leaked bindless slots)
d3d12_uav_clear_test (RTX 3090) — GREEN (rc=0, 0 validation errors)
  • Verdict: PASS (first independent Windows 11 + RTX 3090 verification; reproduces the invalid-UAV acceptance on main and passes all buffer/texture rejection, bindless-room, and live GPU ClearUnorderedAccessViewUint readback checks with 0 validation errors).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249526158 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/578#issuecomment-7249526158). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T02:35:42Z. --- ### Verification Report (`ebc26f9cc3` merged into `main` `c8bf0e7b6`) - **Environment**: Windows 11, MSVC 19.44 (Ninja Release), **NVIDIA GeForce RTX 3090** (Ampere, driver `610.88`, subgroup `32..32`, `robustImageAccess` & `imageSlicedViewOf3D` enabled), Vulkan SDK `1.4.363.1` (`LEONIDA_VK_VALIDATION=1` with `VK_LAYER_KHRONOS_validation`). No game data used (`check_no_game_data.py` `rc=0`). - **Diff & Merge Audit**: Merged `ebc26f9cc3` cleanly into `origin/main` (`c8bf0e7b6`, `0` conflicts; 3 files changed: `runtime/CMakeLists.txt`, `runtime/shims/d3d12_vulkan_device.cpp`, `runtime/test/d3d12_uav_validation_test.cpp`). Audited: - Buffer UAV validation: rejects unknown `D3D12_BUFFER_UAV_FLAGS` bits, `RAW` without `R32_TYPELESS`, non-zero `StructureByteStride` on raw/typed views, zero `NumElements`, overflow-safe `FirstElement` / `NumElements` bounds, and non-structured or misaligned/out-of-bounds UAV counters. - Texture UAV validation: rejects MSAA (`SampleDesc.Count > 1`), `TYPELESS` / sRGB (`is_srgb_format`) / depth-stencil / block-compressed / 96-bit / `B8G8R8X8` effective formats, dimension mismatches, non-zero color `PlaneSlice`, out-of-range `MipSlice`, and `FirstArraySlice` / `ArraySize` (`0` or `UINT_MAX` sentinel on `TEXTURE2DARRAY`) without silently clamping or leaking bindless 2D image slots (`write_image_descriptor` returns `bool` before calling `note_shader_image`). #### Red -> Green Results | Target | Base `main` `d3d12_vulkan_device.cpp` + `#578` test | Merged `main` + `#578` (`ebc26f9cc3`, `LEONIDA_VK_VALIDATION=1`) | |---|---|---| | `d3d12_uav_validation_test` (RTX 3090) | **RED** (`rc=1`: `FAIL: expected null descriptor for invalid UAV (buffer unknown flag bit on structured)`) | **GREEN** (`rc=0`: `d3d12_uav_validation_test: PASS (buffer & texture UAV validation + GPU clear readback)`, `0` validation errors, `0` leaked bindless slots) | | `d3d12_uav_clear_test` (RTX 3090) | — | **GREEN** (`rc=0`, `0` validation errors) | - **Verdict**: **PASS** (first independent Windows 11 + RTX 3090 verification; reproduces the invalid-UAV acceptance on `main` and passes all buffer/texture rejection, bindless-room, and live GPU `ClearUnorderedAccessViewUint` readback checks with 0 validation errors). AI-assisted.
enlight3d commented 2026-11-29 09:03:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T09:03:53Z.


RUN #578 | head ebc26f9cc3, merged cleanly with main 54b2a81e95 (local merge, not pushed)

Commands (from the repository root, in a worktree):

git fetch origin pull/578/head:pr-578
git checkout --detach origin/main && git merge --no-edit --no-ff pr-578
cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON
cmake --build runtime/build -j 8 --target gta6rt d3d12_uav_validation_test d3d12_uav_clear_test d3d12_b5g5r5a1_uav_test d3d12_srgb_uav_test d3d12_r9g9b9e5_uav_test d3d12_descriptor_test d3d12_texture1d_test d3d12_buffer_uav_test d3d12_depth_stencil_uav_test
ctest -C RelWithDebInfo -R "^(d3d12_uav_validation|d3d12_uav_clear|d3d12_b5g5r5a1_uav|d3d12_srgb_uav|d3d12_r9g9b9e5_uav|d3d12_descriptor|d3d12_texture1d|d3d12_buffer_uav|d3d12_depth_stencil_uav)$" --output-on-failure -j1

Green (merged tree, one GPU test at a time): d3d12_uav_validation (new), d3d12_uav_clear, d3d12_b5g5r5a1_uav, d3d12_srgb_uav, d3d12_r9g9b9e5_uav, d3d12_descriptor, d3d12_texture1d, d3d12_buffer_uav, d3d12_depth_stencil_uav all pass (9/9).

Red (PR's test kept, runtime/shims/d3d12_vulkan_device.cpp reverted to main): d3d12_uav_validation fails at its first invalid-descriptor check (expected null descriptor for invalid UAV (buffer unknown flag bit on structured)). Behavioural red: the test only uses the D3D12 API, so it builds on main. The test stops at the first failure, so the later cases (including the TEXTURE2DARRAY ArraySize == UINT_MAX one from the last commit) are not shown failing separately on main.

Link: no new imports vs main (gta6rt.exe, 723 DLL!symbol entries, same list as the baseline built from main).

Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44, Vulkan SDK 1.4.363.1.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7253511859 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/578#issuecomment-7253511859). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T09:03:53Z. --- RUN #578 | head ebc26f9cc38f0e903bea2ad75f4279574a65e4a2, merged cleanly with main 54b2a81e95c470c953ddee6177fd6255cbaf041d (local merge, not pushed) Commands (from the repository root, in a worktree): ``` git fetch origin pull/578/head:pr-578 git checkout --detach origin/main && git merge --no-edit --no-ff pr-578 cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON cmake --build runtime/build -j 8 --target gta6rt d3d12_uav_validation_test d3d12_uav_clear_test d3d12_b5g5r5a1_uav_test d3d12_srgb_uav_test d3d12_r9g9b9e5_uav_test d3d12_descriptor_test d3d12_texture1d_test d3d12_buffer_uav_test d3d12_depth_stencil_uav_test ctest -C RelWithDebInfo -R "^(d3d12_uav_validation|d3d12_uav_clear|d3d12_b5g5r5a1_uav|d3d12_srgb_uav|d3d12_r9g9b9e5_uav|d3d12_descriptor|d3d12_texture1d|d3d12_buffer_uav|d3d12_depth_stencil_uav)$" --output-on-failure -j1 ``` Green (merged tree, one GPU test at a time): `d3d12_uav_validation` (new), `d3d12_uav_clear`, `d3d12_b5g5r5a1_uav`, `d3d12_srgb_uav`, `d3d12_r9g9b9e5_uav`, `d3d12_descriptor`, `d3d12_texture1d`, `d3d12_buffer_uav`, `d3d12_depth_stencil_uav` all pass (9/9). Red (PR's test kept, `runtime/shims/d3d12_vulkan_device.cpp` reverted to main): `d3d12_uav_validation` fails at its first invalid-descriptor check (`expected null descriptor for invalid UAV (buffer unknown flag bit on structured)`). Behavioural red: the test only uses the D3D12 API, so it builds on main. The test stops at the first failure, so the later cases (including the TEXTURE2DARRAY `ArraySize == UINT_MAX` one from the last commit) are not shown failing separately on main. Link: no new imports vs main (gta6rt.exe, 723 DLL!symbol entries, same list as the baseline built from main). Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44, Vulkan SDK 1.4.363.1.
fiestorra commented 2026-11-30 09:51:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T09:51:52Z.


Independent verification on this machine (Windows 11, RTX 4090, MSVC 19.44.35226), with a negative control that bites.

1. It applies. merge-tree clean; the commits cherry-pick onto main 4014af7fe without a conflict. Three files: runtime/CMakeLists.txt, runtime/shims/d3d12_vulkan_device.cpp (the change) and the new runtime/test/d3d12_uav_validation_test.cpp.

2. With the branch its test passes:

ctest -R 'd3d12_uav_validation'
100% tests passed, 0 tests failed out of 1

3. The control - revert only the shim, keep the test:

git checkout origin/main -- runtime/shims/d3d12_vulkan_device.cpp
cmake --build … --target d3d12_uav_validation_test
ctest -R 'd3d12_uav_validation' --output-on-failure
0% tests passed, 1 tests failed out of 1
FAIL: expected null descriptor for invalid UAV (buffer unknown flag bit on structured)

The failure message names the change: a CreateUnorderedAccessView whose buffer description sets an unknown flag bit must write no descriptor, and main's shim fills it instead. So the test is not a companion - it detects the absence of the fix.

What I did not test: the GPU clear readback half of the test (it also clears and reads back), and whether the validation set matches the D3D12 rule exactly. What I established is that the test fails without the change, which is the question a reviewer cannot answer by reading either file alone.

Why I am commenting: I verify open pull requests that replay onto current main by applying them in a scratch worktree, building the targets their tests name in ctest --show-only=json-v1, running them, and then reverting only the source change.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7274789980 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/578#issuecomment-7274789980). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T09:51:52Z. --- Independent verification on this machine (Windows 11, RTX 4090, MSVC 19.44.35226), with a negative control that bites. **1. It applies.** `merge-tree` clean; the commits cherry-pick onto `main` `4014af7fe` without a conflict. Three files: `runtime/CMakeLists.txt`, `runtime/shims/d3d12_vulkan_device.cpp` (the change) and the new `runtime/test/d3d12_uav_validation_test.cpp`. **2. With the branch its test passes:** ``` ctest -R 'd3d12_uav_validation' 100% tests passed, 0 tests failed out of 1 ``` **3. The control - revert only the shim, keep the test:** ``` git checkout origin/main -- runtime/shims/d3d12_vulkan_device.cpp cmake --build … --target d3d12_uav_validation_test ctest -R 'd3d12_uav_validation' --output-on-failure 0% tests passed, 1 tests failed out of 1 FAIL: expected null descriptor for invalid UAV (buffer unknown flag bit on structured) ``` **The failure message names the change**: a `CreateUnorderedAccessView` whose buffer description sets an unknown flag bit must write **no descriptor**, and `main`'s shim fills it instead. So the test is not a companion - it detects the absence of the fix. **What I did not test:** the GPU clear readback half of the test (it also clears and reads back), and whether the validation set matches the D3D12 rule exactly. **What I established is that the test fails without the change**, which is the question a reviewer cannot answer by reading either file alone. **Why I am commenting:** I verify open pull requests that replay onto current `main` by applying them in a scratch worktree, building the targets their tests name in `ctest --show-only=json-v1`, running them, and then reverting **only** the source change. Written with an AI assistant.
aslan2142 commented 2026-12-01 16:30:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:30:52Z.


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:7317731859 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/578#issuecomment-7317731859). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:30:52Z. --- 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!578
No description provided.