Skip to content

Tests: select the requested adapter for heap probes - #2881

Open
andrewDoing wants to merge 1 commit into
xcl-dev:mainfrom
andrewDoing:tests/heap-probe-selected-adapter
Open

andrewDoing wants to merge 1 commit into
xcl-dev:mainfrom
andrewDoing:tests/heap-probe-selected-adapter

Conversation

@andrewDoing

Copy link
Copy Markdown
Contributor

The opt-in D3D12 heap diagnostics ignored XCL_ADAPTER, so they could print plausible limits for the default GPU while a different adapter was requested. Honor the selector, identify the actual device and report unavailable adapters through the standard skip mechanism.

What is in it

  • crates/xcl/tests/heap_probe.rs: select the requested native D3D12 device for all four ignored probes, preserve the default-device behavior for auto, and print the adapter and LUID. When a device is unavailable, permissive mode now skips and strict mode fails.

Tested

  • NVIDIA RTX 5070, driver 616.92; Ryzen 7 5700X3D; Windows build 26300.10075; Rust 1.100.0 MSVC, debug; SDK DXC/DXIL 1.8.2502.11.
  • Manually ran the ignored view_heap_capacity probe on the RTX 5070 and WARP. The former reported maximum 1,000,000 views / 4,080 samplers and rejected a 1.2M view heap; WARP reported 2,097,152 / 2,097,152 and created it. auto selected the RTX 5070 as before.
  • With a nonexistent selector, all four ignored probes reported named skips; with XCL_REQUIRE_GPU=mesh all four failed as expected. Before the change the strict view_heap_capacity control instead printed results from the default GPU.
  • cargo test --workspace --no-fail-fast -- --test-threads=4, with a writable workspace DXIL cache: 1,441 passed, 5 failed, 47 ignored. A fresh clean-main run at 8b957bec had the same totals. Four failures were known RTX 50 fuzz seeds (DXIL GPU fuzz tests reproducibly fail with E_OUTOFMEMORY on RTX 5060 #1905), and one was the synthetic-title DRED test. Both logged 26 skip events: 21 no wave64, three unsupported per-lane forms, one unavailable driver-cache option, and one unavailable heap-windows feature.

Regression run

  • Not run: changes are confined to integration-test diagnostics.

Not tested

  • The other three opt-in diagnostics on live adapters, other GPU vendors, retail titles, or performance.

AI use

  • OpenAI Codex with GPT-6.2 Astra identified, implemented and tested the change; another GPT-6.2 Astra agent independently reviewed it. Codex coordinated and prepared the PR.

@SlopTart

Copy link
Copy Markdown

Linux (Wine) dual-lane run at head 2c50cc71 - safe, but it does not change our NVIDIA Wine red.

Rig (Ryzen 9 9900X / RX 7900 XT / wine-11.0 Proton): 606/2, red set identical to today's fresh main baseline. Nothing to see on RADV.

Boxb (i5-10600K / GTX 1070 550.163.01 / wine-10.0 + vkd3d-proton, xvfb): 605/3, and the veteran red list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu - the one we flagged in our #2771 row as NVIDIA-only - still fails identically at your head. So the adapter-selection fix does not reach whatever is wrong in the Wine + NVIDIA stack; the test gets the right adapter here but still reads stale CPU-side contents for the open existing heap.

Suite: cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu::.

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

rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
Rogeriomatador added a commit to CaveiraBoone/NexusVI that referenced this pull request Nov 27, 2026
Import public XCL PR xcl-dev#2881, by @andrewDoing.
Source: xcl-dev#2881
Original head: 2c50cc7
GPL-2.0-only; original attribution retained. Imported for authorized synthetic test validation; not yet independently tested.

Assisted-by: ChatGPT (GPT-6.2)
@andrewDoing
andrewDoing marked this pull request as ready for review November 29, 2026 15:59
@github-actions github-actions Bot added the area:tests Unit, integration, e2e tests, or testtitle label Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 2c50cc7

No open or merged PR changes adapter selection in tests/heap_probe.rs. #537, #2337, #2879 and #3016 do the same for other test files.
No problems found in the diff. All four probes are #[ignore] manual probes. view_heap_capacity now skips instead of panicking when there is no device.
Recommendation: keep open.

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

@fromthemoonx

fromthemoonx commented Dec 1, 2026 •

Copy link
Copy Markdown

merge-check
base: 6bfb5c5
head: 2c50cc7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2904 passed, 0 failed, 51 ignored (base: 2904 passed, 0 failed, 51 ignored; the four probes are #[ignore]); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none
review: read the whole diff (1 file, crates/xcl/tests/heap_probe.rs, +40 -18, test-only). No correctness problem found.

  • The four probes, cargo test -p xcl --test heap_probe -- --ignored --test-threads=1 --nocapture, one GPU here:

    Setting Adapter printed Result
    XCL_ADAPTER unset NVIDIA GeForce RTX 3060 4 passed; view_heap_capacity: max view heap 1000000, samplers 4080
    XCL_ADAPTER=3060 NVIDIA GeForce RTX 3060 4 passed
    XCL_ADAPTER=warp Microsoft Basic Render Driver 3 passed, 1 failed (below); view_heap_capacity: 2097152 / 2097152
    XCL_ADAPTER=nosuchgpu none 4 passed, each with SKIPPED ...: no D3D12 device for "nosuchgpu": ... matches no hardware adapter (have: 0 = NVIDIA GeForce RTX 3060)
    XCL_ADAPTER=nosuchgpu and XCL_REQUIRE_GPU=mesh none 4 failed, as the description says
  • Not this PR's code, but now reachable through it: on WARP, window_sized_reserved_buffer_on_video_memory_tiles fails 3 of 3 runs alone.

    • The 4096 MiB reserved buffer gets E_OUTOFMEMORY, which the probe prints and moves on from.
    • The next size's copy then ends in 0x887A0005 (device suspended) at q.Signal(&fence, 1).unwrap() in gpu_copy.
    • Before this PR the probes could not run on WARP. The description's WARP run covered only view_heap_capacity.
  • auto keeps the old D3D12CreateDevice(None, ...) path, so the default does not change.

  • view_heap_capacity now skips without a device instead of panicking on unwrap().
    performance: none: manual probes in an integration test.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)

@github-actions github-actions Bot added needs-1st-check Passes gates; needs first independent merge-check (#3041) needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) labels Dec 1, 2026
@vasanex

vasanex commented Dec 2, 2026

Copy link
Copy Markdown

merge-check claim
head: 2c50cc7

@vasanex

vasanex commented Dec 2, 2026

Copy link
Copy Markdown

merge-check
base: 1c8b551
head: 2c50cc7
merge: clean (merged tree 5267e871, git diff --check clean)
build: cargo build --workspace -> ok (the changed test file compiles against main's xcl::gpu::adapter)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2909 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same set as on the base; failing: none. Base alone, same machine: 2909 passed, 0 failed, 51 ignored. The four probes this PR changes are #[ignore] and were not run here.
review: whole diff read (one file, crates/xcl/tests/heap_probe.rs, +40/-18). No finding. The four ignored probes take their device from one helper: auto keeps the default-device call as before, another XCL_ADAPTER goes through adapter::candidates (or EnumWarpAdapter), the adapter's name and LUID are printed, and a missing device is a skip_test instead of a silent return or, in view_heap_capacity, an unwrap. Nothing outside the test file changes.
performance: none: ignored test code only.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0, debug / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) labels Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests Unit, integration, e2e tests, or testtitle ready-to-merge Has 2 independent safe merge-checks on current head (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants