Repository navigation
Conversation
|
One clarification I want in the record, because I nearly wrote the wrong justification: this does not change what renders on a software adapter.
So before this change, on WARP, the runtime emitted What changes is that If a title depended on depth bounds for correctness, it would render wrong on WARP before and after - that is a software adapter's limitation, not something this can fix. What this does is stop the answer lying to anything that asks it next. AI-assisted: yes - DeepSeek v4.1 (flash), which checked its own claim against the callers before making it. Written with an AI assistant. |
|
And what the second production caller does now, since that is the one with a message in it: let depth_bounds = if g.depth_bounds {
if host.depth_bounds() {
true
} else {
static SEEN: AtomicU64 = ...;
if SEEN.fetch_add(1, Relaxed) < 4 {
tracing::warn!("a pipeline enables the depth bounds test, which the host GPU does not support");
}
false
}
} else { false };On a software adapter this branch now fires: the warning appears up to four times and the pipeline does not claim the state. That is the intended behaviour finally happening - the message has always said "the host GPU does not support", and until now a host that could not run the test answered that it could, so the warning never appeared on the one class of adapter it is about. So the blast radius of the change, both places: Three call sites, one answer, and the two that were silent were the ones that had something to say. AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
|
done: green on every check. And what it is worth, measured before the pipeline agreed: the test that failed on a card-less runner now skips there and still runs on the 4090. Where this came from, so it is on the record: #2816's job ran for the first time and failed on this test in five minutes, on a machine with a GPU where it passes. A pull request that is not merged found a red that The first is #2815 (the asset policy). With both merged, and #2652 (the AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
KelboLive
left a comment
There was a problem hiding this comment.
Verified both arms on this machine: with LEONIDA_D3D12_WARP=1 the test skips and passes on the head; on the RTX 4070 Ti SUPER it runs and passes; deleting the early return makes the WARP run fail exactly as reported (left: 255, right: 0, pipeline/host.rs:1793).
The rule is the right level: adapter_of matches the adapter by the device's LUID (indirect.rs:328-336), so the software flag cannot be applied to a hardware adapter, and it covers software adapters beyond WARP (Basic Render Driver). Vendor/device id would miss those; trusting D3D12_OPTIONS2 is the thing that is wrong on WARP. Worth saying in the body that a hardware driver which reports the feature and ignores it is still trusted — only a behavioural probe would catch that, and it is not worth the cost for a CI-only failure.
One real cost to fix before merge: the software check sits outside the OnceLock (host.rs:5772-5777), so every depth_bounds() call does CreateDXGIFactory2 + EnumAdapterByLuid + GetDesc1. I measured ~134 µs per call (~138 µs per warm depth_bounds), and draw::depth_bounds is called on every OMSetDepthBounds and every list replay (draw.rs:2780-2781). Before this PR it was a OnceLock load. Move the check inside BOUNDS.get_or_init, or cache the software flag in its own OnceLock — host() is a process singleton (host.rs:1208-1217), so once per process is safe and matches the existing global cache. On WARP it is never cached at all today, because the early return skips the OnceLock.
Minor: add a direct test of the rule on a software device — right now only the GPU test's skip catches a regression, and only in the shape where WARP is the device.
|
done: it merges onto today's
So on the merged tree the guard does what the branch claims: a runner without a card skips instead of failing, and a machine with one still exercises the depth bounds path. Why this matters to the job that found it: #2816's first real run failed on exactly this test ( The two together are what turns #2816 green: one for the WARP red, one for the policy red, and neither needs the other's file. AI-assisted: yes - DeepSeek v4.1 (flash), both arms on the merged tree. Written with an AI assistant. |
|
Pushed to your branch by MoonEyes (maintainer, the branch allows it), on top of your head, nothing rewritten. Say so if you would rather have it another way, and I take it out. The earlier verdicts are for the head before this one. AI-assisted (Claude Code). |
fc96e20 to
b60a729
Compare
|
Red on It passes on a real card. Running every So the runner and this card disagree in opposite directions on the descriptor host, on two different tests, which points at the WARP path rather than at either PR. #2923 is the fix proposed for this class: the workspace tests share one WARP device across every core, and this crate flakes about one run in eight that way. Written with an AI assistant. |
|
The current head resolves the adapter once across repeated depth-bounds queries. I tested
The fixture ORs The stock AI-assisted local testing, independently checked against the raw logs. |
…ver it answers D3D12_OPTIONS2.DepthBoundsTestSupported is true on WARP, and OMSetDepthBounds is then accepted with every fragment passing: the same frame reads back 255 where a card culls and reads 0. The feature query is right about the API surface and wrong about the driver. So depth_bounds() answers no for an adapter with DXGI_ADAPTER_FLAG_SOFTWARE. The test that guards on it then skips on a CI runner with no card, instead of failing there and passing on a GPU, and still runs where there is one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b60a729 to
7adc427
Compare
|
The red d3d12 (windows-latest) was not this change: it was crash::tests::memory_at_names_what, in crates/leonida-loader, which this branch does not touch.
I could not make it fail here: six runs of cargo test -p leonida-loader --lib crash::tests on this machine, in parallel like CI, 19 passed, 0 failed, six times out of six. It needs a page to be unmapped and read back as unmapped, and a parallel test taking that address between the two is the shape of it. The branch is rebased onto main 913b88b (which also re-runs the jobs - gh run rerun needs admin rights I do not have), so this PR is current and its CI is fresh. If it goes red on the same test again, that test is worth fixing on its own: it is in the same class as #2923 (the crate's tests on one thread for the same reason) and it will keep colouring unrelated pull requests. AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
|
Verified 7adc427 on Windows with the diagnostics build, using fresh processes for hardware and WARP. On RTX 5070 / 616.92, depth_bounds_pipeline_loads_and_filters_draws passed. A second hardware run with a temporary print after the final assertion confirmed both readbacks executed: depth 0.5 produced 0 outside [0.6, 1.0] and 255 inside [0.4, 0.6]. With LEONIDA_D3D12_WARP=1 the unmodified test explicitly printed “no host depth bounds support; skipped”. Both invocations show one passed in the Rust summary, but only the hardware run verified pixels. Codex-assisted. |
A software adapter answers that it supports the depth bounds test and then does not gate the draw, so
depth_bounds()now says no for one. Eleven lines, and the test that guards on it skips where there is no card instead of failing there.How this was found: #2816's job ran for the first time on
windows-latestand failed in five minutes, on a test that passes on a machine with a GPU:And it reproduces here on the software adapter, which is what a runner without a card gets:
The query, and why it is not enough (
host.rs,depth_bounds):D3D12_OPTIONS2.DepthBoundsTestSupportedis true on WARP.OMSetDepthBoundsis then accepted and every fragment passes - the draw the test expects to be culled is not - so the feature query is right about the API surface and wrong about what the driver does with it. That is a software rasterizer's prerogative and not something to fix by trusting the query harder.The change:
adapter_ofwas already there (indirect.rs, the helperamd()and the NVIDIA check use) and becomespub(crate); the flag check is the onewarp_adapter()and three other call sites already use.Both arms, measured:
What this does not do: it does not make the rest of the GPU tests safe on a runner without a card. This one had a guard that happened to ask the wrong question; others may not have a guard at all, and #2816's job will find them one at a time. It does mean the depth bounds test neither hides on a real GPU nor lies on a software one.
AI-assisted: yes - DeepSeek v4.1 (flash), which reproduced it on WARP before changing anything.
Written with an AI assistant.