diff --git a/docs/VALIDATION.md b/docs/VALIDATION.md index 30022cda3..46970ef93 100644 --- a/docs/VALIDATION.md +++ b/docs/VALIDATION.md @@ -314,7 +314,7 @@ holds them, then times each GPU in a job of its own. | Leg | Runs | Built | |---|---|---| -| Each GPU of a Linux node | `metal2vulkan-rt`'s tests under `--cfg m2v_gpu`, under the validation layer, the GPU chosen by `VK_DRIVER_FILES` and, on Mesa, `MESA_VK_DEVICE_SELECT='vendor:device!'`; then, in a job that holds the node alone (`--exclusive`) and times this one GPU, the harness's timed workloads (`crates/metal2vulkan-harness`), both runtimes in one process (`harness --runtime new,old`), the leg's suite `harness` | Once per commit on a CPU node: the tests as a nextest archive, the harness as a release build; both carried to the GPU nodes, which only run them. The archive holds its build's paths, so every node lays the tree out at the same per-commit path. Its binaries run only where the builder's do: a node of another CPU builds its own, in a job that holds no GPU | +| Each GPU of a Linux node | `metal2vulkan-rt`'s tests and the replay player's stream device tests (`metal2vulkan-validation`'s `runtime_lane::replay_streams` and `runtime_lane::rt_replay`) under `--cfg m2v_gpu`, under the validation layer, the GPU chosen by `VK_DRIVER_FILES` and, on Mesa, `MESA_VK_DEVICE_SELECT='vendor:device!'`; then, in a job that holds the node alone (`--exclusive`) and times this one GPU, the harness's timed workloads (`crates/metal2vulkan-harness`), both runtimes in one process (`harness --runtime new,old`), the leg's suite `harness` | Once per commit on a CPU node: the tests as a nextest archive, the harness as a release build; both carried to the GPU nodes, which only run them. The archive holds its build's paths, so every node lays the tree out at the same per-commit path. Its binaries run only where the builder's do: a node of another CPU builds its own, in a job that holds no GPU | | The Windows host's GPU | The same tests (under the validation layer) and harness, built on the host under MSYS2 CLANG64 (the pinned nightly's `x86_64-pc-windows-gnullvm` toolchain) | On the host, in a job that holds no GPU | | `lavapipe` | The gate's suites and the device tests (`metal2vulkan-rt`'s under the validation layer) in one build under `--cfg m2v_cpu_icd` (`cargo nextest run --workspace`, then the doctests), `LP_NUM_THREADS=1` | In place, on the builder | | `lint` | The gate's `cargo fmt --all --check`, clippy with `-D warnings` plain, under `--cfg m2v_gpu` and under `--cfg m2v_cpu_icd`, and Rustdoc with `-D warnings`, each its own suite | In place, on the builder, beside its other jobs | diff --git a/scripts/matrix/matrix b/scripts/matrix/matrix index 628d4c6a1..c3f601cc6 100755 --- a/scripts/matrix/matrix +++ b/scripts/matrix/matrix @@ -88,6 +88,14 @@ KEEP = r"""f == 0 { print; if ($0 ~ /^ *Summary \[/) f = 1; next } /^ +[A-Z][A-Z-]* +\[ *[0-9.]+s\]/ { k = ($1 != "PASS") } k || /M2V-MATRIX / { print }""" NEXTEST_OUT = "--no-fail-fast --success-output final --failure-output final" +#: The packages of the GPU legs' device-test archive, and the tests of it a leg runs: +#: `metal2vulkan-rt`'s, and the replay player's stream device tests on both runtimes +#: (`metal2vulkan-validation`'s `runtime_lane::replay_streams` and `runtime_lane::rt_replay`), each +#: of which writes and plays its own small stream. A break in the player or in a runtime's stream +#: path that only a GPU shows would otherwise wait for a lane's play of a recorded stream to find it. +DEVICE_TEST_PACKAGES = ("metal2vulkan-rt", "metal2vulkan-validation") +DEVICE_TEST_FILTER = ("package(metal2vulkan-rt) | (package(metal2vulkan-validation)" + " & test(/^runtime_lane::(replay_streams|rt_replay)::/))") #: A failed allocation in a job's output: a device or host allocation Vulkan refused, or Rust's. STARVED = re.compile(r"OUT_OF_(DEVICE|HOST)_MEMORY|memory allocation of \d+ bytes failed") DEVICE_LINES = (r"""vulkaninfo --summary 2>/dev/null | tr -d '\r' | sed -n 's/^[[:space:]]*\(deviceName\|driverName\|driverInfo\|driverVersion\)[[:space:]]*= */M2V-DEVICE '"{leg}"' \1 /p'""") @@ -288,7 +296,7 @@ cargo build --release -p metal2vulkan-harness --bin harness && cp -f target/rele h=$?""" if harness else "\nh=0") return linux_head(short, setup) + f"""W=$PWD lay_out || exit 3 -cd "$S" && RUSTFLAGS='--cfg m2v_gpu' CARGO_TARGET_DIR="$S/target/gpucfg" cargo nextest archive -p metal2vulkan-rt --all-features --archive-file "$W/{ARCHIVE}" +cd "$S" && RUSTFLAGS='--cfg m2v_gpu' CARGO_TARGET_DIR="$S/target/gpucfg" cargo nextest archive {" ".join(f"-p {p}" for p in DEVICE_TEST_PACKAGES)} --all-features --archive-file "$W/{ARCHIVE}" a=$? cd "$W" && rm -rf "$S"{timed} echo "M2V-BUILD exit $a $h" @@ -305,7 +313,7 @@ def gpu_script(short, setup, legs, mirror, rev, suite, last, layer=None, cpu=Non for leg in legs) if suite == "rt": file, body = ARCHIVE, f"""{layer_lines(layer, 'linux', '$1')} - cargo nextest run --archive-file "$F" --workspace-remap "$S" {NEXTEST_OUT} 2>&1 | awk "$KEEP" + cargo nextest run --archive-file "$F" --workspace-remap "$S" -E '{DEVICE_TEST_FILTER}' {NEXTEST_OUT} 2>&1 | awk "$KEEP" exit ${{PIPESTATUS[0]}}""" else: file, body = HARNESS, harness_runs('"$S/crates/metal2vulkan-harness"', '"$F"', '$1', cpu=cpu) diff --git a/scripts/matrix/status.tsv b/scripts/matrix/status.tsv index 7c9592823..fb1afe1aa 100644 --- a/scripts/matrix/status.tsv +++ b/scripts/matrix/status.tsv @@ -22,21 +22,19 @@ card | row | status | who 8086:3e9b | create_private_16MiB/first_take | open | memory2 | 5f2494bfc5 | - 8086:a7a0 | create_64MiB/first_take | open | memory2 | 5f2494bfc5 | - 8086:a7a0 | create_private_16MiB/first_take | open | memory2 | 5f2494bfc5 | - -10de:2204 | create_state/first | open | entry | 5f2494bfc5 | - -1002:699f | wide_bindings | open | identity | 5f2494bfc5 | - -8086:3e9b | sampling_deep_64x64x16 | open | identity | 5f2494bfc5 | - -8086:a7a0 | row_cells | open | identity | 795c834ded | - -8086:a7a0 | constant_managed | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | constant_private | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | constexpr_sampling | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | sampling_deep_512x512x16 | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | sampling_deep_512x512x16_16x16x1 | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | sampling_deep_512x512x16_4x4x4 | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | sampling_deep_512x512x16_8x8x1 | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | sampling_deep_64x64x16 | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | threadgroup_scan | open | identity | 5f2494bfc5 | Iris swing unresolved -8086:a7a0 | waves | open | identity | 5f2494bfc5 | Iris swing unresolved -10de:1e87 | frame_5cb | open | core | 140714ceae | latency from idle equal; throughput 8-14% behind +1002:699f | wide_bindings | open | identity | 5f2494bfc5 | waits for the card's native table +8086:3e9b | sampling_deep_64x64x16 | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | row_cells | open | identity | 795c834ded | waits for the card's native table +8086:a7a0 | constant_managed | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | constant_private | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | constexpr_sampling | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | sampling_deep_512x512x16 | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | sampling_deep_512x512x16_16x16x1 | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | sampling_deep_512x512x16_4x4x4 | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | sampling_deep_512x512x16_8x8x1 | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | sampling_deep_64x64x16 | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | threadgroup_scan | open | identity | 5f2494bfc5 | waits for the card's native table +8086:a7a0 | waves | open | identity | 5f2494bfc5 | waits for the card's native table +10de:1e87 | frame_5cb | gap | the planner's ruling of 2026-11-18 | - | the runtime guide's known gaps: NVIDIA's latency per submission; throughput 8-14% behind, latency from idle equal 10de:1e87 | frame | note | - | - | new ahead in throughput and in latency from idle -8086:a7a0 | frame_5cb | open | core | 140714ceae | latency from idle ahead; throughput about 8% behind, the ranges overlapping 8086:a7a0 | frame | note | - | - | new ahead in throughput and in latency from idle diff --git a/scripts/matrix/test_matrix.py b/scripts/matrix/test_matrix.py index f06211f75..4aa233c87 100644 --- a/scripts/matrix/test_matrix.py +++ b/scripts/matrix/test_matrix.py @@ -234,5 +234,25 @@ class JudgingRuleTests(unittest.TestCase): self.assertIn(f"-v skipre='{matrix.results.retime_skip(cpu)}'", script) +class DeviceTestTests(unittest.TestCase): + """The GPU legs' archive holds the replay player's stream device tests beside the runtime's, + and a leg runs exactly those two sets.""" + + def test_the_archive_holds_the_validation_crate_beside_the_runtime(self): + script = matrix.build_script("abc", "", False) + self.assertIn("cargo nextest archive -p metal2vulkan-rt -p metal2vulkan-validation --all-features", script) + + def test_a_leg_runs_the_runtime_s_tests_and_the_two_stream_modules(self): + leg = matrix.Leg("1002:15bf", "n", "0000:c7:00.0", "radeon") + script = matrix.gpu_script("abc", "", [leg], "POTLUCK_MIRROR_x", "0" * 40, "rt", False) + self.assertIn(f"-E '{matrix.DEVICE_TEST_FILTER}'", script) + self.assertIn("test(/^runtime_lane::(replay_streams|rt_replay)::/)", matrix.DEVICE_TEST_FILTER) + + def test_the_harness_suite_takes_no_test_filter(self): + leg = matrix.Leg("1002:15bf", "n", "0000:c7:00.0", "radeon") + script = matrix.gpu_script("abc", "", [leg], "POTLUCK_MIRROR_x", "0" * 40, "harness", False) + self.assertNotIn(matrix.DEVICE_TEST_FILTER, script) + + if __name__ == "__main__": unittest.main()