Tests: cover textured graphics PSOs and static samplers on the GPU #963

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

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


crates/xcl/tests/gpu_pso_e2e.rs skips its textured pipeline test whenever XCL_SAMPLE_RPF is unset, leaving textured graphics PSO translation, T#/S# descriptor decoding, multi-draw descriptor switching, and static sampler extraction without game-free GPU coverage on main. This adds an integration test binary with minimal hand-encoded console VS/PS containers exercising CreateGraphicsPipelineState end-to-end. No runtime files or game data are touched.

What is in it

  • crates/xcl/tests/gpu_textured_draw_e2e.rs: two synthetic GPU tests through CreateGraphicsPipelineState:
    • console_textured_ps_decoded_descriptors_and_switch_between_draws: console VS (POSITION + COLOR + TEXCOORD) + PS loading an 8-dword T# and dynamic 4-dword S# from s[8:9] and multiplying image_sample by vertex color; decodes two 64x64 linear RGBA8 T#s (identity and BGRA swizzle) via gpu::desc::{image, image_d3d12, sampler_d3d12}, checks translated_pipelines / fallback_pipelines, draws both halves in one command list via runner::draw_on_multi switching only s[8], and verifies all 4096 pixels.
    • console_ps_static_sampler_from_constants_in_abi_root_signature: console PS constructing two S# descriptors from SGPR constants (POINT + BORDER(opaque white) and LINEAR + WRAP); verifies static sampler extraction (compiled.samplers) and draws over u in [0, 2] with &[] dynamic samplers so sampling runs solely through the pipeline's ABI root signature static samplers.

Tested

  • Hardware: AMD Ryzen 7 250, Windows 11 Pro build 26300, DXC 1.8.2502.11, rustc 1.100.0 (0ef1bc386 2026-11-09), 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_textured_draw_e2e: 2 passed, 0 failed
      • XCL_ADAPTER=radeon XCL_SPLIT_WAVE64=1 cargo test -p xcl --test gpu_textured_draw_e2e: 2 passed, 0 failed
      • XCL_ADAPTER=radeon XCL_ASYNC_PSO=0 cargo test -p xcl --test gpu_textured_draw_e2e: 2 passed, 0 failed
      • Cold XCL_DXIL_CACHE run on radeon: 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 skips: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware — no wave64)
      • XCL_ADAPTER=nvidia cargo test -p xcl --test gpu_textured_draw_e2e (default and XCL_ASYNC_PSO=0): 2 passed, 0 failed (0 skips)
    • WARP (XCL_ADAPTER=warp): 2 skipped cleanly (no wave64)
  • cargo clippy -p xcl --test gpu_textured_draw_e2e: 0 warnings/errors in gpu_textured_draw_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_textured_draw_e2e.rs and this PR description, checked open PRs for overlap, and ran local verification; all assertions and dual-GPU results verified on AMD Radeon 780M and NVIDIA RTX 5060 hardware.
<!-- greyfinch-sync:ivall/xcl:issue:5469691163 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/969). Originally posted by [ChalanaGimhanaX](https://github.com/ChalanaGimhanaX) on 2026-11-24T09:40:08Z. --- `crates/xcl/tests/gpu_pso_e2e.rs` skips its textured pipeline test whenever `XCL_SAMPLE_RPF` is unset, leaving textured graphics PSO translation, T#/S# descriptor decoding, multi-draw descriptor switching, and static sampler extraction without game-free GPU coverage on `main`. This adds an integration test binary with minimal hand-encoded console VS/PS containers exercising `CreateGraphicsPipelineState` end-to-end. No runtime files or game data are touched. **What is in it** - `crates/xcl/tests/gpu_textured_draw_e2e.rs`: two synthetic GPU tests through `CreateGraphicsPipelineState`: - `console_textured_ps_decoded_descriptors_and_switch_between_draws`: console VS (`POSITION` + `COLOR` + `TEXCOORD`) + PS loading an 8-dword T# and dynamic 4-dword S# from `s[8:9]` and multiplying `image_sample` by vertex color; decodes two 64x64 linear RGBA8 T#s (identity and BGRA swizzle) via `gpu::desc::{image, image_d3d12, sampler_d3d12}`, checks `translated_pipelines` / `fallback_pipelines`, draws both halves in one command list via `runner::draw_on_multi` switching only `s[8]`, and verifies all 4096 pixels. - `console_ps_static_sampler_from_constants_in_abi_root_signature`: console PS constructing two S# descriptors from SGPR constants (`POINT + BORDER(opaque white)` and `LINEAR + WRAP`); verifies static sampler extraction (`compiled.samplers`) and draws over `u in [0, 2]` with `&[]` dynamic samplers so sampling runs solely through the pipeline's ABI root signature static samplers. **Tested** - Hardware: AMD Ryzen 7 250, Windows 11 Pro build 26300, DXC 1.8.2502.11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, 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_textured_draw_e2e`: 2 passed, 0 failed - `XCL_ADAPTER=radeon XCL_SPLIT_WAVE64=1 cargo test -p xcl --test gpu_textured_draw_e2e`: 2 passed, 0 failed - `XCL_ADAPTER=radeon XCL_ASYNC_PSO=0 cargo test -p xcl --test gpu_textured_draw_e2e`: 2 passed, 0 failed - Cold `XCL_DXIL_CACHE` run on `radeon`: 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 skips: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` — `no wave64`) - `XCL_ADAPTER=nvidia cargo test -p xcl --test gpu_textured_draw_e2e` (default and `XCL_ASYNC_PSO=0`): 2 passed, 0 failed (0 skips) - **WARP** (`XCL_ADAPTER=warp`): 2 skipped cleanly (`no wave64`) - `cargo clippy -p xcl --test gpu_textured_draw_e2e`: 0 warnings/errors in `gpu_textured_draw_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_textured_draw_e2e.rs` and this PR description, checked open PRs for overlap, and ran local verification; all assertions and dual-GPU results verified on AMD Radeon 780M and NVIDIA RTX 5060 hardware.
Aniseto commented 2026-11-24 11:05:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-24T10:16:34Z.


Ran both new tests at 23eb733 on a second Blackwell part (wave32 only).

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=nvidia cargo test -p xcl --test gpu_textured_draw_e2e
2 passed; 0 failed; 0 ignored      (exit 0)

The textured PS path and the static sampler from the ABI root signature both render and read back correctly here. This adds an RTX 5070 Ti / driver 32.0.16.2124 datapoint next to the PR's RTX 5060 Laptop run, on Windows 11 build 26200.

Not tested: RDNA2/RDNA4 and Intel GPUs, Wine, the D3D12 debug-layer path for this test, optional XCL_SAMPLE_* retail-data tests.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the test binaries, wrote this report; the worktree was not modified.

<!-- greyfinch-sync:ivall/xcl:comment:7128555349 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/969#issuecomment-7128555349). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-24T10:16:34Z. --- Ran both new tests at `23eb733` on a second Blackwell part (wave32 only). Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=nvidia cargo test -p xcl --test gpu_textured_draw_e2e 2 passed; 0 failed; 0 ignored (exit 0) ``` The textured PS path and the static sampler from the ABI root signature both render and read back correctly here. This adds an RTX 5070 Ti / driver 32.0.16.2124 datapoint next to the PR's RTX 5060 Laptop run, on Windows 11 build 26200. Not tested: RDNA2/RDNA4 and Intel GPUs, Wine, the D3D12 debug-layer path for this test, optional `XCL_SAMPLE_*` retail-data tests. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash 1017** - checked out the PR's head commit in a detached worktree, built it, ran the test binaries, wrote this report; the worktree was not modified.
SlopTart commented 2026-11-24 11:05:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T10:38:20Z.


Linux / AMD RDNA3 datapoint.

Merged state: head 23eb733 onto main 6bac4b4, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 710 passed, 11 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). textured-graphics-PSO/static-sampler test coverage green on RDNA3 wave64.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7129046746 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/969#issuecomment-7129046746). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T10:38:20Z. --- Linux / AMD RDNA3 datapoint. **Merged state:** head `23eb733` onto main `6bac4b4`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **710 passed, 11 failed, 41 ignored**; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). textured-graphics-PSO/static-sampler test coverage green on RDNA3 wave64. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
DavidM1911 commented 2026-11-24 14:06:44 +00:00 (Migrated from github.com)

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


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:7133438677 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/969#issuecomment-7133438677). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T13:51:24Z. --- 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:40Z.


Empirical test report (23eb733a)

Verified xcl-dev/xcl PR #969 at commit 23eb733a0faf096ff22ab0294564cb58516eae6e in a clean, detached worktree.

Hardware / environment

  • Intel Arc A770 (16,258 MiB reported by DXGI), confirmed by the real D3D12 backend in both fixtures. Windows x64 build 26200 on AMD64 Family 23 Model 113.
  • Rust 1.100.0 (0ef1bc386 2026-11-09). DXC 1.9.2609.5 (01b62ad47). Unoptimized Cargo test profile, debug info and incremental compilation disabled.

Commands and results

  • cargo test --workspace --no-run exited 0 outside the GPU lock.
  • Invoke-ArcTest.ps1 -Test { & $fixture } ran the built gpu_textured_draw_e2e test executable with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Exit 0 in the lock wrapper. The test harness reported 2 passed, 0 failed, 0 ignored, and the complete captured output contained 0 SKIPPED lines. Harness time was 2.97 s.

Observed behavior

  • console_textured_ps_decoded_descriptors_and_switch_between_draws passed its pixel readback checks for decoded texture and dynamic sampler descriptors, switching the descriptor table between two draws in one command list, and BGRA swizzle on the right half.
  • console_ps_static_sampler_from_constants_in_abi_root_signature passed its static-sampler extraction and pixel readback checks for point filtering with an opaque white border and linear filtering with wrap, with zero dynamic samplers supplied.
  • Both fixtures passed their translated graphics PSO and fallback-count assertions.

Not tested

The full GPU workspace suite and game smoke runs were omitted. Coverage is limited to the two synthetic 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 pr969-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7153992999 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/969#issuecomment-7153992999). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T05:38:40Z. --- ### Empirical test report (23eb733a) Verified xcl-dev/xcl PR #969 at commit `23eb733a0faf096ff22ab0294564cb58516eae6e` in a clean, detached worktree. **Hardware / environment** - Intel Arc A770 (16,258 MiB reported by DXGI), confirmed by the real D3D12 backend in both fixtures. Windows x64 build 26200 on AMD64 Family 23 Model 113. - Rust `1.100.0 (0ef1bc386 2026-11-09)`. DXC `1.9.2609.5 (01b62ad47)`. Unoptimized Cargo test profile, debug info and incremental compilation disabled. **Commands and results** - `cargo test --workspace --no-run` exited 0 outside the GPU lock. - `Invoke-ArcTest.ps1 -Test { & $fixture }` ran the built `gpu_textured_draw_e2e` test executable with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. Exit 0 in the lock wrapper. The test harness reported **2 passed, 0 failed, 0 ignored**, and the complete captured output contained **0 `SKIPPED` lines**. Harness time was 2.97 s. **Observed behavior** - `console_textured_ps_decoded_descriptors_and_switch_between_draws` passed its pixel readback checks for decoded texture and dynamic sampler descriptors, switching the descriptor table between two draws in one command list, and BGRA swizzle on the right half. - `console_ps_static_sampler_from_constants_in_abi_root_signature` passed its static-sampler extraction and pixel readback checks for point filtering with an opaque white border and linear filtering with wrap, with zero dynamic samplers supplied. - Both fixtures passed their translated graphics PSO and fallback-count assertions. **Not tested** The full GPU workspace suite and game smoke runs were omitted. Coverage is limited to the two synthetic 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 `pr969-focused.log` and published.
DavidM1911 commented 2026-11-26 04:07:37 +00:00 (Migrated from github.com)

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


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:7181676392 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/969#issuecomment-7181676392). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:23:26Z. --- 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:41:59 +00:00 (Migrated from github.com)

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


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:7273232818 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/969#issuecomment-7273232818). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:41:59Z. --- 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:33:34 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 23eb733

No open or merged PR makes the same change. Main's retail_textured_ps_decoded_descriptors_and_a_descriptor_change_between_draws (gpu_pso_e2e.rs) checks the descriptor switch with retail sample shaders only. This file does it with hand-built containers and adds a static-sampler extraction test. #941 (same author) covers untextured PSOs in another file and duplicates the container helpers. The lines shared with #896 are only that boilerplate.
All the APIs it calls (runner::draw_on_multi, pso::console_to_dxil_for, desc::xcl_image_words/xcl_sampler_words) exist on main. 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:7300855776 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/969#issuecomment-7300855776). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:33:34Z. --- **Triage (#1607)** – head 23eb733 No open or merged PR makes the same change. Main's `retail_textured_ps_decoded_descriptors_and_a_descriptor_change_between_draws` (`gpu_pso_e2e.rs`) checks the descriptor switch with retail sample shaders only. This file does it with hand-built containers and adds a static-sampler extraction test. #941 (same author) covers untextured PSOs in another file and duplicates the container helpers. The lines shared with #896 are only that boilerplate. All the APIs it calls (`runner::draw_on_multi`, `pso::console_to_dxil_for`, `desc::xcl_image_words`/`xcl_sampler_words`) exist on main. 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/969:upstream-pr/969'
git switch 'upstream-pr/969'

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