mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:30:53 +01:00
[GH-ISSUE #504] d3d12_execute_indirect_validation: 5 rows where the layer rejects and live WARP and hardware accept (over-strict, not permissive) #10
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @dcastell1 on GitHub (Nov 24, 2026).
Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/504
On
main@8f481cf16,ctest -j 8on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), MSVC 14.44.35207 / RelWithDebInfo: 301 of 303 pass. One of the two that fail is real and repeatable here:d3d12_execute_indirect_validation: 49 parity cases, 44 agree, 5 disagree with both live WARP and live hardware D3D12 on the same machine — the layer'sClose()accepts a call the host rejects:layer=0isS_OK;warp=1andhw=1areE_INVALIDARGmeasured on this GPU, which is the same model the table'sexpected_okcolumn was calibrated on. The rest of the table (alignment, count-buffer width,arg_offset=U64MAXunaligned, the OOBmax=2count-buffer rows) matches exactly, and the positive GPU dispatch runs with 0 validation errors.Two shapes, both argument-buffer bounds:
MaxCommandCount == 0:runtime/src/command_list.h:876returns!closed_before any range check ("the PC runtime takes MaxCommandCount 0 as a no-op"), soargument_offset260 in a 256-byte buffer andU64MAX-3are accepted. The host still validates the offset when no command will run.240 + 20,220 + 2*20,244 + 20in 256 bytes. The check inruntime/shims/d3d12_com.cpp:847-848looks right on paper (offset > width || max > (width - offset) / stride), so either this path is not the one the test drives or the width it reads is not the resource's.Repro, no game files:
The other failure in the same run,
d3d12_present, is not a layer defect here: this box has no active monitor right now, so the test'sGetPixelon the screen DC reads0,0,0at the window centre while its four captured presented images hold the right colours (255,0,0and51,153,229, one colour per frame). That check should probably be skipped when no display is attached, but the presented images prove the swapchain path.@sodove commented on GitHub (Nov 24, 2026):
I reproduced the same five rows on current main
c023a365with live WARP and RTX 5070 Ti. The numeric columns come from SUCCEEDED(hr), so layer=0 means the layer rejected the call, while warp=1 and hw=1 mean the host accepted it. The full table on this machine showed 0x80070057 in the layer column and S_OK in both host columns for all five. The layer and both hosts agreed on all 51 cases with #337 applied, including the two new cases that overrun the argument buffer. Windows test results@dcastell1 commented on GitHub (Nov 24, 2026):
Correction, and thanks @sodove — I read the two numeric columns backwards in the first post.
The
layercolumn is the layer's ownClose()HRESULT, so in these five rows it is the 0x80070057, and it is WARP and the hardware that returnS_OK. The layer is stricter than the host here, not more permissive:Why the host accepts in each shape, as the other rows of the same table show:
MaxCommandCount == 0: nothing runs, so the host never looks at the argument buffer (withmax=1the same offset is refused by both hosts). The layer still applies itsoffset > widthrule, which is where the two rows come from.(max-1)*stride + record_size, notmax*stride— a 16-byteDRAW_ARGUMENTSat offset 240 in a 256-byte buffer fits (240+16 = 256), and the 20-byte stride only matters for a second command. The layer'smax > (width - offset) / striderejects the three stride rows for that reason.So the actionable part is a false rejection, and it matches what you report with #337 making all 51 rows agree. Everything else in the original post (the other 44 rows agreeing, the positive GPU dispatch,
d3d12_presentbeing the headless environment rather than the layer) stands.@quartz-heron-58 commented on GitHub (Nov 24, 2026):
Same five rows on main
d42773d0with live WARP and an NVIDIA GeForce RTX 4080 (driver 621.24), Windows 11 Home build 26300, MSVC 14.44 / RelWithDebInfo.ctest -j 4: 302 of 303 pass, andd3d12_execute_indirect_validationis the one that fails (49 parity cases, 5 failures, positive GPU dispatch ok, 0 validation errors).The table agrees with the corrected reading above: the layer returns 0x80070057 and both hosts return S_OK for
arg_offset=260 >width (max=0 no-op),arg_offset=U64MAX-3 aligned (max=0 no-op),draw stride=20 off=240 max=1,draw stride=20 off=220 max=2anddispatch stride=20 off=244 max=1. Themax=1variants of the first two are refused by the layer and by both hosts here as well.Not tested with #337 applied. AI-assisted (Claude Code ran the tests and wrote this comment).