Repository navigation
shader, docs: skip GPU tests through one helper for XTP_REQUIRE_GPU - #65
Conversation
|
This pull request now conflicts with its base branch. Please rebase it on |
simnJS
left a comment
There was a problem hiding this comment.
Thanks for this first contribution, and for the thorough test matrix! The helper is clean, test_hosts reports every empty path, and the child-process test is a nice touch.
A few things before it can land:
- Rebase needed.
rayquery_tests.rschanged a lot on main today. After rebasing, three WARP tests there still useHost::new(true)witheprintln!("…; skipped"), and they also have "tier 1.1" skips. Please route them throughtest_warp/skip_oncetoo. - Validation helpers.
validate/verdictnow printSKIPPED <test>: no-dxilwhile the test keeps running. That inflates the skip counts, breaks the "return afterskip" rule of xtp-testkit, and loses the error detail. A plain note with{what}: {e}may fit better (geometry_tests.rs:1133,rect_gs.rs:911,smem_data_tests.rs:99,stride_tests.rs:134,waterfall_tests.rs:98,validator_tests.rs:20). - Names and docs.
warp_draws_the_last_primitive_exportand the doc ofloop_limit_tests::runstill say WARP.docs/analysis/hardware-tests.md(lines 155 and 157) still describes the gap this PR closes. - Minor: the ignored test at
salu.rs:809used to panic without a device and now skips unless strict mode is on. Please say whether that's intended.
I'll approve the CI runs once the rebase is pushed. Happy to re-review then!
18b96e0 to
7437240
Compare
|
Thanks for the thorough review! Rebased onto
Re-verified all four |
simnJS
left a comment
There was a problem hiding this comment.
Thanks, all four earlier points are addressed, and the supply chain is clean: xtp-testkit is a workspace path crate, and Cargo.lock gets no new package.
One change, please: keep a_heap_slot_read_by_scalar_and_vector_loads_is_read_raw_both_ways (crates/xtp-shader/src/emit/lower/smem.rs:1315) on Host::test_warp(). Its doc comment explains why WARP is the check there. The test removes the device on the old handle, and hardware behaviour is undefined in that case, so on a real GPU it can pass or crash at random.
I've approved the CI runs for this head. Once that line is back and CI is green, we'll merge.
Add xtp-testkit as a dev-dependency of xtp-shader and centralise test skip reporting in crates/xtp-shader/src/emit/host.rs (Host::test_device, Host::test_warp, Host::test_hosts, skip_gpu, and skip_once). When no host D3D12 device is available, GPU tests now fail if XTP_REQUIRE_GPU (or XTP_REQUIRE=no-gpu) is set and otherwise emit one canonical SKIPPED <test>: <reason> marker through xtp_testkit::skip before returning. Non-returning optional validation and disassembly helpers emit plain notes so skip counts stay exact. Unpin tests that hardcoded Host::new(true) without a WARP-only reason so they follow XTP_TEST_ADAPTER, keep WARP where required (4-lane waves, root-signature-only heap binding, raw scalar reads of a structured slot, and undefined hardware behaviour on the old handle in smem), and update docs/analysis/hardware-tests.md and docs/contributing-without-a-gaming-pc.md. Fixes: MiamiGame#60
7437240 to
91ed24c
Compare
|
Restored |
simnJS
left a comment
There was a problem hiding this comment.
Thanks! The smem heap-slot test is back on Host::test_warp() with a clear reason, and nothing else changed. I've approved the CI runs; we'll merge once they're green.
simnJS
left a comment
There was a problem hiding this comment.
CI is green and the review is clean. Approving, thanks for the cleanup.
What and why
xtp-shader's GPU tests previously returned early and passed when no SM 6.6 device was available (eprintln!("...; skipped")or silentelse { return }), even whenXTP_REQUIRE_GPUwas set.This change:
xtp-testkitas a dev-dependency ofxtp-shader;crates/xtp-shader/src/emit/host.rs(Host::test_device,Host::test_warp,Host::test_hosts,skip_gpu, andskip_once) that write canonicalSKIPPED <test>: <reason>markers throughxtp_testkit::skip(at most once per test and reason) and panic whenXTP_REQUIRE_GPU(orXTP_REQUIRE=no-gpu) forbids skipping;dxc.exe,XTP_CONSOLE_DXC), validator (dxil.dll), and device-capability skip that returns early acrosscrates/xtp-shader/srcthrough these helpers (includingbuffer16_tests,helper_tests, and all WARP tests inrayquery_tests), while keeping plaineprintln!notes in non-returning validation/disassembly helpers so skip counts are not inflated and keepingexpecton#[ignore = "hardware: ..."]tests;Host::new(true)without a WARP-only reason (input_tests,loop_limit_tests,meshidx_tests,r1_tests,userdata_tests,lower::flow,lower::smem::tests::scalar_load_keeps_an_unaligned_byte_offset_with_a_cbv_slot) followXTP_TEST_ADAPTER, while keeping WARP with explanatory comments ongroup_id_tests::flat_ids_on_warp,rayquery_tests'swarp::runtests,smem_tests::run_scalar_reads, andlower::smem::tests::a_heap_slot_read_by_scalar_and_vector_loads_is_read_raw_both_ways;docs/analysis/hardware-tests.mdanddocs/contributing-without-a-gaming-pc.mdto reflect the newxtp-shaderskip behaviour.Size note (
size/L, ~760 changed lines across 38 files): the change is mechanical across the test modules incrates/xtp-shader/srcplus the helper/unit tests inemit/host.rsand two doc updates.Fixes: #60
Depends on: none
Area
shader(crates/xtp-shader),docsTests
cargo xtask pr-checkpasses on my machineCommands verified:
$env:XTP_TEST_ADAPTER='none'; $env:XTP_REQUIRE_GPU='1'; cargo test -p xtp-shader --locked --lib-> all 118 GPU tests fail as expected (387 passed; 118 failed)Remove-Item Env:XTP_REQUIRE_GPU; $env:XTP_TEST_ADAPTER='none'; cargo test -p xtp-shader --locked --lib->505 passed; 0 failed,122canonicalSKIPPED <test>: <reason>markers (118GPU +4no-console-dxc)Remove-Item Env:XTP_REQUIRE_GPU; $env:XTP_TEST_ADAPTER='warp'; cargo test -p xtp-shader --locked --lib->505 passed; 0 failed(5canonical skips:4no-console-dxc+each_adapter_gets_what_it_runs)$env:XTP_TEST_ADAPTER='hardware'; $env:XTP_REQUIRE_GPU='1'; cargo test -p xtp-shader --locked --lib->505 passed; 0 failedon GeForce RTX 3050 Laptop GPU (4no-console-dxcskips)Provenance
Written for XTP from XTP's own
crates/xtp-gpu/src/testgpu.rsandcrates/xtp-testkit.xclandAnyPS5were not read.AI assistance: Gemini assisted with auditing the skip sites in
crates/xtp-shader, writing the shared helper and unit tests, and running the test matrix.Checklist
<area>: <summary>; one topic; under 400 changed lines, or the reason is above