KHR BLAS: no triangles for an indexed geometry with fewer than 3 indices; prebuild sizes the build it gets (RT-KHR-BLAS-PRIMCOUNT-AND-PREBUILD) #2486

Closed
Tyrannys wants to merge 2 commits from upstream-pr/2486 into main
Tyrannys commented 2026-11-27 18:13:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-27T18:13:42Z.


Claimed in the coordination issue as: RT-KHR-BLAS-PRIMCOUNT-AND-PREBUILD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7224579621), item 1 of @kevincommits' finding (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7224204750). Thanks to kevincommits for finding it and for the repro values.

What and why

On the KHR acceleration-structure path (LEONIDA_RT_AS=khr), two places counted the triangles of an indexed BLAS geometry wrong when it had fewer than 3 indices:

  • the build, BuildAccelerationStructure emit in runtime/src/vulkan_replay.h;
  • the size query, GetRaytracingAccelerationStructurePrebuildInfo in runtime/shims/d3d12_vulkan_device.cpp.

Both used (indexed && index_count >= 3) ? index_count / 3 : vertex_count / 3. So an indexed geometry with IndexCount 0 or 2 was counted by its vertices. Its index type stayed UINT16/UINT32, and its index address could be null (no index buffer). vkCmdBuildAccelerationStructuresKHR would then read 3 * (vertex_count / 3) indices from address 0, or past the end of the buffer. With kevincommits' inputs, the build got 1000 and 100 triangles where it should get 0.

The XDXR sites already count (indexed ? index_count : vertex_count) / 3. That rule is now leonida::rt_triangle_count (runtime/src/command_list.h), and both KHR places use it.

The KHR size query also differed from the build it sizes in two more ways:

  • Vertex formats. It sized every vertex format except R32G32_FLOAT as three floats. The build records the four 16-bit formats D3D12 allows (R16G16B16A16_FLOAT, R16G16_FLOAT, R16G16B16A16_SNORM, R16G16_SNORM) as themselves.
  • Flags. It did not forward ALLOW_COMPACTION, which the build does.

Both now come from one header, runtime/shims/d3d12_rt_khr_inputs.h:

  • khr_vertex_format and khr_build_flags are used by the recorded build (d3d12_com.cpp) and by the size query.
  • khr_build_size_query builds the size query's inputs. It is a plain function, so it can be tested without a device.

A vertex format the build refuses is still sized as three floats, since a size query must name a format. Nothing else changes for the XDXR path (the default).

The comment in d3d12_indirect_rt_test.cpp that called the ALLOW_COMPACTION forwarding an open gap now says it is forwarded. The test still takes the driver's own sizes as a floor, as before.

Tested

  • New replay_khr_blas_build (runtime/test/replay_khr_blas_build_test.cpp): records a BLAS build and runs prepare/emit against a fake vkCmdBuildAccelerationStructuresKHR. No GPU. It checks:

    • kevincommits' two inputs (UINT16, index_count 0, vertex_count 3000, index_va 0; UINT32, index_count 2, vertex_count 300, index_va 0) get 0 triangles;
    • indexed and non-indexed geometries that should keep their counts still do;
    • a 16-bit vertex format reaches the build;
    • the build flags reach the build.
  • New d3d12_rt_khr_inputs (runtime/test/d3d12_rt_khr_inputs_test.cpp): checks khr_build_size_query without a device:

    • the same two inputs get 0 triangles;
    • all six vertex formats match the build's;
    • an unknown format is sized as three floats (array of pointers);
    • every build flag is forwarded, ALLOW_COMPACTION included, and PERFORM_UPDATE is not a flag;
    • a TLAS is sized from its instances.
  • Both tests fail with the old behaviour put back (old count rule, old format choice, compaction dropped):

    • replay_khr_blas_build: 2 failures;
    • d3d12_rt_khr_inputs: 7 failures.

    With the fix, both pass.

  • replay_khr_as_copy_postbuild, vk_xdxr_postbuild_readback, d3d12_com and tests/test_ci_registration.py pass.

  • GPU tests, all passing:

    • d3d12_dxr_validation and d3d12_dxr_validation_khr (LEONIDA_RT_AS=khr);
    • d3d12_indirect_rt;
    • d3d12_indirect_rt_test again with LEONIDA_RT_AS=khr LEONIDA_VK_VALIDATION=1: KHR builds, compaction postbuild, CLONE/COMPACT and ray queries, 0 validation errors.
  • Full runtime build (MSVC, Ninja): clean.

GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11 (profile M).

AI-assisted: yes (Claude Code)

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.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5531208843 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2486). Originally posted by [Tyrannys](https://github.com/Tyrannys) on 2026-11-27T18:13:42Z. --- Claimed in the coordination issue as: RT-KHR-BLAS-PRIMCOUNT-AND-PREBUILD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7224579621), item 1 of @kevincommits' finding (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7224204750). Thanks to kevincommits for finding it and for the repro values. ### What and why On the KHR acceleration-structure path (`LEONIDA_RT_AS=khr`), two places counted the triangles of an indexed BLAS geometry wrong when it had fewer than 3 indices: - the build, `BuildAccelerationStructure` emit in `runtime/src/vulkan_replay.h`; - the size query, `GetRaytracingAccelerationStructurePrebuildInfo` in `runtime/shims/d3d12_vulkan_device.cpp`. Both used `(indexed && index_count >= 3) ? index_count / 3 : vertex_count / 3`. So an indexed geometry with `IndexCount` 0 or 2 was counted by its vertices. Its index type stayed `UINT16`/`UINT32`, and its index address could be null (no index buffer). `vkCmdBuildAccelerationStructuresKHR` would then read `3 * (vertex_count / 3)` indices from address 0, or past the end of the buffer. With kevincommits' inputs, the build got 1000 and 100 triangles where it should get 0. The XDXR sites already count `(indexed ? index_count : vertex_count) / 3`. That rule is now `leonida::rt_triangle_count` (`runtime/src/command_list.h`), and both KHR places use it. The KHR size query also differed from the build it sizes in two more ways: - **Vertex formats.** It sized every vertex format except `R32G32_FLOAT` as three floats. The build records the four 16-bit formats D3D12 allows (`R16G16B16A16_FLOAT`, `R16G16_FLOAT`, `R16G16B16A16_SNORM`, `R16G16_SNORM`) as themselves. - **Flags.** It did not forward `ALLOW_COMPACTION`, which the build does. Both now come from one header, `runtime/shims/d3d12_rt_khr_inputs.h`: - `khr_vertex_format` and `khr_build_flags` are used by the recorded build (`d3d12_com.cpp`) and by the size query. - `khr_build_size_query` builds the size query's inputs. It is a plain function, so it can be tested without a device. A vertex format the build refuses is still sized as three floats, since a size query must name a format. Nothing else changes for the XDXR path (the default). The comment in `d3d12_indirect_rt_test.cpp` that called the `ALLOW_COMPACTION` forwarding an open gap now says it is forwarded. The test still takes the driver's own sizes as a floor, as before. ### Tested - New `replay_khr_blas_build` (`runtime/test/replay_khr_blas_build_test.cpp`): records a BLAS build and runs `prepare`/`emit` against a fake `vkCmdBuildAccelerationStructuresKHR`. No GPU. It checks: - kevincommits' two inputs (`UINT16`, `index_count` 0, `vertex_count` 3000, `index_va` 0; `UINT32`, `index_count` 2, `vertex_count` 300, `index_va` 0) get 0 triangles; - indexed and non-indexed geometries that should keep their counts still do; - a 16-bit vertex format reaches the build; - the build flags reach the build. - New `d3d12_rt_khr_inputs` (`runtime/test/d3d12_rt_khr_inputs_test.cpp`): checks `khr_build_size_query` without a device: - the same two inputs get 0 triangles; - all six vertex formats match the build's; - an unknown format is sized as three floats (array of pointers); - every build flag is forwarded, `ALLOW_COMPACTION` included, and `PERFORM_UPDATE` is not a flag; - a TLAS is sized from its instances. - Both tests fail with the old behaviour put back (old count rule, old format choice, compaction dropped): - `replay_khr_blas_build`: 2 failures; - `d3d12_rt_khr_inputs`: 7 failures. With the fix, both pass. - `replay_khr_as_copy_postbuild`, `vk_xdxr_postbuild_readback`, `d3d12_com` and `tests/test_ci_registration.py` pass. - GPU tests, all passing: - `d3d12_dxr_validation` and `d3d12_dxr_validation_khr` (`LEONIDA_RT_AS=khr`); - `d3d12_indirect_rt`; - `d3d12_indirect_rt_test` again with `LEONIDA_RT_AS=khr LEONIDA_VK_VALIDATION=1`: KHR builds, compaction postbuild, CLONE/COMPACT and ray queries, 0 validation errors. - Full runtime build (MSVC, Ninja): clean. GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11 (profile M). AI-assisted: yes (Claude Code) ### 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. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No translator change.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lixonik commented 2026-11-27 21:40:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-27T21:40:58Z.

Review: APPROVED


Reviewed the diff and tested locally on Windows 11 + NVIDIA GeForce RTX 5070 12 GB (MSVC 19.44, Ninja Release).

  • Extracting rt_triangle_count() in command_list.h and shared khr_vertex_format() / khr_build_flags() / khr_index_type() / khr_build_size_query() in d3d12_rt_khr_inputs.h ensures BuildRaytracingAccelerationStructure and GetRaytracingAccelerationStructurePrebuildInfo agree on triangle counts (indexed geometries with < 3 indices produce 0 triangles instead of falling back to vertex_count / 3), all six D3D12 BLAS vertex formats, and ALLOW_COMPACTION.
  • Built d3d12_rt_khr_inputs_test, replay_khr_blas_build_test, and d3d12_indirect_rt_test and ran ctest --output-on-failure:
    • d3d12_rt_khr_inputs: passed (0.03 s).
    • replay_khr_blas_build: passed (0.03 s).
    • d3d12_indirect_rt: passed (0.83 s).
    • d3d12_indirect_rt_upload_sysmem: passed (0.62 s).
  • python -I tests/test_ctest_registration.py -v: 6/6 passed.

GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341; VK_LAYER_KHRONOS_validation not installed locally).
AI-assisted (Antigravity, Gemini).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6093566086 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2486#pullrequestreview-6093566086). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-27T21:40:58Z. **Review:** APPROVED --- Reviewed the diff and tested locally on Windows 11 + NVIDIA GeForce RTX 5070 12 GB (MSVC 19.44, Ninja Release). - Extracting `rt_triangle_count()` in `command_list.h` and shared `khr_vertex_format()` / `khr_build_flags()` / `khr_index_type()` / `khr_build_size_query()` in `d3d12_rt_khr_inputs.h` ensures `BuildRaytracingAccelerationStructure` and `GetRaytracingAccelerationStructurePrebuildInfo` agree on triangle counts (indexed geometries with `< 3` indices produce `0` triangles instead of falling back to `vertex_count / 3`), all six D3D12 BLAS vertex formats, and `ALLOW_COMPACTION`. - Built `d3d12_rt_khr_inputs_test`, `replay_khr_blas_build_test`, and `d3d12_indirect_rt_test` and ran `ctest --output-on-failure`: - `d3d12_rt_khr_inputs`: passed (0.03 s). - `replay_khr_blas_build`: passed (0.03 s). - `d3d12_indirect_rt`: passed (0.83 s). - `d3d12_indirect_rt_upload_sysmem`: passed (0.62 s). - `python -I tests/test_ctest_registration.py -v`: 6/6 passed. GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341; `VK_LAYER_KHRONOS_validation` not installed locally). AI-assisted (Antigravity, Gemini).
timbot103 commented 2026-11-28 02:02:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T02:02:00Z.


