Repository navigation
d3d12-gpu: keep depth stage active on WARP for bounds-only pipelines (D3D12-DEPTH-BOUNDS-TEST-FLAKE) - #2663
d3d12-gpu: keep depth stage active on WARP for bounds-only pipelines (D3D12-DEPTH-BOUNDS-TEST-FLAKE)#2663zmasi wants to merge 21 commits into
Conversation
- 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.
|
[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 On the same device and with the same DXC, the full fixture passed after lowering just those two shader profiles to Tested 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.
|
Good catch on Windows 10 22H2 WARP (
AI-assisted. |
|
Hosted WARP follow-up to the #2648 depth-bounds failure. I built
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.
|
Thanks for the hosted AI-assisted. |
|
Independent SM 6.0 follow-up on two hosted WARP versions. I tested
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. |
|
Retested the SM 6.0 update
Built with Rust 1.98.1, AI-assisted. |
…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>
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.
…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
left a comment
There was a problem hiding this comment.
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-alwayssuffix indescribe()is necessary, not cosmetic: rawDepthEnable=falseis 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.
|
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 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. |
|
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). |
…workflow AI-assisted: yes
|
Thanks for the end-to-end verification and the
AI-assisted: Gemini 4 Carbon. Tested on Windows 11, RTX 3090 (driver 610.88) + |
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, returning255instead of0— the sole failing test in #2648'sd3d12 (windows-latest)job and reported in #2570 (comment)):DepthBoundsTestEnableis used withoutDepthEnable(d3d12/crates/leonida-gpu/src/pipeline/host.rs):DepthBoundsTestEnableistruewithDepthEnable == falseandStencilEnable == false, Microsoft WARP (d3d10warp.dll, used on CPU-only hosts andwindows-latestCI runners) bypasses the depth-stencil stage on directDEPTH_STENCIL1PSOs and passes fragments (20/20deterministic failures even for impossible intervals such as[-2.0, -1.0]and[2.0, 3.0]).effective_depth_bounds_desc(applied inGraphicsState::depth1for both graphics and mesh pipelines and ingraphics_depth_bounds_pipeline) promotesDepthBoundsTestEnable && !DepthEnable && dsv_format != DXGI_FORMAT_UNKNOWNtoDepthEnable = true,DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ZERO,DepthFunc = D3D12_COMPARISON_FUNC_ALWAYS.D3D12_DSV_FLAG_READ_ONLY_DEPTHread-only DSVs under the D3D12 debug layer) while forcing WARP and early-Z-gated drivers to fetch the DSV and evaluate[MinDepthBounds, MaxDepthBounds]. WhenDSVFormat == DXGI_FORMAT_UNKNOWN,DepthEnablestaysfalse; whenDepthEnableis alreadytrue, the caller'sDepthFuncandDepthWriteMaskare preserved unchanged.GraphicsState::screen_passalso excludesself.depth_bounds, andGraphicsState::describedistinguishes normalized bounds-only state (depth-bounds-always) so pre-existing pipeline-library caches do not collide onStorePipeline(0changes ind3d12/crates/leonida-gpu/src/host.rs).d3d12/crates/leonida-gpu/src/pipeline/host.rs):depth_bounds_pipeline_loads_and_filters_drawsinstead of sharingHost::rtv/Host::dsv's lock-freeRTV_RINGacross ~550+ concurrent tests, records the target clears onfirst_listahead of the command-list cut, and compiles synthetic test shaders asvs_6_0/ps_6_0behinddevice_supports_depth_bounds_sm60so SM 6.2 WARP (Windows 10 22H2) runs both fixtures cleanly.depth_bounds_without_depth_test_enables_noop_always_depth_only_with_dsvanddepth_bounds_without_depth_test_filters_on_warp_and_in_parallel, which explicitly enumerateswarp_adapter()alongsidehost()and runs 4-thread concurrent writable and read-only DSV depth-bounds draws on everycargo test -p leonida-gpu --librun.effective_depth_bounds_descis proven deterministically load-bearing by the new parallel WARP fixture (which fails255vs0on writable and read-only DSVs whenever the promotion is reverted), whereas on WARP10.0.26100.9711(@KelboLive) the originaldepth_bounds_pipeline_loads_and_filters_drawsstill passes with the promotion reverted while other WARP builds reproduce255vs0underLEONIDA_D3D12_WARP=1— meaning the original CI failure could also stem from the sharedRTV_RING/ post-cut clear race fixed here rather than depth state alone.depth_bounds_pipeline_loads_and_filters_drawsin CI (.github/workflows/d3d12.yml):-- --skip depth_bounds_pipeline_loads_and_filters_drawsfrom.github/workflows/d3d12.yml(per the comment left in ci: build and test the d3d12 Rust runtime on Windows (CI-D3D12-CARGO-TEST) #2648 for d3d12-gpu: keep depth stage active on WARP for bounds-only pipelines (D3D12-DEPTH-BOUNDS-TEST-FLAKE) #2663) sod3d12 (windows-latest)runs both depth-bounds fixtures directly on the hosted Windows runner.Tested
LEONIDA_D3D12_WARP=1and hardware GPUcargo test -p leonida-gpu --lib pipeline::host::tests -- --test-threads=4->11/11passed (0D3D12 debug-layer errors on initial diagnostic runs +25/25parallel WARP stress runs).10.0.20348.5756) and Server 2025 (10.0.26100.33648) WARP runners (@merzleckeier), Windows 10 22H2 SM 6.2 WARP10.0.19041.7811+ RTX 5070 (@lixonik), and Windows 11 WARP10.0.26100.9711+ RTX 4070 Ti SUPER (@KelboLive).python -I scripts/check_no_game_data.py->0issues.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
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)