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

Closed
github-bot wants to merge 1 commit from gh-pr/1334/head into gh-pr/1334/base
Owner

@⁠CwWwWwW on GitHub · 2026-11-26 15:54 UTC · original
CwWwWwW:port/gpu-test-strict-skip → main · +48 −20 · 1 files · 1 commits · closed without merging

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.)

**@⁠CwWwWwW** on GitHub · 2026-11-26 15:54 UTC · [original](https://github.com/fxceless/victory-fork/pull/1334) `CwWwWwW:port/gpu-test-strict-skip` → `main` · +48 −20 · 1 files · 1 commits · closed without merging ## 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.)
(cherry picked from commit 7cd474e34c7853e2ed9625891fa6ef2173e00cca)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:57:22 +00:00
github-bot closed this pull request 2026-11-26 15:57:22 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.