Reviewed at head ede03426c on Windows 11 (MSVC 2022 19.44) with dual-GPU Vulkan validation (LEONIDA_VK_VALIDATION=1, Vulkan SDK 1.4.363.0).

Verification

  • Built d3d12_rt_khr_inputs_test, replay_khr_blas_build_test, and d3d12_indirect_rt_test.
  • d3d12_rt_khr_inputs_test: passed.
  • replay_khr_blas_build_test: passed.
  • d3d12_indirect_rt_test (LEONIDA_VK_VALIDATION=1): PASS (0 validation errors) on both NVIDIA GeForce RTX 5080 (616.64) and AMD Radeon(TM) Graphics (25.10.30.02).

Findings (Request changes)

  1. Zero-primitive indexed geometry submits VK_INDEX_TYPE_UINT16/UINT32 with a null indexData device address (d3d12_com.cpp:1098-1103; vulkan_replay.h:5460-5486; replay_khr_blas_build_test.cpp:84-108):
    When index_va == 0 and index_count < 3, replay emits primitiveCount = 0 while still setting tr.indexType = VK_INDEX_TYPE_UINT16/UINT32 and tr.indexData.deviceAddress = 0. Under VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806, any triangle geometry with indexType != VK_INDEX_TYPE_NONE_KHR requires a valid device address in indexData (the mock at replay_khr_blas_build_test.cpp:84-108 currently expects the invalid UINT16/zero-address combination). Either normalize null-address empty indexed geometry consistently (e.g., VK_INDEX_TYPE_NONE_KHR in both prebuild and replay) or reject null index_va when an index format is declared.
  2. Prebuild size query omits transformData presence (d3d12_rt_khr_inputs.h:82-97 vs. d3d12_com.cpp:1104, vulkan_replay.h:5468):
    d3d12_rt_khr_inputs.h leaves tr.transformData zero for every geometry during vkGetAccelerationStructureBuildSizesKHR, while replay forwards t.transform_va into tr.transformData.deviceAddress. Vulkan requires transformData.hostAddress (or deviceAddress) to be non-null in the size query whenever the subsequent build uses a transform to guarantee the returned acceleration-structure/scratch sizes are sufficient. Setting a non-null sentinel on tr.transformData when t.Transform3x4 != 0 closes this prebuild parity gap.

AI-assisted review + local MSVC/dual-GPU verification.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232082300 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2486#issuecomment-7232082300). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-28T02:02:00Z. --- Reviewed at head `ede03426c` on Windows 11 (MSVC 2022 `19.44`) with dual-GPU Vulkan validation (`LEONIDA_VK_VALIDATION=1`, Vulkan SDK `1.4.363.0`). ### Verification - Built `d3d12_rt_khr_inputs_test`, `replay_khr_blas_build_test`, and `d3d12_indirect_rt_test`. - `d3d12_rt_khr_inputs_test`: **passed**. - `replay_khr_blas_build_test`: **passed**. - `d3d12_indirect_rt_test` (`LEONIDA_VK_VALIDATION=1`): **PASS (0 validation errors)** on both **NVIDIA GeForce RTX 5080** (`616.64`) and **AMD Radeon(TM) Graphics** (`25.10.30.02`). ### Findings (Request changes) 1. **Zero-primitive indexed geometry submits `VK_INDEX_TYPE_UINT16`/`UINT32` with a null `indexData` device address (`d3d12_com.cpp:1098-1103`; `vulkan_replay.h:5460-5486`; `replay_khr_blas_build_test.cpp:84-108`):** When `index_va == 0` and `index_count < 3`, replay emits `primitiveCount = 0` while still setting `tr.indexType = VK_INDEX_TYPE_UINT16`/`UINT32` and `tr.indexData.deviceAddress = 0`. Under **`VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806`**, any triangle geometry with `indexType != VK_INDEX_TYPE_NONE_KHR` requires a valid device address in `indexData` (the mock at `replay_khr_blas_build_test.cpp:84-108` currently expects the invalid `UINT16`/zero-address combination). Either normalize null-address empty indexed geometry consistently (e.g., `VK_INDEX_TYPE_NONE_KHR` in both prebuild and replay) or reject null `index_va` when an index format is declared. 2. **Prebuild size query omits `transformData` presence (`d3d12_rt_khr_inputs.h:82-97` vs. `d3d12_com.cpp:1104`, `vulkan_replay.h:5468`):** `d3d12_rt_khr_inputs.h` leaves `tr.transformData` zero for every geometry during `vkGetAccelerationStructureBuildSizesKHR`, while replay forwards `t.transform_va` into `tr.transformData.deviceAddress`. Vulkan requires `transformData.hostAddress` (or `deviceAddress`) to be non-null in the size query whenever the subsequent build uses a transform to guarantee the returned acceleration-structure/scratch sizes are sufficient. Setting a non-null sentinel on `tr.transformData` when `t.Transform3x4 != 0` closes this prebuild parity gap. AI-assisted review + local MSVC/dual-GPU verification.
zmasi commented 2026-11-28 23:02:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:02:16Z.


#2486 | head ede03426c9 (merged cleanly with main adfb3821a2) | ctest --test-dir runtime/build -C RelWithDebInfo -R "^(d3d12_rt_khr_inputs|replay_khr_blas_build|replay_khr_as_copy_postbuild|d3d12_dxr_validation|d3d12_dxr_validation_khr|d3d12_indirect_rt)$" --output-on-failure + LEONIDA_RT_AS=khr on d3d12_indirect_rt + live KHR empty-indexed BLAS GPU probe (LEONIDA_VK_VALIDATION=1) | red on main's < 3 index formula: replay_khr_blas_build_test fails its two < 3 static_assert checks (error C2607 at lines 56 and 57) and d3d12_rt_khr_inputs fails (FAIL: R16_UINT, IndexCount 0, VertexCount 3000: 0 triangles (not 1000) and FAIL: R32_UINT, IndexCount 2, VertexCount 300: 0 triangles (not 100)) | green on PR+main: 6/6 CTests (d3d12_rt_khr_inputs, replay_khr_blas_build, replay_khr_as_copy_postbuild, d3d12_dxr_validation, d3d12_dxr_validation_khr, d3d12_indirect_rt) plus d3d12_indirect_rt under LEONIDA_RT_AS=khr and test_ci_registration.py (18/18) pass on RTX 3090 with 0 Khronos validation errors (check_no_game_data.py 0 violations). Note on the earlier review comments: (1) a live LEONIDA_RT_AS=khr + VK_LAYER_KHRONOS_validation 1.4.363.1 GPU submission of an empty indexed BLAS (DXGI_FORMAT_R16_UINT, IndexCount = 0, IndexBuffer = 0 -> indexType = VK_INDEX_TYPE_UINT16, indexData.deviceAddress = 0, primitiveCount = 0) completes with 0 validation errors, as VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806 applies only when primitiveCount != 0; (2) setting a non-null tr.transformData sentinel in khr_build_size_query when t.Transform3x4 != 0 remains a worthwhile follow-up so prebuild sizes include transform overhead | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247154847 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2486#issuecomment-7247154847). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:02:16Z. --- #2486 | head ede03426c98bb3c4f7658f034ca0dfc5091ee5ef (merged cleanly with main adfb3821a23612263c1c5b195453ed01c4c114db) | `ctest --test-dir runtime/build -C RelWithDebInfo -R "^(d3d12_rt_khr_inputs|replay_khr_blas_build|replay_khr_as_copy_postbuild|d3d12_dxr_validation|d3d12_dxr_validation_khr|d3d12_indirect_rt)$" --output-on-failure` + `LEONIDA_RT_AS=khr` on `d3d12_indirect_rt` + live KHR empty-indexed BLAS GPU probe (`LEONIDA_VK_VALIDATION=1`) | red on main's `< 3` index formula: `replay_khr_blas_build_test` fails its two `< 3` `static_assert` checks (`error C2607` at lines `56` and `57`) and `d3d12_rt_khr_inputs` fails (`FAIL: R16_UINT, IndexCount 0, VertexCount 3000: 0 triangles (not 1000)` and `FAIL: R32_UINT, IndexCount 2, VertexCount 300: 0 triangles (not 100)`) | green on PR+main: `6/6` CTests (`d3d12_rt_khr_inputs`, `replay_khr_blas_build`, `replay_khr_as_copy_postbuild`, `d3d12_dxr_validation`, `d3d12_dxr_validation_khr`, `d3d12_indirect_rt`) plus `d3d12_indirect_rt` under `LEONIDA_RT_AS=khr` and `test_ci_registration.py` (`18/18`) pass on RTX 3090 with `0` Khronos validation errors (`check_no_game_data.py` `0` violations). Note on the earlier review comments: (1) a live `LEONIDA_RT_AS=khr` + `VK_LAYER_KHRONOS_validation` `1.4.363.1` GPU submission of an empty indexed BLAS (`DXGI_FORMAT_R16_UINT`, `IndexCount = 0`, `IndexBuffer = 0` -> `indexType = VK_INDEX_TYPE_UINT16`, `indexData.deviceAddress = 0`, `primitiveCount = 0`) completes with **`0` validation errors**, as `VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806` applies only when `primitiveCount != 0`; (2) setting a non-null `tr.transformData` sentinel in `khr_build_size_query` when `t.Transform3x4 != 0` remains a worthwhile follow-up so prebuild sizes include transform overhead | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes
timbot103 commented 2026-11-29 01:06:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T01:06:40Z.

Review: COMMENTED


I reviewed ede03426c through static inspection only. I ran no builds, tests, or GPU workloads. The shared count gives the short indexed cases zero triangles, and the query now uses the same vertex-format and build-flag mappings as recording. Two issues remain in the Vulkan inputs.

  1. In runtime/src/vulkan_replay.h:5467, the empty indexed cases still submit UINT16 or UINT32 with a zero index address. The Vulkan SDK 1.4.363.0 text for VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806 requires a valid index address for those types, including at zero primitives. Please supply a valid, aligned build-input address for an absent index buffer on this path and update runtime/test/replay_khr_blas_build_test.cpp:104 to check the address and the zero count. Apply the same address handling to a missing vertex buffer on an empty geometry under pInfos-03804.
  2. In runtime/shims/d3d12_rt_khr_inputs.h:93, the query leaves transformData zero even when replay supplies a transform at runtime/src/vulkan_replay.h:5468. The returned sizes are only guaranteed for a build without a transform when the query has a null transform address. Please pass a nonzero sentinel when Transform3x4 is set and cover both cases in the size-query test.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6100841389 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2486#pullrequestreview-6100841389). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-29T01:06:40Z. **Review:** COMMENTED --- I reviewed `ede03426c` through static inspection only. I ran no builds, tests, or GPU workloads. The shared count gives the short indexed cases zero triangles, and the query now uses the same vertex-format and build-flag mappings as recording. Two issues remain in the Vulkan inputs. 1. In `runtime/src/vulkan_replay.h:5467`, the empty indexed cases still submit `UINT16` or `UINT32` with a zero index address. The Vulkan SDK 1.4.363.0 text for `VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806` requires a valid index address for those types, including at zero primitives. Please supply a valid, aligned build-input address for an absent index buffer on this path and update `runtime/test/replay_khr_blas_build_test.cpp:104` to check the address and the zero count. Apply the same address handling to a missing vertex buffer on an empty geometry under `pInfos-03804`. 2. In `runtime/shims/d3d12_rt_khr_inputs.h:93`, the query leaves `transformData` zero even when replay supplies a transform at `runtime/src/vulkan_replay.h:5468`. The returned sizes are only guaranteed for a build without a transform when the query has a null transform address. Please pass a nonzero sentinel when `Transform3x4` is set and cover both cases in the size-query test. AI-assisted.
TheGeogeo commented 2026-11-29 14:17:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:17:50Z.


Tested ede03426c merged (no commit) with main 8fb974878: MSVC 19.52, Windows 11 10.0.26300.
GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40.

  • Green: d3d12_rt_khr_inputs, d3d12_indirect_rt, d3d12_indirect_rt_upload_sysmem and replay_khr_blas_build pass. The 294 relinked CTests pass, except xbox_present, which fails on main too (its resize case).
  • Red: with the five non-test files back to main, the tests do not compile (d3d12_rt_khr_inputs.h is new, and replay_khr_blas_build_test.cpp(56): C3861 'rt_triangle_count'). No runtime red was shown here.
  • gta6rt links with nothing new over main: no new unresolved symbol, same imports.
  • Merge order: conflicts with #2496 in runtime/CMakeLists.txt. Whichever lands second needs a rebase.
  • The three points of the review posted after the last commit (an aligned build-input address for an absent index buffer and for a missing vertex buffer, and a nonzero sentinel with Transform3x4) have no commit yet.
  • No game data check passes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257193033 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2486#issuecomment-7257193033). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:17:50Z. --- Tested ede03426c merged (no commit) with main 8fb974878: MSVC 19.52, Windows 11 10.0.26300. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40. - Green: `d3d12_rt_khr_inputs`, `d3d12_indirect_rt`, `d3d12_indirect_rt_upload_sysmem` and `replay_khr_blas_build` pass. The 294 relinked CTests pass, except `xbox_present`, which fails on main too (its resize case). - Red: with the five non-test files back to main, the tests do not compile (`d3d12_rt_khr_inputs.h` is new, and `replay_khr_blas_build_test.cpp(56)`: `C3861 'rt_triangle_count'`). No runtime red was shown here. - `gta6rt` links with nothing new over main: no new unresolved symbol, same imports. - Merge order: conflicts with #2496 in `runtime/CMakeLists.txt`. Whichever lands second needs a rebase. - The three points of the review posted after the last commit (an aligned build-input address for an absent index buffer and for a missing vertex buffer, and a nonzero sentinel with `Transform3x4`) have no commit yet. - No game data check passes. AI-assisted (Claude Code).
aslan2142 commented 2026-12-01 16:45:14 +00:00 (Migrated from github.com)

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


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