From 0d13b071a55caaf4cc1ab5a73298139006edd7c6 Mon Sep 17 00:00:00 2001 From: b3IKK <278540256+b3IKK@users.noreply.github.com> Date: Wed, 25 Nov 2026 11:11:37 +0000 Subject: [PATCH] Tests: two expectations that no longer match the code Both tests fail on unmodified `main` (9633138), so every PR's suite is red for reasons that have nothing to do with the PR: - rerouted_disk_entries_follow_the_direct_translator read the marker at byte 0 of the synthetic DXIL `compiled()` builds. Since the translated cache began checking that an entry is a DXIL container, marker 1 sits at byte 67 and byte 0 is 'D' (68), so the test compared 68 with 1. - pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa required formats 85 (B5G6R5) and 88 (B8G8R8X8) to come through unchanged. `pc_resource_desc` promotes them to 28 (R8G8B8A8) and 87 (B8G8R8A8) because a PC driver takes neither as a UAV, and ALLOW_UNORDERED_ACCESS is valid on the promoted format - so it stays there, and the flag assertion only holds for the formats that are left as they are. Test-only: the two tests pass here, and the suite goes from 2 failed to 0. Assisted-by: OpenCode (Claude Fable 5.2) --- crates/xcl/src/gpu/recomp/pso.rs | 3 ++- crates/xcl/src/hle/d3d12x/device_x.rs | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/xcl/src/gpu/recomp/pso.rs b/crates/xcl/src/gpu/recomp/pso.rs index 743a31264..c9a50b72b 100644 --- a/crates/xcl/src/gpu/recomp/pso.rs +++ b/crates/xcl/src/gpu/recomp/pso.rs @@ -1354,7 +1354,8 @@ mod shader_cache_tests { Ok((compiled(marker), rerouted)) }) .unwrap() - .dxil[0] + // (`compiled`: a DXIL container whose marker byte is 67, not its first byte) + .dxil[67] }; let mut calls = 0; assert_eq!(go(enormous_blob, 7, 1, true, &mut calls), 1); diff --git a/crates/xcl/src/hle/d3d12x/device_x.rs b/crates/xcl/src/hle/d3d12x/device_x.rs index 152431e22..d1bc058dc 100644 --- a/crates/xcl/src/hle/d3d12x/device_x.rs +++ b/crates/xcl/src/hle/d3d12x/device_x.rs @@ -1373,8 +1373,14 @@ mod tests { 103, 107, // YUV (NV12, YUY2) ] { let (out_fmt, out_flags) = make(3, fmt, 1, 0x4); - assert_eq!(out_fmt, fmt, "format {fmt} kept"); - assert_eq!(out_flags & 0x4, 0, "format {fmt} must strip ALLOW_UNORDERED_ACCESS"); + if matches!((fmt, out_fmt), (85, 28) | (88, 87)) { + // promoted to a format a PC driver takes as a UAV of the same values: the flag + // stays, and is valid there + assert_eq!(out_flags & 0x4, 0x4, "format {fmt} promoted to {out_fmt} keeps ALLOW_UNORDERED_ACCESS"); + } else { + assert_eq!(out_fmt, fmt, "format {fmt} kept"); + assert_eq!(out_flags & 0x4, 0, "format {fmt} must strip ALLOW_UNORDERED_ACCESS"); + } } // Multisampled textures never support UAV even on UAV-capable formats: assert_eq!(make(3, 28, 4, 0x5), (28, 0x1));