"""Rendered RGB, alpha subrect preservation, and per-frame output comparison.""" from pathlib import Path import struct import subprocess import tempfile import unittest ROOT = Path(__file__).resolve().parents[1] COMPARE = ROOT / "tools" / "compare_rr_output.py" class RayReconstructionOutputTests(unittest.TestCase): def setUp(self): self.directory = tempfile.TemporaryDirectory() self.addCleanup(self.directory.cleanup) self.a = Path(self.directory.name) / "host.raw" self.b = Path(self.directory.name) / "gpu.raw" def compare(self, width=1, height=1, *extra): return subprocess.run( ["python3", str(COMPARE), "--a", str(self.a), "--b", str(self.b), "--width", str(width), "--height", str(height), *extra], capture_output=True, text=True) def test_channel_swap_with_identical_luma_is_rejected(self): self.a.write_bytes(struct.pack("