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

Open
github-bot wants to merge 2 commits from github-bot/gh-1449 into main AGit
Owner

@⁠whoalin1 on GitHub · 2026-11-25 00:24 UTC · original
whoalin1:pc-tail-skip-guards → main · +51 −1 · 26 files · 2 commits · open

Claimed in the coordination issue: #14
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.

**@⁠whoalin1** on GitHub · 2026-11-25 00:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1449) `whoalin1:pc-tail-skip-guards` → `main` · +51 −1 · 26 files · 2 commits · open Claimed in the coordination issue: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 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.
On GPUs whose maxPushConstantsSize is under the 144 bytes every translated
shader's push-constant block needs (the Vulkan minimum is 128; the AMD iGPU
reports 128), the D3D12 layer refuses every pipeline with E_NOTIMPL
(PipelineState::push_constants_fit; the uniform-buffer tail of #224 is not
built), so every test that creates a PSO fails there. LEONIDA_PC_TAIL_UBO=1
does not help: it only changes how test/shaders/build.py translates the
shader fixtures, while the layer still declares the whole 144-byte range.

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). The 22 test sources behind the failing
ctest entries call it after initialize() and return 77. Every one of those
entries already mapped 77 to SKIP through SKIP_RETURN_CODE except
xbox_native_base_draw, xbox_derived_mask_zero and xbox_derived_mask_restore
(entries of d3d12_translated_draw_test added to main later), which gain the
same mapping here.

Verified on the AMD iGPU (radeon, maxPushConstantsSize 128): the entries of
the 22 sources now skip; the rest of the d3d12 set is unchanged. On the
RTX 4070 SUPER all of them still pass.

AI-assisted.

Co-Authored-By: Devin <[email protected]>
Co-Authored-By: SWE-2.1 Max <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:51:50 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 15:31 UTC · original

Reviewed 90abd34f: this box (arm64 Linux, no GPU, no C++/Vulkan toolchain) cannot run or compile
the d3d12 suite, so verification was static: the <144 skip twins push_constants_fit
(sizeof(ShaderUserData)=144), all 22 guards follow initialize(), and all 24 ctest entries map
SKIP_RETURN_CODE 77. Unverified suggestion: state_sweep and first_light (env set) also build
through the shim with no such skip — a below-contract Windows GPU would still fail them; a
follow-up if such machines are in scope.

AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 15:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1449#issuecomment-7166964154) Reviewed 90abd34f: this box (arm64 Linux, no GPU, no C++/Vulkan toolchain) cannot run or compile the d3d12 suite, so verification was static: the <144 skip twins push_constants_fit (sizeof(ShaderUserData)=144), all 22 guards follow initialize(), and all 24 ctest entries map SKIP_RETURN_CODE 77. Unverified suggestion: state_sweep and first_light (env set) also build through the shim with no such skip — a below-contract Windows GPU would still fail them; a follow-up if such machines are in scope. AI-assisted review. **Recommendation:** Merge
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-25 19:06 UTC · original

Rebased onto current main (73cc1a2ba) and pushed as 428522e85.

Verification on this machine:

  • Full rebuild after rebase: BUILD_RC=0.
  • NVIDIA RTX 4070 (Vulkan validation enabled): all 53 guarded entries passed, including the three xbox_native_base_draw / xbox_derived_mask_zero / xbox_derived_mask_restore entries.
  • AMD RDNA2 iGPU with LEONIDA_PC_TAIL_UBO=1: 52/53 guarded entries now skip honestly through return code 77; the only pass is d3d12_bundle_indirect_warp, which exits through the WARP path before the device-initialize guard. In particular, the three xbox entries that previously printed SKIP but were counted as failures now report ***Skipped because the regenerated CTest metadata maps them correctly.

The state-sweep / first-light coverage PierreEbele mentioned is already split into #1467 (honest-pushconst-skips), so this PR remains scoped to the existing PSO tests.

AI-assisted verification with Devin.

**@⁠whoalin1** on GitHub · 2026-11-25 19:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1449#issuecomment-7171823064) Rebased onto current main (`73cc1a2ba`) and pushed as `428522e85`. Verification on this machine: - Full rebuild after rebase: `BUILD_RC=0`. - NVIDIA RTX 4070 (Vulkan validation enabled): all 53 guarded entries passed, including the three `xbox_native_base_draw` / `xbox_derived_mask_zero` / `xbox_derived_mask_restore` entries. - AMD RDNA2 iGPU with `LEONIDA_PC_TAIL_UBO=1`: 52/53 guarded entries now skip honestly through return code 77; the only pass is `d3d12_bundle_indirect_warp`, which exits through the WARP path before the device-initialize guard. In particular, the three xbox entries that previously printed SKIP but were counted as failures now report `***Skipped` because the regenerated CTest metadata maps them correctly. The state-sweep / first-light coverage PierreEbele mentioned is already split into `#1467` (`honest-pushconst-skips`), so this PR remains scoped to the existing PSO tests. AI-assisted verification with Devin.
d3d12_first_light_test builds translated PSOs that need 144 push-constant
bytes; on a device with a smaller limit (e.g. a 128-byte iGPU) PSO creation
would fail. d3d12_state_sweep_test was worse: every case's PSO fails the same
way, each counts as a per-case skip, and the test could return success having
compared nothing.

Both now check rt::d3d12::device_push_constants_need_fallback right after the
layer device exists and return 77, matching d3d12_pipeline_library_test,
d3d12_msaa_draw_test and d3d12_fspx_compute_test.

Co-Authored-By: Devin <[email protected]>
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1449/head:github-bot/gh-1449'
git switch 'github-bot/gh-1449'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1449'
git switch 'github-bot/gh-1449'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1449'
git switch 'github-bot/gh-1449'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1449'
git switch 'main'
git merge --squash 'github-bot/gh-1449'
git switch 'main'
git merge --ff-only 'github-bot/gh-1449'
git switch 'main'
git merge 'github-bot/gh-1449'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.