Skip to content

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

Closed
iggyvilla wants to merge 3 commits into
xcl-dev:amd-devfrom
iggyvilla:amd-ci-fix-tests
Closed

iggyvilla wants to merge 3 commits into
xcl-dev:amd-devfrom
iggyvilla:amd-ci-fix-tests

Conversation

@iggyvilla

@iggyvilla iggyvilla commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

On amd-dev (f33df5a), 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: a68f609 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 (D3D12.X: add opt-in XCL_SPARSE_VRAM_CAP_MB to overflow sparse pools to L0 system memory #3112's log ends
    before a_gpu_write_… prints FAILED). main and nvidia-dev already fixed this in 9d967cf
    (Tests: sparse tests take CI's Basic Render Driver for a software device #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
    9d967cf 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 2331f2e from main (-x). tests/d3d12_mesh_stream.rs on amd-dev still expects the pre-D3D12.X: a console MS in the AS slot is translated as the mesh shader it is #541 refusal text (in the AS slot); since D3D12.X: a console MS in the AS slot is translated as the mesh shader it is #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 95e3651:

  • 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 f33df5a 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 (9d967cf, its own AI disclosure is in its message).

iggyvilla and others added 2 commits November 29, 2026 17:59
a68f609 made res_release ask the resource for its desc on the last
release (to log a buffer's GPU address). The fake resource in
release_tests::the_last_release_drops_entries_before_the_object_goes
has only AddRef and Release in its vtable, so the GetDesc slot is a
null pointer: the child process the test runs in (XCL_LATE_RELEASE=0)
dies with an access violation (0xC0000005) before printing anything,
and the parent's assertion fails with an empty output. Fails on CI
and on a PC alike.

The fake now answers GetDesc with a texture's desc, which takes no
GPU address, so the test checks what it checked before.

Assisted-by: Claude Code (Claude Opus 5.5)
Signed-off-by: Enrique Villa <eevilla@up.edu.ph>
On nvidia-dev, a_gpu_view_tile_is_filled_from_its_cpu_view_and_follows_its_writes
sizes its GPU view by software(): 53 tiles on a software device, 3 GiB on a GPU.
software() only looked at DXGI_ADAPTER_FLAG_SOFTWARE. On the CI runner the
default adapter is the Microsoft Basic Render Driver (0 MiB VRAM), and the CI log
of af2cecc shows the test reserving the 3 GiB view there; the device is then
removed (0x887a0020) and the device-removal handler ends the test process, so the
CI job fails on nvidia-dev and on every PR against it.

software() now also counts the Microsoft software adapter by its IDs
(vendor 0x1414, device 0x8c), which WARP and the Basic Render Driver share.
small_runs_go_up_in_dispatches_and_leave_what_lies_between uses the same check
and skips there as its comment intends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 9d967cf)
Signed-off-by: Enrique Villa <eevilla@up.edu.ph>
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly (xcl-dev#2015) expects
the "in the AS slot" refusal. xcl-dev#541 (70f9185) removed that refusal on
purpose: a console MS alone in the AS slot is now translated as the mesh
shader it is. nvidia-dev has both, so the test failed on every GPU run.
The synthetic container has no NGG variant, so it is still refused with
E_INVALIDARG, now by the MS translation ("MS: no NGG hardware variant").
The test now expects that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2331f2e)
Signed-off-by: Enrique Villa <eevilla@up.edu.ph>
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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

  • It's already on its branch. Merging this head into current origin/amd-dev (41aa60c) changes nothing. Equivalent commits are there already: f5ccab5 (yours), 1e75126 and 2331f2e. It can be closed.
  • Main doesn't need it either: 9d967cf and 2331f2e 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

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 95e3651

All three commits of this PR are already on amd-dev with identical patches: f5ccab5 (fake resource gets a GetDesc in release_tests), 2331f2e (d3d12_mesh_stream.rs expects the MS translation's refusal) and 1e75126 (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 f5ccab5, 2331f2e, 1e75126).

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

@throny

throny commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Closing as superseded: this change is already on amd-dev (f5ccab5, 1e75126, 2331f2e). 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).

@throny throny added the duplicate This issue or pull request already exists label Dec 1, 2026
@throny throny closed this Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA area:tests Unit, integration, e2e tests, or testtitle duplicate This issue or pull request already exists gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants