Skip to content

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

Closed
whoalin1 wants to merge 1 commit into
ProjectLeonida:mainfrom
whoalin1:honest-pushconst-skips
Closed

whoalin1 wants to merge 1 commit into
ProjectLeonida:mainfrom
whoalin1:honest-pushconst-skips

Conversation

@whoalin1

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

…ract

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 <noreply@cognition.ai>
@whoalin1

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants