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

Closed
whoalin1 wants to merge 1 commit from upstream-pr/1467 into main
whoalin1 commented 2026-11-25 00:49:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T00:49:30Z.


Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148908938
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).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5482951896 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1467). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-25T00:49:30Z. --- Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148908938 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).
PierreEbele commented 2026-11-25 15:34:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T15:34:48Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7167060683 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1467#issuecomment-7167060683). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T15:34:48Z. --- 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
whoalin1 commented 2026-11-25 20:07:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T20:07:24Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7173221182 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1467#issuecomment-7173221182). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-25T20:07:24Z. --- 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 commented 2026-11-26 13:27:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-26T13:27:26Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7193377312 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1467#issuecomment-7193377312). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-26T13:27:26Z. --- 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

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!1467
No description provided.