leonida-shader: guard 32-lane host tests by the adapter's wave width #2920
Closed
github-bot
wants to merge 4 commits from
github-bot/gh-2920 into main
AGit
pull from: github-bot/gh-2920
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2920
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2920"
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?
@aznohonza on GitHub · 2026-12-01 18:23 UTC · original
aznohonza:gpu/warp-wave-guards→main· +151 −83 · 4 files · 4 commits · closed without mergingLEONIDA_WARP=1makesHost::new(false)return the software adapter, so tests that ask for "hardware only" still run on it. The software adapter takes 4-lane waves, while the translator lowers these programs for 32-lane host waves, so eight of theleonida-shadertests fail with that switch.Host::takes_waves_of(lanes)asks the adapter (D3D12_OPTIONS1) which program wave widths it accepts, and the tests that assume 32 skip a device that does not:valu_tests:run_cases_ontakes the required width (Nonekeeps the old behaviour). The quadmask and the two cross-wave LDS tests use a 32-lane path, and the whole-wave f64 test checks its own loop.pack_tests: the five host sites guard for 32 and printSKIP: the adapter does not run 32-lane waves.wave64_tests:host_32()is the hardware lookup plus the width check; all 14 sites use it, and the two manualD3D12_OPTIONS1queries now use the helper.Verification:
cargo xwin check --target x86_64-pc-windows-msvc --workspace --all-targets --lockedpasses, and-p leonida-shader --tests --features hostpasses too.Claimed in #2570 (RS-WARP-TEST-WAVES). AI-assisted.
The full
leonida-shadersuite on the software adapter still has four failures onbarycentric/rect; they are the DXIL validator refusing the shader (#2864), not wave width. With #2864's commit on this head the crate is 415 passed, 0 failed, 5 ignored on WARP.@merzleckeier on GitHub · 2026-12-01 18:37 UTC · original
Wave-width guard check on Radeon and RTX 4070 SUPER at
00e56f41onmain7fbdf851(Win64, Wine 11.22 / VKD3D-Proton 3.1.0, RADV 26.3.1 and NVIDIA 620.73.4 as reported by Wine). Six selected pack, VALU/LDS and wave64 tests returned success on each GPU for each build. On RADV,both_host_waves_observe_the_lds_flag_after_the_joinlogged a skip onmainbecause its old check required the maximum width to equal 32. The PR admitted the adapter and the dispatch assertions passed.For the negative control, an instrumented run logged the RTX device’s real Options1 range of 32–32 and supplied a 4–4 range to the PR’s predicate. All six selected cases guarded out their 32-lane hardware sections. An explicit
LEONIDA_WARP=1run logged that DXVK returned the first hardware adapter, so native Microsoft WARP remains unmeasured here.MEASURED with the repository’s synthetic fixtures. AI-assisted (Codex).
@Neutron-0 on GitHub · 2026-12-01 18:59 UTC · original
Verified on Windows 11, Rust 1.98.1, with the software adapter. The pull request says "this box has no D3D12 device, so the runs themselves were not repeated" - this box has one, and
LEONIDA_WARP=1reaches the software adapter, so the runs were repeated.The change does what it says.
cargo test -p leonida-shader --tests --features host --lockedwithLEONIDA_WARP=1:7fbdf851100e56f41bThe eight failures that are gone on the head are exactly the eight the pull request names -
pack_tests::a_packed_program_keeps_each_console_groups_memory_to_itself,pack_tests::a_packed_program_reads_the_lanes_of_its_own_console_group,valu_tests::ds_min_max_f32_order_floats_and_return_the_old_value,valu_tests::lds_subtracts_return_the_old_value_and_subtract,valu_tests::v_permlane16_and_x16_read_the_lanes_their_selectors_pick,valu_tests::whole_wave_f64_sum_and_cvt_f32_f64,wave64_tests::a_lane_mask_joined_with_a_number_is_read_as_the_number_it_isandwave64_tests::partial_dispatch_with_a_cross_half_wave_op_runs_in_32_lane_waves- so the count of eight is right, and on the head they skip with a named reason instead of failing.The four failures that are left are not about wave width, and they are not this pull request's to fix. They are:
and all four panic at the same place,
crates/leonida-shader/src/emit/mod.rs:3840:50, which is the.unwrap()on the DXIL validator's verdict inside the test helpervalidate()- the validator refuses the shader. That has nothing to do with the adapter: they fail the same way withLEONIDA_WARPunset, on this box's own card. The cause is thePSV0part's name table, and #2864 is the pull request that fixes it. Put #2864's commit on top of this head and the whole crate on the software adapter is green:00e56f41bplus #2864's commit,LEONIDA_WARP=1cargo test -p leonida-shader --tests --features host --lockedSo the pull request's own claim is complete once #2864 is in, and the four leftovers are worth saying out loud - otherwise the next person to run the suite on a machine with a
dxil.dllwill read them as this pull request's doing.One note on the helper, not blocking.
Host::takes_waves_of(lanes)readsD3D12_OPTIONS1and asks whether the adapter's range contains the width, which is the better question than the two it replaces: one of them askedWaveLaneCountMax != 32(so an adapter that took 16 to 64 lanes was refused) and the other askedcontains(&32)(so it was accepted). A device that reportsWaveLaneCountMin = 0because it does not support wave operations at all would answercontains(&32)as true, and the tests would run on it;WaveOpsis what says whether the adapter has wave operations at all, and the old code's first version checked it. It costs one field to askWaveOpsas well.Not checked: a 4-lane adapter as such (the software adapter here reports a wave width outside 32, which is the same branch the guard takes); the tests' behaviour on an adapter that takes 32 lanes but not 64; the
xwincross-build (only the native Windows build was run).@KelboLive on GitHub · 2026-12-01 19:06 UTC · original · reviewed
The guard shape is right:
D3D12_OPTIONS1is 32/32 on this card, 4/4 on WARP, and Arc's 16..32 still runs — so Intel's mixed widths are not hidden, and on a 32-lane host every test still executes (414/0/5 here, 500 s). The f64 guard is genuinely load-bearing: removing it under WARP fails at pipeline creation (valu_tests.rs:2349, "The parameter is incorrect"), while therun_cases_32mutation is inert at 4 lanes — which is fine, but means that one is only exercised on a host that is neither 32-wide nor WARP.Two nits before merge:
wave64_tests.rs:1358and:1954use a bareelse { return }, so a 4-lane or 64-only host reports a pass with no reason. The other 12 print. That contradicts the "named reason" claim, and it is exactly the failure mode this PR is meant to fix.takes_waves_ofdrops theWaveOpscheck the oldboth_host_wavesblock had. A device that reports the width range but not wave ops would be treated as runnable and fail at pipeline creation instead of skipping.Not blocking on either. Merge is clean against current main, and there is no file overlap with #2917 — conceptually they are adjacent and agree: this guard correctly lets Arc run the tests that #2917 would make it request 32-lane waves for.
@aznohonza on GitHub · 2026-12-01 19:14 UTC · original
Both nits fixed in
a06018f3e:partial_dispatch_with_a_cross_half_wave_op_runs_in_32_lane_wavesandone_d_wave64_group_skips_entry_ticket_barrier_and_keeps_thread_idsnow printno SM 6.6 device that runs 32-lane waves; not runbefore returning, like the other 12.takes_waves_ofnow requiresWaveOpsas well as the width range, so an adapter that reports the range but no wave operations skips instead of failing at pipeline creation.Thanks for the WARP run and the #2864 pointer — I added a line to the description so the four remaining validator failures are not read as wave-width ones. This box has no D3D12 device, so only the cross-build was repeated.
AI-assisted.
Pull request closed