Recompiler: geometry ES's s_setpc and gs_start bound structured stretches in every wave form #1873

Open
github-bot wants to merge 2 commits from github-bot/gh-1873 into main AGit
Owner

@⁠bmjask on GitHub · 2026-11-24 22:28 UTC · original
bmjask:fix/geometry-setpc-boundary → main · +67 −7 · 2 files · 2 commits · open

Follow-up to #1689 that addresses @⁠MatyEjsr's two review notes there (confirmed on 87d421b).

What is in it

  • In geometry mode, an unresolved s_setpc_b64 in the ES now ends a structured stretch in every wave form. Before, this only happened in split wave64. In native wave64, an early s_setpc_b64 on one ES branch fell through into the other branch's code instead of jumping to gs_start.
  • gs_start is entered from the ES's s_setpc_b64, an edge that Ctx::edges doesn't hold. A structured stretch starting in padding between the ES and the GS (e.g. s_nop) could run across it and drop the if (pc == gs_start) entry. Stretches now stop at gs_start.
  • Ctx::phase_split is replaced by geometry and gs_entry. Only geometry mode is affected. mod.rs is in build.rs's translator source hash, so translated-cache entries re-key automatically.
  • Tests: geometry_early_setpc_ends_the_es_in_every_wave_form (fails on main in the native form) and geometry_padding_before_gs_start_keeps_its_entry (fails on main).

Tested

  • RTX-class NVIDIA, Windows 11, Rust 1.100.0, debug: cargo test -p xcl --lib gpu::recomp -- --test-threads=4: 263 passed, 0 failed, 18 ignored. Both new tests fail without the mod.rs change.
  • After merging origin/main (df6445c): cargo build --workspace and cargo test --workspace -- --test-threads=4, 0 failed.

Regression run
scripts/smoke.ps1, 60 s, XCL_PRESS_AT=2:B,4:B,6:B,8:B XCL_PRESS_A_AT=10,15,20,25,30,40, run back to back. main is a release build of origin/main (689f2db); PR is a release build of the head (df6445c, origin/main merged in). Each block comes from its own checkout's scripts/smoke.ps1.

main:

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 4090
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1415 (PresentX 1416)
presents per 2 s (last 3): 60 60 48
device removals: 0
crashes: 0
peak commit: 19365 MB

PR:

xcl-smoke v1
commit: df6445ce772484247648d0fbfc2104c12aa6ba60
gpu: NVIDIA GeForce RTX 4090
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1397 (PresentX 1397)
presents per 2 s (last 3): 60 60 53
device removals: 0
crashes: 0
peak commit: 19522 MB

Not tested

  • Native wave64 GPU execution of the new cases (the tests check the emitted HLSL), AMD.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, the tests and this description for @⁠bmjask.

🤖 Generated with Claude Code

**@⁠bmjask** on GitHub · 2026-11-24 22:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1873) `bmjask:fix/geometry-setpc-boundary` → `main` · +67 −7 · 2 files · 2 commits · open Follow-up to #1689 that addresses @⁠MatyEjsr's two review notes there (confirmed on `87d421b`). **What is in it** - In geometry mode, an unresolved `s_setpc_b64` in the ES now ends a structured stretch in every wave form. Before, this only happened in split wave64. In native wave64, an early `s_setpc_b64` on one ES branch fell through into the other branch's code instead of jumping to `gs_start`. - `gs_start` is entered from the ES's `s_setpc_b64`, an edge that `Ctx::edges` doesn't hold. A structured stretch starting in padding between the ES and the GS (e.g. `s_nop`) could run across it and drop the `if (pc == gs_start)` entry. Stretches now stop at `gs_start`. - `Ctx::phase_split` is replaced by `geometry` and `gs_entry`. Only geometry mode is affected. `mod.rs` is in build.rs's translator source hash, so translated-cache entries re-key automatically. - Tests: `geometry_early_setpc_ends_the_es_in_every_wave_form` (fails on `main` in the native form) and `geometry_padding_before_gs_start_keeps_its_entry` (fails on `main`). **Tested** - RTX-class NVIDIA, Windows 11, Rust 1.100.0, debug: `cargo test -p xcl --lib gpu::recomp -- --test-threads=4`: 263 passed, 0 failed, 18 ignored. Both new tests fail without the `mod.rs` change. - After merging origin/main (df6445c): `cargo build --workspace` and `cargo test --workspace -- --test-threads=4`, 0 failed. **Regression run** `scripts/smoke.ps1`, 60 s, `XCL_PRESS_AT=2:B,4:B,6:B,8:B XCL_PRESS_A_AT=10,15,20,25,30,40`, run back to back. main is a release build of origin/main (689f2db); PR is a release build of the head (df6445c, origin/main merged in). Each block comes from its own checkout's `scripts/smoke.ps1`. main: ``` xcl-smoke v1 commit: 689f2db477c3c062cf162649781640ef8a977c18 gpu: NVIDIA GeForce RTX 4090 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1415 (PresentX 1416) presents per 2 s (last 3): 60 60 48 device removals: 0 crashes: 0 peak commit: 19365 MB ``` PR: ``` xcl-smoke v1 commit: df6445ce772484247648d0fbfc2104c12aa6ba60 gpu: NVIDIA GeForce RTX 4090 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1397 (PresentX 1397) presents per 2 s (last 3): 60 60 53 device removals: 0 crashes: 0 peak commit: 19522 MB ``` **Not tested** - Native wave64 GPU execution of the new cases (the tests check the emitted HLSL), AMD. **AI use** - Claude Code (Claude Opus 5.5) wrote the change, the tests and this description for @⁠bmjask. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Follow-up to #1689 review notes (MatyEjsr):
- an unresolved s_setpc_b64 in the ES ended a structured stretch only in the
  split wave64 form; in native wave64 an early s_setpc on one branch fell
  through into the other branch's code instead of jumping to gs_start.
- gs_start is entered from the ES's s_setpc, an edge c.edges does not hold, so
  a stretch starting in padding between the ES and the GS could run across it
  and drop its if (pc == gs_start) entry.

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

@⁠futurepro62 on GitHub · 2026-11-24 23:54 UTC · original · edited 2026-11-25 00:01 UTC

Full-suite run, since this PR has no test report yet. Tested exact head df6445c (on its base 689f2db).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::dxil::fuzz_tests: 967 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: geometry_early_setpc_ends_the_es_in_every_wave_form, geometry_padding_before_gs_start_keeps_its_entry.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 976 passed, 0 failed, 45 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 62265d3 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651) and the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 23:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/1873#issuecomment-7147920391) · edited 2026-11-25 00:01 UTC Full-suite run, since this PR has no test report yet. Tested exact head `df6445c` (on its base `689f2db`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::dxil::fuzz_tests`: **967 passed, 0 failed, 43 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `geometry_early_setpc_ends_the_es_in_every_wave_form`, `geometry_padding_before_gs_start_keeps_its_entry`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **976 passed, 0 failed, 45 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `62265d3` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651) and the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 01:45 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 01:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1873#issuecomment-7149929726) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/recomp/tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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