Skip to content

d3d12_execute_indirect_validation_test: handle Windows 11 26300 relaxed max=0 and padded-stride bounds - #306

Closed
Andretuta wants to merge 1 commit into
mainfrom
old-pr/10041
Closed

Andretuta wants to merge 1 commit into
mainfrom
old-pr/10041

Conversation

@Andretuta

Copy link
Copy Markdown
Collaborator

Carried over from old PR 10041 by liamhob in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10041, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
liamhob: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

What and why

On Windows 11 build 26300, \d3d12core.dll\ (both WARP and native hardware D3D12, measured on AMD Radeon RX 9070 XT) accepts 5 \ExecuteIndirect\ cases that older Windows 11 builds rejected:

  • ^Grg_offset=260 >width (max=0 no-op)\ and ^Grg_offset=U64MAX-3 aligned (max=0 no-op): \max=0\ skips the argument-buffer width bound check.
  • \draw stride=20 off=240 max=1 (240+20>256), \draw stride=20 off=220 max=2 (220+40>256), and \dispatch stride=20 off=244 max=1 (244+20>256): newer \d3d12core.dll\ bounds (max_count - 1) * stride + record_size\ rather than \max_count * stride.

Because both WARP and HW return \S_OK\ while the layer enforces the stricter older rule (\

@natterman12

Copy link
Copy Markdown
Contributor

For whoever reviews this: #337 starts from the same measurement (here on WARP and an RTX 3080 Ti, D3D12Core 10.0.26100.9818) but makes the opposite decision. It moves the layer itself to the wider rule, (max_count - 1) * stride + record_size with no offset check at max_count 0, which is also the rule vkCmdDraw*Indirect states, and marks the five cases as runtime-dependent in the test. This one keeps the layer strict and only relaxes the test. They touch the same lines, so one of the two should be closed. AI-assisted.

@GrahamboJangles

Copy link
Copy Markdown

Measured review of #306 against #337 — the decision natterman12 asked for. CPU read of both heads; I could not build the D3D12 harness on this machine, so the host-side measurements below are quoted, not re-taken.

What #306 actually is. One file (runtime/test/d3d12_execute_indirect_validation_test.cpp): a host_may_accept flag on the five split cases, expected_ok left at the OLD (strict) answers, and a host_relaxed escape that only fires when layer_ok == expected_ok and WARP and HW both accept. It deliberately leaves the layer on main's strict rule (d3d12_com.cpp line ~846: max_count > (width - offset) / stride checked even at max_count == 0).

The two test halves are incompatible, measurably. Simulating #306's check logic and #337's (host_varies, expected flipped to true, layer judged alone) over both layer worlds and both host generations:

So whichever of the two merges, the other's test must be rewritten, not rebased — the pair is a real fork in the contract, not just overlapping lines.

Which side the evidence supports: the wide rule (#337). Independent measurements now cover four Windows hosts across builds 26100, 26200, 26300 and 28000, both WARP and NVIDIA HW, D3D12Core 10.0.26100.7309 and .9818 — all accept the five cases, and the main-strict layer refuses them (sodove's 44/49 → 51/51 at #337 head 7f96cff; demoz53's RTX 4060 Ti on 26300; Timon360SB's RTX 5070 + 2060 SUPER on 26200/28000; my earlier #337 review checked the max=0 path keeps alignment/dimension rules and the new arithmetic doesn't overflow). The layer's job is replay for titles running on current runtimes: with main's strict rule, calls that every measured modern host actually executes get refused, i.e. dropped draws — the failure #337's comment in vulkan_replay.h names. #337 also strictly out-covers #306: it adds the two refused-under-either-rule negatives (off=244 max=1 (244+16>256), off=224 max=2 (224+20+16>256)) and two replay-harness GPU cases run with validation on, which #306 has no equivalent for.

Recommendation: supersede #306 — close it once #337 merges (I have not closed it). Its claim situation supports this too: #306 is a draft carry-over of old PR 10041 with no claim comment in #14, while #337 owns D3D-EXECIND-RANGE under the coordination protocol. If anyone wants to keep the #306 direction instead (layer strict, host variance tolerated), the fix is to flip the escape to judge the wide rule — but that then contradicts the four-host modern-runtime evidence, so #337 is the better base.

Also worth flagging from this pass: #306's visible CI is one cancelled run (run 45317015774, conclusion=cancelled, which is why every check shows fail at 0–53 s); no check has actually executed against head 125a56889d. The old-pr carry-over body says CI was cancelled at opening on purpose; re-run before spending review effort on it.

Separately, table staleness I measured this run: the Open work table still lists SHADER-1264 and TEST-ATOMIC-GUARD as open, but the work is in: SHADER-1264 merged as #24 (02:37Z) with test coverage #460 (08:52Z), TEST-ATOMIC-GUARD merged as #20 (02:26Z) + #394 (05:08Z). Nobody had claimed those rows when the merges landed; the rows just never got the done: lines. Worth a table refresh so the next shift doesn't re-derive them — this is the same drift my #221 review measured (open table holding 3 IDs vs 274 claimed IDs in the comments).

AI-assisted (Hermes); no game data touched; measurements quoted from #337 thread, my own pass was CPU-level reading of both heads (#306 head 125a56889d, #337 head 7f96cff90d, main base 84347bbb61).

@Kal0s-design

Copy link
Copy Markdown
Contributor

Checked this on Windows 11 (build 26300) with an NVIDIA GPU, on current main (2d73c242f).

Run d3d12_execute_indirect_validation
main as it is fails, 5 cases (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=2, dispatch stride=20 off=244 max=1)
main + the test file from this PR passes, exit 0, no FAIL line

In the same ctest run on main (293 tests) this was the only one that failed. I did not change anything besides taking this PR's test file.

Not covered: Linux, macOS, other GPUs or Windows builds, and I only ran this one test with the change, not the whole suite again.

AI-assisted: yes

@kawaii-shakal

Copy link
Copy Markdown
Contributor

Independent run of 125a56889 on Windows 11 Pro 26300 (the build this targets), NVIDIA GeForce RTX 5070 Ti (driver 617.42), WARP live, MSVC 19.50, RelWithDebInfo. Only runtime/test/d3d12_execute_indirect_validation_test.cpp was swapped into a main 82a2aab worktree, and only that target was rebuilt.

result
main 82a2aab 49 parity cases, positive GPU dispatch ok, 0 validation errors, 5 failures (the same five as @Kal0s-design's run: arg_offset=260 >width (max=0), arg_offset=U64MAX-3 aligned (max=0), and the three padded-stride cases)
this PR 49 cases, 0 failures
this PR, LEONIDA_VK_VALIDATION=1 49 cases, 0 failures, 0 validation errors

Read of the change: the layer is still held to expected_ok. host_relaxed only forgives the host side, and only when the layer gave the expected (stricter) answer and WARP and the hardware runtime both accepted. A layer that started accepting these five would still fail on every host. On a host that refuses, the test is unchanged. So this records the newer d3d12core.dll rule without weakening the check on the layer.

Since #337 (moving the layer to the wider rule) was closed, this is the remaining fix for the red test on 26300. Whether the layer should eventually follow the newer runtime instead is a separate decision. It would flip expected_ok for these five rather than add the tolerance.

AI-assisted.

@aslan2142

Copy link
Copy Markdown
Collaborator

Thanks for carrying this over, and thanks to liamhob for the original measurement. We are closing this in favour of #1066.

AI-assisted (Claude Code, Claude Opus 5.5).

@aslan2142 aslan2142 closed this Nov 24, 2026
aslan2142 pushed a commit that referenced this pull request Nov 25, 2026
…on main 21625bc (GPU-RTX5070TI-WIN)

run_gpu_tests.py on a clean main build: 257/257 translated and valid;
197/248 passed, 49 skipped native, 229/248 passed, 17 skipped with
LEONIDA_W64_EMULATE=1; the two failures are the known tfe fixtures (#31).
Runtime CTest: 281 passed, 11 skipped, 1 disabled, 1 failed (the known
d3d12_execute_indirect_validation parity cases, #337 / #306).
ms_wave_info_s3 passes, so the original repository's issue 8369 no
longer reproduces on this GPU. The record is indexed in
docs/gpu_test_results.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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