Files
reims-vgpu/conformance/tests/test_verdict.py
T
Anees Iqbal 3c019bf8b2 conformance: add the macOS 15 Metal compatibility battery
Component: conformance; x86 macOS guest on the Linux Vulkan PCI pathway, rail macos-15.

Add a 290-case Metal battery, native Apple M4 oracle, split driver and translation ownership inventories, focused modes, boot manifests, artifact hashing, typed failure scoring, and catastrophic-run gates. This is test-only and changes no device behavior.

The API invariant is monotonic, oracle-backed compatibility: native results establish each Metal relation, while guest failures remain explicit debt owned by either translation or the device. Missing, duplicate, unexplained, and uncovered results fail the scorer.

Verification:
- Apple M4, macOS 15.6.1 build 24G90: full native oracle 290/290 PASS, zero skips.
- verdict unit tests: 5/5 PASS.
- run-native.sh and run-guest.sh: bash syntax clean.
- baseline file matches the final full native result byte-for-byte.
- current focused VM runs: integer clear and topology repeated clean; RGBA32Float clean with guest import on and off; indexed draw repeated with three classified driver failures and zero unexplained results.
- focused candidate boots loaded QEMU SHA-256 0b4ed961deaac18886b4e1ca8eb1db2a34c7e7f06e46b53652167e6dba61951d and static library SHA-256 512fa87458223053e3ca1a58e49501d28705f26b95984c211581d74ee91d195c from source fa29b2e527.

Not verified: there is no single complete 290-case guest run. The earlier 276-case full candidate emitted four stamp-wait timeouts and is not a passing validation. The consolidated macos-15 ledger is 184 pass, 77 classified driver failure, and 29 capability skip. Other guest rails and Apple-host backends were not run.
2026-08-29 18:20:50 +03:00

77 lines
3.0 KiB
Python

#!/usr/bin/env python3
"""Behavioral tests for conformance failure ownership."""
import subprocess
import tempfile
import unittest
from pathlib import Path
VERDICT = Path(__file__).resolve().parents[1] / "verdict.py"
class VerdictOwnershipTests(unittest.TestCase):
def run_verdict(self, translation: str = "", driver: str = "", guest: str = "FAIL"):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
native = root / "native.txt"
guest_run = root / "guest.txt"
translation_errors = root / "translation-errors.txt"
driver_errors = root / "driver-errors.txt"
native.write_text("CASE sample PASS oracle\nDEVICE native\n")
guest_run.write_text(f"CASE sample {guest} guest\nDEVICE guest\n")
translation_errors.write_text(translation)
driver_errors.write_text(driver)
return subprocess.run(
[
"python3",
str(VERDICT),
"--native",
str(native),
"--guest",
str(guest_run),
"--translation-errors",
str(translation_errors),
"--driver-errors",
str(driver_errors),
"--quiet",
],
check=False,
capture_output=True,
text=True,
)
def test_translation_failure_is_named_and_accepted(self):
result = self.run_verdict(translation="sample # package=sample-query\n")
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
self.assertIn("translation sample", result.stdout)
self.assertIn("active translation failures 1/1, active driver failures 0/0", result.stdout)
def test_driver_failure_is_named_and_accepted(self):
result = self.run_verdict(driver="sample # clear publication ordering\n")
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
self.assertIn("driver sample", result.stdout)
self.assertIn("active translation failures 0/0, active driver failures 1/1", result.stdout)
def test_one_failure_cannot_have_two_owners(self):
result = self.run_verdict(
translation="sample # package=sample-query\n",
driver="sample # publication ordering\n",
)
self.assertNotEqual(result.returncode, 0)
self.assertIn("DUPLICATE-CLASSIFICATION sample", result.stdout)
def test_unclassified_guest_failure_remains_a_regression(self):
result = self.run_verdict()
self.assertNotEqual(result.returncode, 0)
self.assertIn("REGRESSION sample", result.stdout)
def test_passing_known_failure_is_stale(self):
result = self.run_verdict(driver="sample # publication ordering\n", guest="PASS")
self.assertNotEqual(result.returncode, 0)
self.assertIn("FIXED-DRIVER sample", result.stdout)
if __name__ == "__main__":
unittest.main()