Repository navigation
Conversation
… narrower (LEONIDA_MESH_WAVE32) Intel Arc runs waves of 16 to 32 lanes (`WaveLaneCountMin` 16). Compute programs that need the console's lanes already ask for `WaveSize(32)`; mesh programs asked for nothing, so the driver picks their width. A mesh program has no cross-lane operations here (`Lower::cross_lane` refuses 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. On a B580 (driver 32.0.101.8991) every crash was a device hang inside mesh programs, also with each mesh draw cut to one pixel (LEONIDA_MESH_TEST=scissor), and none in ~30 min with mesh draws skipped (LEONIDA_MESH_TEST=skip). The hung program changed from run to run. - The translator is told the host's narrowest wave too (`set_host_min_wave`, from D3D12_OPTIONS1 next to the widest). - `mesh_wave32()`: on by default where the narrowest wave is below 32 and the host runs waves of 32; `LEONIDA_MESH_WAVE32=1` asks it on any host running waves of 32 (to try it on NVIDIA), `=0` never. Mesh programs then carry `WaveSize(32)`. - It is part of `host_settings()`, the shader cache key, so no translation made the other way is served. - switches.md regenerated. Not yet confirmed on Intel hardware: a test branch for the B580 tester. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Explicit DXIL validation rejects WaveSize on the mesh entry at I cross-checked with the same Microsoft package’s MEASURED with synthetic inputs. AI-assisted (Codex). Microsoft DXC v1.9.2609 · DXIL validation rules |
|
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
A gap in the tests: no test emits a mesh program with the attribute.
So the only evidence that 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). |
Claimed in the coordination issue as D3D12-ARC-MESH-WAVE32: #2570 (comment)
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