From b9bfae60d59466e9664d465a40303ca1d1228860 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Tue, 1 Dec 2026 02:50:10 +0100 Subject: [PATCH] test: only_what_differs_goes_up knows about LEONIDA_TAKE_BLOCKS The test branches on LEONIDA_SEND_CHANGED and asserts the pre-TAKE_BLOCKS answer in its else arm, so it fails on main since TAKE_BLOCKS went on by default in d920d850d: take_dirty after a landing answers [] for the page the landing took, because that page went up as the 4 KiB pieces that differed. A third arm covers the default and the two switches no longer collide. Measured on main d920d850d, the same test: default ok, TAKE_BLOCKS=0 ok, SEND_CHANGED=1 ok, and the crate 583 passed 0 failed 53 ignored. --- d3d12/crates/leonida-gpu/src/host.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/d3d12/crates/leonida-gpu/src/host.rs b/d3d12/crates/leonida-gpu/src/host.rs index b22544b398..6a4030b408 100644 --- a/d3d12/crates/leonida-gpu/src/host.rs +++ b/d3d12/crates/leonida-gpu/src/host.rs @@ -14731,6 +14731,11 @@ mod refresh_tests { if std::env::var_os("LEONIDA_SEND_CHANGED").is_some_and(|v| v != "0") { assert_eq!(again, []); assert_eq!(written, [(2 * PAGE + 128, 2 * PAGE + 132), (2 * PAGE + 136, 2 * PAGE + 144)]); + } else if crate::toggled!("LEONIDA_TAKE_BLOCKS") { + // The page the landing took is no longer reported whole: it went up as the 4 KiB pieces + // that differed, so nothing is left dirty for it. The volatile writes are the next page. + assert_eq!(again, []); + assert_eq!(written, [(2 * PAGE, 2 * PAGE + 4096)]); } else { assert_eq!(again, [(PAGE, 2 * PAGE)]); assert_eq!(written, [(2 * PAGE, 3 * PAGE)]);