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

Closed
github-bot wants to merge 1 commit from gh-pr/306/head into gh-pr/306/base
Owner

@⁠Andretuta on GitHub · 2026-11-24 03:05 UTC · original
ubiquitarianism:old-pr/10041 → main · +15 −8 · 1 files · 1 commits · closed without merging

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 (\

**@⁠Andretuta** on GitHub · 2026-11-24 03:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/306) `ubiquitarianism:old-pr/10041` → `main` · +15 −8 · 1 files · 1 commits · closed without merging > 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 (\
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:52:44 +00:00
github-bot closed this pull request 2026-11-26 08:52:44 +00:00
Author
Owner

@⁠natterman12 on GitHub · 2026-11-24 03:21 UTC · original

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.

**@⁠natterman12** on GitHub · 2026-11-24 03:21 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/306#issuecomment-7121011962) 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.
Author
Owner

@⁠GrahamboJangles on GitHub · 2026-11-24 11:22 UTC · original

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:

  • #306 test, strict layer: PASS on new Windows (via host_relaxed) and PASS on old (via the strict comparison) — consistent with its "keep the layer strict" intent.
  • #306 test, wide layer (#337 merged first): FAIL on all five cases, on both old and new hosts — host_relaxed demands layer_ok == expected_ok (false), and the strict comparison then fails because the layer answers true. So #306 cannot be rebased onto #337's layer as-is; the escape hatch is wired to the wrong world.
  • #337 test, strict layer: FAIL; #337 test, wide layer: PASS. Its head is self-consistent (shim + replay + test all move together); #306's is self-consistent only with main's layer.

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 7f96cff9; 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).

**@⁠GrahamboJangles** on GitHub · 2026-11-24 11:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/306#issuecomment-7130014882) 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: - #306 test, strict layer: PASS on new Windows (via `host_relaxed`) and PASS on old (via the strict comparison) — consistent with its "keep the layer strict" intent. - #306 test, wide layer (#337 merged first): **FAIL on all five cases, on both old and new hosts** — `host_relaxed` demands `layer_ok == expected_ok` (false), and the strict comparison then fails because the layer answers true. So #306 cannot be rebased onto #337's layer as-is; the escape hatch is wired to the wrong world. - #337 test, strict layer: FAIL; #337 test, wide layer: PASS. Its head is self-consistent (shim + replay + test all move together); #306's is self-consistent only with main's layer. 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 7f96cff9; 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`).
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-24 13:36 UTC · original

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

**@⁠Kal0s-design** on GitHub · 2026-11-24 13:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/306#issuecomment-7133062256) 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
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-24 17:15 UTC · original

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 82a2aabcc worktree, and only that target was rebuilt.

result
main 82a2aabcc 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.

**@⁠kawaii-shakal** on GitHub · 2026-11-24 17:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/306#issuecomment-7138929240) 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` 82a2aabcc worktree, and only that target was rebuilt. | | result | |---|---| | `main` 82a2aabcc | 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.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 19:50 UTC · original

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

  • Both start from the same five rows in #504. #1066 moves the layer to the rule current runtimes use; this PR keeps the layer refusing calls that live WARP and the hardware run.
  • A refusal there fails Close() and drops the command list, so the layer is what needs fixing ("Fix, don't disable"). Relaxing the test would hide the gap.
  • The wider rule is Vulkan's own vkCmdDraw*Indirect bound, so replay never reads past the buffer.
  • The two test changes can't be stacked: with the wider layer, this test fails on all five rows.
  • The measurements quoted here and on #749 helped settle it.

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

**@⁠aslan2142** on GitHub · 2026-11-24 19:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/306#issuecomment-7142658010) Thanks for carrying this over, and thanks to liamhob for the original measurement. We are closing this in favour of #1066. - Both start from the same five rows in #504. #1066 moves the layer to the rule current runtimes use; this PR keeps the layer refusing calls that live WARP and the hardware run. - A refusal there fails `Close()` and drops the command list, so the layer is what needs fixing ("Fix, don't disable"). Relaxing the test would hide the gap. - The wider rule is Vulkan's own `vkCmdDraw*Indirect` bound, so replay never reads past the buffer. - The two test changes can't be stacked: with the wider layer, this test fails on all five rows. - The measurements quoted here and on #749 helped settle it. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.