Skip to content

d3d12: RSSetScissorRects with more than 16 rectangles keeps the first 16; d3d12_close_parity passes again (D3D-SCISSOR-COUNT-PARITY) - #1286

Merged
aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
aslan2142:d3d12-scissor-count-parity
Nov 24, 2026
Merged

aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
aslan2142:d3d12-scissor-count-parity

Conversation

@aslan2142

Copy link
Copy Markdown
Collaborator

Claimed in the coordination issue as: D3D-SCISSOR-COUNT-PARITY (#14 (comment))

What and why

d3d12_close_parity has failed on main since #510 was merged (found by QemmHD in #510 (comment)):

FAIL RSSetScissorRects(17): layer Close 0x80070057, WARP succeeds
  • d3d12/vulkan: implement multi-viewport and multi-scissor rendering (D3D-MULTI-VIEWPORT) #510 made RSSetScissorRects with more than 16 rectangles an error (check(false)), so the list's Close returns E_INVALIDARG.
  • WARP closes such a list, and the parity row at runtime/test/d3d12_close_parity_test.cpp:362 expects the layer to match it.
  • This change keeps the call valid: the rectangles past the 16 a pipeline can have are dropped, with a one-time stub notice. Counts from 1 to 16 behave as before.
  • RSSetViewports(17) is unchanged; the parity test already lists it as a known stricter case.

I merged #510, so this is my regression to fix. One file: runtime/shims/d3d12_com.cpp.

Tested

The Windows runtime was cross-built on Linux with clang-cl / lld-link 23.1.5 and the xwin MSVC CRT and Windows SDK 10.0.26100, and the full ctest suite was run under Wine 11.22, headless, on two devices. No game files.

Test main this PR, llvmpipe this PR, RDNA2 iGPU
d3d12_close_parity 1 failure, RSSetScissorRects(17) passes passes
d3d12_multi_viewport (from #510) passes passes passes
  • Against the full-suite results of main under the same setup, no test changes from pass to fail on either device.
  • This is clang-cl under Wine, not MSVC on Windows, and under Wine the parity test compares against its recorded WARP column. A run on real Windows would be welcome.

GPUs tested: Mesa llvmpipe (LLVM 23.1.5) and AMD Ryzen 9 7950X3D integrated graphics (RDNA2, RADV, Mesa 26.3.1), Linux, through Wine 11.22

AI-assisted: yes (Claude Code, Claude Fable 5.2)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator rule.)

… 16 (D3D-SCISSOR-COUNT-PARITY)

The multi-viewport change made a call with more than 16 rectangles an error, so the list's Close
returned E_INVALIDARG. WARP closes such a list, and d3d12_close_parity has that row
("RSSetScissorRects(17)", match), so the test has failed on main since that merge. The call is no
longer an error: the rectangles past the 16 a pipeline can have are dropped, with a one-time notice.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@quartz-heron-58

Copy link
Copy Markdown
Contributor

Independent Windows run of 4ff9a77: Windows 11 build 26300, NVIDIA GeForce RTX 4080 (621.24), MSVC 14.44 RelWithDebInfo, built with scripts\build_runtime.ps1.

  • d3d12_close_parity: passes. 113 cases, 82 match WARP, 16 known layer-stricter, 15 known layer-looser, 0 failures. The RSSetScissorRects(17) row reads 0x00000000 | 0x00000000 | match, and the layer prints the one-time note that the first 16 are used.
  • On main 6261ca9 (measured in another tree, merged into the vulkan: print the driver's fault report when the device is lost (RT-DEVICE-FAULT-INFO) #1028 branch) the same test fails with RSSetScissorRects(17): layer Close 0x80070057, WARP succeeds, 81 matching.
  • d3d12_multi_viewport: all 4 cases, 64/64 pixels exact against host D3D12.
  • ctest -j 6, whole suite: 314 of 314 pass.

One run of each. No game files. Not run: other GPUs, validation layers.

AI-assisted: yes (Claude Code)

@aslan2142
aslan2142 merged commit 51757ec into ProjectLeonida:main Nov 24, 2026
5 checks passed
@aslan2142
aslan2142 deleted the d3d12-scissor-count-parity branch November 24, 2026 21:25
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** ARENA-NEGATIVE-MB: LEONIDA_ARENA_MB is parsed with strtoll, so a negative value clamps to the 16 MiB floor instead of wrapping around to the 4095 MiB maximum. KernelSmoker approved this exact head.

**Why it's good:** A 3-line parse change. arena_size passes both plain and under validation.

Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 66d4f5a, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main 0b45fdc: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main 6261ca9: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
…unce-and-nan

Merging.

**Why merged:** RT-ACTIVE-INPUT-DEBOUNCE-NAN: active_input ignores an out-of-order timestamp in the debounce and ignores NaN/Inf stick and trigger samples. KernelSmoker's note that the new case wasn't registered doesn't apply at this head: it's in cases[] and runs ("8 of 8 cases pass"), as the author replied.

**Why it's good:** Header-only logic. active_input passes both plain and under validation.

Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 66d4f5a, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main 0b45fdc: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main 6261ca9: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** RT-712: XPersistentLocalStorageGetPath reports the required size on a short buffer and leaves the buffer untouched, as the GDK documents. moffington's ASan/UBSan harness passes 26/26, and their comment nit is fixed.

**Why it's good:** There are no writes into the caller's buffer on that path. xgameruntime passes both plain and under validation.

Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 66d4f5a, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main 0b45fdc: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main 6261ca9: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
…ned-root-sig-deserializer

Merging.

**Why merged:** OLD-10012: d3d12_xs exports D3D12CreateVersionedRootSignatureDeserializer and ordinal #7, forwarding to the host with the Xbox RTS0 flags cleared on a copy (the existing copy_rts0_blob_clear_xbox_flags guard). d3d12_xs_surface.md is updated. SweatierKey verified an earlier head, and trigger337's redundant-checksum finding is fixed in this head, with a zero-hash test.

**Why it's good:** root_sig passes both plain and under validation.

Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 66d4f5a, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main 0b45fdc: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main 6261ca9: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
…sing-folder-error

Merging.

**Why merged:** OLD-10004: DeleteFile, RemoveDirectory, SetFileAttributes and the MoveFile source return ERROR_PATH_NOT_FOUND for a name inside a missing folder, as the host does. runtime_imports.md is updated. moffington ran it under Wine with no regressions.

**Why it's good:** Error codes only. The new checks compare against the real host APIs, and the test confirms nothing is left in the overlay. file_system passes both plain and under validation.

Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 66d4f5a, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main 0b45fdc: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main 6261ca9: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** TEST-WINE-HOST-GUARDS, test-only: eight host-comparison tests skip the host part under Wine and still check the layer, and the heap-properties and residency tests gain layer-only assertions. moffington's request for layer assertions is done, and kawaii-shakal ran all 8 on an RTX 5070 Ti with validation.

**Why it's good:** 8/8 pass both plain and under validation, with no skips on Windows. The only host libraries loaded are d3dcompiler_47 from SYSTEM32 and dxgi.dll.

Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 66d4f5a, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative of this batch (13 PRs) on main 0b45fdc: the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The only failures are main's: d3d12_depth_resolve (pre-existing) and d3d12_close_parity (the #510 regression, fixed by #1286). All d3d12_* tests under validation show 0 VUIDs. git merge-tree against current main 6261ca9: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

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

QemmHD commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Confirmed after the merge on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24, VS 2022, Ninja, RelWithDebInfo), with a fresh build of main 51757ec. The results are identical plain and with LEONIDA_VK_VALIDATION=1, with 0 VUIDs:

  • d3d12_close_parity passes: 113 cases, 0 failures. RSSetScissorRects(17) now returns 0x00000000, matching WARP.
  • d3d12_multi_viewport passes all 4 cases, an exact match against host D3D12.
  • d3d12_draw passes.

Thanks for the quick fix.

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

quartz-heron-58 added a commit to quartz-heron-58/leonida that referenced this pull request Nov 24, 2026
Brings in the RSSetScissorRects fix (ProjectLeonida#1286) that d3d12_close_parity needs.

Co-Authored-By: Claude Fable 5.2 <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.

3 participants