D3D12.X: log once which form wave64 programs get, and why (#1407) #1410

Open
github-bot wants to merge 1 commit from github-bot/gh-1410 into main AGit
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-24 15:42 UTC · original
tiagonogueiraa-bit:wave-mode-log → main · +47 −2 · 1 files · 1 commits · open

Which form wave64 programs get decides whether cross-lane results are right: compute / mesh / geometry split into 32-lane halves or native wave64, and VS / PS with or without the upper-lanes form. A wrong choice shows nothing else in the log. It was decided silently from the device's wave range, XCL_SPLIT_WAVE64=1, or an unknown range. Fixes #1407.

wave32_only_for_device and graphics_wave32_for_device now log one line the first time either runs, for example:

[SHADER] wave mode: wave64 compute / mesh / geometry split into 32-lane halves, wave64 VS / PS with the upper-lanes form (the driver may pick 32 lanes) (device waves 32-32)

What is in it

  • crates/xcl/src/gpu/recomp/pso.rs:
    • log_wave_mode (once per process, std::sync::Once) and wave_mode_line, a pure function for the text.
    • Both *_for_device functions read the wave range once and log it.
    • Unit test wave_mode_line_names_the_form_and_why: 32–32, 32–64, 64–64, the XCL_SPLIT_WAVE64=1 override and an unknown range.

Tested

  • macOS, Rust stable:
    • cargo check -p xcl --lib --tests --target x86_64-pc-windows-msvc: no errors (C code stubbed, nothing linked).
    • The unit test's assertions pass, compiled with rustc against copies of wave32_only, graphics_wave32 and wave_mode_line.
  • @⁠MiharaxD, native Windows, RTX 3070 Ti (32-lane waves), on this head b63a67b (report):
    • cargo test --workspace --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignored, with SKIPPED (no wave64) gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware. wave_mode_line_names_the_form_and_why passes.
    • In a 60 s retail run, the log has the line exactly once, at 2.6 s: [SHADER] wave mode: wave64 compute / mesh / geometry split into 32-lane halves, wave64 VS / PS with the upper-lanes form (the driver may pick 32 lanes) (device waves 32-32).

Regression run
By @⁠MiharaxD: scripts/smoke.ps1 -Seconds 60, RTX 3070 Ti, start screen, no input, unedited, from the report.

main:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 3070 Ti
title: game
seconds: 60
exit: 0x0
frames shown: 1589 (PresentX 1589)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15376 MB

PR:

xcl-smoke v1
commit: b63a67b175d83cc9f9b28cf0ed59555635ec7b14
gpu: NVIDIA GeForce RTX 3070 Ti
title: game
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15012 MB

Not tested

  • The log line on AMD / Intel and with native wave64, XCL_SPLIT_WAVE64=1 or an unknown range in a real run; the unit test covers those texts.
  • A retail title.

AI use

  • Claude Code with Claude Opus 5.5. It wrote the change, the test and this description, and ran the macOS checks.

🤖 Generated with Claude Code

**@⁠tiagonogueiraa-bit** on GitHub · 2026-11-24 15:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/1410) `tiagonogueiraa-bit:wave-mode-log` → `main` · +47 −2 · 1 files · 1 commits · open Which form wave64 programs get decides whether cross-lane results are right: compute / mesh / geometry split into 32-lane halves or native wave64, and VS / PS with or without the upper-lanes form. A wrong choice shows nothing else in the log. It was decided silently from the device's wave range, `XCL_SPLIT_WAVE64=1`, or an unknown range. Fixes #1407. `wave32_only_for_device` and `graphics_wave32_for_device` now log one line the first time either runs, for example: ``` [SHADER] wave mode: wave64 compute / mesh / geometry split into 32-lane halves, wave64 VS / PS with the upper-lanes form (the driver may pick 32 lanes) (device waves 32-32) ``` **What is in it** - `crates/xcl/src/gpu/recomp/pso.rs`: - `log_wave_mode` (once per process, `std::sync::Once`) and `wave_mode_line`, a pure function for the text. - Both `*_for_device` functions read the wave range once and log it. - Unit test `wave_mode_line_names_the_form_and_why`: 32–32, 32–64, 64–64, the `XCL_SPLIT_WAVE64=1` override and an unknown range. **Tested** - macOS, Rust stable: - `cargo check -p xcl --lib --tests --target x86_64-pc-windows-msvc`: no errors (C code stubbed, nothing linked). - The unit test's assertions pass, compiled with `rustc` against copies of `wave32_only`, `graphics_wave32` and `wave_mode_line`. - @⁠MiharaxD, native Windows, RTX 3070 Ti (32-lane waves), on this head `b63a67b` ([report](https://github.com/ivall/xcl/pull/1410#issuecomment-7136969496)): - `cargo test --workspace --no-fail-fast -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, with SKIPPED (no wave64) `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. `wave_mode_line_names_the_form_and_why` passes. - In a 60 s retail run, the log has the line exactly once, at 2.6 s: `[SHADER] wave mode: wave64 compute / mesh / geometry split into 32-lane halves, wave64 VS / PS with the upper-lanes form (the driver may pick 32 lanes) (device waves 32-32)`. **Regression run** By @⁠MiharaxD: `scripts/smoke.ps1 -Seconds 60`, RTX 3070 Ti, start screen, no input, unedited, from [the report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1410). main: ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 3070 Ti title: game seconds: 60 exit: 0x0 frames shown: 1589 (PresentX 1589) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15376 MB ``` PR: ``` xcl-smoke v1 commit: b63a67b175d83cc9f9b28cf0ed59555635ec7b14 gpu: NVIDIA GeForce RTX 3070 Ti title: game seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15012 MB ``` **Not tested** - The log line on AMD / Intel and with native wave64, `XCL_SPLIT_WAVE64=1` or an unknown range in a real run; the unit test covers those texts. - A retail title. **AI use** - Claude Code with Claude Opus 5.5. It wrote the change, the test and this description, and ran the macOS checks. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Which form wave64 programs get decides whether cross-lane results are
right: compute / mesh / geometry split into 32-lane halves or native
wave64, and VS / PS with or without the upper-lanes form. A wrong choice
shows nothing else in the log. It was decided silently from the device's
wave range, XCL_SPLIT_WAVE64=1, or an unknown range.

wave32_only_for_device and graphics_wave32_for_device now log one
`[SHADER] wave mode:` line the first time either runs, e.g.
"wave64 compute / mesh / geometry split into 32-lane halves, wave64
VS / PS with the upper-lanes form (the driver may pick 32 lanes)
(device waves 32-32)". The text comes from wave_mode_line, which has a
unit test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:53:06 +00:00
Author
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-24 16:02 UTC · original

Thank you, @⁠MiharaxD! The suite and the log line from a real run are in Tested, and the PR is ready for review.

One small request: your smoke blocks' title: line is the game folder's name, which names the game, and the maintainer asks that it stay out of PRs. Blocks can't be edited by hand, so I linked your pair instead of pasting it. If you rerun with the folder renamed to something neutral (e.g. game), I'll paste both blocks as they are.

Written with Claude Code (Claude Opus 5.5).

**@⁠tiagonogueiraa-bit** on GitHub · 2026-11-24 16:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1410#issuecomment-7137016297) Thank you, @⁠MiharaxD! The suite and the log line from a real run are in **Tested**, and the PR is ready for review. One small request: your smoke blocks' `title:` line is the game folder's name, which names the game, and the maintainer asks that it stay out of PRs. Blocks can't be edited by hand, so I linked your pair instead of pasting it. If you rerun with the folder renamed to something neutral (e.g. `game`), I'll paste both blocks as they are. Written with Claude Code (Claude Opus 5.5).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 17:08 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 17:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1410#issuecomment-7138746896) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. Thanks!
Author
Owner

@⁠MiharaxD on GitHub · 2026-11-24 18:59 UTC · original

Reposted: the earlier copy of this comment was deleted.

Windows run on a 32-lane NVIDIA card, head b63a67b (on main 930e8b4), which covers the "not run on Windows" and "the log line in a real run" lines.

Tested

  • RTX 3070 Ti 8 GB (driver 621.01), Intel i5-14400F, 32 GB RAM, Windows 11 Pro 10.0.26300, Rust 1.100.0, DXC 1.9.2602.17.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 (debug) on b63a67b: 752 passed, 0 failed, 41 ignored (lib tests 708 / 0 / 21). wave_mode_line_names_the_form_and_why passes. The build's one warning (fetch_update deprecated, hle/xgameruntime/mod.rs:547) is not from this PR.
  • SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • Retail title, the PR's smoke run below: the log has the line exactly once, at 2.7 s:
    [SHADER] wave mode: wave64 compute / mesh / geometry split into 32-lane halves, wave64 VS / PS with the upper-lanes form (the driver may pick 32 lanes) (device waves 32-32)
    
    That matches this card: 32-32 device waves, so split wave64 for both.

Regression run
scripts/smoke.ps1 -Game <game folder> -Seconds 60 (release builds, start screen, no input; game folder renamed to game, so title: names no title). main is now 9e3831e; the PR is still on 930e8b4:

main:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 3070 Ti
title: game
seconds: 60
exit: 0x0
frames shown: 1589 (PresentX 1589)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15376 MB

this PR's head:

xcl-smoke v1
commit: b63a67b175d83cc9f9b28cf0ed59555635ec7b14
gpu: NVIDIA GeForce RTX 3070 Ti
title: game
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15012 MB

Not tested

  • XCL_SPLIT_WAVE64=1 and an unknown wave range in a real run: only the unit test covers them.
  • AMD / Intel, native wave64 (the native wave64 and as they are forms).
  • This PR merged into current main: it is tested as pushed, on 930e8b4.

AI use: Claude Code (Claude Opus 5.5) built the PR, ran the tests and both smoke runs, read the log and wrote this report; I checked it before posting.

**@⁠MiharaxD** on GitHub · 2026-11-24 18:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/1410#issuecomment-7141447356) *Reposted: the earlier copy of this comment was deleted.* Windows run on a 32-lane NVIDIA card, head `b63a67b` (on `main` `930e8b4`), which covers the "not run on Windows" and "the log line in a real run" lines. **Tested** - RTX 3070 Ti 8 GB (driver 621.01), Intel i5-14400F, 32 GB RAM, Windows 11 Pro 10.0.26300, Rust 1.100.0, DXC 1.9.2602.17. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug) on `b63a67b`: **752 passed, 0 failed, 41 ignored** (lib tests 708 / 0 / 21). `wave_mode_line_names_the_form_and_why` passes. The build's one warning (`fetch_update` deprecated, `hle/xgameruntime/mod.rs:547`) is not from this PR. - SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - Retail title, the PR's smoke run below: the log has the line exactly once, at 2.7 s: ``` [SHADER] wave mode: wave64 compute / mesh / geometry split into 32-lane halves, wave64 VS / PS with the upper-lanes form (the driver may pick 32 lanes) (device waves 32-32) ``` That matches this card: 32-32 device waves, so split wave64 for both. **Regression run** `scripts/smoke.ps1 -Game <game folder> -Seconds 60` (release builds, start screen, no input; game folder renamed to `game`, so `title:` names no title). `main` is now `9e3831e`; the PR is still on `930e8b4`: main: ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 3070 Ti title: game seconds: 60 exit: 0x0 frames shown: 1589 (PresentX 1589) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15376 MB ``` this PR's head: ``` xcl-smoke v1 commit: b63a67b175d83cc9f9b28cf0ed59555635ec7b14 gpu: NVIDIA GeForce RTX 3070 Ti title: game seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15012 MB ``` **Not tested** - `XCL_SPLIT_WAVE64=1` and an unknown wave range in a real run: only the unit test covers them. - AMD / Intel, native wave64 (the `native wave64` and `as they are` forms). - This PR merged into current `main`: it is tested as pushed, on `930e8b4`. **AI use:** Claude Code (Claude Opus 5.5) built the PR, ran the tests and both smoke runs, read the log and wrote this report; I checked it before posting.
Author
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-24 19:22 UTC · original

Thank you for the rerun with a neutral folder, @⁠MiharaxD! Both blocks are under Regression run exactly as posted.

Written with Claude Code (Claude Opus 5.5).

**@⁠tiagonogueiraa-bit** on GitHub · 2026-11-24 19:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/1410#issuecomment-7141991270) Thank you for the rerun with a neutral folder, @⁠MiharaxD! Both blocks are under **Regression run** exactly as posted. Written with Claude Code (Claude Opus 5.5).
Author
Owner

@⁠Mischief8713 on GitHub · 2026-11-24 20:36 UTC · original

GPU run of b63a67b on Windows (NVIDIA GTX 1660 Ti, Turing): 708 passed, 0 failed, 21 ignored

Tested

  • NVIDIA GeForce GTX 1660 Ti 6 GB (Turing, driver 32.0.16.2114), Ryzen 5 2600X, Windows 11 (10.0.26300), rustc 1.100.0, debug build
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4; build exit 0, test exit 0
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64)
  • The head does not contain current main (9039900). It was run as it is.
  • lib: 708 passed, 0 failed, 21 ignored.
  • gpu::recomp::pso::shader_cache_tests::wave_mode_line_names_the_form_and_why passed.

Not tested

  • No retail title and no scripts/smoke.ps1 run, so no regression run
  • The [SHADER] wave mode: line in a real title's log, since that needs a title
  • AMD GPUs; only Turing was run here

AI use

  • Claude Code with Claude Sonnet 5.5 ran the commands and wrote this report. I checked the output.
**@⁠Mischief8713** on GitHub · 2026-11-24 20:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1410#issuecomment-7143816712) **GPU run of `b63a67b` on Windows (NVIDIA GTX 1660 Ti, Turing): 708 passed, 0 failed, 21 ignored** **Tested** - NVIDIA GeForce GTX 1660 Ti 6 GB (Turing, driver 32.0.16.2114), Ryzen 5 2600X, Windows 11 (10.0.26300), rustc 1.100.0, debug build - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`; build exit 0, test exit 0 - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64) - The head does not contain current `main` (`9039900`). It was run as it is. - lib: 708 passed, 0 failed, 21 ignored. - `gpu::recomp::pso::shader_cache_tests::wave_mode_line_names_the_form_and_why` passed. **Not tested** - No retail title and no `scripts/smoke.ps1` run, so no regression run - The `[SHADER] wave mode:` line in a real title's log, since that needs a title - AMD GPUs; only Turing was run here **AI use** - Claude Code with Claude Sonnet 5.5 ran the commands and wrote this report. I checked the output.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1410/head:github-bot/gh-1410'
git switch 'github-bot/gh-1410'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1410'
git switch 'github-bot/gh-1410'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1410'
git switch 'github-bot/gh-1410'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1410'
git switch 'main'
git merge --squash 'github-bot/gh-1410'
git switch 'main'
git merge --ff-only 'github-bot/gh-1410'
git switch 'main'
git merge 'github-bot/gh-1410'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.