mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1341] [CLOSED] d3d12: skip named compute programs on request (RT-SKIP-COMPUTE-DIAGNOSTIC) #1372
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1372
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1341
Author: @Moriz82
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:split/rt-skip-compute-diagnostic📝 Commits (1)
4c54b80d3d12: skip named compute programs on request (RT-SKIP-COMPUTE-DIAGNOSTIC)📊 Changes
3 files changed (+322 additions, -0 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+9 -0)📝
runtime/CMakeLists.txt(+12 -0)➕
runtime/test/d3d12_skip_compute_test.cpp(+301 -0)📄 Description
Claimed in the coordination issue as: RT-SKIP-COMPUTE-DIAGNOSTIC (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 (integration source; there the switch hooks into a lazy compute build that
maindoes not have and logs at the first dropped dispatch, here it acts wherecreate_computebuilds the pipeline and logs when the state is created). #42 (LEONIDA_STUB_PIPELINES) makes a pipeline with no translated shader a no-op stub. It does not take a translated program out of a run by name.What and why
A compute program that hangs the GPU or loses the device stops a run at that dispatch. Nothing after it can be looked at until the program or its input is fixed, and there was no way to take one program out of a run to see whether it is the cause.
LEONIDA_SKIP_COMPUTE=<part of a name>[,<part>...]is a diagnostic and is unset by default. A compute program whose library name contains one of the parts (allor*: every compute program) is not built:CreateComputePipelineStatedoes everything it did before exceptvkCreateShaderModuleandvkCreateComputePipelines, returns the same result and writes one line,[rt] d3d12: compute program <name> is skipped (LEONIDA_SKIP_COMPUTE): it is not built and its dispatches are dropped.Dispatchand eachExecuteIndirectdispatch that names the program, with or without a count buffer, and records the rest of the command list.ComputePipeline::skippedcarries the mark.It is a way to isolate a program, not a fix, and no list of names is part of the change: nothing is skipped unless the person running sets the variable. The variable is read once, at the first compute pipeline state.
With the variable unset the list of parts is empty, no pipeline is marked, and the four added tests in
prepareandrecordare false for every pipeline. The existing lines of both functions are unchanged.Tested
Cross-built on CachyOS Linux 7.3.5 with clang-cl 23.1.5 and the xwin SDK. Ran the Windows tests one at a time under Wine 11.22 (distribution package, fresh prefix) on a Ryzen 5 5600X, 16 GB RAM, NVIDIA GeForce RTX 4070 12 GB, driver 620.73.04.
d3d12_skip_compute_testis new. Two synthetic programs,count_keepandcount_drop, share one hand-written GLSL module that counts its dispatches in the buffer its root UAV names. Both buffers are seeded with 100/1000. One command list dispatchescount_keep(2 groups), thencount_dropthree ways (Dispatch,ExecuteIndirectwith one record,ExecuteIndirectwith two records and a GPU count), thencount_keepagain (1 group). The test sets or deletes the variable itself before the device exists, captures stderr around the twoCreateComputePipelineStatecalls and reads both buffers back.d3d12_skip_compute_testcount_keep103/1004,count_drop109/1016.d3d12_skip_compute_test --skip-oneabsent,dropcount_drop109/1016, expected 100/1000.count_drop,count_keep103/1004,count_drop100/1000.d3d12_skip_compute_test --skip-allallcount_keep103/1004, expected 100/1000.Both pipeline states are created and the list replays with
ReplayResult::successin every form. "Base implementation" is this branch withruntime/shims/d3d12_vulkan_device.cppandruntime/src/vulkan_replay.has they are on6293c1c4f.command_list_test,d3d12_compute_test,d3d12_fspx_compute_test,d3d12_m4_compute_test,d3d12_execute_indirect_validation_test,d3d12_pipeline_library_testd3d12_indirect_zero_testd3d12_indirect_dispatch_count_testd3dcompiler_47, WARP) before it creates a Vulkan device.python3 -I scripts/check_no_game_data.py,tests/test_docs_env_vars.py(4 tests),tests/test_ctest_registration.py(4 tests),git diff --checkcompileall, 520 files oftests/, the content guard)tests/test_imhex_patterns.py, as on the base. None added.Not run: the
*spelling ofall, the variable set from the shell instead of by the test, native Windows, Proton, AMD and Intel GPUs, the Vulkan validation layer (not installed), CTest itself (the executables were started directly), the translator's semantic suite (no Python or translator file changed) and a boot of the title.GPUs tested: NVIDIA GeForce RTX 4070, driver 620.73.04, Linux under Wine 11.22.
AI-assisted: yes (Claude Code).
Checklist
6293c1c4f.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.