Skip to content

d3d12_skip_compute_test: add the GPU regression and skip on 128-byte devices - #1419

Open
whoalin1 wants to merge 2 commits into
ProjectLeonida:mainfrom
whoalin1:pc-tail-skip-guard
Open

whoalin1 wants to merge 2 commits into
ProjectLeonida:mainfrom
whoalin1:pc-tail-skip-guard

Conversation

@whoalin1

@whoalin1 whoalin1 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

LEONIDA_SKIP_COMPUTE is already implemented in main, but its GPU regression test was never merged with it. This PR adds that test and keeps it honest on 128-byte push-constant devices.

What

  • Adds d3d12_skip_compute_test, Moriz82's synthetic regression test for the diagnostic already documented in main: two counting compute programs exercise unset, one-name and all modes, including direct and indirect dispatches.
  • Registers the three cases in CTest with SKIP_RETURN_CODE 77.
  • On a device whose maxPushConstantsSize is below the test's 144-byte ShaderUserData block (128, the Vulkan minimum — e.g. AMD Radeon iGPUs), checks device_push_constants_need_fallback() and returns 77 instead of failing with E_NOTIMPL. This is the same guard already used by d3d12_msaa_draw_test, d3d12_set0_compute_test and d3d12_fspx_compute_test.

This branch was rebased onto current main; the stale duplicate documentation paragraph and the obsolete dependency on closed #1341 were removed. No game data.

Validation

  • Moriz82's original evidence: cross-built gta6rt and d3d12_skip_compute_test with clang-cl and ran the test under Wine 11.22 on an RTX 4070. Unset: both programs run and nothing is logged. absent,drop: only the named program is dropped. all: both are dropped.
  • Refreshed local evidence on f177f7a03 (Windows 11, MSVC): build succeeds; native NVIDIA RTX 4070 SUPER passes all three ctest entries; AMD Radeon iGPU with validation on and a 128-byte push-constant limit honestly skips all three through return code 77 because the pipelines need 144 bytes. The AMD run directly exercises the new guard.

AI-assisted.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
@whoalin1

Copy link
Copy Markdown
Contributor Author

Rebased onto #1341's current head (4c54b8044) — the branch now contains only this PR's own commit on top of it, so the earlier conflict is resolved.

One thing worth flagging for reviewers: #1341's updated head already includes the device_push_constants_need_fallback → return 77 guard in d3d12_skip_compute_test.cpp itself. After the rebase this PR's remaining delta is only the explanatory comment and a clearer skip message (+4/−1). The functional fix therefore lands with #1341; this PR is now just polish on top of it. Maintainer's call whether to keep it for the comment or close once #1341 merges — happy either way.

@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
@whoalin1

Copy link
Copy Markdown
Contributor Author

Rebased cleanly onto current main (db1a22d29) as 324ca00cf to refresh the stale CI baseline; no conflicts. The branch is unchanged: the RT-SKIP-COMPUTE-DIAGNOSTIC named-program skip plus the push-constant-limit guard for d3d12_skip_compute_test. AI-assisted with Devin.

@whoalin1
whoalin1 force-pushed the pc-tail-skip-guard branch 2 times, most recently from 324ca00 to 882d86a Compare November 26, 2026 00:26
Moriz82 and others added 2 commits November 26, 2026 06:30
…STIC)

A compute program that hangs the GPU or loses the device stops a run at
that dispatch. Nothing after it can be examined until the program or its
input is fixed, and there was no way to take one program out of a run.

LEONIDA_SKIP_COMPUTE=<part of a name>[,<part>...] (all or *: every compute
program) is a diagnostic and is unset by default. A compute program whose
library name contains one of the parts gets no shader module and no
VkPipeline. CreateComputePipelineState still succeeds and logs the name
once. Replay drops each direct and indirect dispatch of the program and
records the rest of the command list. What the program would have written
keeps its previous contents. With the variable unset no pipeline is marked
and no dispatch is dropped.

Cross-built gta6rt and d3d12_skip_compute_test with clang-cl and ran the
test under Wine 11.22 on an RTX 4070. It runs two synthetic counting
programs with direct, indirect and counted indirect dispatches. Unset:
both run and no line is logged. "absent,drop": one program is dropped, the
dispatches before and after it run. "all": both are dropped. With the base
implementation the unset form passes with the same counts and the two set
forms fail.

AI-assisted (Claude Code).

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is under 144 bytes

On a device whose maxPushConstantsSize is below the 144-byte ShaderUserData block (128, the Vulkan minimum, as on the AMD Radeon iGPUs), PipelineState::push_constants_fit refuses the pipeline states with E_NOTIMPL and the test failed instead of skipping. Check device_push_constants_need_fallback after create_vulkan_device and return 77, the same guard d3d12_msaa_draw_test, d3d12_set0_compute_test and d3d12_fspx_compute_test already use; the CMake entries already set SKIP_RETURN_CODE 77.

The implementation this test covers is already in main; this branch now carries only its synthetic regression test and the 128-byte-device skip guard.
@whoalin1 whoalin1 changed the title d3d12_skip_compute_test: SKIP(77) when the GPU's push-constant limit is under 144 bytes d3d12_skip_compute_test: add the GPU regression and skip on 128-byte devices Nov 26, 2026
@whoalin1

Copy link
Copy Markdown
Contributor Author

Maintenance update: rebased onto current main and removed the stale duplicate documentation paragraph plus the obsolete dependency on closed #1341. The implementation itself is already in main; this PR is now exactly the missing synthetic GPU regression test plus the 128-byte push-constant skip guard. Head f177f7a.

@whoalin1

Copy link
Copy Markdown
Contributor Author

