[PR #1449] d3d12 tests: skip PSO tests on devices below the 144-byte push-constant contract #1479

Open
opened 2026-11-26 20:21:23 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1449
Author: @whoalin1
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: pc-tail-skip-guards


📝 Commits (2)

  • 428522e d3d12 tests: skip PSO tests on devices below the 144-byte push-constant contract
  • e8f0953 tests: skip honestly when push constants fall below the 144-byte contract

📊 Changes

26 files changed (+51 additions, -1 deletions)

View changed files

📝 runtime/CMakeLists.txt (+2 -1)
📝 runtime/test/d3d12_bindless_churn_test.cpp (+1 -0)
📝 runtime/test/d3d12_buffer_uav_test.cpp (+1 -0)
📝 runtime/test/d3d12_bundle_test.cpp (+1 -0)
📝 runtime/test/d3d12_compute_test.cpp (+1 -0)
📝 runtime/test/d3d12_depth24_draw_test.cpp (+1 -0)
📝 runtime/test/d3d12_depth_resolve_test.cpp (+1 -0)
📝 runtime/test/d3d12_draw_test.cpp (+1 -0)
📝 runtime/test/d3d12_execute_indirect_validation_test.cpp (+1 -0)
📝 runtime/test/d3d12_f16_halves_test.cpp (+1 -0)
📝 runtime/test/d3d12_first_light_test.cpp (+5 -0)
📝 runtime/test/d3d12_geometry_test.cpp (+1 -0)
📝 runtime/test/d3d12_indirect_dispatch_count_test.cpp (+1 -0)
📝 runtime/test/d3d12_m2_formats_test.cpp (+1 -0)
📝 runtime/test/d3d12_m2_textured_test.cpp (+1 -0)
📝 runtime/test/d3d12_m3_frame_test.cpp (+1 -0)
📝 runtime/test/d3d12_m4_compute_test.cpp (+1 -0)
📝 runtime/test/d3d12_mesh_test.cpp (+1 -0)
📝 runtime/test/d3d12_multi_viewport_test.cpp (+1 -0)
📝 runtime/test/d3d12_pso_validation_test.cpp (+1 -0)

...and 6 more files

📄 Description

Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148481068
Related: #1419 applies the same guard to #1341's new d3d12_skip_compute_test (Depends on: #1341).

What

On GPUs whose maxPushConstantsSize is under the 144 bytes every translated shader's push-constant block needs (the Vulkan minimum is 128; AMD Radeon iGPUs report 128), the D3D12 layer refuses every pipeline with E_NOTIMPL (PipelineState::push_constants_fit; the uniform-buffer tail is not built yet). Every test that creates a PSO therefore failed on such devices — 24 ctest entries on our AMD iGPU.

LEONIDA_PC_TAIL_UBO=1 does not help these tests: it only changes how test/shaders/build.py translates the .asm fixtures, while the layer still declares the whole 144-byte VkPushConstantRange.

  • vktest::Device now records the chosen device's maxPushConstantsSize and offers below_shader_push_constant_contract() — the vk-side twin of rt::d3d12::device_push_constants_need_fallback (same <144 condition, usable before the D3D12 device exists, which the helper-structured tests need).
  • One guard line after initialize() in the 22 test sources behind the 24 failing entries (all already had SKIP_RETURN_CODE 77 in CMake — no CMake change).
  • Tests that intentionally exercise the refusal (d3d12_vulkan_device_test) and tests already guarded are untouched.

Tested

  • AMD Radeon iGPU (gfx1035, driver 24.10.24, Vulkan 1.3.280, LEONIDA_PC_TAIL_UBO=1, validation on): all 24 entries now ***Skipped (exit 77) — e.g. d3d12_compute_test: skipped, the shaders' push-constant block needs 144 bytes and this GPU has 128; the remaining AMD failures are the 3 known pre-existing ones (d3d12_clear NaN → #787, d3d12_xdxr_rt_check → #1210, d3d12_pipeline_library_host env crash).
  • NVIDIA RTX 4070 SUPER: all 24 touched tests PASS (24/24).
  • Full build clean (Ninja, RelWithDebInfo, 622+ targets).

Known tradeoff (reviewer-noted): d3d12_typeless_families/d3d12_depth_resolve skip their clears-only paths too on low-limit devices; d3d12_first_light (package-gated) and d3d12_state_sweep (silent zero-comparison pass) have the same latent gap — follow-ups noted on the coordination issue.

AI-assisted (Devin).

Consolidated follow-up

This branch now also includes the two remaining push-constant-contract skips formerly opened as #1467: d3d12_first_light_test and d3d12_state_sweep_test now exit 77 before building PSOs on devices below the 144-byte contract, rather than failing or silently comparing nothing. The consolidation is cherry-pick e8f09538f; no additional code was written.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1449 **Author:** [@whoalin1](https://github.com/whoalin1) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pc-tail-skip-guards` --- ### 📝 Commits (2) - [`428522e`](https://github.com/ubiquitarianism/leonida/commit/428522e8539ed933f0e809e2bfe518f309ecef9a) d3d12 tests: skip PSO tests on devices below the 144-byte push-constant contract - [`e8f0953`](https://github.com/ubiquitarianism/leonida/commit/e8f09538f7c9f318f0bacb600c75a30adf312f10) tests: skip honestly when push constants fall below the 144-byte contract ### 📊 Changes **26 files changed** (+51 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+2 -1) 📝 `runtime/test/d3d12_bindless_churn_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_buffer_uav_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_bundle_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_compute_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_depth24_draw_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_depth_resolve_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_draw_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_execute_indirect_validation_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_f16_halves_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_first_light_test.cpp` (+5 -0) 📝 `runtime/test/d3d12_geometry_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_indirect_dispatch_count_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_m2_formats_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_m2_textured_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_m3_frame_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_m4_compute_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_mesh_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_multi_viewport_test.cpp` (+1 -0) 📝 `runtime/test/d3d12_pso_validation_test.cpp` (+1 -0) _...and 6 more files_ </details> ### 📄 Description Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148481068 Related: #1419 applies the same guard to #1341's new `d3d12_skip_compute_test` (Depends on: #1341). ## What On GPUs whose `maxPushConstantsSize` is under the 144 bytes every translated shader's push-constant block needs (the Vulkan minimum is 128; AMD Radeon iGPUs report 128), the D3D12 layer refuses **every** pipeline with `E_NOTIMPL` (`PipelineState::push_constants_fit`; the uniform-buffer tail is not built yet). Every test that creates a PSO therefore **failed** on such devices — 24 ctest entries on our AMD iGPU. `LEONIDA_PC_TAIL_UBO=1` does not help these tests: it only changes how `test/shaders/build.py` translates the `.asm` fixtures, while the layer still declares the whole 144-byte `VkPushConstantRange`. - `vktest::Device` now records the chosen device's `maxPushConstantsSize` and offers `below_shader_push_constant_contract()` — the vk-side twin of `rt::d3d12::device_push_constants_need_fallback` (same `<144` condition, usable **before** the D3D12 device exists, which the helper-structured tests need). - One guard line after `initialize()` in the 22 test sources behind the 24 failing entries (all already had `SKIP_RETURN_CODE 77` in CMake — no CMake change). - Tests that intentionally exercise the refusal (`d3d12_vulkan_device_test`) and tests already guarded are untouched. ## Tested - AMD Radeon iGPU (gfx1035, driver 24.10.24, Vulkan 1.3.280, `LEONIDA_PC_TAIL_UBO=1`, validation on): all 24 entries now `***Skipped` (exit 77) — e.g. `d3d12_compute_test: skipped, the shaders' push-constant block needs 144 bytes and this GPU has 128`; the remaining AMD failures are the 3 known pre-existing ones (`d3d12_clear` NaN → #787, `d3d12_xdxr_rt_check` → #1210, `d3d12_pipeline_library_host` env crash). - NVIDIA RTX 4070 SUPER: all 24 touched tests **PASS** (24/24). - Full build clean (Ninja, RelWithDebInfo, 622+ targets). Known tradeoff (reviewer-noted): `d3d12_typeless_families`/`d3d12_depth_resolve` skip their clears-only paths too on low-limit devices; `d3d12_first_light` (package-gated) and `d3d12_state_sweep` (silent zero-comparison pass) have the same latent gap — follow-ups noted on the coordination issue. AI-assisted (Devin). ## Consolidated follow-up This branch now also includes the two remaining push-constant-contract skips formerly opened as #1467: `d3d12_first_light_test` and `d3d12_state_sweep_test` now exit 77 before building PSOs on devices below the 144-byte contract, rather than failing or silently comparing nothing. The consolidation is cherry-pick `e8f09538f`; no additional code was written. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1479
No description provided.