Tests: cover two-pass MS and ES+GS PSO hooks without game files #971

Open
ChalanaGimhanaX wants to merge 1 commit from upstream-pr/977 into main
ChalanaGimhanaX commented 2026-11-24 09:48:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ChalanaGimhanaX on 2026-11-24T09:48:30Z.


All two-pass mesh (MS) and legacy geometry (ES+GS) PSO hook tests in crates/xcl/tests/gpu_pso_e2e.rs skip when XCL_SAMPLE_RPF is unset, leaving translated_mesh_stream, own_stream, translated_gs_pso, and TwoPassPso without game-free GPU test coverage. This adds an integration test binary with minimal hand-encoded console MS/PS and ES/GS/PS containers that exercise both hooks end to end on the GPU. No runtime files or game data are touched.

What is in it

  • crates/xcl/tests/gpu_mesh_e2e.rs: two game-free GPU tests covering ID3D12Device2::CreatePipelineState on a console MS (NGG, hw=7, api=6) + console PS stream (cold XCL_DXIL_CACHE, stack stream + shader buffer overwrite proving own_stream deep copy, async stand-in resolution, two_pass_of kind == "MS", two-pass Dispatch + DispatchMesh execution with record and pixel readback, and two_pass_count cleanup on drop) and ID3D12Device::CreateGraphicsPipelineState on console VS (ES variant hw=2) + GS (hw=3, triangle to triangle-strip parallelogram expansion) + console PS (two_pass_of kind == "GS", two-pass GPU execution with strip winding and pixel readback inside both original and GS-generated triangles, and drop cleanup).

Tested

  • Hardware: AMD Ryzen 7 250, Windows 11 Pro build 26300, DXC 1.8.2502.11, rustc 1.100.0, debug build, tested on both GPUs on this machine:
    • AMD Radeon 780M Graphics (RDNA3, wave64 + mesh shaders, driver 32.0.21030.11004):
      • XCL_ADAPTER=radeon .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4): 718 passed, 0 failed, 41 ignored (0 GPU tests skipped)
      • XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --test gpu_mesh_e2e: 2 passed, 0 failed
      • XCL_ADAPTER=radeon XCL_SPLIT_WAVE64=1 cargo test -p xcl --test gpu_mesh_e2e: 2 passed, 0 failed
      • XCL_ADAPTER=radeon XCL_ASYNC_PSO=0 cargo test -p xcl --test gpu_mesh_e2e: 2 passed, 0 failed
      • XCL_ADAPTER=radeon cargo test -p xcl --test gpu_mesh_e2e -- --test-threads=1: 2 passed, 0 failed
    • NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell, wave32 + mesh shaders, driver 610.88 / 32.0.16.1088):
      • XCL_ADAPTER=nvidia .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4): 718 passed, 0 failed, 41 ignored (2 GPU tests skipped: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64)
      • XCL_ADAPTER=nvidia cargo test -p xcl --test gpu_mesh_e2e: 2 passed, 0 failed (also 2 passed under XCL_ASYNC_PSO=0)
    • WARP (XCL_ADAPTER=warp): cargo test -p xcl --test gpu_mesh_e2e: 2 passed (2 skipped: no wave64)
  • cargo clippy -p xcl --test gpu_mesh_e2e: 0 warnings in crates/xcl/tests/gpu_mesh_e2e.rs

Not tested

  • Intel GPUs, RDNA2/RDNA4 discrete GPUs, Wine / vkd3d-proton
  • D3D12 debug layer (d3d12SDKLayers.dll not installed) and optional XCL_SAMPLE_* retail-data tests

AI use

  • Antigravity (Gemini 4 Neon): wrote crates/xcl/tests/gpu_mesh_e2e.rs and this PR description, checked open PRs for overlap, and ran local dual-GPU verification on AMD Radeon 780M and NVIDIA RTX 5060 hardware.
<!-- greyfinch-sync:ivall/xcl:issue:5469813926 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/977). Originally posted by [ChalanaGimhanaX](https://github.com/ChalanaGimhanaX) on 2026-11-24T09:48:30Z. --- All two-pass mesh (`MS`) and legacy geometry (`ES+GS`) PSO hook tests in `crates/xcl/tests/gpu_pso_e2e.rs` skip when `XCL_SAMPLE_RPF` is unset, leaving `translated_mesh_stream`, `own_stream`, `translated_gs_pso`, and `TwoPassPso` without game-free GPU test coverage. This adds an integration test binary with minimal hand-encoded console MS/PS and ES/GS/PS containers that exercise both hooks end to end on the GPU. No runtime files or game data are touched. **What is in it** - `crates/xcl/tests/gpu_mesh_e2e.rs`: two game-free GPU tests covering `ID3D12Device2::CreatePipelineState` on a console MS (NGG, `hw=7, api=6`) + console PS stream (cold `XCL_DXIL_CACHE`, stack stream + shader buffer overwrite proving `own_stream` deep copy, async stand-in resolution, `two_pass_of` `kind == "MS"`, two-pass `Dispatch` + `DispatchMesh` execution with record and pixel readback, and `two_pass_count` cleanup on drop) and `ID3D12Device::CreateGraphicsPipelineState` on console VS (ES variant `hw=2`) + GS (`hw=3`, triangle to triangle-strip parallelogram expansion) + console PS (`two_pass_of` `kind == "GS"`, two-pass GPU execution with strip winding and pixel readback inside both original and GS-generated triangles, and drop cleanup). **Tested** - Hardware: AMD Ryzen 7 250, Windows 11 Pro build 26300, DXC 1.8.2502.11, `rustc 1.100.0`, debug build, tested on both GPUs on this machine: - **AMD Radeon 780M Graphics** (RDNA3, wave64 + mesh shaders, driver `32.0.21030.11004`): - `XCL_ADAPTER=radeon .\scripts\test.ps1` (`cargo test --workspace -- --test-threads=4`): 718 passed, 0 failed, 41 ignored (0 GPU tests skipped) - `XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --test gpu_mesh_e2e`: 2 passed, 0 failed - `XCL_ADAPTER=radeon XCL_SPLIT_WAVE64=1 cargo test -p xcl --test gpu_mesh_e2e`: 2 passed, 0 failed - `XCL_ADAPTER=radeon XCL_ASYNC_PSO=0 cargo test -p xcl --test gpu_mesh_e2e`: 2 passed, 0 failed - `XCL_ADAPTER=radeon cargo test -p xcl --test gpu_mesh_e2e -- --test-threads=1`: 2 passed, 0 failed - **NVIDIA GeForce RTX 5060 Laptop GPU** (Blackwell, wave32 + mesh shaders, driver `610.88` / `32.0.16.1088`): - `XCL_ADAPTER=nvidia .\scripts\test.ps1` (`cargo test --workspace -- --test-threads=4`): 718 passed, 0 failed, 41 ignored (2 GPU tests skipped: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64`) - `XCL_ADAPTER=nvidia cargo test -p xcl --test gpu_mesh_e2e`: 2 passed, 0 failed (also 2 passed under `XCL_ASYNC_PSO=0`) - **WARP** (`XCL_ADAPTER=warp`): `cargo test -p xcl --test gpu_mesh_e2e`: 2 passed (2 skipped: `no wave64`) - `cargo clippy -p xcl --test gpu_mesh_e2e`: 0 warnings in `crates/xcl/tests/gpu_mesh_e2e.rs` **Not tested** - Intel GPUs, RDNA2/RDNA4 discrete GPUs, Wine / vkd3d-proton - D3D12 debug layer (`d3d12SDKLayers.dll` not installed) and optional `XCL_SAMPLE_*` retail-data tests **AI use** - Antigravity (Gemini 4 Neon): wrote `crates/xcl/tests/gpu_mesh_e2e.rs` and this PR description, checked open PRs for overlap, and ran local dual-GPU verification on AMD Radeon 780M and NVIDIA RTX 5060 hardware.
DavidM1911 commented 2026-11-24 14:06:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:51:30Z.


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

  • lib pso: 22 passed, 1 ignored, 0 failed.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7133440856 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/977#issuecomment-7133440856). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T13:51:30Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - lib pso: 22 passed, 1 ignored, 0 failed. Thanks!
JJAutoCompare commented 2026-11-25 06:05:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:38:34Z.


Empirical test report (47fb4bb5)

Verified xcl-dev/xcl PR #977 at 47fb4bb5a831a02d9fce281c0da9f5f2d457c948.

Hardware / environment

  • Intel Arc A770 Graphics (16,258 MiB reported by XCL), Intel driver 32.0.101.9175, and AMD x64 CPU (family 23, model 113, stepping 0).
  • Windows x64 build 10.0.26200, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5 (01b62ad4), and Cargo's unoptimized test profile with debug info and incremental compilation disabled.

Commands and results

  • cargo test --workspace --no-run completed outside the GPU lock with exit code 0.
  • Ran the resulting gpu_mesh_e2e-7490f57fced0e70c.exe --nocapture inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. The wrapper acquired and released the GPU lock. The fixture exited 0 after 1.74 s of test time.
  • Libtest reported 2 passed, 0 failed, 0 ignored. The captured output contained 0 SKIPPED lines, so both tests exercised their GPU assertions.

Observed behavior

  • console_es_gs_graphics_hook_executes_two_passes_and_cleans_up passed. The graphics PSO hook produced a compute pass and a mesh pass. GPU readback matched the expected strip record, including triangle winding, and pixels in both the original and generated triangles.
  • console_ms_ps_stream_hook_executes_two_passes_and_cleans_up passed. The cold-cache stream hook resolved the async stand-in after the fixture overwrote the caller's stream and shader bytes. GPU readback matched the records and expected pixels for both mesh groups.
  • Both fixtures verified that translation produced no additional fallback pipelines and that dropping the PSO released its two-pass entry. Both used synthetic shader containers.

Not tested

The full GPU workspace suite and game smoke runs were omitted. GPU execution was limited to the two fixtures on the Arc A770.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr977-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7153991194 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/977#issuecomment-7153991194). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T05:38:34Z. --- ### Empirical test report (47fb4bb5) Verified xcl-dev/xcl PR #977 at `47fb4bb5a831a02d9fce281c0da9f5f2d457c948`. **Hardware / environment** - Intel Arc A770 Graphics (16,258 MiB reported by XCL), Intel driver `32.0.101.9175`, and AMD x64 CPU (family 23, model 113, stepping 0). - Windows x64 build `10.0.26200`, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.9.2609.5 (01b62ad4)`, and Cargo's unoptimized test profile with debug info and incremental compilation disabled. **Commands and results** - `cargo test --workspace --no-run` completed outside the GPU lock with exit code 0. - Ran the resulting `gpu_mesh_e2e-7490f57fced0e70c.exe --nocapture` inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. The wrapper acquired and released the GPU lock. The fixture exited 0 after 1.74 s of test time. - Libtest reported **2 passed, 0 failed, 0 ignored**. The captured output contained **0 `SKIPPED` lines**, so both tests exercised their GPU assertions. **Observed behavior** - `console_es_gs_graphics_hook_executes_two_passes_and_cleans_up` passed. The graphics PSO hook produced a compute pass and a mesh pass. GPU readback matched the expected strip record, including triangle winding, and pixels in both the original and generated triangles. - `console_ms_ps_stream_hook_executes_two_passes_and_cleans_up` passed. The cold-cache stream hook resolved the async stand-in after the fixture overwrote the caller's stream and shader bytes. GPU readback matched the records and expected pixels for both mesh groups. - Both fixtures verified that translation produced no additional fallback pipelines and that dropping the PSO released its two-pass entry. Both used synthetic shader containers. **Not tested** The full GPU workspace suite and game smoke runs were omitted. GPU execution was limited to the two fixtures on the Arc A770. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr977-focused.log` and published.
DavidM1911 commented 2026-11-26 04:07:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:23:32Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7181678034 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/977#issuecomment-7181678034). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:23:32Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
github-actions[bot] commented 2026-11-30 08:42:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:42:03Z.


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:7273234354 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/977#issuecomment-7273234354). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:42:03Z. --- 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.
Foniass commented 2026-12-01 04:34:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:34:54Z.


Triage (#1607) – head 47fb4bb

No open or merged PR adds the same test. Main's tests/d3d12_mesh_stream.rs covers only refusals and malformed streams, not executing the two passes. Every API the new tests/gpu_mesh_e2e.rs uses (real::two_pass_of, two_pass_count, TwoPassPso::mesh_groups_per_record, pso_async::resolve_wait, IO_GS_*, MESH_HEADER) is still public on main, and the tests skip through runner::skip_test without DXC, a GPU, wave64 or mesh shaders. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300879619 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/977#issuecomment-7300879619). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:34:54Z. --- **Triage (#1607)** – head 47fb4bb No open or merged PR adds the same test. Main's `tests/d3d12_mesh_stream.rs` covers only refusals and malformed streams, not executing the two passes. Every API the new `tests/gpu_mesh_e2e.rs` uses (`real::two_pass_of`, `two_pass_count`, `TwoPassPso::mesh_groups_per_record`, `pso_async::resolve_wait`, `IO_GS_*`, `MESH_HEADER`) is still public on main, and the tests skip through `runner::skip_test` without DXC, a GPU, wave64 or mesh shaders. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/977:upstream-pr/977'
git switch 'upstream-pr/977'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/977'
git switch 'upstream-pr/977'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/977'
git switch 'upstream-pr/977'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/977'
git switch 'main'
git merge --squash 'upstream-pr/977'
git switch 'main'
git merge --ff-only 'upstream-pr/977'
git switch 'main'
git merge 'upstream-pr/977'
git push origin 'main'
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!971
No description provided.