Refreshed local validation on f177f7a (Windows 11, MSVC, no game data):

  • Build: cmake configure and d3d12_skip_compute_test target succeeded.
  • NVIDIA RTX 4070 SUPER, native Windows: d3d12_skip_compute_unset/one/all all PASS (3/3), with the expected unset/one/all dispatch counts.
  • AMD Radeon iGPU (128-byte maxPushConstantsSize), validation on with LEONIDA_PC_TAIL_UBO=1: all three entries honestly SKIP through return code 77: the pipelines need 144 push-constant bytes and this GPU has 128. This directly exercises the new guard; ctest reports 100% passed with the three tests skipped.

The implementation itself was already in main; this validates the carried synthetic regression and the 128-byte-device behavior.

MoonEyes pushed a commit to MoonEyes/leonida that referenced this pull request Nov 27, 2026
… hosts (LEONIDA_PAIRED_LANES)

One host wave of 32 threads runs one console wave of 64, each thread lowering console lanes n and
n + 32 (paired.rs). Wave-wide values ask the host wave for both lanes of every thread, so nothing is
exchanged between host waves through LDS. Tried right before the wave-wide form (unset or 1;
`first`: before every form; 0: never); part of the translation fingerprint.

Over the 2,734 compute programs (translate_cdxil --census, dxil.dll's validator) only the seven
CS_TransmissionVolumetrics programs change, none invalid: 6f225b641c5b0708 125 group barriers (76 in
loops) -> 5 (none in loops), 5dc3b25986622949 111 -> 5, 926c46bab3b86bd6 703 -> 10. Hand-written
fixtures run on an RTX 4060 Ti (paired_tests).

Ported from TaynanGT/Vice-Tay 5e588e8 (Geckomacabre with fxceless; after ByFxbian's
fxceless/victory-fork ProjectLeonida#1397 and ProjectLeonida#1419, PiloteCode ProjectLeonida#854, darkworldhm 840243e2 and 08fdf0b), GPL-3.0.
Not taken: its ordered FP32 replay, its program list by hash and its loop-exit change to the
wave-wide form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Native Windows 11 + MSVC 19.44 + RTX 3090 Vulkan Verification (f177f7a03b + origin/main adfb3821a2)

Verdict: PASS on GPU + Khronos Validation (0 functional blockers; 1 CMake parallel-build dependency note & 1 minor /W4 nit below)

Environment & Merge Check

  • Host: Windows 11 (10.0.26200), MSVC 19.44.35228 (x64), NVIDIA GeForce RTX 3090 (Vulkan subgroup 32..32, ReBAR enabled), Khronos VK_LAYER_KHRONOS_validation 1.4.363.1 (LEONIDA_VK_VALIDATION=1, VK_VALIDATE_SYNC=1)
  • Merge hygiene: Clean merge onto origin/main (adfb3821a2, git merge-tree --write-tree rc=0) and python -I tests/test_ci_registration.py OK.

Red -> Green GPU Results

  • Red: d3d12_skip_compute_test and its 3 CTest cases (d3d12_skip_compute_unset, d3d12_skip_compute_one, d3d12_skip_compute_all) are absent on origin/main.
  • Green (PR #1419 + origin/main on NVIDIA GeForce RTX 3090, both default and with LEONIDA_VK_VALIDATION=1 + VK_VALIDATE_SYNC=1):
    1. d3d12_skip_compute_test.exe (d3d12_skip_compute_unset): PASS (rc=0, 0.52 s, 0 VUID- errors) — 0 log line(s), count_keep 103/1004 (expected 103/1004), count_drop 109/1016 (expected 109/1016).
    2. d3d12_skip_compute_test.exe --skip-one (d3d12_skip_compute_one, LEONIDA_SKIP_COMPUTE="absent,drop"): PASS (rc=0, 0.52 s, 0 VUID- errors) — 1 log line(s), count_keep 103/1004 (expected 103/1004), count_drop 100/1000 (expected 100/1000).
    3. d3d12_skip_compute_test.exe --skip-all (d3d12_skip_compute_all, LEONIDA_SKIP_COMPUTE="all"): PASS (rc=0, 0.50 s, 0 VUID- errors) — 2 log line(s), count_keep 100/1000 (expected 100/1000), count_drop 100/1000 (expected 100/1000).

Diff Audit Notes

  1. CMake glslangValidator parallel-build race against origin/main (runtime/CMakeLists.txt): Since commit 86554c879 on main, ${_indirect_count_spv} is owned by add_custom_target(gta6rt_indirect_count_shader DEPENDS ${_indirect_count_spv}), and both d3d12_indirect_dispatch_count_test and d3d12_compute_journal_test omit ${_indirect_count_spv} from add_executable(...) in favor of add_dependencies(<target> gta6rt_indirect_count_shader) (as noted in the comment directly above: "naming its output here too would give Make a second rule for the same file, and the two glslangValidator runs raced"). Dropping ${_indirect_count_spv} from add_executable(d3d12_skip_compute_test ...) and adding add_dependencies(d3d12_skip_compute_test gta6rt_indirect_count_shader) keeps parallel Makefile/MSBuild builds race-free.
  2. Minor MSVC /W4 nit (runtime/test/d3d12_skip_compute_test.cpp:54): std::fopen triggers warning C4996 under /W4 unless _CRT_SECURE_NO_WARNINGS is added to target_compile_definitions(d3d12_skip_compute_test PRIVATE ...) or std::ifstream is used.

AI-assisted.

@OreoFR

OreoFR commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Verified by OreoFR

AI-assisted (Claude Code, Claude Opus 5.5).

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.

4 participants