Skip to content

[upstream #1763] Tests: generate RDNA2 programs for compile-time measurements (#1269) - #369

Draft
ufoptg wants to merge 4 commits into
mainfrom
upstream-pr/1763
Draft

ufoptg wants to merge 4 commits into
mainfrom
upstream-pr/1763

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner

A generator of deterministic RDNA2 programs for the synthetic compile-time benchmark of xcl-dev#1269: no game data, so it runs anywhere, CI included. Test-only: one commit in crates/xcl/tests/compile_bench/, nothing in crates/xcl/src. Nothing is timed yet; the DXC measurement is the next PR, stacked on this one.

Part of xcl-dev#1269

What is in it

  • crates/xcl/tests/compile_bench/gen.rs: program(&Knobs) assembles a program with rdna2::encode from a seed and knobs: the number of operations, divergent ifs (v_cmp → s_and_saveexec → s_cbranch_execz) and how deep they nest, uniform loops (SGPR counter, backward s_cbranch_scc1) and how deep they nest, wave32 or wave64, the VGPR and SGPR pools, and the share of LDS and memory accesses. Knobs that would give more operations than asked for are refused.
  • crates/xcl/tests/compile_bench/main.rs: 7 tests, CPU only. They check in the disassembly, not in the generator: the operation count, how deep the ifs and loops nest, where every branch lands, the EXEC instructions of each wave size, the LDS and memory shares and the VGPR pool; 24 knob combinations translate completely with structured control flow on and off.

Tested

  • AMD Radeon RX 6700 (RDNA2), driver 32.0.21045.29003, Ryzen 5 3600, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.
  • cargo test -p xcl --test compile_bench: 7 passed, 0 failed, 0 ignored.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 5ae62c5: 755 passed, 3 failed, 41 ignored (20 binaries); no SKIPPED tests. The failures are placed_title_textures_share_vram_and_preserve_pixels ("3D 64x64x64 4 mips: subresource 2 mismatch") and two tests that then fail on the lock it poisons; the first fails alone on main 930e8b4 too (4 of 4 runs). The same failure (same message, RDNA2, same driver) is reported fixed by D3D12.X: map and unmap 3D texture mips separately xcl-dev/xcl#1028 on an RX 6600, RX 6750 XT and RX 6900 XT; D3D12.X: map and unmap 3D texture mips separately xcl-dev/xcl#1028 was not run here.
  • Negative control: 10 mutations of the generator (seed ignored, loops not nested, loop and execz branch offsets off by one, wrong EXEC width, if depth ignored, VGPR pool too large, LDS share ignored, operations miscounted, the operation-count check removed); each makes at least one test fail.

Regression run

  • Not needed: test-only change, nothing in crates/xcl/src.

Not tested

  • scripts/smoke.ps1 or any retail title (no game data here; the change does not touch the runtime).
  • NVIDIA, wave32-only GPUs; release build.

AI use

  • Claude Code with Claude Opus 5.5: wrote the generator, the tests and this description, and ran the tests on the machine above; reviewed by an independent Claude Code agent before posting.

🤖 Generated with Claude Code


Mirror of xcl-dev#1763 (auto-synced, do not edit).

BetterJdue and others added 4 commits November 24, 2026 16:05
…#1269)

The synthetic compile-time benchmark of xcl-dev#1269 needs console programs that
anyone can build, CI included, without game data. This adds the generator
it will measure: deterministic RDNA2 programs, assembled with
rdna2::encode, from a seed and knobs for the number of operations,
divergent ifs (v_cmp, s_and_saveexec, s_cbranch_execz) and how deep they
nest, uniform loops (SGPR counter, backward s_cbranch_scc1) and how deep
they nest, wave32 or wave64, the VGPR and SGPR pools, and the share of LDS
and memory accesses. Knobs that would give more operations than asked for
(fewer than two per loop level) are refused. Nothing is timed yet; that
comes next, with DXC.

The tests count what each knob does in the disassembly of the program,
not in the generator: the operations, how deep the ifs and loops nest,
that every s_cbranch_execz lands on its EXEC restore and every loop
branch on the instruction after its counter is set, the EXEC instructions
of each wave size, the LDS and memory shares, the highest VGPR. Every
knob combination the tests use translates completely, structured and as
the guarded block chain, with as many instructions as the disassembly.

Negative control: ten mutations of the generator (seed ignored, loops
not nested, loop and execz branch offsets off by one, wave32 using the
64-bit EXEC instructions, if depth ignored, VGPR pool one too large, LDS
share ignored, operations miscounted, the operation-count check removed)
each make at least one test fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-oom

dxil: eliminate giant-shader IR and CFG blowup in FormatLoad and multi-window memory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants