Skip to content

d3d12-gpu: keep depth stage active on WARP for bounds-only pipelines (D3D12-DEPTH-BOUNDS-TEST-FLAKE) - #2663

Open
zmasi wants to merge 21 commits into
ProjectLeonida:mainfrom
zmasi:fix/d3d12-depth-bounds-test-flake
Open

zmasi wants to merge 21 commits into
ProjectLeonida:mainfrom
zmasi:fix/d3d12-depth-bounds-test-flake

Conversation

@zmasi

@zmasi zmasi commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: D3D12-DEPTH-BOUNDS-TEST-FLAKE (#2570 (comment))

What and why

Fixes the failure in pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws (depth 0.5 outside [0.6, 1.0] must be rejected, returning 255 instead of 0 — the sole failing test in #2648's d3d12 (windows-latest) job and reported in #2570 (comment)):

  1. Keep depth-stencil active when DepthBoundsTestEnable is used without DepthEnable (d3d12/crates/leonida-gpu/src/pipeline/host.rs):
    • When DepthBoundsTestEnable is true with DepthEnable == false and StencilEnable == false, Microsoft WARP (d3d10warp.dll, used on CPU-only hosts and windows-latest CI runners) bypasses the depth-stencil stage on direct DEPTH_STENCIL1 PSOs and passes fragments (20/20 deterministic failures even for impossible intervals such as [-2.0, -1.0] and [2.0, 3.0]).
    • effective_depth_bounds_desc (applied in GraphicsState::depth1 for both graphics and mesh pipelines and in graphics_depth_bounds_pipeline) promotes DepthBoundsTestEnable && !DepthEnable && dsv_format != DXGI_FORMAT_UNKNOWN to DepthEnable = true, DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ZERO, DepthFunc = D3D12_COMPARISON_FUNC_ALWAYS.
    • This comparison is a mathematical no-op on depth testing and depth writes (and valid with D3D12_DSV_FLAG_READ_ONLY_DEPTH read-only DSVs under the D3D12 debug layer) while forcing WARP and early-Z-gated drivers to fetch the DSV and evaluate [MinDepthBounds, MaxDepthBounds]. When DSVFormat == DXGI_FORMAT_UNKNOWN, DepthEnable stays false; when DepthEnable is already true, the caller's DepthFunc and DepthWriteMask are preserved unchanged.
    • GraphicsState::screen_pass also excludes self.depth_bounds, and GraphicsState::describe distinguishes normalized bounds-only state (depth-bounds-always) so pre-existing pipeline-library caches do not collide on StorePipeline (0 changes in d3d12/crates/leonida-gpu/src/host.rs).
  2. Isolate test RTV/DSV descriptors, pre-cut clears, and SM 6.0 WARP profiles (d3d12/crates/leonida-gpu/src/pipeline/host.rs):
    • Allocates dedicated 1-descriptor RTV and DSV heaps in depth_bounds_pipeline_loads_and_filters_draws instead of sharing Host::rtv / Host::dsv's lock-free RTV_RING across ~550+ concurrent tests, records the target clears on first_list ahead of the command-list cut, and compiles synthetic test shaders as vs_6_0 / ps_6_0 behind device_supports_depth_bounds_sm60 so SM 6.2 WARP (Windows 10 22H2) runs both fixtures cleanly.
    • Adds depth_bounds_without_depth_test_enables_noop_always_depth_only_with_dsv and depth_bounds_without_depth_test_filters_on_warp_and_in_parallel, which explicitly enumerates warp_adapter() alongside host() and runs 4-thread concurrent writable and read-only DSV depth-bounds draws on every cargo test -p leonida-gpu --lib run.
    • Independent failure modes note: These two fixes are independent. effective_depth_bounds_desc is proven deterministically load-bearing by the new parallel WARP fixture (which fails 255 vs 0 on writable and read-only DSVs whenever the promotion is reverted), whereas on WARP 10.0.26100.9711 (@KelboLive) the original depth_bounds_pipeline_loads_and_filters_draws still passes with the promotion reverted while other WARP builds reproduce 255 vs 0 under LEONIDA_D3D12_WARP=1 — meaning the original CI failure could also stem from the shared RTV_RING / post-cut clear race fixed here rather than depth state alone.
  3. Re-enable depth_bounds_pipeline_loads_and_filters_draws in CI (.github/workflows/d3d12.yml):

Tested

  • Local: LEONIDA_D3D12_WARP=1 and hardware GPU cargo test -p leonida-gpu --lib pipeline::host::tests -- --test-threads=4 -> 11/11 passed (0 D3D12 debug-layer errors on initial diagnostic runs + 25/25 parallel WARP stress runs).
  • Independently verified across hosted Windows Server 2022 (10.0.20348.5756) and Server 2025 (10.0.26100.33648) WARP runners (@merzleckeier), Windows 10 22H2 SM 6.2 WARP 10.0.19041.7811 + RTX 5070 (@lixonik), and Windows 11 WARP 10.0.26100.9711 + RTX 4070 Ti SUPER (@KelboLive).
  • python -I scripts/check_no_game_data.py -> 0 issues.

GPUs tested: Microsoft WARP (d3d10warp.dll) and NVIDIA GeForce RTX 3090 (driver 610.88), Windows 11 Pro (26200).

AI-assisted: authored with Gemini 4 Carbon; independently reviewed with Gemini 4 Neon (opus-systems-critic) plus external reviews noted above.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

- GPU-VEGA20-RADV: record native-wave64 fixtures, validation and pipeline creation on main a73a57e.
- Keep the stock image-atomic failure and the separate ProjectLeonida#1518 fixture control distinct.
- AI-assisted; synthetic repository fixtures only.
- Record the forced geometry fallback on the same pinned gfx906 GPU and main revision.
- Keep the unchanged computed-I/J skip and the known image-atomic fixture failure visible.
…unds PSOs

When DepthBoundsTestEnable is true with DepthEnable and StencilEnable false,
Microsoft WARP bypasses the depth-stencil stage completely and passes
fragments even when the depth buffer value lies outside [MinDepthBounds,
MaxDepthBounds].

Normalize host D3D12_DEPTH_STENCIL_DESC1 in pipeline::host so pipelines with
DepthBoundsTestEnable && !DepthEnable and a non-UNKNOWN DSVFormat enable
DepthEnable with D3D12_COMPARISON_FUNC_ALWAYS and D3D12_DEPTH_WRITE_MASK_ZERO
(a mathematical no-op on depth comparison and writes, valid on read-only DSVs
as well), exclude depth-bounds passes from GraphicsState::screen_pass, and
isolate RTV/DSV descriptors and pre-cut clears in
depth_bounds_pipeline_loads_and_filters_draws alongside a 4-thread parallel
WARP + hardware regression test.

Refs: ProjectLeonida#2570

AI-assisted.
@lixonik

lixonik commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

[P2] Use a shader profile supported by the WARP adapter in the depth-bounds fixture

On Windows 10 22H2 (build 19045, system WARP 10.0.19041.7811), WARP advertises DepthBoundsTestSupported but reports Shader Model 6.2. The new fixture compiles its synthetic shaders as vs_6_5 and ps_6_5. The WARP PSO returns E_INVALIDARG (0x80070057) before the pixel assertions. I reproduced it on all four targeted reruns.

On the same device and with the same DXC, the full fixture passed after lowering just those two shader profiles to vs_6_0 and ps_6_0 and adding a diagnostic shader-model query. The fixture uses basic shaders, so SM 6.0 lets it exercise depth bounds on this WARP version. The optional hardware pass also depends on getting through WARP setup and its capability guard. Running that pass independently would preserve hardware coverage when WARP lacks depth bounds.

Tested 51ea09bf534bc5838f3e0bb14eebaef9d353856f merged locally into 452d1d1b68aa2da94d5f0eff43ad0a6a83bbbadf. The original native pipeline::host::tests run had 10 passes and this one failure. The descriptor test and existing hardware draw/readback test both passed. I used local test-executable loader exports for Agility SDK 1.614.1 and synthetic inputs only.

AI-assisted.

…/host passes

Lower the standalone parallel depth-bounds regression test's synthetic
shaders from vs_6_5/ps_6_5 to vs_6_0/ps_6_0 so Windows 10 22H2 WARP
(max SM 6.2) supports them, gate each device independently on
DepthBoundsTestSupported + D3D_SHADER_MODEL_6_0, and deduplicate by
adapter LUID so skipping WARP never skips hardware coverage.

Refs: ProjectLeonida#2570

AI-assisted.
@zmasi

zmasi commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Good catch on Windows 10 22H2 WARP (max SM 6.2)! Pushed c65f657c45 updating depth_bounds_without_depth_test_filters_on_warp_and_in_parallel:

  1. Lowered the synthetic shaders to vs_6_0 and ps_6_0 and added device_supports_depth_bounds_sm60 checking both DepthBoundsTestSupported and D3D_SHADER_MODEL_6_0 per device.
  2. Decoupled the standalone warp_adapter() pass and the host() hardware pass (run_parallel_depth_bounds_check with adapter-LUID deduplication) so hardware coverage still runs independently when WARP is unavailable or lacks depth-bounds support (11/11 passing under LEONIDA_D3D12_WARP=1 LEONIDA_D3D12_DEBUG=1 and on hardware).

AI-assisted.

@merzleckeier

Copy link
Copy Markdown
Contributor

Hosted WARP follow-up to the #2648 depth-bounds failure. I built c65f657c4 (GitHub merge 38cbdc263 onto b8bd37111) with diagnostics and ran the tests with LEONIDA_D3D12_WARP=1 and LEONIDA_D3D12_DEBUG=1. Windows Server 2025 build 26100, system WARP 10.0.26100.33648, DXC 1.9.2602.17. The fork commit only adds the probe workflow. Hosted Windows job.

  • MEASURED All three depth-bounds tests passed in each of five fresh test processes, with no skip messages or D3D12 errors. All 11 pipeline-host tests also passed with four test threads. This includes the pipeline-library test that was red in ci: build and test the d3d12 Rust runtime on Windows (CI-D3D12-CARGO-TEST) #2648 and the new parallel writable/read-only DSV check.
  • READ IN CODE The older depth_bounds_pipeline_loads_and_filters_draws fixture still uses vs_6_5 / ps_6_5 behind a depth-bounds-only device check. If the host is forced to the SM 6.2 WARP adapter from the Windows 10 report, that fixture is worth a focused check as well. The new parallel fixture now uses SM 6.0. Legacy fixture.

Synthetic fixtures only. AI-assisted with OpenAI Codex.

Compile the synthetic shaders in depth_bounds_pipeline_loads_and_filters_draws
as vs_6_0/ps_6_0 and check device_supports_depth_bounds_sm60 so running
with LEONIDA_D3D12_WARP=1 on Windows 10 22H2 (WARP max SM 6.2) succeeds
cleanly.

Refs: ProjectLeonida#2570

AI-assisted.
@zmasi

zmasi commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the hosted windows-latest verification (5/5 processes clean)! Also lowered depth_bounds_pipeline_loads_and_filters_draws to vs_6_0 / ps_6_0 with device_supports_depth_bounds_sm60 in ee9fb09755 so both fixtures run cleanly when LEONIDA_D3D12_WARP=1 is forced on Windows 10 22H2 (SM 6.2 WARP).

AI-assisted.

@merzleckeier

Copy link
Copy Markdown
Contributor

Independent SM 6.0 follow-up on two hosted WARP versions. I tested ee9fb0975 (GitHub merge a7db42495 onto b8bd37111) with diagnostics, LEONIDA_D3D12_WARP=1, LEONIDA_D3D12_DEBUG=1 and DXC 1.9.2602.17. The fork adds only the probe workflow. Server 2022 job · Server 2025 job.

  • MEASURED All three depth-bounds tests passed in each of five fresh processes on Server 2022 (WARP 10.0.20348.5756) and Server 2025 (WARP 10.0.26100.33648). Both the pipeline-library fixture and the parallel writable/read-only DSV fixture ran with no depth-bounds skip messages or D3D12 errors.
  • MEASURED The broader pipeline::host::tests filter reported 11 passed on each image. The optional mesh fixture returned early on Server 2022 because WARP did not advertise mesh shaders.

This checks the updated fixture on the two Server WARP versions. The Windows 10 22H2 repro uses a different WARP build. Synthetic fixtures only. AI-assisted with OpenAI Codex.

@lixonik

lixonik commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Retested the SM 6.0 update ee9fb0975584a0a92f86de0778afe086a20927ea merged locally into 0eab02a8bcffbb9d1609f9c2fba40c2357513d06, on the same Windows 10 22H2 machine as the original report (system WARP 10.0.19041.7811, max SM 6.2, RTX 5070 on 610.88, DXC 1.9.0.5512).

  • With LEONIDA_D3D12_WARP=1, pipeline::host::tests passed 11/11. The optional mesh-shader fixture reported unsupported. All three depth-bounds tests passed in five fresh processes, with no depth-bounds skip. Both GPU fixtures reached their assertions and the original E_INVALIDARG did not recur.
  • With WARP forcing unset, pipeline::host::tests passed 11/11 with no skip messages.

Built with Rust 1.98.1, --profile diag --features diagnostics, local test-executable loader exports for Agility SDK 1.614.1, and synthetic fixtures only. This resolves my Windows 10 review finding.

AI-assisted.

MoonEyes added a commit to MoonEyes/leonida that referenced this pull request Nov 30, 2026
…rojectLeonida#2663

It is the only failure of the job, and it hides the crates after leonida-gpu and the replay test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aznohonza and others added 7 commits November 30, 2026 22:25
The comment still claimed an absent invocation in a partial non-fragment
quad gave an undefined value natively, while the non-fragment branch
reads every lane's activity with OpGroupNonUniformBallot. Wording only.

DOC-QUAD-ANY-PARTIAL.
…ST-RED-GREEN-COMPILER-CRASH)

A verification's only trial said "red does not build" while rustc had crashed (0xC0000005). A side whose
cargo output shows rustc or a build script ending with a Windows crash status, an internal compiler
error or a failed allocation now builds again once, and the report says so; a second crash gives the
verdict `compiler crashed` (exit 1), not `red does not build`. A test binary that crashes stays a test
result.
…mes (DOCS-RUNNING-LINUX-WINE-NVIDIA)

The page has Linux RADV, a Proton NVIDIA report and Windows sections, but no Linux + Wine + NVIDIA
profile. This one is a desktop RTX 3060 12 GB with Wine 11.22: it draws the first-run UI at 30 frames/s,
loads the story and draws the opening sequence's prison yard, city street and carnival scenes at 1-3
frames per 10-16 s, with host memory at 19-20 GB and up to 23.6 GB.

The section carries the build, shader pack, environment (including LEONIDA_STRAY_RO_HEAL=1, without which
a run ends at 47 s here) and what to expect, and names the two ends of the carnival scene as known
problems: a console value wait held for 101 minutes with the list values on, and a device loss with
LEONIDA_LIST_VALUES=0. Every value comes from the RUN blocks posted on ProjectLeonida#2464, which the section links;
no game data is added.

AI-assisted.
…he profile

- separate the 22.2 GB run that drew the city night street from the
  22.3 GB default-arena run, as the reports do;
- say the 1.7 GB journal was warm from three earlier runs, not filled by
  these runs;
- replace the unsourced scene names and the submissions-per-frame count
  with the reports' words, and give the 47 s STRAY_RO_HEAL observation
  its provenance;
- say that 724 is the maintainers' count and 723 is this pack's, that
  the skip list takes name fragments and is the ray-tracing programs;
- give the full run_game_wine.sh invocation and name the local trace-off
  change;
- index the profile in docs/README.md and point linux_proton.md at it.

AI-assisted.
The runs report the cgroup's peak, as the RUN blocks do; the VRAM
spilled to host memory is a different figure.

AI-assisted.
aslan2142 pushed a commit that referenced this pull request Dec 1, 2026
…TEST) (#2648)

* d3d12: min/max samplers honour filterMinmaxImageComponentMapping (D3D-994)

Without VkPhysicalDeviceSamplerFilterMinmaxProperties::
filterMinmaxImageComponentMapping, a minimum/maximum reduction defines
only the R component of a sample; G, B and A are undefined. The AMD
Windows driver on Polaris (RX 580) reports singleComponentFormats = 1
and imageComponentMapping = 0, and returns exactly that: R is correct,
G/B/A vary.

The layer now records the property in VulkanDeviceInfo and logs once
when it creates a reduction sampler on a device without it. The
descriptor test compares R only on such devices, and all four channels
where the device maps every component.

* d3d12: say when the driver's pipeline cache stops keeping new pipelines (RT-PIPELINE-CACHE-GROWTH-STALL)

A driver can stop adding to a large VkPipelineCache with no error. On NVIDIA 610.88 a 1.23 GB or 1.35 GB cache
came back the same size to the byte after a 2 s compile, so the next run compiles the same pipelines again and
nothing says why. The runtime now takes the cache's size at creation and at each session save, counts the title's
pipeline builds that took at least 200 ms, and logs once when 16 or more compiled while the cache grew less than
64 KiB. pipeline_cache_store_test covers the decision; docs/d3d12_vulkan.md records the measurements.

* docs: rewrap the pipeline cache growth paragraph (RT-PIPELINE-CACHE-GROWTH-STALL)

* d3d12_xs: say so when LEONIDA_D3D12=vulkan is asked of a runtime built without the Vulkan device (RT-VULKAN-REQUESTED-NOT-BUILT)

A gta6rt configured without Vulkan headers is built without
LEONIDA_VULKAN_DEVICE. D3D12XboxCreateDevice then ignored
LEONIDA_D3D12=vulkan without a word and wrapped the host's D3D12 device,
so a run stopped somewhere else and read like a boot result.

It now prints one [rt] d3d12_xs line naming the cause and the configure
options. Which device is created does not change. The reading of the
variable moves to shims/d3d12_backend.h, used by both builds; new CPU-only
test d3d12_backend, registered outside the Vulkan-headers block.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* d3d12: frame-time percentiles and what stalls frames, in the log and on the panel (D3D12-FRAME-TIME-STATS)

The frame-rate line gives a mean over the last second or more, and the F3
panel only the longest frame, so a run with smooth frames and a few
multi-second stalls looks like a slow one, and the stalls do not show.

host/frametime.rs keeps every presented frame's time. With the frame-rate
line, every five seconds, it logs one line: the median, 95th and 99th
percentiles (nearest rank), the longest frame, how many took over 100 ms
and over a second, and beside them host pipelines queued and made a second,
waits for new memory to be resident per frame, and the commit the system has
left. The panel shows the last line's numbers and the pipeline wait per
frame. Pure parts are unit-tested.

* d3d12: frame-time panel lines fit long stalls, the first line counts from the first present (review)

- Panel: frame times of 10 s or more (the launcher's pipeline budget) made
  the percentile line longer than 40 columns, and the panel cut it without
  a sign ("MAX 10000" showed as "MAX 100"). Times from 10 s up are shown in
  whole seconds ("10S"); the test covers 10 s, 100 s and 10 min.
- The first line's pipelines made a second and residency waits counted
  everything since the process started: the meter now starts from the
  totals at the first present.
- "queued" was queued or being made: the log says so, the panel says
  PIPES PENDING.
- The nearest-rank test covers 95% of 100 frames, where a float ceil would
  take the 96th.

* d3d12: a pipeline a frame waits for goes before those asked for earlier (D3D12-PIPELINE-WAIT-QUEUE)

A draw whose host pipeline is not made queues it at the back of the
requested list, and its frame then waits for it up to the frame's budget.
On the first visit to the world about 1,700 pipelines were queued at once,
562 of them took over a second each, and with the launcher's 10 s budget
every frame waited the whole budget for a pipeline a thousand others stood
before, then dropped its draws anyway: 0.35 fps for three and a half
minutes (RTX 3080, 8 workers).

A new queue state, AWAITED, sits between REQUESTED and MAKING. When a frame
starts waiting for a pipeline that is still in the queue, the entry moves
to the front of its list (passes over the screen in theirs), after those
awaited before it, so the next free worker makes it. It moves at most once,
is never claimed twice, and WAITING does not count it again; makes already
running are not interrupted. LEONIDA_PIPELINE_AWAIT_FIRST=0 keeps the order
asked.

Frames on a cold cache still wait up to the frame's budget: the waits now
succeed, so a frame may spend its budget on several pipelines it then draws
instead of one it drops. The budget setting bounds that, as before.

* ci: build and test the d3d12 Rust runtime on Windows (CI-D3D12-CARGO-TEST)

No workflow ran the d3d12/ workspace tests. This adds one on windows-latest for changes under d3d12/: build, then cargo test as the gate (no GPU, no game data). The xtask asset-policy test and clippy -D warnings both fail on main today (two sources over the 640 KiB limit; about 25 clippy findings), so they run as reports until fixed. cargo fmt is left out: it would reformat most of the tree under the open d3d12 pull requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* d3d12: a frame's pipeline wait counts the queue lock its promotion waits for (review)

wait() started its timer after promote() took the queue's lock, so time
spent waiting for that lock came on top of the frame's budget: in a
synthetic contention test (queue held 240 ms, 80 ms budget) a frame waited
320 ms. The timer now starts before the promotion, so the lock delay is part
of the budget (240 ms in the same test, the lock holder's time itself).
Reported with the test by merzleckeier.

* ci: d3d12 workflow follows TheGeogeo's review

mods/** in the paths (leonida-lua's tests read mods/example_lua), a build with the features people run, the replay
test of leonida-gpu (diagnostics), a cache of Cargo's downloads, a limit on the test step. d3d12/.github/workflows/ci.yml
is removed: GitHub runs workflows only from the repository's root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: skip the depth bounds test on the runner's software adapter until #2663

It is the only failure of the job, and it hides the crates after leonida-gpu and the replay test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Zilumz1 <221744236+Zilumz1@users.noreply.github.com>
Co-authored-by: Galaxy <jojomalrbx@gmail.com>
Co-authored-by: quartz-heron-58 <245169279+quartz-heron-58@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: OreoFR <29048345+OreoFR@users.noreply.github.com>
Co-authored-by: Galaxy <23423870+thegalaxydev@users.noreply.github.com>
Co-authored-by: TheGeogeo <57634077+TheGeogeo@users.noreply.github.com>
Co-authored-by: MoonEyes <14891700+MoonEyes@users.noreply.github.com>
…nux-wine-nvidia

docs: a Linux + Wine + NVIDIA profile that draws world frames (DOCS-RUNNING-LINUX-WINE-NVIDIA)
…artial

rdna2spirv: quad_any's docstring says partial quads are exact (DOC-QUAD-ANY-PARTIAL)
…compiler-crash

scripts: red_green.py tells a crashed compiler from a build error (TEST-RED-GREEN-COMPILER-CRASH)
…radv

gpu-test-results: Radeon Pro Vega II (gfx906, Linux RADV) — GPU-VEGA20-RADV

@KelboLive KelboLive left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the core claim end to end, which is what matters for a WARP-only flake: with effective_depth_bounds_desc short-circuited, the WARP fixture reproduces the reported failure exactly (worker 0 iter 0 bounds [0.6, 1] → left: 255, right: 0, 4 workers) while the hardware fixture on the RTX 4070 Ti SUPER still passes; restored, all three tests pass. So the promotion is the fix, not a masking change.

The shape is right: DepthBoundsTestEnable && !DepthEnable && DSVFormat != UNKNOWN → DepthEnable = true, DepthWriteMask = ZERO, DepthFunc = ALWAYS preserves the title's depth result and its writes, and it reaches both paths — depth1() → graphics_depth_bounds_pipeline, and mesh_pipeline(..., g.depth1(), ...). screen_pass only changes the scheduling flag, so no alternate pipeline path appears.

Two details worth keeping exactly as they are:

  • The depth-bounds-always suffix in describe() is necessary, not cosmetic: raw DepthEnable=false is unchanged by the normalization, so without it a pre-fix library entry would be loaded instead of rebuilt.
  • The per-test RTV/DSV heaps and pre-cut clears fix a genuine ring/ordering race rather than papering over it — that is the part that makes the parallel WARP test trustworthy.

State here: leonida-gpu --lib 552/0/47, the merged tree 633/0/59 serially, check_no_game_data and diff --check clean, and merge-tree against current main is clean. One caveat only: the branch is 896 commits behind, so rebase before merging even though the merge is conflict-free. One of my parallel runs of the merged suite aborted without a summary and both the serial and a repeat parallel run were green — worth knowing, not blocking.

@KelboLive

Copy link
Copy Markdown

One extra data point from a second WARP run here (10.0.26100.9711), worth a sentence in the body:

With the guard reverted, the new fixture fails exactly as expected (255 vs 0, read-only DSV included), but the original depth_bounds_pipeline_loads_and_filters_draws still passes on this WARP even with LEONIDA_D3D12_WARP=1 (depth_enable=false bounds=true dsv=40). So the promotion is proven load-bearing by the new fixture, while the old fixture's CI failure may have been the shared RTV/DSV ring race rather than the depth state — the two fixes in this PR are independent, and saying which one the old failure was would make the history clear.

No objection to the change itself: both paths are covered, the cache suffix is necessary, and the SM 6.0 + feature probe is the right answer to the Windows 10 WARP report.

@merzleckeier

Copy link
Copy Markdown
Contributor

A physical-GPU follow-up to the WARP results: I tested ee9fb09 merged into cd0c52f, Win64 MSVC target with diagnostics, under Wine 11.22 and VKD3D-Proton 3.1.0. Both new Rust tests passed on Radeon Raphael (RADV 26.3.1) and RTX 4070 SUPER (620.73.04). A local print after the parallel test’s host branch confirmed all four workers completed their eight draw/readback cases per GPU, including the read-only DSV and exact-bound case. Wine skipped the WARP branch.

On both GPUs, the unmodified older depth_bounds_pipeline_loads_and_filters_draws failed on main and on the PR at the pipeline-library hit assertion. For a second diagnostic run I recorded that counter instead of asserting it, leaving the draw and readback assertions unchanged. The counter stayed 0 -> 0 on all four runs. Both main and PR then passed the original inside/outside depth readbacks on both GPUs. That baseline cache result is independent of the PR’s added depth checks in this setup. MEASURED with synthetic draw fixtures. AI-assisted (Codex).

@zmasi

zmasi commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the end-to-end verification and the 10.0.26100.9711 WARP data point @KelboLive!

  1. Added an explicit note in the PR description documenting that the two fixes here are independent (effective_depth_bounds_desc is load-bearing for the parallel WARP writable/read-only DSV fixture, whereas depth_bounds_pipeline_loads_and_filters_draws passing on 10.0.26100.9711 with the promotion reverted shows its intermittent CI failure could also come from the shared RTV_RING / clear-cut race).
  2. Merged current main (cd0c52fcf4) so the branch is up to date (0abaae0d7), and dropped -- --skip depth_bounds_pipeline_loads_and_filters_draws from .github/workflows/d3d12.yml (per the comment left in ci: build and test the d3d12 Rust runtime on Windows (CI-D3D12-CARGO-TEST) #2648) so d3d12 (windows-latest) runs both depth-bounds fixtures directly in CI on this PR.

AI-assisted: Gemini 4 Carbon. Tested on Windows 11, RTX 3090 (driver 610.88) + LEONIDA_D3D12_WARP=1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants