Tests: the draw harness puts the memory windows in its heap #1743

Open
github-bot wants to merge 1 commit from github-bot/gh-1743 into main AGit
Owner

@⁠Retried on GitHub · 2026-11-24 20:08 UTC · original
Retried:tests/draw-heap-window-views → main · +26 −12 · 4 files · 1 commits · open

With XCL_HEAP_WINDOWS=1, three retail tests in gpu_pso_e2e fail on any GPU: retail_vs_ps_through_the_pso_hook_render_and_read_back, retail_pipelines_built_in_the_background_behind_a_stand_in and retail_textured_ps_decoded_descriptors_and_a_descriptor_change_between_draws. Each image comes back as the clear colour. The cause is the test harness, not the heap form. A pipeline built by the backend's hook reads memory window k through ResourceDescriptorHeap[MEM_HEAP_BASE + k]. The console heap keeps those slots for the window views, and the title's views come after them. runner::draw_on / draw_on_multi instead bound a heap of their own with no window views and the textures at 2·i, so the VS read an empty slot and drew nothing. The compute runner already fills the window slots (dispatch_with); the graphics path did not. The tests need XCL_SAMPLE_RPF, which is probably why the #680 test runs did not show this.

Part of #680 (heap windows on by default needs the whole suite green in both forms).

What is in it

  • Tests: the draw harness puts the memory windows in its heap:
    • crates/xcl/src/gpu/recomp/runner.rs: bind_views puts a raw UAV of mem in every window slot (MEM_HEAP_BASE..) and the textures from the new VIEW_HEAP_BASE (MEM_HEAP_BASE + MAX_WINDOWS, where the console heap's views start). Every draw goes through it.
    • The three textured tests use VIEW_HEAP_BASE as their texture index: crates/xcl/tests/gpu_pso_e2e.rs, crates/xcl/src/gpu/recomp/tests.rs, crates/xcl/src/gpu/dxil/graphics_tests.rs.

Tested

  • NVIDIA GeForce RTX 2070 SUPER (driver 621.35), Ryzen 7 5800X3D, 32 GB, Windows build 26300, rustc 1.100.0, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), debug
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_SAMPLE_RPF set) on 0e89e2c (this PR on 6c89285):
    • XCL_HEAP_WINDOWS unset: 863 passed, 0 failed, 42 ignored
    • XCL_HEAP_WINDOWS=1: 863 passed, 0 failed, 42 ignored. The first run of this form had 862 passed and 1 failed: test_title_draws_with_a_root_signature_under_the_debug_layer, where the test title hung after its triangle check. That test then passed alone 5 times out of 5, on 6c89285 and on this PR, about 2.7 s each. The draw harness is not on its path, and no runtime code calls it.
  • Before the rebase, on c160d86: with this PR, 858 passed, 0 failed, 42 ignored in both forms; without it, with XCL_HEAP_WINDOWS=1, 855 passed and 3 failed (the three tests above).
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64); with XCL_HEAP_WINDOWS unset also heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)

Regression run

The diff changes only test code (no runtime code calls the draw harness), but runner.rs lives in crates/xcl/src. Same title, same 60 s, XCL_TRANSLATED_CACHE=0, an empty XCL_DXIL_CACHE for each run; main ran first. This PR: 99.0 % of main's frames, 99.96 % of its peak commit, no device removal or crash.

xcl-smoke v1
commit: 6c89285b8b529bde59cd17a26b911c39912fb677
gpu: NVIDIA GeForce RTX 2070 SUPER
title: hehe
seconds: 60
exit: 0x0
frames shown: 1086 (PresentX 1087)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15592 MB
xcl-smoke v1
commit: 0e89e2c887159acd7f90c582bfcaeeb2c3f93ea6
gpu: NVIDIA GeForce RTX 2070 SUPER
title: hehe
seconds: 60
exit: 0x0
frames shown: 1075 (PresentX 1075)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15586 MB

Before the rebase onto 6c89285, one head run (01ed927) reached only 553 frames: after loading it held 28 presents per 2 s where main had 60. Three reruns in a row (head 1094, main 1057, head 1062 frames) all held 60.

