Tests: hardware tests can no longer pass without running, strict runs fail fast (port of spk-c 7cd474e3) #1331

Closed
CwWwWwW wants to merge 1 commit from upstream-pr/1334 into main
CwWwWwW commented 2026-11-26 15:54:29 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-26T15:54:29Z.


Problem

The wave64 hardware tests in crates/victory-shader/src/emit/wave64_tests.rs use Host::new(false) and skip with eprintln!(...); return; when no SM 6.6 device exists. A test that returns counts as a pass, so a CI or developer run requesting hardware coverage reports green while executing nothing - a silently untested shader change can look verified.

Found while comparing the other forks: spk-c/victory-fork commit 7cd474e3 (spk). It is not in this fork, upstream/main, the #653 batch or any open PR; this is that fix ported unchanged.

Change

  • New gpu_unavailable(stage, error): prints GPU test skipped at <stage>: <error>, or panics with GPU test unavailable at <stage>: <error> when VICTORY_REQUIRE_GPU_TESTS=1.
  • All six hardware test entry points (device initialization and compute pipeline creation, including the on_the_card helper) go through it; the old bare eprintln! skips are gone.
  • Default behavior is unchanged for hardware-less CI: the test reports the stage and passes. Strict hardware jobs can now fail instead of silently passing.
  • Test-only; no product code touched.

Tests

  • cargo test -p victory-shader --lib wave64 (no device here): 8 tests pass (2 pure + 6 hardware skips), as before.
  • VICTORY_REQUIRE_GPU_TESTS=1 cargo test -p victory-shader --lib wave64: 6 hardware tests fail with GPU test unavailable at device initialization: 指定的设备接口或功能级别在此系统上不受支持。, which is the intended strict behavior - a green run can no longer mean "nothing ran".
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.
  • No game or GPU needed.

(CI note: the check job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)

<!-- greyfinch-sync:fxceless/victory-fork:issue:6630367606 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1334). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-26T15:54:29Z. --- ## Problem The wave64 hardware tests in `crates/victory-shader/src/emit/wave64_tests.rs` use `Host::new(false)` and skip with `eprintln!(...); return;` when no SM 6.6 device exists. A test that returns counts as a pass, so a CI or developer run requesting hardware coverage reports green while executing nothing - a silently untested shader change can look verified. Found while comparing the other forks: **spk-c/victory-fork** commit [`7cd474e3`](https://github.com/spk-c/victory-fork/commit/7cd474e3) (spk). It is not in this fork, `upstream/main`, the #653 batch or any open PR; this is that fix ported unchanged. ## Change - New `gpu_unavailable(stage, error)`: prints `GPU test skipped at <stage>: <error>`, or panics with `GPU test unavailable at <stage>: <error>` when `VICTORY_REQUIRE_GPU_TESTS=1`. - All six hardware test entry points (device initialization and compute pipeline creation, including the `on_the_card` helper) go through it; the old bare `eprintln!` skips are gone. - Default behavior is unchanged for hardware-less CI: the test reports the stage and passes. Strict hardware jobs can now fail instead of silently passing. - Test-only; no product code touched. ## Tests - `cargo test -p victory-shader --lib wave64` (no device here): 8 tests pass (2 pure + 6 hardware skips), as before. - `VICTORY_REQUIRE_GPU_TESTS=1 cargo test -p victory-shader --lib wave64`: 6 hardware tests fail with `GPU test unavailable at device initialization: 指定的设备接口或功能级别在此系统上不受支持。`, which is the intended strict behavior - a green run can no longer mean "nothing ran". - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings`: clean. - No game or GPU needed. (CI note: the `check` job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)
upstream-sync closed this pull request 2026-11-26 16:06:36 +00:00

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
fxceless/victory-fork!1331
No description provided.