d3d12-gpu: a test that needs a card says SKIP when there is none #2963

Closed
leonida/mandy
aznohonza wants to merge 0 commits from gpu/test-require-host into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

aznohonza commented 2026-12-01 21:55:47 +00:00

Re-created from the original #2908. aznohonza/mandy-contrib was made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (422 state cannot be changed). Same branch, rebased on main at 913b88b90; current head 13844f2f2. The original review thread is at #2908.


Tests that need the host device mostly read let Some(host) = crate::host::host() else { return }; and return without a word when the machine has no D3D12 device, so a run where they were skipped looks exactly like a run where they passed.

host::require_host() is the same lookup with one stderr line when there is none:

SKIP: no D3D12 device

The test call sites that used the silent form now call it. Host heaps say the same through heap_or_skip (SKIP: no host descriptor heap), and the tests that looked the device up directly print the line themselves. Sites that already print their own reason (e.g. sampler, pool::small, compose, indirect/bench) are left as they were, and production callers are untouched — require_host and heap_or_skip exist in test builds only.

Both CI steps that can skip for want of a device now run with --nocapture (the workspace tests and the diagnostics replay test), because libtest hides the stderr of a passing test: without it, CI showed none of these lines.

Review follow-up (all on this head):

  • --nocapture on the no-GPU cargo test step and on the diagnostics replay step (no adapter: skipped is now visible too).
  • Swept the remaining silent sites: descriptor/host.rs (the raw-view move test and every test-gated HostHeap::new), indirect.rs (argument clamp), resource.rs (two tests that looked the device up directly). ambient.rs has no silent site left on this base (#2893 is still open; whichever of the two lands second sweeps its new test).
  • The now-unused host import and the six double SKIP lines in host.rs are gone.

Verification:

  • cargo xwin test --target x86_64-pc-windows-msvc -p leonida-gpu --lib --no-run compiles; cargo xwin check without --tests is clean of new warnings (require_host/heap_or_skip are #[cfg(test)]).
  • On a host with no D3D12 device (this Linux box, the test binary under Wine): 641 passed, 3 failed, 59 ignored, and --nocapture prints 63 SKIP: lines, including every site listed in the review; the replay integration test prints no adapter: skipped with the flag and nothing without it. The three failures are watch::* tests that fail identically on unmodified main under Wine (checked by running the same three from main).
  • No test changes its assertions, runs or environment; no game data; no new switch.

Claimed in #2570 (RUST-SILENT-SKIP; the Python half is Neutron-0's PY-TEST-HARDLINK-GUARD-SKIP). AI-assisted.

The original review thread is #2908.

Re-created from the original #2908. `aznohonza/mandy-contrib` was made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (`422 state cannot be changed`). Same branch, rebased on `main` at `913b88b90`; current head `13844f2f2`. The original review thread is at #2908. --- Tests that need the host device mostly read `let Some(host) = crate::host::host() else { return };` and return without a word when the machine has no D3D12 device, so a run where they were skipped looks exactly like a run where they passed. `host::require_host()` is the same lookup with one stderr line when there is none: ``` SKIP: no D3D12 device ``` The test call sites that used the silent form now call it. Host heaps say the same through `heap_or_skip` (`SKIP: no host descriptor heap`), and the tests that looked the device up directly print the line themselves. Sites that already print their own reason (e.g. `sampler`, `pool::small`, `compose`, `indirect/bench`) are left as they were, and production callers are untouched — `require_host` and `heap_or_skip` exist in test builds only. Both CI steps that can skip for want of a device now run with `--nocapture` (the workspace tests and the diagnostics replay test), because libtest hides the stderr of a passing test: without it, CI showed none of these lines. **Review follow-up (all on this head):** - `--nocapture` on the no-GPU `cargo test` step and on the diagnostics replay step (`no adapter: skipped` is now visible too). - Swept the remaining silent sites: `descriptor/host.rs` (the raw-view move test and every test-gated `HostHeap::new`), `indirect.rs` (argument clamp), `resource.rs` (two tests that looked the device up directly). `ambient.rs` has no silent site left on this base (#2893 is still open; whichever of the two lands second sweeps its new test). - The now-unused `host` import and the six double `SKIP` lines in `host.rs` are gone. **Verification:** - `cargo xwin test --target x86_64-pc-windows-msvc -p leonida-gpu --lib --no-run` compiles; `cargo xwin check` without `--tests` is clean of new warnings (`require_host`/`heap_or_skip` are `#[cfg(test)]`). - On a host with no D3D12 device (this Linux box, the test binary under Wine): 641 passed, 3 failed, 59 ignored, and `--nocapture` prints 63 `SKIP:` lines, including every site listed in the review; the replay integration test prints `no adapter: skipped` with the flag and nothing without it. The three failures are `watch::*` tests that fail identically on unmodified `main` under Wine (checked by running the same three from `main`). - No test changes its assertions, runs or environment; no game data; no new switch. Claimed in #2570 (RUST-SILENT-SKIP; the Python half is Neutron-0's `PY-TEST-HARDLINK-GUARD-SKIP`). AI-assisted. The original review thread is #2908.
KelboLive reviewed 2026-12-01 22:19:31 +00:00
KelboLive left a comment
No description provided.
This is the same head (`42957b26b`) as #2908, where changes were requested, and the resubmission does not address them. Both blockers still apply: 1. libtest captures stderr for passing tests, and `.github/workflows/d3d12.yml:76` still runs `cargo test` **without `--nocapture`** on a no-GPU runner — so `SKIP: no D3D12 device` remains invisible exactly where it matters. Add the flag or count skips in a summary. 2. The sweep is still incomplete: `descriptor/host.rs:7625`, `indirect.rs:2377`, `resource.rs:4657`, and 14 `HostHeap::new(...) else { return }` sites still pass silently under a no-device run. Also, main has churned four of the swept files since this base (`host.rs` +372/−84, reaper work), so the sweep needs redoing after a rebase regardless. Please rebase and address the two points, then I'll re-check.
aznohonza commented 2026-12-01 22:28:25 +00:00

You are right, and the resubmission does not address either blocker.

  • Visibility: the no-GPU step still runs cargo test without --show-output/--nocapture (.github/workflows/d3d12.yml:76), so the lines are captured. I will add --show-output there, or a skip count if the log volume is a problem.
  • Sweep: descriptor/host.rs:7625, indirect.rs:2377, resource.rs:4657, the 14 HostHeap::new(...) else { return } sites, ambient.rs, and #2893's new gather_dispatches_the_partial_group are still silent.
  • The unused host import at host.rs:5761 and the six double-line sites are also mine.

Main's churn in four of those files means I will rebase first, then redo the sweep and the CI flag on the rebased tree, and re-request review. The PR body now carries this gap note so the claim is not repeated.

AI-assisted.

You are right, and the resubmission does not address either blocker. - Visibility: the no-GPU step still runs `cargo test` without `--show-output`/`--nocapture` (`.github/workflows/d3d12.yml:76`), so the lines are captured. I will add `--show-output` there, or a skip count if the log volume is a problem. - Sweep: `descriptor/host.rs:7625`, `indirect.rs:2377`, `resource.rs:4657`, the 14 `HostHeap::new(...) else { return }` sites, `ambient.rs`, and #2893's new `gather_dispatches_the_partial_group` are still silent. - The unused `host` import at `host.rs:5761` and the six double-line sites are also mine. Main's churn in four of those files means I will rebase first, then redo the sweep and the CI flag on the rebased tree, and re-request review. The PR body now carries this gap note so the claim is not repeated. AI-assisted.
aznohonza commented 2026-12-01 23:14:18 +00:00

Rebased on main (913b88b90) and both blockers are addressed in e4b99e3ab:

  1. The no-GPU step now runs cargo test ... -- --skip ... --nocapture, so the SKIP: lines are in the CI log.
  2. The sweep is finished on this base: the raw-view move test, indirect::tests::argument_clamp_builds, the two resource tests that looked the device up directly, and every test-gated HostHeap::new now go through a line-printing helper. ambient.rs has no silent site left here; #2893 is still open, so its new test is the only cross-PR piece I cannot sweep yet.
  3. The unused host import and the six double lines in host.rs are gone.

Checked with no device here (the test binary under Wine): --nocapture prints 63 SKIP: lines, including all the sites you listed. 641 passed / 3 failed / 59 ignored; the three are watch::* tests that fail identically on unmodified main under Wine (ran those three from main to confirm).

Re-requesting review.

Rebased on `main` (`913b88b90`) and both blockers are addressed in `e4b99e3ab`: 1. The no-GPU step now runs `cargo test ... -- --skip ... --nocapture`, so the `SKIP:` lines are in the CI log. 2. The sweep is finished on this base: the raw-view move test, `indirect::tests::argument_clamp_builds`, the two `resource` tests that looked the device up directly, and every test-gated `HostHeap::new` now go through a line-printing helper. `ambient.rs` has no silent site left here; #2893 is still open, so its new test is the only cross-PR piece I cannot sweep yet. 3. The unused `host` import and the six double lines in `host.rs` are gone. Checked with no device here (the test binary under Wine): `--nocapture` prints 63 `SKIP:` lines, including all the sites you listed. 641 passed / 3 failed / 59 ignored; the three are `watch::*` tests that fail identically on unmodified `main` under Wine (ran those three from `main` to confirm). Re-requesting review.
andrew-ai commented 2026-12-01 23:19:23 +00:00

One separate CI invocation still hides a GPU skip at e4b99e3ab. The workspace step has --nocapture, but the following “Replay test (diagnostics)” step invokes --test replay with default libtest capture. The replay integration test already prints "no adapter: skipped" before its early return.

I compiled that integration test on Windows with only the device creation call omitted to simulate an unavailable device. Running the same binary with the replay step's default output showed "1 passed" with no diagnostic. With --nocapture it printed "no adapter: skipped" and then "1 passed". Adding -- --nocapture to that second cargo invocation would expose the reason there too. This checks output visibility only. Codex-assisted.

One separate CI invocation still hides a GPU skip at e4b99e3ab. The workspace step has --nocapture, but the following “Replay test (diagnostics)” step invokes --test replay with default libtest capture. The replay integration test already prints "no adapter: skipped" before its early return. I compiled that integration test on Windows with only the device creation call omitted to simulate an unavailable device. Running the same binary with the replay step's default output showed "1 passed" with no diagnostic. With --nocapture it printed "no adapter: skipped" and then "1 passed". Adding -- --nocapture to that second cargo invocation would expose the reason there too. This checks output visibility only. Codex-assisted.
aznohonza commented 2026-12-01 23:22:54 +00:00

Fixed in 13844f2f2: the diagnostics replay step now runs with -- --nocapture too. Checked with the same binary under Wine (no adapter here): default output is just 1 passed, with --nocapture it prints no adapter: skipped first. The workspace step keeps its flag, and the body now lists both.

AI-assisted.

Fixed in `13844f2f2`: the diagnostics replay step now runs with `-- --nocapture` too. Checked with the same binary under Wine (no adapter here): default output is just `1 passed`, with `--nocapture` it prints `no adapter: skipped` first. The workspace step keeps its flag, and the body now lists both. AI-assisted.
andrew-ai commented 2026-12-01 23:23:35 +00:00

Confirmed 13844f2f2 closes my replay CI visibility finding. I extracted the libtest arguments from both workflow revisions and ran the same Windows replay binary with simulated unavailable device. The old arguments hid the reason; the revised arguments emitted "no adapter: skipped" on stderr. Both processes exited successfully, as expected. Codex-assisted.

Confirmed 13844f2f2 closes my replay CI visibility finding. I extracted the libtest arguments from both workflow revisions and ran the same Windows replay binary with simulated unavailable device. The old arguments hid the reason; the revised arguments emitted "no adapter: skipped" on stderr. Both processes exited successfully, as expected. Codex-assisted.
ammonium231 commented 2026-12-02 01:19:15 +00:00

RTX 3090 / 621.47, 13844f2f2 merged onto main 5d06e4793: cargo test -p leonida-gpu --locked is 656 passed, 0 failed, 59 ignored on both trees, with no SKIP lines. With a card present the tests run and pass. The diagnostics replay test is 1/1 passed on both.

RTX 3090 / 621.47, 13844f2f2 merged onto main 5d06e4793: cargo test -p leonida-gpu --locked is 656 passed, 0 failed, 59 ignored on both trees, with no SKIP lines. With a card present the tests run and pass. The diagnostics replay test is 1/1 passed on both.
MoonEyes commented 2026-12-02 12:19:11 +00:00

Closing: this pull request no longer applies to current main (merge conflict in .github/workflows/d3d12.yml), and open pull requests that have fallen out of step with main are being closed so the list stays workable. If you still want this change, rebase it on current main and reopen it (or open a new pull request); it will be looked at again.

AI-assisted (Claude Code).

Closing: this pull request no longer applies to current `main` (merge conflict in `.github/workflows/d3d12.yml`), and open pull requests that have fallen out of step with `main` are being closed so the list stays workable. If you still want this change, rebase it on current `main` and reopen it (or open a new pull request); it will be looked at again. AI-assisted (Claude Code).
Sign in to join this conversation.
No description provided.