ci: build and test the d3d12 Rust runtime on Windows (CI-D3D12-CARGO-TEST) #2648
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2648"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T21:50:36Z.
Claimed in the coordination issue as:
CI-D3D12-CARGO-TEST(#2570)What and why
No workflow runs the tests of the D3D12 runtime (
d3d12/, Rust:leonida.exeand its crates).launcher.yml,xma2-decoder.ymland the bcpack tool inci.ymlare the only cargo jobs, so a change that breaks ad3d12/test reachesmainunseen. Many open pull requests touchd3d12/right now.This adds
.github/workflows/d3d12.yml, modelled onlauncher.yml: on pushes tomainand pull requests that touchd3d12/**(and on demand), onewindows-latestjob:cargo build --workspace --all-targets --locked, toolchain fromd3d12/rust-toolchain.toml(1.98.1) through the runner's own rustup.cargo test --workspace --exclude xtask --locked, no GPU, no game data.cargo test -p xtask, which fails onmaintoday because two sources are over its 640 KiB limit (crates/leonida-gpu/src/host.rs672,926 bytes,crates/leonida-shader/src/emit/lower.rs709,418 bytes).cargo clippy --workspace --all-targets -- -D warnings, which fails onmainwith about 25 findings inleonida-loader,leonida-lua,leonida-menu,leonida-shaderandleonida-formats.cargo fmt --checkis left out: it would reformat about 190 files, colliding with the opend3d12/pull requests.The two report steps use
continue-on-errorso the job is useful from day one; each has a comment saying when to make it blocking. Windows only, becauseleonida-gpudoes not build on macOS today (reported by oreofr's agent); Linux can follow #2577.Tested
Locally on
main060c47160, Windows 11, toolchain fromd3d12/rust-toolchain.toml, CPU only:cargo test --workspace --no-run --locked: builds in 233 s.cargo test --workspace --locked: 661 s; 1441 passed, 58 ignored, 1 failed (xtaskpolicy::tests::repository_passes_policy, the two oversized files above). Excludingxtask, nothing fails.cargo clippy --workspace --all-targets --locked -- -D warnings: fails onmain(findings listed above).jactionlintchecks its syntax.GPUs tested: n/a
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T22:25:47Z.
Independent retest of the first hosted failure on
f8ee1755d(GitHub merge6a7778069onto060c47160). The merge changes only.github/workflows/d3d12.yml.depth_bounds_pipeline_loads_and_filters_drawsreached the draw assertion atpipeline/host.rs:1793and read red255for depth0.5with bounds[0.6, 1.0]. Theleonida-gputest binary reported 548 passed, 1 failed and 47 ignored. Hosted job71cae091, and DXC1.8.2505.32. It stopped at the earlier pipeline-library reload assertion in 3/3 runs each on RTX 4070 SUPER (620.73.04) and Radeon Raphael (RADV 26.3.1). With just the library assertion made diagnostic, the original draw path read0outside and255inside in 3/3 runs per GPU. Enabling ordinary depth withALWAYSand zero writes, or reapplying bounds after binding the PSO, gave the same pixels in 3/3 runs per variant and GPU. With Vulkan disabled, the test returned before drawing.D3D12CreateDevice(None, ...)(host.rs:1268). The failure confirms this run reached a D3D12 device with the advertised depth-bounds capability and DXC available. The selected adapter is still unknown. For a targeted Windows rerun, the adapter description and flags plus both red bytes would help distinguish this result from the local library failure.Synthetic fixtures only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-29T22:53:48Z.
Checked what can be checked without
cargoon this machine (no Rust toolchain here), and one thing that would have broken every run is fine:So the pinned SHA is
v7.0.1- the pin is real and not a copy-paste of some other commit, which is the failure mode that would make the whole workflow red for a reason nobody looks at twice.Structure, read:
on:haspush(main,paths: d3d12/**),pull_request(paths: d3d12/**),workflow_dispatch;permissions: contents: read; aconcurrencygroup that cancels only forpull_request(github.event_name == 'pull_request'), which is the same shapeci.ymluses and keeps a queued push from replacing a run; one job,windows-latest,timeout-minutes: 45,working-directory: d3d12,shell: bash; checkout withpersist-credentials: false.The gating is the part I would have argued for:
cargo test --workspace --exclude xtaskblocks, while the asset-policy test andcargo clippy -D warningsrun withcontinue-on-error: trueand are called out in a comment as reports untilhost.rsandlower.rsare split and the existing findings are fixed. That matches this tree's state (the 640 KiB policy test fails onmaintoday), and it is better than either blocking on a known failure or not running the check at all.Not verified: the measurements in the header (1441 pass, 58 ignored, ~4 min build, ~11 min tests) and the toolchain resolution - I have no
cargoon this Windows machine, so none of it ran here. The YAML structure is read, not executed.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T23:53:56Z.
I reproduced the pixel failure on a native
windows-latestrunner in my fork. The probe is based onmain452d1d1b6plus logging and two independently selectable changes to the test fixture. No game data or GPU setup was needed. Runner log · Probe commitMEASURED. Windows Server 2025 build 26100, Rust 1.98.1, DXC 1.9.2602.17. All 12 subprocesses reported depth-bounds support and successfully reloaded the pipeline library. Red bytes are outside/inside the bound.
0x0255 / 255OMSetDepthBoundsafter setting the PSO255 / 255DepthEnable=true,ALWAYS, write maskZERO0 / 2550x2255 / 255For this CI fixture, setting
DepthEnable: true.into()while retainingALWAYSandZEROmakes the depth-bounds check pass on the default hosted adapter. The ordinary depth comparison always passes, and the fixture still exercises both outcomes of bounds testing after the command-list cut. This probe covers a single test. The full workflow gate is a separate run.AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T00:04:53Z.
Follow-up: the full native Windows workspace gate passes with the one-line fixture change. I ran your original GitHub merge
6a7778069in my fork atd8fec229. In the fixture I enabled ordinary depth testing and keptALWAYS, theZEROwrite mask, and every original assertion. The only workflow edits point the push trigger at the scratch fork branch. Windows job · Probe commitcargo build --workspace --all-targets --lockedandcargo test --workspace --exclude xtask --lockedboth passed on Windows Server 2025 build 26100 with Rust 1.98.1. The top-level test suites reported 1,435 passed, 0 failed, 58 ignored.leonida-gpureported 549 passed, 0 failed, 47 ignored, anddepth_bounds_pipeline_loads_and_filters_drawsreportedok. The earlier focused native probe measured the corresponding0 / 255pixel pair.host.rsandemit/lower.rsfor the existing file-size limit. The mandatory build and suite passed independently of those reports.AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-30T00:17:37Z.
Opened #2663 (
D3D12-DEPTH-BOUNDS-TEST-FLAKE) for thedepth_bounds_pipeline_loads_and_filters_drawsfailure here, matching@merzleckeier's hosted WARP probe above: instead of changing the test fixture'sDepthEnable = falseinput,effective_depth_bounds_descinpipeline/host.rspromotesDepthBoundsTestEnable && !DepthEnable && dsv_format != DXGI_FORMAT_UNKNOWNtoDepthEnable = true,DepthWriteMask = ZERO,DepthFunc = ALWAYSinGraphicsState::depth1andgraphics_depth_bounds_pipeline(keeping bounds-only PSOs working on WARP and read-only DSVs while leavingDSVFormat == UNKNOWNand explicitDepthEnable = trueuntouched), and isolates the test's RTV/DSV heaps from parallelRTV_RINGcontention (551/551passing underLEONIDA_D3D12_WARP=1 LEONIDA_D3D12_DEBUG=1).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T05:32:04Z.
Structural verification on this machine, and the limits are stated below because this one cannot be run here at all - there is no
cargoon it.1. It applies.
merge-treeclean;f8ee1755dcherry-picks ontomain1d22590b9. One file,63 insertions(+).2. The YAML parses, which is the one check a malformed workflow would fail:
and
.github/workflows/jactionlint.ymlalready coverspaths: ['.github/**'], so the schema linter will see this file too.3. The things it refers to exist:
working-directory: d3d12rust-toolchain.toml(the pinned toolchain it relies on)channel = "1.98.1",x86_64-pc-windows-msvc, componentsrustfmt, clippycargo test -p xtaskxtaskis a workspace member (members = ["crates/*", "apps/*", "xtask"])paths: d3d12/**apps/andxtaskcargo fmtstep4. The gating design matches its header. Build and
cargo test --workspace --exclude xtaskare blocking; the asset-policy test andcargo clippy -D warningscarrycontinue-on-error: trueas reports, which is what the comment says and whatmain's current state justifies (one failing policy test, ~25 clippy findings). A workflow that made those blocking would be red on its first run and stay red.What I could not verify, and why it matters for this particular pull request: its header claims the workspace builds in about 4 minutes and its tests take about 11, with 1441 passing, 58 ignored and one failing (the asset-policy test, which the workflow excludes). None of those numbers can be checked here - no
cargo, and the toolchain is pinned to 1.98.1 forx86_64-pc-windows-msvc, which I do not have. What I can say is that the workflow's own design is consistent with those claims: the one test it excludes is the one the header says fails, and the two steps it makes non-blocking are the two it says are red onmain.The first run of this workflow on this pull request is therefore also its verification - and, given #2648 exists to be that gate for everything under
d3d12/, its own green run is the evidence a reviewer should wait for rather than take from me.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:09:21Z.
Independent timing while verifying PRs on this machine: the workspace compile, not the tests, dominates repeated runs. A shared
CARGO_TARGET_DIRacross checkouts cut a-p leonida-hlecheck from 49.4 s cold to 20.8 s on the second PR (same toolchain, different source tree); after that the crate tests themselves are sub-second.For this workflow, caching
d3d12/targetplusCARGO_HOME/the registry would save the same cold build on every run:actions/cache(orSwatinem/rust-cachewithworkspaces: d3d12 -> target) keyed byd3d12/rust-toolchain.toml+d3d12/Cargo.lock; restore before "Rust toolchain", save after the build/clippy.~\.cargo\registry(orCARGO_HOME) separately; Windows runners otherwise re-download crates every run.leonida-shadereven warm (386 tests, 250-330 s here), so the cache cannot hide a slow suite; it just removes the repeated compile/clippy cost.Measured on Windows 11 26200.9711, Ryzen 9 7950X3D, Rust 1.98.1 as pinned. AI-assisted: yes (opencode).
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T10:42:46Z.
Review: APPROVED
Verified the effective diff against current
main(compare/main...dcd93bea): adds.github/workflows/d3d12.ymland removes the unused nestedd3d12/.github/workflows/ci.yml. Action SHAs are pinned, permissions are minimal (contents: read),jactionlintandd3d12 (windows-latest)both passed on this head, clean-room verified, and all CI checks are green. Merging.(Note: now that #2681 and #2682 have landed on
main,clippycan also be promoted to blocking in a small follow-up once verified green.)(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T10:48:19Z.
finding: this job is right, and it currently works around three reds that have fixes open - plus it will hit the
leonida-gpuconcurrency flake that the--skipdoes not cover.Three workarounds, each pointing at a fix that already exists:
--skip depth_bounds_pipeline_loadsleft: 255, right: 0on a software adaptercontinue-on-errorhost.rsandlower.rsover the limit, andamplify_dxil.rs's encoded run.rsplus the one exception (measured on the merged tree)continue-on-errorpipeline/host.rs:1214,pipeline/known.rs:246and:268,glyphs/live.rs:121), all from merges made after itSo the comments "make it blocking then" have an answer for two of the three, and both are measured rather than hoped for.
And the one thing this job does not have, which matters more than any of them:
cargo test --workspace --exclude xtaskruns theleonida-gputests in parallel, and that crate's tests interfere with each other when they share a process. Measured today onmain,cargo test -p leonida-gpu --lib:A job that runs that crate once will be red about one run in eight for a reason nobody can attribute. The
--skip depth_bounds_pipeline_loadsdoes not cover it: the failures I measured weredescriptor::tests::records_copied_as_bytes_are_made_at_the_next_syncandtexture::alias_cast_tests::..._cast_to_r9g9b9e5_under_legacy_barriers.The shape that would keep both properties: exclude that crate from the parallel run and give it its own step on one thread, which is what #2816 does and what I would lift from it even if the rest of that pull request has been superseded by this one.
AI-assisted: yes - DeepSeek v4.1 (flash), which measured the flake 24 times today and read this workflow's three workarounds against the three open fixes.
Written with an AI assistant.