Tests: make the Windows no-GPU CI job pass on amd-dev again #3361

Closed
iggyvilla wants to merge 3 commits from upstream-pr/3361 into amd-dev
iggyvilla commented 2026-11-29 10:21:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-29T10:21:13Z.


On amd-dev (f33df5a7), every PR's Build and test (Windows, no GPU) job fails in hle::d3d12x.
There are two separate test-only causes:

  1. real::release_tests::the_last_release_drops_entries_before_the_object_goes: a68f609f made
    res_release call GetDesc on a resource's last release (to log a buffer's GPU address). The
    test's fake resource only has AddRef and Release in its vtable, so GetDesc calls a null
    pointer. The child process the test runs in (XCL_LATE_RELEASE=0) dies with 0xC0000005 before
    it prints anything, and the parent's output.status.success() assertion fails with empty
    output. This happens on a PC with a GPU as well as on CI.
  2. sparse::tests::a_gpu_write_into_a_gpu_view_lands_in_its_cpu_view does not fail on its own.
    It runs next to a_gpu_view_tile_is_filled_from_its_cpu_view_and_follows_its_writes, which
    uses software() to size its GPU view: 53 tiles on a software device, 3 GiB on a GPU.
    software() only checks DXGI_ADAPTER_FLAG_SOFTWARE. The CI runner's default adapter is
    the Microsoft Basic Render Driver, which does not have that flag, so the test reserves 3 GiB
    there (the 0xc0000000 bytes reservation in the CI logs). The shared device is then removed,
    the next Map (in a_gpu_write_…) returns 0x887a0005, and stop_if_device_removed ends the
    whole test process. That is why the failing test name changes between runs (#3112's log ends
    before a_gpu_write_… prints FAILED). main and nvidia-dev already fixed this in 9d967cf8
    (#2837), which never reached amd-dev. This PR cherry-picks it.

What is in it

  • Tests: give the last-release test's fake resource a GetDesc: the fake's vtable gets a
    GetDesc (slot pc_slot!("ID3D12Resource", "GetDesc")) that returns a texture's desc, so
    res_release skips the buffer-address log and the test checks the same things as before.
    No assertion was changed.
  • Tests: sparse tests take CI's Basic Render Driver for a software device: a cherry-pick of
    9d967cf8 from main (author kept, -x). software() also treats vendor 0x1414 / device 0x8c
    as software (WARP and the Basic Render Driver).
  • Tests: a console MS in the AS slot is refused by its MS translation: a cherry-pick of 2331f2ea from main (-x). tests/d3d12_mesh_stream.rs on amd-dev still expects the pre-#541 refusal text (in the AS slot); since #541 an MS in the AS slot is translated as the MS and refused for having no NGG variant. It only showed up once the lib tests passed, because cargo stops at the first failing test binary.

Only #[cfg(test)] code and a test file change.

Tested
Windows 11, AMD RX 6650 XT, branch head 95e36515:

  • cargo test --lib release_tests -- --test-threads=1: 1 passed (before the fix: 1 failed, child exit 0xC0000005).

  • cargo test -q --lib hle::d3d12x::sparse::tests::a_gpu_write_into_a_gpu_view_lands_in_its_cpu_view -- --exact, run 10 times on the GPU and 10 times with XCL_TEST_WARP=1: 20 of 20 passed.

  • XCL_TEST_WARP=1 cargo test -q --lib hle::d3d12x::sparse:: -- --test-threads=4, run 3 times: 77 passed, 0 failed, 1 ignored each time.

  • cargo test --lib hle::d3d12x:: -- --test-threads=1: 654 passed, 7 failed, 2 ignored. All 7 also fail on unmodified amd-dev f33df5a7 on this PC, and none is touched here: sparse::private_physical_pages_reach_the_gpu_on_mapping, sparse::a_tile_decommitted_and_committed_again_keeps_its_video_memory, sparse::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight, title_textures::placed_title_textures_share_vram_and_preserve_pixels, and the three title_textures::stream_recheck_* (PoisonError left by the placed_… panic).

  • cargo test --test d3d12_mesh_stream -- --test-threads=1: 3 passed (before: 1 failed).

  • Not run to the end: cargo test --workspace locally (it has GPU/game-dependent failures of its own on this PC, e.g. e2e and gpu:: tests that also fail on amd-dev).

Regression run
Only #[cfg(test)] code changes, but scripts/pr_check.py counts real.rs and sparse.rs as runtime files, so here are the two 60 s scripts/smoke.ps1 runs (XCL_PREPARE=0, same title, RX 6650 XT, compute pipeline cache warmed with xcl pso-precompile --used). First main d8bd9a38, then this PR's head.

xcl-smoke v1
commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
gpu: AMD Radeon RX 6650 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15479 MB
xcl-smoke v1
commit: 95e3651549275061af72b31141a4efbbdc64c2c5
gpu: AMD Radeon RX 6650 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 1370 (PresentX 1370)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 24520 MB

Peak commit is past the 1.25x rule, but that is amd-dev's: unmodified amd-dev f33df5a7 peaks at 25,028 MB in the same run, and the cause is in #3360. This PR does not change it.

Not tested

  • The Basic Render Driver itself: there is none on this PC. The 0x1414/0x8c check is taken from main, where CI with it is green (run 46240519584 sizes the test at 53 tiles). This PR's own CI run is the check.
  • The whole workspace suite (cargo test --workspace -- --test-threads=4) was not run. Only the hle::d3d12x tests were.
  • Whether CI gets past the rest of hle::d3d12x after this is not known. On main's CI, placed_title_textures_… skips (no reserved cube with mips) and the stream_recheck_* tests pass.

AI use
Claude Code (Claude Opus 5.5, medium effort, subagent) found the cause, wrote the fix and ran the tests; coordinated by Claude Code (Claude Sonnet 5.5); the account owner did not write it. The second commit is a cherry-pick of an existing main commit (9d967cf8, its own AI disclosure is in its message).

<!-- greyfinch-sync:ivall/xcl:issue:5549781463 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3361). Originally posted by [iggyvilla](https://github.com/iggyvilla) on 2026-11-29T10:21:13Z. --- On `amd-dev` (f33df5a7), every PR's `Build and test (Windows, no GPU)` job fails in `hle::d3d12x`. There are two separate test-only causes: 1. `real::release_tests::the_last_release_drops_entries_before_the_object_goes`: a68f609f made `res_release` call `GetDesc` on a resource's last release (to log a buffer's GPU address). The test's fake resource only has AddRef and Release in its vtable, so `GetDesc` calls a null pointer. The child process the test runs in (`XCL_LATE_RELEASE=0`) dies with 0xC0000005 before it prints anything, and the parent's `output.status.success()` assertion fails with empty output. This happens on a PC with a GPU as well as on CI. 2. `sparse::tests::a_gpu_write_into_a_gpu_view_lands_in_its_cpu_view` does not fail on its own. It runs next to `a_gpu_view_tile_is_filled_from_its_cpu_view_and_follows_its_writes`, which uses `software()` to size its GPU view: 53 tiles on a software device, 3 GiB on a GPU. `software()` only checks `DXGI_ADAPTER_FLAG_SOFTWARE`. The CI runner's default adapter is the Microsoft Basic Render Driver, which does not have that flag, so the test reserves 3 GiB there (the `0xc0000000 bytes` reservation in the CI logs). The shared device is then removed, the next `Map` (in `a_gpu_write_…`) returns 0x887a0005, and `stop_if_device_removed` ends the whole test process. That is why the failing test name changes between runs (#3112's log ends before `a_gpu_write_…` prints FAILED). main and nvidia-dev already fixed this in 9d967cf8 (#2837), which never reached amd-dev. This PR cherry-picks it. **What is in it** - `Tests: give the last-release test's fake resource a GetDesc`: the fake's vtable gets a `GetDesc` (slot `pc_slot!("ID3D12Resource", "GetDesc")`) that returns a texture's desc, so `res_release` skips the buffer-address log and the test checks the same things as before. No assertion was changed. - `Tests: sparse tests take CI's Basic Render Driver for a software device`: a cherry-pick of 9d967cf8 from main (author kept, `-x`). `software()` also treats vendor 0x1414 / device 0x8c as software (WARP and the Basic Render Driver). - `Tests: a console MS in the AS slot is refused by its MS translation`: a cherry-pick of 2331f2ea from main (`-x`). `tests/d3d12_mesh_stream.rs` on amd-dev still expects the pre-#541 refusal text (`in the AS slot`); since #541 an MS in the AS slot is translated as the MS and refused for having no NGG variant. It only showed up once the lib tests passed, because cargo stops at the first failing test binary. Only `#[cfg(test)]` code and a test file change. **Tested** Windows 11, AMD RX 6650 XT, branch head 95e36515: - `cargo test --lib release_tests -- --test-threads=1`: 1 passed (before the fix: 1 failed, child exit 0xC0000005). - `cargo test -q --lib hle::d3d12x::sparse::tests::a_gpu_write_into_a_gpu_view_lands_in_its_cpu_view -- --exact`, run 10 times on the GPU and 10 times with `XCL_TEST_WARP=1`: 20 of 20 passed. - `XCL_TEST_WARP=1 cargo test -q --lib hle::d3d12x::sparse:: -- --test-threads=4`, run 3 times: 77 passed, 0 failed, 1 ignored each time. - `cargo test --lib hle::d3d12x:: -- --test-threads=1`: 654 passed, 7 failed, 2 ignored. All 7 also fail on unmodified amd-dev f33df5a7 on this PC, and none is touched here: `sparse::private_physical_pages_reach_the_gpu_on_mapping`, `sparse::a_tile_decommitted_and_committed_again_keeps_its_video_memory`, `sparse::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight`, `title_textures::placed_title_textures_share_vram_and_preserve_pixels`, and the three `title_textures::stream_recheck_*` (PoisonError left by the `placed_…` panic). - `cargo test --test d3d12_mesh_stream -- --test-threads=1`: 3 passed (before: 1 failed). - Not run to the end: `cargo test --workspace` locally (it has GPU/game-dependent failures of its own on this PC, e.g. `e2e` and `gpu::` tests that also fail on amd-dev). **Regression run** Only `#[cfg(test)]` code changes, but `scripts/pr_check.py` counts `real.rs` and `sparse.rs` as runtime files, so here are the two 60 s `scripts/smoke.ps1` runs (`XCL_PREPARE=0`, same title, RX 6650 XT, compute pipeline cache warmed with `xcl pso-precompile --used`). First `main` `d8bd9a38`, then this PR's head. ``` xcl-smoke v1 commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0 gpu: AMD Radeon RX 6650 XT title: 1778c2d9 seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 15479 MB ``` ``` xcl-smoke v1 commit: 95e3651549275061af72b31141a4efbbdc64c2c5 gpu: AMD Radeon RX 6650 XT title: 1778c2d9 seconds: 60 exit: 0x0 frames shown: 1370 (PresentX 1370) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 24520 MB ``` Peak commit is past the 1.25x rule, but that is `amd-dev`'s: unmodified `amd-dev` `f33df5a7` peaks at 25,028 MB in the same run, and the cause is in #3360. This PR does not change it. **Not tested** - The Basic Render Driver itself: there is none on this PC. The 0x1414/0x8c check is taken from main, where CI with it is green (run 46240519584 sizes the test at 53 tiles). This PR's own CI run is the check. - The whole workspace suite (`cargo test --workspace -- --test-threads=4`) was not run. Only the `hle::d3d12x` tests were. - Whether CI gets past the rest of `hle::d3d12x` after this is not known. On main's CI, `placed_title_textures_…` skips (no reserved cube with mips) and the `stream_recheck_*` tests pass. **AI use** Claude Code (Claude Opus 5.5, medium effort, subagent) found the cause, wrote the fix and ran the tests; coordinated by Claude Code (Claude Sonnet 5.5); the account owner did not write it. The second commit is a cherry-pick of an existing main commit (9d967cf8, its own AI disclosure is in its message).
Foniass commented 2026-12-01 09:02:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:02:01Z.


Review (head 95e36515, diff read, not a merge-check; draft, base amd-dev):

  • It's already on its branch. Merging this head into current origin/amd-dev (41aa60ce) changes nothing. Equivalent commits are there already: f5ccab5b (yours), 1e75126c and 2331f2ea. It can be closed.
  • Main doesn't need it either: 9d967cf8 and 2331f2ea are on main, and the GetDesc fake isn't needed there (main's res_release doesn't call GetDesc).

Fine: every hunk is test code (release_tests and sparse::tests are #[cfg(test)]), with no #[ignore] and no new skips. The "MS: " prefix match in d3d12_mesh_stream.rs is the same as on main.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7306117871 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3361#issuecomment-7306117871). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:02:01Z. --- Review (head 95e36515, diff read, not a merge-check; draft, base `amd-dev`): - **It's already on its branch.** Merging this head into current `origin/amd-dev` (41aa60ce) changes nothing. Equivalent commits are there already: f5ccab5b (yours), 1e75126c and 2331f2ea. It can be closed. - Main doesn't need it either: 9d967cf8 and 2331f2ea are on main, and the `GetDesc` fake isn't needed there (main's `res_release` doesn't call `GetDesc`). Fine: every hunk is test code (`release_tests` and `sparse::tests` are `#[cfg(test)]`), with no `#[ignore]` and no new skips. The `"MS: "` prefix match in `d3d12_mesh_stream.rs` is the same as on main. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Foniass commented 2026-12-01 09:51:34 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 95e3651

All three commits of this PR are already on amd-dev with identical patches: f5ccab5b (fake resource gets a GetDesc in release_tests), 2331f2ea (d3d12_mesh_stream.rs expects the MS translation's refusal) and 1e75126c (sparse.rs software() takes the Basic Render Driver 0x1414:0x8c).
The large line overlap with #3111, #3112, #3335 and #3099 is only their shared amd-dev base, not the same change.
Recommendation: close (superseded by amd-dev commits f5ccab5b, 2331f2ea, 1e75126c).

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:7307309806 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3361#issuecomment-7307309806). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:51:34Z. --- **Triage (#1607)** – head 95e3651 All three commits of this PR are already on `amd-dev` with identical patches: f5ccab5b (fake resource gets a `GetDesc` in `release_tests`), 2331f2ea (`d3d12_mesh_stream.rs` expects the MS translation's refusal) and 1e75126c (`sparse.rs` `software()` takes the Basic Render Driver 0x1414:0x8c). The large line overlap with #3111, #3112, #3335 and #3099 is only their shared `amd-dev` base, not the same change. Recommendation: close (superseded by amd-dev commits f5ccab5b, 2331f2ea, 1e75126c). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 16:01:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T16:01:34Z.


Closing as superseded: this change is already on amd-dev (f5ccab5b, 1e75126c, 2331f2ea). From Foniass's rechecked close list on #1607, checked again by script just now. If something here is still missing, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7316911246 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3361#issuecomment-7316911246). Originally posted by [throny](https://github.com/throny) on 2026-12-01T16:01:34Z. --- Closing as superseded: this change is already on `amd-dev` (f5ccab5b, 1e75126c, 2331f2ea). From Foniass's rechecked close list on #1607, checked again by script just now. If something here is still missing, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5).

Pull request closed

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!3361
No description provided.