Skip to content

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

Closed
CwWwWwW wants to merge 1 commit into
fxceless:mainfrom
CwWwWwW:port/gpu-test-strict-skip
Closed

CwWwWwW wants to merge 1 commit into
fxceless:mainfrom
CwWwWwW:port/gpu-test-strict-skip

Conversation

@CwWwWwW

@CwWwWwW CwWwWwW commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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 CwWwWwW closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants