leonida-shader: guard 32-lane host tests by the adapter's wave width #2964
Closed
github-bot
wants to merge 4 commits from
github-bot/gh-2964 into main
AGit
pull from: github-bot/gh-2964
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!2964
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2964"
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 21:55 UTC · original
gpu/warp-wave-guards→main· +151 −83 · 4 files · 4 commits · closed without mergingRe-created from the original #2920.
aznohonza/mandy-contribwas made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (422 state cannot be changed). Same branch, same head00a0681069b64b150fb287f6c8e0ee696e27caea. The original review thread is at #2920.LEONIDA_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.@KelboLive on GitHub · 2026-12-01 22:19 UTC · original · reviewed
Identical to #2920 (
00a068106), which I reviewed — the guard shape is right (32/32 here, 4/4 on WARP, Arc 16..32 still runs), andmerge-treeagainst current main is clean. No re-review needed; the two nits from there are non-blocking: two sites still skip silently (wave64_tests.rs:1358,:1954), andtakes_waves_ofdrops theWaveOpscheck the old block had.@merzleckeier on GitHub · 2026-12-01 22:21 UTC · original
The wave-width guard admits the physical readbacks and skips the four-lane fixture.
I tested
00a0681069b64b150fb287f6c8e0ee696e27caeaintegrated onto mainc4ca5761508f136c5530482093bb3053b0bad4fa, using Wine 11.22 / VKD3D-Proton 3.1.0. The pack, scalar quad and partial-dispatch selections each completed on RTX 4070 SUPER (620.73.4) and AMD Raphael (RADV 26.3.1).45, 1, 33, 0. The main controls also passed.The observed source on this head also requires
waves.WaveOps.as_bool()intakes_waves_of. The injected range exercises the width branch on physical devices. Native WARP was outside this fixture. AI-assisted, independently verified against the raw results.@aznohonza on GitHub · 2026-12-01 22:28 UTC · original
Thanks — the device matrix matches what the guard is for.
On the two nits: I think they are from the earlier head. At
00a068106both sites print the named skip (wave64_tests.rs:1358and:1954carryeprintln!("no SM 6.6 device that runs 32-lane waves; not run")), andtakes_waves_of(emit/host.rs:155) requireswaves.WaveOps.as_bool()before the width range. That wasa06018f3e, included in the head you reviewed. Nothing else changed on this branch.AI-assisted.
@ammonium231 on GitHub · 2026-12-02 01:19 UTC · original
RTX 3090 / 621.47,
00a068106merged onto main5d06e4793(hardware waves 32..32): cargo test -p leonida-shader --locked is 420 passed, 0 failed, 5 ignored on both trees. 32-lane hardware cases ran. WARP 32-lane cases now skip, and they didn't run on main either.@imShangLi on GitHub · 2026-12-02 05:32 UTC · original
VERIFY-2964 — Linux, Fedora 45, Rust 1.98.1 (the pinned toolchain), no GPU device, no game files
Verdict: MIXED. The change is a clean, correct refactor that I reviewed statically and found sound — it removes a real panic path and unifies four inconsistent adapter guards behind one method. But every file it touches is
#[cfg(... windows ...)], so neither the new method nor any of its tests compile or run on Linux; the repository's ownred_green.pyreturns "no red" here and I have no runtime evidence for it. This is a static review only.Head
00a0681069b64b150fb287f6c8e0ee696e27caea, base the currentmain(origin/main8422def759cda12c89f918438eeb8d53dd5972a6), merge base60f7dcd904cfc5874a1da62c4297a14e62bca74a, 4 files, +151/−83:d3d12/crates/leonida-shader/src/emit/host.rs(+19/−0)d3d12/crates/leonida-shader/src/emit/pack_tests.rs(+20/−0)d3d12/crates/leonida-shader/src/emit/valu_tests.rs(+71/−22)d3d12/crates/leonida-shader/src/emit/wave64_tests.rs(+41/−61)1. What it changes
It adds one method to the host D3D12 adapter and routes every 32-lane host test through it.
In
host.rsit adds the reusable query (the heart of the change):Before, the same idea was done four different ways inline in the tests, and not all of them were safe:
wave64_tests.rs'sboth_host_waves_observe_the_lds_flag_after_the_joincalledCheckFeatureSupport(...).expect("query host wave sizes")— a panic if the feature query fails — then checkedWaveLaneCountMax != 32.a_first_lane_read_of_a_wave_alike_sum_under_a_wave_alike_loopdid a different inline query checking only(WaveLaneCountMin..=WaveLaneCountMax).contains(&32).valu_tests.rs'srun_cases_onhad a singleran == 0escape hatch that only covered "hardware-only, no hardware", not a width mismatch.The pull request deletes both inline
CheckFeatureSupportblocks (and their now-unneededuse windows::...D3D12_OPTIONS1imports), adds alanes: Option<u32>parameter torun_cases_onwithrun_cases/run_cases_32wrappers, and makes the skip non-fatal:pack_tests.rsgets the sameif !host.takes_waves_of(32) { eprintln!("SKIP: ..."); return; }guard in its fiveHost::new(false)tests.wave64_tests.rsintroduces ahost_32()helper and switches ~14 tests fromHost::new(false)to it.2. The new test checks the property that matters
This is a test-only change plus one production helper; there is no new assertion that fails on
main. The property it adds is: a test that assumes the card's 32-lane waves must ask the adapter first, and skip rather than run wrong or panic. That property is only observable on Windows with a non-32-lane adapter (e.g. a software adapter that runs 4-lane waves) or when the feature query fails. The concrete defects it removes are the.expect("query host wave sizes")panic and thepanic!("{label}: compute_pipeline failed")that a WARP pipeline creation of aWaveSize(32)program would hit (the code's own comment says "WARP does not support fixed WaveSize(32) on SM 6.6"). I could not execute any of this on Linux —Host::newneeds a D3D12 device andtakes_waves_ofneedsCheckFeatureSupport, neither of which exists off Windows.3. What the tests do here
python3 -I scripts/red_green.py pr2964 --no-fetch --crate leonida-shader --work-dir .../rg-2964(verdictno red, exit 1):origin/main+ this PR's tests only)origin/main+ this PR merged)origin/mainon its ownNothing failed on either side and no test moved red→green, because none of the four changed files is compiled on Linux:
emit/mod.rsgates them all off.So the crate's Linux suite is byte-for-byte unaffected by this pull request, and the red/green tool has nothing to discriminate. That "252 on both" is a true statement about Linux, but it is not a verification of this PR — it is the absence of one.
4. Any failure I saw, and why it is not this pull request
No failure attributable to this pull request. Two things I want to state plainly so they are not misread:
00a06810, a merge oforigin/mainintogpu/warp-wave-guards) runs 246 Linux tests, not 252, because that branch predates ~6 Linux tests thatmainhas since gained.red_green.pytests against currentmain(where the green side is 252), so this is a stale-branch artifact, not a regression the PR causes.source_hash_tests(the shared-CARGO_TARGET_DIRtrap in the brief) never appeared: I gave this run its own--work-dir, and both sides ran in one worktree with one target dir as the tool intends.5. What I did not check
takes_waves_ofor the rewrittenrun_cases_on/host_32— on Linux these files are not compiled at all, so a syntax or type error in them would not be caught by any Linux build. My "it is correct" is a reading of the diff, not a compiler's..expect("query host wave sizes")panic or the WARPcompute_pipelinepanic, nor confirm the new guards prevent them — that needs a Windows box with a non-32-lane adapter.run_gpu_tests.py) or Wine/Proton (run_wine_tests.py) suites. Not run; they are Windows/Wine paths.Net: on static review this meets the repository's bar — it fixes the root cause (one shared query instead of stacked inline guards), removes a panic, keeps the code simple and modular, and adds no workaround. I just could not run it here.
@MoonEyes on GitHub · 2026-12-02 12:33 UTC · original
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
@Kal0s-design on GitHub · 2026-12-02 15:56 UTC · original
Ran natively on Windows 11, head
00a068106merged into currentmain(3c106eb2f, clean merge). The one exception is the PR's default full run (1,149 s), which was on the merge into83046a713, the previousmain;leonida-shaderhas no changes between the two. Allmainbaselines are3c106eb2f.Wave widths (measured, throwaway test printing
D3D12_OPTIONS1)Host::new(false), cardHost::new(true), WARPHost::new(false)withLEONIDA_WARP=1Full suite (measured,
cargo test -p leonida-shader --locked)mainLEONIDA_WARP=1The 8
mainfailures under WARP are the ones the PR describes: 2 pack,ds_min_max_f32_order…,lds_subtracts_return…,v_permlane16…,whole_wave_f64…,a_lane_mask_joined…,partial_dispatch…. The fourbarycentric/rectvalidator failures mentioned in the PR body did not occur on currentmain.New: the PR also drops WARP legs that ran and passed on
main(measured)I added a temporary
eprintln!afterran += 1inrun_cases_onand ran the four tests one at a time with the card present:main: WARP legs run and passedscalar_quad_masks_pack_nibbles_and_set_sccds_min_max_f32_are_atomic_across_waveslds_subtracts_are_atomic_across_waveswhole_wave_f64_sum_and_cvt_f32_f64So 13 of the 14
warp: … skippedlines in the default PR run are checks that ran and passed onmain. Only thewhole_wave_f64one replaces an existing skip. This differs from the earlier note that the WARP 32-lane cases did not run onmain, which holds only forwhole_wave_f64.Under
LEONIDA_WARP=1(one test at a time, per-test output attributed), 38 tests print a 32-lane skip on the PR. Onmain:valu_testsabove (instrumented),wave64_tests::a_16_bit_sum_rounds_to_nearest_when_asked_to(it prints its WARP results onmain), and the two pack testsa_grid_past_what_one_dimension_holds…anda_packed_program_runs_every_console_group_once…. Their helperrun()creates the pipeline with.expect(…), so a pass means the dispatch ran;one_d_wave64_group_skips_entry_ticket_barrier…continues silently on a pipeline refusal.These 6 pass at 4 lanes, so a 32-lane guard on them is stricter than the failures require. On a 32-wide card no test is skipped on both legs: every guarded test still runs its hardware leg.
Skip visibility (measured)
Under
LEONIDA_WARP=1without--nocapture, 0 skip lines are visible and libtest reports every guarded test asok. With--nocapture, each skip is named: 4×SKIP: the adapter does not run 32-lane waves, 34×hardware: … skipped, 14×warp: … skipped, 58×no SM 6.6 device that runs 32-lane waves; not run, plus the per-shape lines.Clippy (measured)
cargo clippy -p leonida-shader --features host --locked(lib, the feature theleonidaapp enables):main0 warnings, PR 1:method takes_waves_of is never used(dead_code,emit/host.rs:143), because only test modules call it.--all-targetsis otherwise identical tomain. The d3d12 clippy job is report-only, so this does not fail CI.#[cfg(test)]on the method would remove the warning.On the in-game request (reading only): the changed test modules are
cfg(test). The only code this PR adds to a non-test build istakes_waves_of, and thedead_codewarning above shows nothing calls it there.Not checked: Arc/AMD or any adapter with a range other than 32..32 or 4..4 natively, the debug layer, an in-game run (requested above; not done here).
GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).
@MoonEyes on GitHub · 2026-12-02 17:06 UTC · original
RUN (in game, batch of eleven render-path pull requests), each head merged with
git merge --no-ffonto main3c106eb2f, in one build: #3071c2065b540, #298265155eceb, #296400a068106, #310779333e26b, #2833823087ec3, #2947b07f64346, #291933e2e4c13, #2962a4a26ec63, #2847c8b950cb4, #3114c4ebe52de, #26640e2b6287c. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps today on main with single pull requests or other batches. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; free system memory was low (median 0.6 GB); arrival in the world was driven by keys and not checked on pictures. An earlier attempt of this batch is not counted: two runs were started at the same time by mistake on one GPU (no device loss in either, but the measure is not clean).
AI-assisted (Claude Code).
@MoonEyes on GitHub · 2026-12-02 18:18 UTC · original
Verification of #2964 (third party, code review on Linux; not built: the touched files are Windows-only,
#[cfg(windows)])00a0681069b64b150fb287f6c8e0ee696e27caea(4 files underleonida-shader/src/emit/, +151/-83).This is the same head as the closed #2920.
60f7dcd90.git merge-tree --write-tree origin/main pr/2964againstmain45dc41f95is clean(355 commits behind). CI on the head: 12/12 success.
python -I scripts/check_no_game_data.pyon the 4 files: exit 0.3c106eb2fthat includes00a068106(PASS).
Review
LEONIDA_WARP=1makesHost::new(false)return WARP, which runs 4-lane waves. Programs lowered for32-lane host waves then fail there. Guarding on what the device reports is the right fix, not a skip list:
takes_waves_of(emit/host.rs) requiresWaveOpsand32 in WaveLaneCountMin..=Max. Hardware still runsevery case. RDNA (32..64) and NVIDIA (32..32) both pass the check, as the reviewers measured.
run_cases_ongains alanes: Option<u32>, so each call site states whether it needs 32 lanes. Cases thatare width-independent pass
Noneand still run on WARP. Each skip prints a named line, so nothing is silent.if !host.takes_waves_of(32) { eprintln!("SKIP: ..."); return; }invalu_tests.rs/pack_tests.rsdo whatthe new
host_32()(inwave64_tests.rs) already does. One shared helper inemit/host.rswould keep themessage and the check in one place. Not blocking.
stops exercising them. That matches what the tests can honestly prove there. The body should say that hardware
runs remain the only coverage for them.
Process
Verdict: ready (not built here). The disclosure needs the model names.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@fiestorra on GitHub · 2026-12-03 05:38 UTC · original
VERIFY-2964 — 414 tests en verde, y el cambio es de los que evitan un rojo ajeno
El título: «guard 32-lane host tests by the adapter's wave width» — y eso es exactamente lo que esta noche me faltó: tests que asumen 32 lanes en un adaptador que tiene 64
fallan en una máquina y pasan en otra, y el que lo lee no sabe si el código está mal.Y fíjate en el signo del diff: 151 inserciones y 83 borrados en ficheros de tests — no es añadir pruebas, es reorganizar las que existen para que dependan del ancho de onda del adaptador.
wave64_tests.rs+102/−… es el fichero que se separa, yvalu_tests.rs+93 pierde las que no eran suyas.Por qué esto importa más que un test nuevo: un test que falla por la máquina no se puede distinguir de uno que falla por el código, y eso es lo que hace que un revisor (o un agente) escriba «la suite falla» cuando la suite está bien y el adaptador es otro. Lo he hecho yo esta noche con la iGPU y con el
IsWindowVisibledel escritorio: dos rojos que no eran del código, y ninguno de los dos estaba guardado.Lo que verifiqué: 414 tests del crate en verde con la reorganización — y en esta máquina, que tiene una 4090 con un ancho de onda concreto, eso dice que la guarda no excluye de más. Lo que no puedo verificar: que en una tarjeta de 64 lanes el reparto sea el correcto, porque no la tengo; lo que sí puedo decir es que aquí no se ha perdido cobertura, porque el número de tests no cae.
Pull request closed