Skip to content

Tests: fence waits without an event and Fence1 query on the null device - #1971

Open
brandostrong wants to merge 1 commit into
xcl-dev:mainfrom
brandostrong:fence-contract-tests
Open

brandostrong wants to merge 1 commit into
xcl-dev:mainfrom
brandostrong:fence-contract-tests

Conversation

@brandostrong

@brandostrong brandostrong commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Two contract tests for the null D3D12.X device, from public reports that titles wait on fences with a NULL event handle and query ID3D12Fence1 off their fences. The wait must return S_OK with the value reached (not E_NOTIMPL) and must set a given event; the fence must answer Fence1. Both pass today — they pin the behaviour the reports say titles depend on. Part of the D3D12.X contract line claimed on #1269.

What is in it

  • crates/xcl/src/hle/d3d12x/null.rs: a_fence_wait_without_an_event_returns_when_the_value_is_reached (NULL event → S_OK, value reached; real event gets set) and a_fence_answers_query_interface_for_fence1 (IID from the layout table) — tests only, no runtime change

Tested

  • RTX 4090, i9-13900K, 32 GB RAM, Windows 11 26200, cargo 1.100.0, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on b77bdbe: 988 passed, 0 failed, 45 ignored; 22 SKIPPED, all adapter limits of this wave32 card (the wave64 lowering/comparison GPU tests and heap_window_out_of_memory_falls_back_to_the_switch_form)

Not tested

  • AMD / RADV (no GPU behaviour involved — null-device tests only)

AI use

  • Claude Code, Claude Opus 5.5: wrote the tests and this description, and ran the suite; the user reviewed the diff.

🤖 Generated with Claude Code

@futurepro62

futurepro62 commented Nov 25, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head b77bdbe (on its base 62265d3).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 978 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: a_fence_wait_without_an_event_returns_when_the_value_is_reached, a_fence_answers_query_interface_for_fence1.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 987 passed, 0 failed, 45 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 80f4819 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests and const_and_null_mask_operands_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@brandostrong

Copy link
Copy Markdown
Contributor Author

The diff is only #[cfg(test)] mod tests code in null.rs — the description check counts it as a runtime change. A test-only label would waive the smoke requirement (CONTRIBUTING.md, item 3).

@JJAutoCompare

Copy link
Copy Markdown

PR #1971 compatibility verification

Tested detached head b77bdbe2c79688b73312efc75c0c8f8368687c49 on STOR-WINLAB. The diff adds two tests in crates/xcl/src/hle/d3d12x/null.rs.

Tested

  • Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0). d3d12SDKLayers.dll was unavailable.
  • Rust 1.100.0 (0ef1bc386 2026-11-09). The runtime logged dxcompiler 1.9.2609.5 (01b62ad4) and dxil 1.9.2609.5. XCL_DXC_DIR selected the requested toolchain.
  • cargo build --workspace and cargo test --workspace --no-run both succeeded outside the GPU lock with dev and test debug info disabled.
  • cargo test -p xcl hle::d3d12x::null::tests::a_fence_ -- --nocapture returned 2 passed, 0 failed, 0 ignored with zero SKIPPED lines. The null-handle wait returned S_OK and advanced the completed fence value to 3. A second wait signaled the supplied event. QueryInterface for ID3D12Fence1 returned S_OK and a non-null pointer.

Full workspace suite

cargo test --workspace --no-fail-fast -- --test-threads=4 ran once under Invoke-ArcTest.ps1 and exited 101. The 20 Cargo summaries in pr1971-suite.log sum to 963 passed, 25 failed, 45 ignored. Both PR tests passed again.

  • 20 GPU unit failures reported CreateComputePipelineState error 0x80070057 across DXIL fuzz, operations, rounding, and recompiler tests. Four other GPU unit failures were assertions on fused FMA overflow, implicit-LOD sampling, the packed FP16 high half, and wave64 pixel reductions.
  • One test-title integration failure reported a blue pixel where dynamic depth bias via RSSetDepthBiasX expected green.
  • The log contains 22 SKIPPED lines. Of these, 17 cite unavailable wave64, 3 cite unsupported per-lane FP16-related lowering, 1 cites unavailable driver cache control, and 1 cites unavailable heap windows. The skip lines describe coverage gaps within the raw Cargo outcomes.

Not tested

Retail-title smoke, a run on main for baseline comparison, other GPUs, and D3D12 debug-layer coverage.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1971-suite.log and published this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

Two contract tests for the null D3D12.X device from public reports that titles
wait on fences with a NULL event handle and query ID3D12Fence1 off them: the
wait must return S_OK with the value reached (not E_NOTIMPL) and set a given
event, and the fence must answer Fence1's interface. Both pass today; they pin
the behaviour the reports say titles depend on. Part of the D3D12.X contract
line claimed on xcl-dev#1269.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Toons29

Toons29 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run of b86dcaf9 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 568e7db7, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: b86dcaf974a1630d084314ff2f80857353dcbca6
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1632 (PresentX 1632)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14623 MB

Against the limits in CONTRIBUTING.md: 104 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

@ivall

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Both tests pass here in review and the CI build is green. One change before the test-only label and a merge: WaitForSingleObject(ev, INFINITE) would hang the whole suite, and CI, if the null device ever stopped setting the event. Please give it a timeout (10 s, say), so that a regression fails instead.

AI use: Claude Code (Claude Opus 5.5) wrote this on the maintainer's behalf.

@DavidM1911

Copy link
Copy Markdown
Contributor

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head b86dcaf

These are test-only additions in null.rs. They pin behaviour that Fence_SetEventOnCompletion (NULL event) and QueryInterface already have on main.
#2374 adds a null-device contract test with SetEventOnCompletion on a real event, but has no NULL-event or ID3D12Fence1 case, so it is not a duplicate.
No problems found in the diff. The slot numbers (device #36, fence #0 / #8 / #9) match null.rs.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

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.

7 participants