Not tested

  • AMD and Intel GPUs, wave64 hardware
  • #1695 and #1669 add a null view at MEM_HEAP_BASE + MAX_WINDOWS, and the console heap's views then start one slot later. Whichever of them lands after this one needs VIEW_HEAP_BASE = MEM_HEAP_NULL + 1 and the null view in bind_views.

AI use

  • Claude Code, Claude Opus 5.5: found the cause, wrote the change and this description, ran the tests and the smoke runs. I reviewed the diff.

🤖 Generated with Claude Code

**@⁠Retried** on GitHub · 2026-11-24 20:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1743) `Retried:tests/draw-heap-window-views` → `main` · +26 −12 · 4 files · 1 commits · open With `XCL_HEAP_WINDOWS=1`, three retail tests in `gpu_pso_e2e` fail on any GPU: `retail_vs_ps_through_the_pso_hook_render_and_read_back`, `retail_pipelines_built_in_the_background_behind_a_stand_in` and `retail_textured_ps_decoded_descriptors_and_a_descriptor_change_between_draws`. Each image comes back as the clear colour. The cause is the test harness, not the heap form. A pipeline built by the backend's hook reads memory window k through `ResourceDescriptorHeap[MEM_HEAP_BASE + k]`. The console heap keeps those slots for the window views, and the title's views come after them. `runner::draw_on` / `draw_on_multi` instead bound a heap of their own with no window views and the textures at 2·i, so the VS read an empty slot and drew nothing. The compute runner already fills the window slots (`dispatch_with`); the graphics path did not. The tests need `XCL_SAMPLE_RPF`, which is probably why the #680 test runs did not show this. Part of #680 (heap windows on by default needs the whole suite green in both forms). **What is in it** - `Tests: the draw harness puts the memory windows in its heap`: - `crates/xcl/src/gpu/recomp/runner.rs`: `bind_views` puts a raw UAV of `mem` in every window slot (`MEM_HEAP_BASE`..) and the textures from the new `VIEW_HEAP_BASE` (`MEM_HEAP_BASE + MAX_WINDOWS`, where the console heap's views start). Every draw goes through it. - The three textured tests use `VIEW_HEAP_BASE` as their texture index: `crates/xcl/tests/gpu_pso_e2e.rs`, `crates/xcl/src/gpu/recomp/tests.rs`, `crates/xcl/src/gpu/dxil/graphics_tests.rs`. **Tested** - NVIDIA GeForce RTX 2070 SUPER (driver 621.35), Ryzen 7 5800X3D, 32 GB, Windows build 26300, rustc 1.100.0, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), debug - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` (`XCL_SAMPLE_RPF` set) on `0e89e2c` (this PR on `6c89285`): - `XCL_HEAP_WINDOWS` unset: 863 passed, 0 failed, 42 ignored - `XCL_HEAP_WINDOWS=1`: 863 passed, 0 failed, 42 ignored. The first run of this form had 862 passed and 1 failed: `test_title_draws_with_a_root_signature_under_the_debug_layer`, where the test title hung after its triangle check. That test then passed alone 5 times out of 5, on `6c89285` and on this PR, about 2.7 s each. The draw harness is not on its path, and no runtime code calls it. - Before the rebase, on `c160d86`: with this PR, 858 passed, 0 failed, 42 ignored in both forms; without it, with `XCL_HEAP_WINDOWS=1`, 855 passed and 3 failed (the three tests above). - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64); with `XCL_HEAP_WINDOWS` unset also `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) **Regression run** The diff changes only test code (no runtime code calls the draw harness), but `runner.rs` lives in `crates/xcl/src`. Same title, same 60 s, `XCL_TRANSLATED_CACHE=0`, an empty `XCL_DXIL_CACHE` for each run; `main` ran first. This PR: 99.0 % of main's frames, 99.96 % of its peak commit, no device removal or crash. ``` xcl-smoke v1 commit: 6c89285b8b529bde59cd17a26b911c39912fb677 gpu: NVIDIA GeForce RTX 2070 SUPER title: hehe seconds: 60 exit: 0x0 frames shown: 1086 (PresentX 1087) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15592 MB ``` ``` xcl-smoke v1 commit: 0e89e2c887159acd7f90c582bfcaeeb2c3f93ea6 gpu: NVIDIA GeForce RTX 2070 SUPER title: hehe seconds: 60 exit: 0x0 frames shown: 1075 (PresentX 1075) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15586 MB ``` Before the rebase onto `6c89285`, one head run (`01ed927`) reached only 553 frames: after loading it held 28 presents per 2 s where main had 60. Three reruns in a row (head 1094, main 1057, head 1062 frames) all held 60. **Not tested** - AMD and Intel GPUs, wave64 hardware - #1695 and #1669 add a null view at `MEM_HEAP_BASE + MAX_WINDOWS`, and the console heap's views then start one slot later. Whichever of them lands after this one needs `VIEW_HEAP_BASE = MEM_HEAP_NULL + 1` and the null view in `bind_views`. **AI use** - Claude Code, Claude Opus 5.5: found the cause, wrote the change and this description, ran the tests and the smoke runs. I reviewed the diff. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With XCL_HEAP_WINDOWS=1 a pipeline built by the backend's hook reads
memory window k through ResourceDescriptorHeap[MEM_HEAP_BASE + k], as
the console heap lays it out (window views first, the title's views
after them). runner::draw_on / draw_on_multi bound a heap of their own
with the textures at 2*i and no window views, so the retail VS/PS of
gpu_pso_e2e read an empty slot, drew nothing and left the clear colour:
three tests failed only in the heap form. The compute runner already
fills the window slots; the graphics one did not.

