From 069cf6f9ee25caa04085f7f02eaf1f6d04f2e888 Mon Sep 17 00:00:00 2001 From: thehollowedone <36892342+thehollowedone@users.noreply.github.com> Date: Fri, 27 Nov 2026 02:31:52 -0500 Subject: [PATCH] Tests: isolate the console mesh cache probe from parallel tests The test assumes a process-wide shader cache entry survives between its public compile and cached-only probe. Parallel library tests can change those shared caches, causing a DXIL-not-compiled failure on main while the isolated test passes. Run the existing assertions in a child test process with a private DXC cache. On the RTX 3080 Ti, the four-thread workspace suite changed from 1456 passed / 1 failed to 1457 passed / 0 failed, with 47 ignored in both runs. Assisted-by: Codex (GPT-6.2 Sol) --- crates/xcl/src/gpu/recomp/pso.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/xcl/src/gpu/recomp/pso.rs b/crates/xcl/src/gpu/recomp/pso.rs index 5d000775ef..3d981342cf 100644 --- a/crates/xcl/src/gpu/recomp/pso.rs +++ b/crates/xcl/src/gpu/recomp/pso.rs @@ -1943,6 +1943,23 @@ mod shader_cache_tests { #[test] fn console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk() { use std::sync::atomic::{AtomicUsize, Ordering}; + const RUN: &str = "XCL_TEST_CONSOLE_MESH_CACHE_RUN"; + if std::env::var_os(RUN).is_none() { + // The public entry point uses process-wide caches. Parallel tests can change their + // state between the first call and the cached-only assertion. + let nonce = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos(); + let dir = std::env::temp_dir().join(format!("xcl-mesh-cache-isolated-{}-{nonce}", std::process::id())); + let output = std::process::Command::new(std::env::current_exe().unwrap()) + .args(["gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk", "--exact", "--nocapture"]) + .env(RUN, "1") + .env("XCL_DXIL_CACHE", &dir) + .env("XCL_TRANSLATED_CACHE", "1") + .env("XCL_DIRECT_DXIL", "0") + .output().unwrap(); + let _ = std::fs::remove_dir_all(&dir); + assert!(output.status.success(), "{}\n{}", String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr)); + return; + } let blob = synthetic_mesh_container(); let dir = std::env::temp_dir().join(format!("xcl-mesh-hlsl-cache-{}", std::process::id())); let _ = std::fs::remove_dir_all(&dir);