shader: mesh programs ask for waves of 32 on hosts whose waves can be narrower, Intel Arc (D3D12-ARC-MESH-WAVE32) #2917
Closed
github-bot
wants to merge 2 commits from
github-bot/gh-2917 into main
AGit
pull from: github-bot/gh-2917
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!2917
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2917"
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?
@OreoFR on GitHub · 2026-12-01 18:05 UTC · original
OreoFR:fix/arc-mesh-wave32→main· +86 −7 · 5 files · 2 commits · closed without mergingClaimed in the coordination issue as D3D12-ARC-MESH-WAVE32: #2570
What and why
Intel Arc runs waves of 16 to 32 lanes (
D3D12_OPTIONS1.WaveLaneCountMin16,Max32). Compute programs that need the console's lanes already ask forWaveSize(32); mesh programs asked for nothing, so on Arc the driver picks their width. A mesh program has no cross-lane operations here (Lower::cross_lanerefuses them), but the console's code still counts on its group being whole waves of 32 or 64: LDS shared within a wave without barriers, branches the wave takes together. In waves of 16, two host waves run what was one console wave, unordered.What a B580 tester saw (Intel Arc B580 12 GB, driver 32.0.101.8991, logs kept private):
LEONIDA_INDIRECT_BATCH=0,LEONIDA_MESH_OUTPUT_STRICT=1,LEONIDA_LIBRARY_MAP=0,LEONIDA_MESH_TEST=keep:<hex>DXGI_ERROR_DEVICE_HUNGafter 6 to 17.5 min; DRED stops inside mesh draws (direct and indirect), a different mesh program each timeLEONIDA_MESH_TEST=scissor(mesh programs run, one pixel drawn)LEONIDA_MESH_TEST=skip(no mesh draws)So the hang is in the mesh programs' own execution, on Intel only, and not in one program.
The change
set_host_min_wave, fromD3D12_OPTIONS1next to the widest (leonida-gpu/src/host.rs).mesh_wave32()(leonida-shader/src/emit/lower.rs): on by default where the narrowest wave is below 32 and the host runs waves of 32 (Arc); off on NVIDIA (32 only) and AMD RDNA (32 and 64), and on hosts without waves of 32 (64 only).LEONIDA_MESH_WAVE32=1asks it on any host running waves of 32, to try it on NVIDIA;=0never.WaveSize(32)(DXIL entry property and PSV0 lanes).host_settings(), so the shader cache never serves a translation made the other way. Like any translator change, this one retranslates every shader once on every machine; on NVIDIA and AMD the translations are then the same as before.switches.mdregenerated.Tests
emit::lower::mesh_wave32_tests::mesh_programs_ask_for_waves_of_32_only_where_the_driver_could_pick_narrower(the decision for Intel, NVIDIA, AMD RDNA, 64-only and unknown hosts).a10d3a0fd,main27613ab6bmerged in), RTX 4070 Laptop, Windows 11:cargo test --locked -p leonida-gpu633 passed / 0 failed;cargo test --locked -p leonida-shader415 passed / 0 failed (main's 414 plus the new test).-SeriesS -NoDlss -NoFrameGen,-NoPrecompile,LEONIDA_MESH_WAVE32=1forced: 240 s in the world, 1,191 mesh programs translated with the attribute, mesh pipelines made and drawn (~4,500 draws a frame), 0ERRORlines, no device loss. So dxil.dll's validator and the driver takeWaveSize(32)on mesh programs. (Frame rate not comparable: shaders translated during the run.)Asking for
LEONIDA_D3D12_DRED=light, noLEONIDA_MESH_TEST.lower.rsby someone who knows the mesh path.AI-assisted: yes, Claude Code agent
oreofr-agentfor OreoFR. Tested on an RTX 4070 Laptop (NVIDIA 621.40), Windows 11.🤖 Generated with Claude Code
@merzleckeier on GitHub · 2026-12-01 18:17 UTC · original
Explicit DXIL validation rejects WaveSize on the mesh entry at
a10d3a0f+7fbdf851. A synthetic triangle from the existing translator fixture emits PSV032..32with the 16–32 host policy and withLEONIDA_MESH_WAVE32=1on the 32–32 host policy. The official x64dxil.dllfrom Microsoft DXC v1.9.2609 rejects both modules before PSO creation withWaveSize only allowed on compute or node shaders.I cross-checked with the same Microsoft package’s
dxc.exe. A standalone HLSL mesh entry compiles inms_6_6andms_6_8. Adding only[WaveSize(32)]produces the same diagnostic in both profiles. The main, ordinary host defaults, and override-off translator controls validate and draw 256/256 expected pixels under Wine 11.22 / VKD3D-Proton 3.1.0 on RADV and the RTX 4070 SUPER. The 16–32 case is a simulated translation policy. The measured Intel criteria here are serialization and validation.MEASURED with synthetic inputs. AI-assisted (Codex). Microsoft DXC v1.9.2609 · DXIL validation rules
@Kal0s-design on GitHub · 2026-12-01 18:18 UTC · original
Checked on Windows 11 on an NVIDIA desktop card (native driver), rustc 1.98.1. That is the "nothing changes" side; I have no Arc.
Head
a10d3a0fd, which already containsmaind2a564b66:cargo test -p leonida-shader --lib: 415 passed, 0 failed, 5 ignored. That ismain's 414 plus the new test, as in the description. The first run showedsource_hash_tests::the_source_hash_leaves_the_test_modules_outfailing, but that was my shared target dir keeping an oldbuild.rsoutput; after touchingbuild.rsit passes. Not related to this PR._ => runs_32 && min < 32changed to_ => runs_32(on for every host that runs 32),mesh_programs_ask_for_waves_of_32_only_where_the_driver_could_pick_narrowerfails atlower.rs:1740, on the NVIDIA(32, 32)case.A gap in the tests: no test emits a mesh program with the attribute.
mesh_wave32_foronly.HOST_MIN_WAVEis only set byleonida-gpu'screate(), so inleonida-shader's own tests it stays0.mesh_wave32()is then false even withLEONIDA_MESH_WAVE32=1, and thes.wave_size = Some(32)line in the mesh prologue never runs under test.dxil.dlland draws them,emit::diff_tests::translated_mesh_shaders_draw_as_pc_ones, skips here:no console or PC compiler; skipped. It would not set the minimum wave either.So the only evidence that
dxil.dlland a driver takeWaveSize(32)on a translated mesh program is your forced in-game run. A small test would close that, and would run on any Windows machine withdxil.dll: callset_host_min_wave(16)with a host max wave of 32, translate one mesh program, assert that the entry carries wave size 32, and validate it.Not checked: Intel Arc, and the game.
GPUs tested: one NVIDIA desktop card (unit tests only; the attribute is off there by default).
AI-assisted: yes (Claude Code).
@KelboLive on GitHub · 2026-12-01 18:57 UTC · original · requested changes
Blocking:
s.wave_size = Some(32)(lower.rs:2867-2869) writes DXIL entry property 11 (shader.rs:1023-1027) and PSV0 32/32 (container.rs:194-196), but DXIL permitsWaveSizeonly on compute or node entries. I reproduced it end to end:lower_meshwith no host policy validates clean.(16,32)) is rejected bydxil.dll1.9.2609:Function: main: error: WaveSize only allowed on compute or node shaders/Validation failed.Same result throughdxv.exe.[WaveSize(32)]onms_6_6andms_6_8directly: "attribute WaveSize only allowed on compute or node shaders".So the forced NVIDIA run shows the driver tolerated invalid DXIL, not that the validator accepts it — and
leonida translate --validatewould fail on Arc. Until there is a legal way to pin mesh wave width (there is none in DXIL today), please don't emit this.The decision logic itself is fine, and the new test covers it (mutating
_ => runs_32 && min < 32to_ => runs_32fails on the NVIDIA(32,32)case). Two caveats:HOST_MIN_WAVEis only set byleonida-gpu'sHost::create, so inleonida-shadertests it stays 0, and the offline tools (apps/leonida/src/main.rs:229-230,translate.rs:250) set only the max wave —translate --validatecannot reproduce the Arc policy.host_settings()grows 4→5 (lower.rs:1892-1900), so every host rekeys and retranslates once, not just Intel. Worth saying in the body.Non-Intel behaviour is otherwise unchanged,
d3d12_switches.py --checkpasses, 415/0/5 on the shader crate, and merge is clean (also clean combined with #2920 and #2887).@OreoFR on GitHub · 2026-12-01 19:04 UTC · original
Result on Intel Arc: the hang is not fixed. Moving this back to draft.
The B580 tester (Intel Arc B580 12 GB, driver 32.0.101.8991,
LEONIDA_D3D12_DRED=light,LEONIDA_LIBRARY_MAP=0, noLEONIDA_MESH_TEST) built this head,a10d3a0fd(confirmed withgit log -1), and played into the Mandy mission:DXGI_ERROR_DEVICE_HUNGfamily), with a page fault at an address nothing owns, in the same0x8000_xxxx_x000area as the earlier runs.DispatchMesh, 1 to 16 groups), like before.host wave lanes min=16 max=32and noLEONIDA_MESH_WAVE32, so the default putWaveSize(32)on the mesh programs.So narrower waves are not the cause of the hang (one run, but within the 6 to 17.5 min range of the runs without this change). What still holds: the hang is inside mesh program execution (
LEONIDA_MESH_TEST=skip: ~30 min, no hang;scissor: hang). The outdoor picture looked better at first, but the full-white frames came back while driving, so no claim on that either.I keep the branch and this pull request as a draft for now; I will close it unless a later run gives it a reason to exist. Logs stay private.
@MoonEyes on GitHub · 2026-12-02 12:18 UTC · original
Closing: this pull request no longer applies to current
main(merge conflict ind3d12/crates/leonida-gpu/src/shader_cache.rs,d3d12/crates/leonida-shader/src/emit/lower.rs,d3d12/crates/leonida-shader/src/emit/mod.rs,d3d12/docs/switches.md), and open pull requests that have fallen out of step withmainare being closed so the list stays workable. If you still want this change, rebase it on currentmainand reopen it (or open a new pull request); it will be looked at again.AI-assisted (Claude Code).
Pull request closed