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

Merged
bmjask merged 2 commits from upstream-pr/1873 into main 2026-11-28 13:24:12 +00:00
bmjask commented 2026-11-24 22:28:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-24T22:28:38Z.


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, release builds, run back to back with XCL_PREPARE=0 against the same unstaged hard-link/junction view of the title (the original game folder was not modified). Input schedule: XCL_PRESS_AT=2:B,4:B,6:B,8:B and XCL_PRESS_A_AT=10,15,20,25,30,40.

main:

xcl-smoke v1
commit: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd
gpu: NVIDIA GeForce RTX 4090
title: 679c71f7
seconds: 60
exit: 0x0
frames shown: 1325 (PresentX 1325)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 17168 MB

PR:

xcl-smoke v1
commit: dc684f21664d4c68a15564dba9a79c25174cd651
gpu: NVIDIA GeForce RTX 4090
title: 679c71f7
seconds: 60
exit: 0x0
frames shown: 1374 (PresentX 1374)
presents per 2 s (last 3): 59 60 60
device removals: 0
crashes: 0
peak commit: 16694 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
<!-- greyfinch-sync:ivall/xcl:issue:5481394593 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1873). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-24T22:28:38Z. --- 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, release builds, run back to back with `XCL_PREPARE=0` against the same unstaged hard-link/junction view of the title (the original game folder was not modified). Input schedule: `XCL_PRESS_AT=2:B,4:B,6:B,8:B` and `XCL_PRESS_A_AT=10,15,20,25,30,40`. main: ``` xcl-smoke v1 commit: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd gpu: NVIDIA GeForce RTX 4090 title: 679c71f7 seconds: 60 exit: 0x0 frames shown: 1325 (PresentX 1325) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 17168 MB ``` PR: ``` xcl-smoke v1 commit: dc684f21664d4c68a15564dba9a79c25174cd651 gpu: NVIDIA GeForce RTX 4090 title: 679c71f7 seconds: 60 exit: 0x0 frames shown: 1374 (PresentX 1374) presents per 2 s (last 3): 59 60 60 device removals: 0 crashes: 0 peak commit: 16694 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)
futurepro62 commented 2026-11-25 00:09:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T23:54:09Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7147920391 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1873#issuecomment-7147920391). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T23:54:09Z. --- 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://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) 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.
DavidM1911 commented 2026-11-25 02:08:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T01:45:56Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7149929726 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1873#issuecomment-7149929726). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T01:45:56Z. --- 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!
github-actions[bot] commented 2026-11-28 08:01:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:17Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7236309630 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1873#issuecomment-7236309630). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:01:17Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
xcl-dev/xcl!1863
No description provided.