From 34b58e591bd0bdfa5129f38550da89deebf9657c Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 18 Nov 2026 13:30:04 -0800 Subject: [PATCH] matrix, runtime tests: the open record's exception goes; the Shared refusal's unit table holds the lab drivers' recorded types The open record against the RTX 3090's extra leg is closed: the old runtime refuses a Shared dma-buf import on a type with no coherence promise, and reims's forced-refusal pair is green at the refusal's commit. So the matrix's exception for that record goes with its tests: results.record_excused, the wrong-bytes parse behind it, the matrix's record_suites and the `open_records` config key. Every failure on an extra leg is judged again. a_shared_dma_buf_import_takes_host_coherent_types_or_none now runs over each lab driver's memory types as vulkaninfo printed them (NVIDIA 620.70.06 on the RTX 2080, ANV on the Iris Xe, RADV on the RX 550, RX 7900 XTX and 780M, lavapipe), with the udmabuf types the device test printed on each, in place of the synthetic lists. Verified: python3 -m unittest test_results test_matrix (53 OK); the per-device expectations match the SHARED-DMA-BUF lines of the device test on each card (refused untried on both NVIDIA cards, type 2 on the Iris Xe, type 5 on the three RADV cards, type 0 on lavapipe). The Rust test is compiled and run by the next check. --- .../metal2vulkan-runtime/src/tests/memory.rs | 64 ++++++++-------- scripts/matrix/matrix | 24 +----- scripts/matrix/results.py | 76 ++----------------- scripts/matrix/test_results.py | 44 ----------- 4 files changed, 45 insertions(+), 163 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/tests/memory.rs b/crates/metal2vulkan-runtime/src/tests/memory.rs index 9650972a4..f531d2693 100644 --- a/crates/metal2vulkan-runtime/src/tests/memory.rs +++ b/crates/metal2vulkan-runtime/src/tests/memory.rs @@ -168,58 +168,62 @@ fn dma_buf_imports_try_the_system_memory_types_the_host_maps_last() { /// A `Shared` import of a dma-buf takes the type its order ([`dma_buf_order`]) takes first where /// that type is host-coherent, trying the order's host-coherent types alone; where it is not, it -/// tries nothing ([`dma_buf_candidates`]). Over each lab driver's memory types and the types it -/// lists for a udmabuf among those a buffer takes, the type taken first before (the order whole) +/// tries nothing ([`dma_buf_candidates`]). Over each lab driver's memory types (each type's +/// property flags, as vulkaninfo lists them) and the types it lists for a udmabuf among those a +/// buffer takes (`tests::export_after_dma_buf`), the type taken first before (the order whole) /// and after is the same everywhere but NVIDIA's, whose order takes type 0 (no property flag) /// first: refused there, with no import tried. Every other class's order is unchanged. #[cfg(unix)] #[test] fn a_shared_dma_buf_import_takes_host_coherent_types_or_none() { use vk::MemoryPropertyFlags as P; - let host = P::HOST_VISIBLE | P::HOST_COHERENT; + let listed = |flags: &[u32]| -> Vec { + flags.iter().map(|&raw| ty(P::from_raw(raw))).collect() + }; // Each driver: its types, the udmabuf's among those a buffer takes, unified memory, and the // first type a `Shared` import takes before and after. let drivers = [ ( - "NVIDIA 620.70.06 (RTX 3090, RTX 2080)", - vec![ - ty(P::empty()), - ty(P::DEVICE_LOCAL), - ty(P::DEVICE_LOCAL), - ty(host), - ty(host | P::HOST_CACHED), - ty(P::DEVICE_LOCAL | host), - ], - 0x11, + "NVIDIA 620.70.06 (RTX 2080, RTX 3090)", + listed(&[0x0, 0x1, 0x1, 0x6, 0xe, 0x7]), + 0b1_0001, false, (Some(0), None), ), ( - "ANV, Mesa 26.2.x (Iris Xe)", - vec![ - ty(P::DEVICE_LOCAL), - ty(P::DEVICE_LOCAL | host), - ty(P::DEVICE_LOCAL | host | P::HOST_CACHED), - ], + "ANV, Mesa 26.2.6 (Iris Xe, RPL-P)", + listed(&[0x1, 0x7, 0xf, 0x21, 0x1, 0x7, 0xf]), 0b111, true, (Some(2), Some(2)), ), ( - "RADV, a discrete GPU", - vec![ - ty(P::DEVICE_LOCAL), - ty(host), - ty(P::DEVICE_LOCAL | host), - ty(host | P::HOST_CACHED), - ], - 0b1010, + "RADV, Mesa 26.2.6 (RX 550, POLARIS12)", + listed(&[0x1, 0x1, 0x6, 0x7, 0x7, 0xe, 0xe]), + 0b10_0000, false, - (Some(3), Some(3)), + (Some(5), Some(5)), ), ( - "lavapipe", - vec![ty(P::DEVICE_LOCAL | host | P::HOST_CACHED)], + "RADV, Mesa 26.2.6 (RX 7900 XTX, NAVI31)", + listed(&[0x1, 0x1, 0x6, 0x7, 0x7, 0xe, 0xe, 0xc1, 0xc6, 0xc7, 0xce]), + 0b100_0010_0000, + false, + (Some(5), Some(5)), + ), + ( + "RADV, Mesa 26.2.6 (780M, PHOENIX)", + listed(&[ + 0x1, 0x1, 0x6, 0x7, 0x7, 0xe, 0xe, 0x21, 0x21, 0x21, 0x21, 0x20, 0x20, 0xc1, 0xc6, + 0xc7, 0xce, + ]), + 0b1_0000_1000_0010_0000, + true, + (Some(5), Some(5)), + ), + ( + "lavapipe, Mesa 26.2.4", + listed(&[0xf]), 0b1, true, (Some(0), Some(0)), diff --git a/scripts/matrix/matrix b/scripts/matrix/matrix index a628fbb3a..90e1ea2af 100755 --- a/scripts/matrix/matrix +++ b/scripts/matrix/matrix @@ -18,7 +18,6 @@ The cluster's own facts come from potluck (its nodes, their GPUs and CPUs) and f "setup": {"A": "SHELL"}, "skip_gpus": ["vendor:device"], "record_nodes": {"vendor:device": "A"}, - "open_records": {"vendor:device@B": "ONE LINE"}, "validation_layer": "PATH"} The first builder whose gate command exits 0 (no gate: always) builds the GPU legs' test archive @@ -26,10 +25,7 @@ and runs the lavapipe leg. Its archive runs on every Linux node when it is `port on nodes of its CPU model; any other node builds its own. `setup` is shell each job on that node runs first. A GPU in `skip_gpus` gets no leg. A card in `record_nodes` has its leg of record on that node, named by the card, and runs as an extra leg, `vendor:device@node`, on each other node -that holds it, judged like any leg. A leg in `open_records` is an extra leg with an open record -against its card: a test that failed there with wrong bytes and passed on the card's leg of -record at the same commit is listed with the record, not judged (results.record_excused); every -other failure, and every timing row, is judged. `validation_layer` is the carry +that holds it, judged like any leg. `validation_layer` is the carry `scripts/validation-layer make` made (default ~/.cache/metal2vulkan-matrix/validation-layer): every job that runs rt's device tests (each GPU leg's, lavapipe's, the Windows host's) unpacks its OS's directory in its workspace and points the loader at it, and its note gives the layer's @@ -815,26 +811,14 @@ class Run: # --- commands ------------------------------------------------------------------------------------ -def record_suites(run, card): - """The suites of CARD's leg of record at the run's commit: this run's, else its note's.""" - for leg in run.legs: - if leg.id == card: - return leg.parsed["suites"] - return (((note(run.sha) or {}).get("legs") or {}).get(card) or {}).get("suites") or {} - - def leg_entry(run, leg): - """A leg's document in the note, judged against its base where only one leg is needed. An - extra leg under an open record (the config's `open_records`) has its wrong-bytes failures that - passed on the card's leg of record listed with the record (results.record_excused).""" + """A leg's document in the note, judged against its base where only one leg is needed.""" parsed = leg.parsed records, problems = results.leg_records(parsed) base_sha, base = base_of(run.sha, leg.id) problems += run.failures.get(leg.id, []) base_records = base and results.base_records(base["records"], harness_tree(base_sha) == harness_tree(run.sha)) - record = run.cfg.get("open_records", {}).get(leg.id) - excused = record and results.record_excused(parsed, record_suites(run, results.card_of(leg.id)), record) or {} - problems += results.leg_problems(parsed, records, base_records, excused) + problems += results.leg_problems(parsed, records, base_records) problems += results.old_path_moved(parsed, run.since_bless) if leg.id not in CPU_LEGS and run.lock_budget: problems += results.lock_budget_missing(records, results.names_lock_event(run.setup(leg.node))) @@ -855,7 +839,7 @@ def leg_entry(run, leg): minutes=leg.started and leg.ended and round((leg.ended - leg.started) / 60, 2), suites={name: {k: s[k] for k in ("exit", "run", "passed", "failed")} for name, s in parsed["suites"].items()}, records=records, base=base_sha, base_records=base and base["records"], problems=problems, - parked=results.leg_parked(parsed, records, excused) + budget_parked) + parked=results.leg_parked(parsed, records) + budget_parked) def run_cmd(sha, only, dry): diff --git a/scripts/matrix/results.py b/scripts/matrix/results.py index 131a48205..63715b1b9 100644 --- a/scripts/matrix/results.py +++ b/scripts/matrix/results.py @@ -101,33 +101,6 @@ LIBTEST_RESULT = re.compile(r"^test result: \w+\. (\d+) passed; (\d+) failed") LIBTEST_FAILED = re.compile(r"^test (.+) \.\.\. FAILED\s*$") # The harness command's line for a workload that failed on one runtime. HARNESS_FAILED = re.compile(r"^\s*M2V-FAILED (\S+)\s*$") -# nextest's status line of any test, in the captured outputs after its summary: each test's -# output follows its own. -NEXTEST_STATUS = re.compile(r"^\s*([A-Z][A-Z-]*) \[[^\]]*\]\s+(?:\(\s*\d+/\d+\)\s+)?(\S+ \S+)\s*$") -#: A test's output that shows it read wrong bytes: Rust's `assert_eq!` message, whose two sides -#: (WRONG_BYTES_SIDE) are each a list of numbers, the bytes, words or texels the test read against -#: those it expected. A compare of one value (a count) is not wrong bytes. -WRONG_BYTES_ASSERT = re.compile(r"assertion `left == right` failed") -WRONG_BYTES_SIDE = re.compile(r"^\s*(left|right): \[\s*-?[0-9][0-9a-fA-FxX.eE+-]*" - r"(?:,\s*-?[0-9][0-9a-fA-FxX.eE+-]*)+\s*\]\s*$") -#: A test's output that shows something other than wrong bytes, whatever else it shows: a device -#: loss or a validation message. -NOT_WRONG_BYTES = re.compile(r"DEVICE_LOST|[Dd]evice ?[Ll]ost|VUID-|Validation Error") - - -def wrong_bytes(lines): - """Whether a failed test's captured output LINES shows wrong bytes and nothing else: a - WRONG_BYTES_ASSERT with both its sides lists of numbers, and no NOT_WRONG_BYTES line. Any other - failure (a panic of another message, a device loss, a validation message, or output that does - not tell) is not wrong bytes.""" - if any(NOT_WRONG_BYTES.search(line) for line in lines): - return False - if not any(WRONG_BYTES_ASSERT.search(line) for line in lines): - return False - sides = {m.group(1) for m in (WRONG_BYTES_SIDE.match(line) for line in lines) if m} - return sides == {"left", "right"} - - def empty_records(): return {kind: {} for kind in KINDS} @@ -136,26 +109,14 @@ def parse_suite(lines): """One suite's output: tests run and passed, the tests that failed, and its records, with the problems of the records themselves (an unknown kind, a value that is not a count, a key recorded twice, a gauge key without its point). A key recorded twice keeps its first value and - is listed, by kind, in `duplicated`. `wrong_bytes` lists the tests whose status was FAIL and - whose captured output after the summary shows wrong bytes (wrong_bytes): a TIMEOUT, a signal or - a leak never does.""" + is listed, by kind, in `duplicated`.""" run = passed = 0 failed, problems = [], [] records = empty_records() duplicated = set() golden = dict(changed=0, profile=0) summary = False - # Each FAIL test's captured output after the summary, by its name. - outputs, current = {}, None for line in lines: - if summary: - m = NEXTEST_STATUS.match(line) - if m: - current = m.group(2) if m.group(1) == "FAIL" else None - if current: - outputs.setdefault(current, []) - elif current: - outputs[current].append(line) for kind, pattern in (("changed", GOLDEN_CHANGED), ("profile", GOLDEN_PROFILE)): m = pattern.search(line) if m: @@ -192,8 +153,7 @@ def parse_suite(lines): else: records[kind][key] = float(value) if kind == "time" else int(value) return dict(run=run, passed=passed, failed=failed, records=records, problems=problems, - golden=golden, duplicated=duplicated, - wrong_bytes=[name for name, output in outputs.items() if name in failed and wrong_bytes(output)]) + golden=golden, duplicated=duplicated) def parse_job(text): @@ -287,31 +247,10 @@ def extra_leg_id(card, node): return f"{card}@{node}" -def record_excused(leg, record_suites, record): - """The failed tests of LEG, an extra leg under an open RECORD (the matrix config's - `open_records`, one line), that are listed with the record and not judged: each failed with - wrong bytes (parse_suite's `wrong_bytes`), in a suite that the card's leg of record ran at the - same commit (RECORD_SUITES, its suites, each with `run` and `failed`) without it failing there. - Where the leg of record has no such suite, nothing is excused. Returns {test: its line}.""" - out = {} - for name, suite in leg["suites"].items(): - theirs = record_suites.get(name) - if not theirs or not theirs.get("run"): - continue - for test in suite.get("wrong_bytes", ()): - if test in suite["failed"] and test not in theirs["failed"]: - out[test] = (f"test {test}: wrong bytes, passed on the card's leg of record at this " - f"commit: {record}") - return out - - -def leg_parked(leg, records, excused=None): - """The leg's parked failures (PARKED_TESTS, PARKED_RECORDS' gauges, and EXCUSED, record_excused's - lines), one line each.""" - excused = excused or {} +def leg_parked(leg, records): + """The leg's parked failures (PARKED_TESTS and PARKED_RECORDS' gauges), one line each.""" out = [f"test {test}" for suite in leg["suites"].values() for test in suite["failed"] if test in PARKED_TESTS] - out += [excused[test] for suite in leg["suites"].values() for test in suite["failed"] if test in excused] gauges = records["gauge"] for key, value in sorted(gauges.items()): name, _, point = key.rpartition("@") @@ -321,15 +260,14 @@ def leg_parked(leg, records, excused=None): return out -def leg_problems(leg, records, base, excused=()): +def leg_problems(leg, records, base): """What fails a leg: a suite that failed, a record's own problem, and the rules against the base leg's records (BASE None: no base, so only the rules that need none). A suite whose every - failed test is parked (PARKED_TESTS, or a harness workload of PARKED_RECORDS) or EXCUSED (the - tests record_excused lists) has not failed.""" + failed test is parked (PARKED_TESTS, or a harness workload of PARKED_RECORDS) has not failed.""" problems = [] for name, suite in leg["suites"].items(): failed = [test for test in suite["failed"] - if test not in PARKED_TESTS and not test.startswith(PARKED_RECORDS) and test not in excused] + if test not in PARKED_TESTS and not test.startswith(PARKED_RECORDS)] if failed or (suite["exit"] != 0 and not suite["failed"]): shown = ", ".join(failed[:5]) + (" ..." if len(failed) > 5 else "") problems.append(f"suite {name} exited {suite['exit']}" diff --git a/scripts/matrix/test_results.py b/scripts/matrix/test_results.py index 1cdfad887..4469c792e 100644 --- a/scripts/matrix/test_results.py +++ b/scripts/matrix/test_results.py @@ -89,50 +89,6 @@ class ParseTests(unittest.TestCase): self.assertEqual(len(suite["problems"]), 5, suite["problems"]) self.assertEqual(suite["records"]["metric"], {"a/z": 1}) - def test_a_failure_reads_as_wrong_bytes_only_from_an_assertion_of_two_lists_and_nothing_else(self): - tests = ("bytes", "count", "lost", "vuid", "unwrap", "slow") - status = {name: "TIMEOUT" if name == "slow" else "FAIL" for name in tests} - lists = [" assertion `left == right` failed: case 3: the words", - " left: [0, 255, 0x7f, 1.5]", - " right: [0, 255, 0x7f, 2.5]"] - stderr = { - "bytes": lists, - "count": [" assertion `left == right` failed: the slots", " left: 3", " right: 1"], - "lost": [" vkQueueSubmit2: ERROR_DEVICE_LOST"] + lists, - "vuid": [" Validation Error: [ VUID-vkCmdDraw-None-08600 ] ..."] + lists, - "unwrap": [" called `Result::unwrap()` on an `Err` value: Timeout"], - "slow": lists, - } - lines = [f" {status[name]} [ 1.000s] ({i + 1}/6) metal2vulkan-rt tests::{name}" - for i, name in enumerate(tests)] - lines.append(" Summary [ 6.000s] 6 tests run: 0 passed, 5 failed, 1 timed out, 0 skipped") - for i, name in enumerate(tests): - lines += [f" {status[name]} [ 1.000s] ({i + 1}/6) metal2vulkan-rt tests::{name}", - " stderr ───", - f" thread 'tests::{name}' panicked at crates/metal2vulkan-rt/src/tests/x.rs:1:1:", - *stderr[name]] - suite = results.parse_suite(lines) - self.assertEqual(len(suite["failed"]), 6) - self.assertEqual(suite["wrong_bytes"], ["metal2vulkan-rt tests::bytes"]) - - def test_an_extra_leg_lists_a_wrong_bytes_failure_that_passed_on_the_leg_of_record_and_judges_the_rest(self): - bytes_, count = "metal2vulkan-rt tests::bytes", "metal2vulkan-rt tests::count" - leg = leg_of(recs(), code=100) - leg["suites"]["rt"].update(failed=[bytes_, count], wrong_bytes=[bytes_]) - record = "the card reads stale host memory lines under load" - excused = results.record_excused(leg, {"rt": dict(run=2, failed=[])}, record) - self.assertEqual(list(excused), [bytes_]) - self.assertEqual(results.leg_problems(leg, recs(), None, excused), - [f"suite rt exited 100, 1 failed: {count}"]) - self.assertEqual(results.leg_parked(leg, recs(), excused), - [f"test {bytes_}: wrong bytes, passed on the card's leg of record at this commit: {record}"]) - # Failed on the leg of record too, or the leg of record ran no such suite: judged. - self.assertEqual(results.record_excused(leg, {"rt": dict(run=2, failed=[bytes_])}, record), {}) - self.assertEqual(results.record_excused(leg, {}, record), {}) - self.assertEqual(results.record_excused(leg, {"rt": dict(run=0, failed=[])}, record), {}) - self.assertEqual(results.leg_problems(leg, recs(), None, {}), - [f"suite rt exited 100, 2 failed: {bytes_}, {count}"]) - def test_an_extra_leg_is_held_to_its_card_s_ceilings_and_floors(self): card = next(iter(results.HARNESS_CEILINGS)) row = next(iter(results.HARNESS_CEILINGS[card]))