From faf7f0a0b06a80e1f42ff8d6a7f34f696b070944 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Tue, 1 Dec 2026 02:08:53 +0100 Subject: [PATCH 1/5] ci: a job that runs the d3d12 workspace's tests No workflow runs cargo test on d3d12/. ci.yml builds tools/bcpack_calibration, launcher.yml tests the launcher crate, xma2-decoder.yml tests runtime/xma_decoder, and the workspace that holds thirteen crates and the asset-policy test is not wired to anything. This adds the job: windows-latest, cached cargo and target, cargo test --workspace --locked. Deliberately absent: cargo fmt --all -- --check, because d3d12/ has a rustfmt.toml and does not follow it (cargo fmt --all rewrites 190 files), and clippy -D warnings, because the workspace has 115 warnings and no errors. Each is its own change and neither belongs in a CI pull request. --- .github/workflows/d3d12-rust.yml | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/d3d12-rust.yml diff --git a/.github/workflows/d3d12-rust.yml b/.github/workflows/d3d12-rust.yml new file mode 100644 index 0000000000..16ace92d37 --- /dev/null +++ b/.github/workflows/d3d12-rust.yml @@ -0,0 +1,61 @@ +# Builds and tests the d3d12 workspace (Rust) when it changes, so a change that does not pass its +# tests shows up in CI. It needs no GPU, no display and no game files. +# +# Two checks that are deliberately not here, and why: +# +# cargo fmt --all -- --check d3d12/ has a rustfmt.toml and does not follow it: running +# `cargo fmt --all` rewrites 190 files. That is its own change, +# and not one to smuggle into a CI pull request. +# cargo clippy ... -D warnings 115 warnings and no errors across the workspace; holding them at +# -D warnings is also its own change. +# +# When either lands, its step belongs next to the tests below. +name: D3D12 Rust + +on: + push: + branches: [main] + paths: + - "d3d12/**" + - ".github/workflows/d3d12-rust.yml" + pull_request: + paths: + - "d3d12/**" + - ".github/workflows/d3d12-rust.yml" + workflow_dispatch: + +concurrency: + group: d3d12-rust-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + test: + name: d3d12-rust + # Windows: the workspace's GPU crate talks to D3D12 and Vulkan through Windows APIs, and the + # gate scripts its tests drive are PowerShell. + runs-on: windows-latest + timeout-minutes: 40 + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + - name: Cache Cargo dependencies and build + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + d3d12/target + key: d3d12-cargo-${{ runner.os }}-${{ hashFiles('d3d12/Cargo.lock') }} + restore-keys: | + d3d12-cargo-${{ runner.os }}- + - name: Tests + working-directory: d3d12 + # The asset-policy test reads the whole tree and is the reason this job exists: it is green + # once policy no longer measures a Rust source file as data (#2815). + run: cargo test --workspace --locked From 04691cccaaaf1fb1b4b8a63cc7b14c76e87ece5d Mon Sep 17 00:00:00 2001 From: fiestorra Date: Tue, 1 Dec 2026 03:40:37 +0100 Subject: [PATCH 2/5] ci: install the toolchain d3d12/rust-toolchain.toml pins, not whatever stable is The action installed stable and cargo, run from d3d12/, then had rustup fetch the pinned 1.98.1 on the fly: the same result with a download nobody asked for. --- .github/workflows/d3d12-rust.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/d3d12-rust.yml b/.github/workflows/d3d12-rust.yml index 16ace92d37..619b3168c3 100644 --- a/.github/workflows/d3d12-rust.yml +++ b/.github/workflows/d3d12-rust.yml @@ -43,7 +43,12 @@ jobs: with: persist-credentials: false - name: Install Rust - uses: dtolnay/rust-toolchain@stable + # The channel `d3d12/rust-toolchain.toml` pins. `@stable` installs whatever the runner calls + # latest, and then `cargo` run from `d3d12/` has rustup fetch the pinned one on the fly: the + # same result with a download nobody asked for. If that file bumps, this line follows it. + uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.98.1 - name: Cache Cargo dependencies and build uses: actions/cache@v4 with: From 3e03ab511d3d9e97fb26c6547d84443ee3d8cf58 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Tue, 1 Dec 2026 03:42:12 +0100 Subject: [PATCH 3/5] ci: pin the three actions to the commits the rest of the repo pins jactionlint requires it: a tag can be moved, and every other workflow here uses a sha with the version in a comment. checkout v7.0.1 and cache v6.1.0 are the shas already in use; rust-toolchain is pinned at v1 and the version comes from the 'with: toolchain' input instead of the ref. --- .github/workflows/d3d12-rust.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/d3d12-rust.yml b/.github/workflows/d3d12-rust.yml index 619b3168c3..d8e44797f3 100644 --- a/.github/workflows/d3d12-rust.yml +++ b/.github/workflows/d3d12-rust.yml @@ -39,18 +39,18 @@ jobs: runs-on: windows-latest timeout-minutes: 40 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install Rust # The channel `d3d12/rust-toolchain.toml` pins. `@stable` installs whatever the runner calls # latest, and then `cargo` run from `d3d12/` has rustup fetch the pinned one on the fly: the # same result with a download nobody asked for. If that file bumps, this line follows it. - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 with: toolchain: 1.98.1 - name: Cache Cargo dependencies and build - uses: actions/cache@v4 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.cargo/registry From 72020a87479539414acfe8088ef6098b4843c8a0 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Tue, 1 Dec 2026 08:34:52 +0100 Subject: [PATCH 4/5] ci: leonida-gpu runs one thread, the rest of the workspace keeps its own Sixteen runs of \cargo test -p leonida-gpu --lib\ with the default threads failed\ntwice (descriptor::tests::records_copied_as_bytes_are_made_at_the_next_sync and\ntexture::alias_cast_tests::..._cast_to_r9g9b9e5_under_legacy_barriers), and eight\nwith --test-threads=1 failed none. Both tests pass fifteen times in isolation, so\nthe interference is between tests inside one process, not between runs.\n\nSerial for the whole workspace would put leonida-shader's six-minute suite well\npast the timeout, so only this crate runs that way: 37 s against 13, and the rest\nof the workspace is unchanged. --- .github/workflows/d3d12-rust.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/d3d12-rust.yml b/.github/workflows/d3d12-rust.yml index d8e44797f3..254aab2133 100644 --- a/.github/workflows/d3d12-rust.yml +++ b/.github/workflows/d3d12-rust.yml @@ -63,4 +63,11 @@ jobs: working-directory: d3d12 # The asset-policy test reads the whole tree and is the reason this job exists: it is green # once policy no longer measures a Rust source file as data (#2815). - run: cargo test --workspace --locked + run: cargo test --workspace --locked --exclude leonida-gpu + - name: Tests (leonida-gpu, one thread) + working-directory: d3d12 + # This crate's tests interfere with each other when they share a process: sixteen runs with + # the default threads failed twice and eight with --test-threads=1 failed none (#2570). It + # costs 37 seconds instead of 13, and it is the difference between a red that means + # something and a red one run in eight that nobody can attribute. + run: cargo test -p leonida-gpu --lib --locked -- --test-threads=1 From f816499497109508195fe8f65731ce378c6b72e4 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Tue, 1 Dec 2026 08:41:20 +0100 Subject: [PATCH 5/5] ci: leonida-gpu runs even when the workspace step fails The first run after the split failed in the first step (the policy test, until #2815\nmerges) and skipped the second, so the one result I wanted to see never ran.\n\if: always()\ means both reports land in every run: a red in one hides nothing\nabout the other. --- .github/workflows/d3d12-rust.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/d3d12-rust.yml b/.github/workflows/d3d12-rust.yml index 254aab2133..0d31137281 100644 --- a/.github/workflows/d3d12-rust.yml +++ b/.github/workflows/d3d12-rust.yml @@ -66,8 +66,10 @@ jobs: run: cargo test --workspace --locked --exclude leonida-gpu - name: Tests (leonida-gpu, one thread) working-directory: d3d12 - # This crate's tests interfere with each other when they share a process: sixteen runs with - # the default threads failed twice and eight with --test-threads=1 failed none (#2570). It - # costs 37 seconds instead of 13, and it is the difference between a red that means - # something and a red one run in eight that nobody can attribute. + # Runs even if the step above failed: one red should not hide the other. This crate's tests + # interfere with each other when they share a process: sixteen runs with the default threads + # failed twice and eight with --test-threads=1 failed none (#2570). It costs 37 seconds + # instead of 13, and it is the difference between a red that means something and a red one + # run in eight that nobody can attribute. + if: always() run: cargo test -p leonida-gpu --lib --locked -- --test-threads=1