From f7ac6cbf120b1948b1bc670851c94a52069d5f0f Mon Sep 17 00:00:00 2001 From: itsSio <31954644+itsSio@users.noreply.github.com> Date: Thu, 26 Nov 2026 04:44:38 +0100 Subject: [PATCH] Tests: the nvidia-dev suite follows late release and the moved AS-slot MS Five tests failed on nvidia-dev c044dc6d with no runtime fault behind them: - texture_upload some_ranges: the LCG step overflowed usize in debug builds (pieces_hold_the_texels_of_their_levels and gpu_parts_of_a_texture_go_up_and_the_rest_stays). It now wraps, which is what release builds already did, so the ranges are the same. - d3d12_mesh_stream: a console MS alone in the AS slot is taken as the MS (real::mesh_shader_slots) instead of being refused for the slot. The synthetic container has no NGG variant, so it still fails with E_INVALIDARG, now as "MS: no NGG hardware variant". The test checks for that and for the absence of an AS-slot refusal. - gpu_compute_e2e async_compute_pso_registers_real_pso_and_not_standin and gpu_two_pass_cache_e2e: the real pipeline behind a released stand-in goes through late_release::hold_pipeline, once every queue is past a fence, and is forgotten when that Release runs. The tests checked right after drop(); they now poll for up to 10 s, as late_release's own test does. Test-only; no runtime code changes. Assisted-by: Google Antigravity CLI (Claude Opus 5.5 (High)) --- crates/xcl/src/hle/d3d12x/texture_upload.rs | 2 +- crates/xcl/tests/d3d12_mesh_stream.rs | 12 +++++++----- crates/xcl/tests/gpu_compute_e2e.rs | 7 ++++++- crates/xcl/tests/gpu_two_pass_cache_e2e.rs | 6 ++++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/crates/xcl/src/hle/d3d12x/texture_upload.rs b/crates/xcl/src/hle/d3d12x/texture_upload.rs index 16e06fd028..da7e270168 100644 --- a/crates/xcl/src/hle/d3d12x/texture_upload.rs +++ b/crates/xcl/src/hle/d3d12x/texture_upload.rs @@ -999,7 +999,7 @@ mod tests { let mut at = seed * 37 % size.div_ceil(PAGE) * PAGE; let mut n = seed; while at < size && out.len() < 6 { - n = n * 1103515245 + 12345; + n = n.wrapping_mul(1103515245).wrapping_add(12345); let to = (at + PAGE * (1 + n / 65536 % 4)).min(size); out.push((at, to)); at = to + PAGE * (1 + n / 16 % (size / PAGE / 5 + 2)); diff --git a/crates/xcl/tests/d3d12_mesh_stream.rs b/crates/xcl/tests/d3d12_mesh_stream.rs index d742ee26d0..f349efa48b 100644 --- a/crates/xcl/tests/d3d12_mesh_stream.rs +++ b/crates/xcl/tests/d3d12_mesh_stream.rs @@ -2,8 +2,9 @@ //! (`d3d12x::real::dev_create_pipeline_state` / `translated_mesh_stream`), with no game data. //! //! Runs on any D3D12 adapter (AMD, NVIDIA, Intel, or WARP) with zero vendor-specific skips: -//! 1. Synthetic console MS placed in the AS slot with no MS slot is refused cleanly with -//! `E_INVALIDARG` and records the `"in the AS slot – refused"` error. +//! 1. Synthetic console MS placed in the AS slot with no MS slot is taken as the mesh shader it +//! is (`real::mesh_shader_slots`) and, having no NGG variant, fails cleanly with +//! `E_INVALIDARG` as an MS translation error, not as an AS-slot refusal. //! 2. Synthetic console MS paired with an AS subobject is refused cleanly with `E_INVALIDARG`. //! 3. Empty, truncated, unknown-subobject, and unreadable-shader pipeline streams fail cleanly //! without panicking or crashing. @@ -93,10 +94,11 @@ fn console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly() { }; let err = unsafe { d2.CreatePipelineState::(&desc) }.expect_err("MS in AS slot must be refused"); assert_eq!(err.code(), E_INVALIDARG); + // translated as the MS (the synthetic container has no NGG variant), not refused for the slot + let errors = real::stats().translation_errors; assert!( - real::stats().translation_errors.iter().any(|e| e.contains("in the AS slot")), - "expected AS-slot refusal in translation_errors: {:?}", - real::stats().translation_errors + errors.iter().any(|e| e.starts_with("MS: ")) && !errors.iter().any(|e| e.contains("in the AS slot")), + "expected an MS translation error and no AS-slot refusal in translation_errors: {errors:?}" ); // Case 2: console MS paired with an AS subobject diff --git a/crates/xcl/tests/gpu_compute_e2e.rs b/crates/xcl/tests/gpu_compute_e2e.rs index 5ffa519a96..e18cc8af86 100644 --- a/crates/xcl/tests/gpu_compute_e2e.rs +++ b/crates/xcl/tests/gpu_compute_e2e.rs @@ -530,8 +530,13 @@ fn async_compute_pso_registers_real_pso_and_not_standin() { assert!(!real::is_translated_compute(standin_raw), "stand-in must remain unregistered after background build"); assert!(real::pso_root_signature(real_raw).is_some(), "real compute PSO must have an ABI root signature"); - // Releasing the stand-in must release and forget the background-built real PSO too. + // Releasing the stand-in must release and forget the background-built real PSO too. The real + // one goes once the queues are past a fence (`late_release::hold_pipeline`), not in the drop. drop(pso); + let start = std::time::Instant::now(); + while real::is_translated_compute(real_raw) && start.elapsed() < std::time::Duration::from_secs(10) { + std::thread::sleep(std::time::Duration::from_millis(5)); + } assert!(!real::is_translated_compute(real_raw), "forgetting released async compute PSO must clean up TRANSLATED_COMPUTE"); } diff --git a/crates/xcl/tests/gpu_two_pass_cache_e2e.rs b/crates/xcl/tests/gpu_two_pass_cache_e2e.rs index c1c74a9840..61a5e2dc76 100644 --- a/crates/xcl/tests/gpu_two_pass_cache_e2e.rs +++ b/crates/xcl/tests/gpu_two_pass_cache_e2e.rs @@ -646,6 +646,12 @@ float4 main(V v) : SV_Target0 { return v.p0; } assert_eq!(draw_two_pass_and_read(&dev, &gs, 1, true), [0.0, 1.0, 0.0, 1.0]); assert_eq!(real::two_pass_count(), before + 3); drop((ms1, ms2, gs)); + // (the real pipelines behind the stand-ins go once the queues are past a fence: + // `late_release::hold_pipeline`, not in the drop) + let start = std::time::Instant::now(); + while real::two_pass_count() != before && start.elapsed() < std::time::Duration::from_secs(10) { + std::thread::sleep(std::time::Duration::from_millis(5)); + } assert_eq!(real::two_pass_count(), before, "releasing the title PSOs releases their two-pass state"); if dev.cast::().is_ok() {