bind_views now puts a raw UAV of `mem` in every window slot and the
textures from VIEW_HEAP_BASE (MEM_HEAP_BASE + MAX_WINDOWS) on, and every
draw goes through it; the three textured tests use that index.

RTX 2070 SUPER (driver 621.35), DXC 1.9.2602.17,
cargo test --workspace --no-fail-fast -- --test-threads=4:
- XCL_HEAP_WINDOWS unset: 858 passed, 0 failed, 42 ignored
- XCL_HEAP_WINDOWS=1: 858 passed, 0 failed, 42 ignored
  (before: 855 passed, 3 failed: retail_vs_ps_through_the_pso_hook_*,
  retail_pipelines_built_in_the_background_*, retail_textured_ps_*)

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

@⁠futurepro62 on GitHub · 2026-11-24 21:16 UTC · original · edited 2026-11-24 21:58 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 0e89e2c (on its base 6c89285).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, 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 pso_measurement_compiles_an_exact_synthetic_record: 862 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 863 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (#1651), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set XCL_REQUIRE_GPU, so there both just print SKIPPED.

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 21:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1743#issuecomment-7144718388) · edited 2026-11-24 21:58 UTC Full-suite run, since this PR has no test report yet. Tested exact head `0e89e2c` (on its base `6c89285`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, 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 pso_measurement_compiles_an_exact_synthetic_record`: **862 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - No new `#[test]` functions in the diff. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **863 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Two tests were skipped with `--skip` on NVIDIA. Both fail on main `7f7e768` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. `heap_window_out_of_memory_falls_back_to_the_switch_form` skips when `XCL_HEAP_WINDOWS` is unset (#1651), and `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set `XCL_REQUIRE_GPU`, so there both just print SKIPPED. **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

@⁠Retried on GitHub · 2026-11-24 22:28 UTC · original

I am not going to follow this PR up any further. It is finished as described, and maintainers can edit the branch, take it over or close it.

If #1695 or #1669 lands first, the draw harness has to follow the new heap layout. That means VIEW_HEAP_BASE = MEM_HEAP_NULL + 1 in runner.rs and the null view in bind_views, as the description says under Not tested.

**@⁠Retried** on GitHub · 2026-11-24 22:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1743#issuecomment-7146267772) I am not going to follow this PR up any further. It is finished as described, and maintainers can edit the branch, take it over or close it. If #1695 or #1669 lands first, the draw harness has to follow the new heap layout. That means `VIEW_HEAP_BASE = MEM_HEAP_NULL + 1` in `runner.rs` and the null view in `bind_views`, as the description says under **Not tested**.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 22:55 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 22:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1743#issuecomment-7146804297) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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