From 3c3b527b7f7acbe564140cbd6312e96a88760d59 Mon Sep 17 00:00:00 2001 From: Exalted5373 <247056922+Exalted5373@users.noreply.github.com> Date: Thu, 8 Oct 2026 18:33:43 -0700 Subject: [PATCH] Web: the window wire test allows the CPU/GPU difference a_window_job_crosses_the_wire_and_renders_the_same_window compared the worker's CPU render with the engine job's render bit for bit. On a machine with a GPU the engine job renders there, so the test failed by 1 LSB (on main too); without a GPU (CI) both run on the CPU. It now checks both sizes and a maximum channel difference of 3, the bound docs/gpu-pipeline.md documents. Co-Authored-By: Claude Opus 5.5 --- apps/lightcraft-web/src/wire.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/lightcraft-web/src/wire.rs b/apps/lightcraft-web/src/wire.rs index 81a76e6c9..b08ae150b 100644 --- a/apps/lightcraft-web/src/wire.rs +++ b/apps/lightcraft-web/src/wire.rs @@ -368,7 +368,11 @@ mod tests { let a = core.render(&wire, None).unwrap(); let b = job.run().rendered.unwrap(); assert_eq!((a.image.width, a.image.height), (160, 120)); - assert_eq!(a.image.data, b.image.data); + assert_eq!((b.image.width, b.image.height), (160, 120)); + // the worker renders on the CPU; the engine job uses a GPU when the machine has one, which + // stays within docs/gpu-pipeline.md's bound (≤ 3 LSB per channel) rather than bit-exact + let max = a.image.data.iter().zip(&b.image.data).flat_map(|(p, q)| (0..3).map(move |c| p[c].abs_diff(q[c]))).max(); + assert!(max.is_some_and(|m| m <= 3), "max channel difference {max:?}"); } // a job from before windows existed has none