tests: skip honestly when push constants fall below the 144-byte contract #1467

Closed
github-bot wants to merge 1 commit from github-bot/gh-1467 into main AGit
Owner

@⁠whoalin1 on GitHub · 2026-11-25 00:49 UTC · original
whoalin1:honest-pushconst-skips → main · +12 −0 · 2 files · 1 commits · closed without merging

Claimed in the coordination issue: #14
Complements #1449 (which guards the other 24 entries); both use the existing device_push_constants_need_fallback → return 77 pattern.

What

Two tests had latent gaps on GPUs with maxPushConstantsSize < 144 (the 144-byte ShaderUserData contract; 128-byte devices like AMD Radeon iGPUs):

  • d3d12_first_light_test (package-gated by LEONIDA_FIRST_LIGHT_DIR): creates translated PSOs that need 144 push-constant bytes — would FAIL on a smaller-limit device. Now checks device_push_constants_need_fallback after the layer device exists and returns 77, matching d3d12_msaa_draw_test/d3d12_fspx_compute_test.
  • d3d12_state_sweep_test — 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 (silent pass). Now guards right after create_vulkan_device, before host_device()/the case loop.

(+12 lines, 2 files; both CMake entries already had SKIP_RETURN_CODE 77.)

Tested

  • AMD Radeon iGPU (gfx1035, driver 24.10.24, LEONIDA_PC_TAIL_UBO=1, validation on): d3d12_state_sweep_test prints the skip and exits 77 (was silent pass); d3d12_first_light_test skips (no package dir on this machine — guard verified by inspection + clean compile, same position/pattern as the three existing guarded tests).
  • NVIDIA RTX 4070 SUPER: d3d12_state_sweep_test ran the full sweep — 498 cases compared, 0 differ, 0 skipped, exit 0.
  • Full runtime build clean (Ninja, RelWithDebInfo, 642 targets).

AI-assisted (Devin).

**@⁠whoalin1** on GitHub · 2026-11-25 00:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1467) `whoalin1:honest-pushconst-skips` → `main` · +12 −0 · 2 files · 1 commits · closed without merging Claimed in the coordination issue: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 Complements #1449 (which guards the other 24 entries); both use the existing `device_push_constants_need_fallback → return 77` pattern. ## What Two tests had latent gaps on GPUs with `maxPushConstantsSize < 144` (the 144-byte `ShaderUserData` contract; 128-byte devices like AMD Radeon iGPUs): - **`d3d12_first_light_test`** (package-gated by `LEONIDA_FIRST_LIGHT_DIR`): creates translated PSOs that need 144 push-constant bytes — would FAIL on a smaller-limit device. Now checks `device_push_constants_need_fallback` after the layer device exists and returns 77, matching `d3d12_msaa_draw_test`/`d3d12_fspx_compute_test`. - **`d3d12_state_sweep_test`** — 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** (silent pass). Now guards right after `create_vulkan_device`, before `host_device()`/the case loop. (+12 lines, 2 files; both CMake entries already had `SKIP_RETURN_CODE 77`.) ## Tested - AMD Radeon iGPU (gfx1035, driver 24.10.24, `LEONIDA_PC_TAIL_UBO=1`, validation on): `d3d12_state_sweep_test` prints the skip and exits 77 (was silent pass); `d3d12_first_light_test` skips (no package dir on this machine — guard verified by inspection + clean compile, same position/pattern as the three existing guarded tests). - NVIDIA RTX 4070 SUPER: `d3d12_state_sweep_test` ran the full sweep — **498 cases compared, 0 differ, 0 skipped**, exit 0. - Full runtime build clean (Ninja, RelWithDebInfo, 642 targets). AI-assisted (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]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:52:32 +00:00
Author
Owner

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

Reviewed 696237b: could not execute here — both tests need Windows+MSVC+GPU (first_light also needs tools/first_light.py output), so I verified by inspection against main. The skips are warranted: main's layer refuses every translated graphics PSO below 144 push-constant bytes (ShaderUserData is fixed at 144 and the uniform-buffer fallback is not built yet), both tests are registered with SKIP_RETURN_CODE 77, the helpers accept the inner device, and d3d12_state_sweep_test really would end with differ ? 1 : 0 — a green exit having compared nothing — without this early skip. The branch merges cleanly into current main (merge-tree exit 0; main's newer create_device_proxy(console_lists=false) call is kept alongside the skips). No finding. AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 15:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1467#issuecomment-7167060683) Reviewed 696237b: could not execute here — both tests need Windows+MSVC+GPU (first_light also needs tools/first_light.py output), so I verified by inspection against main. The skips are warranted: main's layer refuses every translated graphics PSO below 144 push-constant bytes (ShaderUserData is fixed at 144 and the uniform-buffer fallback is not built yet), both tests are registered with SKIP_RETURN_CODE 77, the helpers accept the inner device, and d3d12_state_sweep_test really would end with `differ ? 1 : 0` — a green exit having compared nothing — without this early skip. The branch merges cleanly into current main (merge-tree exit 0; main's newer create_device_proxy(console_lists=false) call is kept alongside the skips). No finding. AI-assisted review. **Recommendation:** Merge
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-25 20:07 UTC · original

Rebased cleanly onto current main (db1a22d29) as b71723ab4 to refresh the stale CI baseline; no conflicts. The branch remains the two honest push-constant skip guards. AI-assisted with Devin.

**@⁠whoalin1** on GitHub · 2026-11-25 20:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1467#issuecomment-7173221182) Rebased cleanly onto current main (`db1a22d29`) as `b71723ab4` to refresh the stale CI baseline; no conflicts. The branch remains the two honest push-constant skip guards. AI-assisted with Devin.
github-bot closed this pull request 2026-11-26 13:33:25 +00:00
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-26 13:27 UTC · original

Consolidated into #1449 as cherry-pick e8f09538f to reduce review noise. The first-light and state-sweep push-constant skips are preserved there.

**@⁠whoalin1** on GitHub · 2026-11-26 13:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1467#issuecomment-7193377312) Consolidated into #1449 as cherry-pick `e8f09538f` to reduce review noise. The first-light and state-sweep push-constant skips are preserved there.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.