Runtime tests: fix two failures on main (d3d12_com stale depth-clear check, root_sig merge of two checksum fixes) #16
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!16
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/16/head"
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?
@Pixel-Katana on GitHub · 2026-11-24 01:45 UTC · original
Pixel-Katana:fix/main-test-regressions→main· +48 −41 · 2 files · 2 commits · merged 2026-11-24 02:27 UTCTwo runtime tests fail on
main(30daa695). Both come from changes that were merged without the matching follow-up; one commit each.What and why
d3d12_com(test only).3ce953ae8madeCommandList::clear_depth_stencilrecord a depth outside [0, 1] as given, matching WARP, and updatedcommand_list_test,d3d12_clear_testandd3d12_close_parity_test.d3d12_com_teststill expectedCloseto returnE_INVALIDARGforClearDepthStencilView(depth 2.0):line 345: list->Close() == E_INVALIDARG. It now expectsS_OK, as the close-parity rows do.root_sig(d3d12_xs_rootsig.cpp).b95925cbf(an all-zero checksum is accepted, as hostd3d12.dlldoes) andc297bb577/5c3487a94(strict checksum, fail closed on a malformed chunk table) changedcopy_rts0_blob_clear_xbox_flagsin parallel. Merge1e029d6dfkept the strict early checksum from one and the chunk loop from the other:root_sig_testfails its two all-zero-checksum cases;min_chunk_offunused.The function now has 5c3487a94's fail-closed chunk walk and RTS0 version check, with b95925cbf's rule: an all-zero checksum is accepted and stays zero after the rewrite; any other checksum must match. The duplicate
total_sizeand checksum checks inside the loop are gone.Tested
Windows 11 (10.0.26300), RTX 5080, NVIDIA 621.24, VS 2022 Build Tools 17.14 / MSVC 19.44, Vulkan SDK 1.4.363.0,
scripts\build_runtime.ps1; no new warnings.root_sig_test: OK (0 failures), was 2 failures.d3d12_com_test: exit 0, also withLEONIDA_VK_VALIDATION=1.root_sig,root_signature,root_signature_oracle,device_proxy*,xs_proxy_mock*): 11/11.ctest(302): only three failures left, all present onmainbefore this change and untouched here:d3d12_execute_indirect_validation,d3d12_vulkan_device(line 6576,tiles == 1),d3d12_depth_resolve.xmemandcrt_timed_waitfailed once under-j 4and pass 3/3 run alone.main(14 commits ahead of the base).No game data, keys or decryption. AI-assisted.
🤖 Generated with Claude Code
3ce953ae8) 0c9864c98e@wavehs on GitHub · 2026-11-24 02:13 UTC · original
macOS arm64 review (Apple M3 Pro) — the rootsig half is reproducible here after all: the repository's own function fails 4 of 14 cases on base and passes all 14 on this head
Head
681847c7c, merge base30daa6958, 2 files +48/−41 (runtime/shims/d3d12_xs_rootsig.cpp,runtime/test/d3d12_com_test.cpp); merges cleanly intoubi/main(9ec34cdff,git merge-tree --write-treerc=0). The targets are Windows-only (MSVC + WARP + the hostd3d12.dll), which I cannot run. What I could do instead:runtime/shims/d3d12_xs_rootsig.cpponly needs four D3D12 typedefs for the code path under test, so I extractedcopy_rts0_blob_clear_xbox_flags,dxbc_checksum,clear_high_byte,rotlandmd5_blockverbatim from30daa6958and from681847c7cinto a harness with a two-line type stub (using D3D12_ROOT_SIGNATURE_FLAGS = std::uint32_t;), added the same kind of DXBC input the Windows test builds (oneRTS0chunk at +36), and compiled both with Apple clang 21.0.0,-std=c++20 -O1 -g -fsanitize=address,undefined.30daa6958681847c7cFlags = 0x03000000root_sig_testoutemptytotal_size != size, trailing bytes, no Xbox high bytechunk_sizepast end, short chunk (zero checksum)Base: 4 failures of 14. Head: 14/14, no ASan/UBSan report. The harness is the repo's code, so the branch logic being exercised is the code being merged; the registries, the host deserializer and WARP are not.
Why base was red, and it is not the PR's fault.
b95925cbf("verify DXBC total_size and incoming checksum before re-signing") added bothroot_sig_test.cpp:552-568(all-zero checksum must be rewritten and kept zero) and the header sentence "an all-zero hash is accepted as-is and kept zeroed", but its top-level check still compareddxbc_checksum(...)against bytes 4..19 unconditionally — so a zero checksum was rejected before the in-loop zero branch could ever run, and the test asserts the opposite of what the code does. This PR makes the code match its own test and header.The new checks match the rest of the codebase. The version range 1..3 is exactly
rt::rootsig::parse_rts0's (runtime/src/root_signature.cpp:320-333: 1 = 1.0, 2 = 1.1, 3 = 1.2, everything else a hard error) anddocs/d3d12_vulkan.md:1839; thechunk_sizebound mirrorsparse_rts0's own check (:499-511), which also decodes onlypayload_sizebytes and rejects an overrun. Thetotal_sizecheck that disappears from the loop is still there at the top of the function, so thebad_totalcase keeps refusing (harness confirms).The
d3d12_com_testhalf is right on the code.3ce953ae8changedruntime/src/command_list.h:762-773: a depth outside [0, 1] is now recorded as given and a flags mask of 0 closes the list, soClose()isS_OKand the oldE_INVALIDARGexpectation could only fail. The portablecommand_listctest passes here (1/1 inbuild32), and the referencedd3d12_close_parity_testrow exists (runtime/test/d3d12_close_parity_test.cpp:276).Two small things.
runtime/shims/d3d12_xs_rootsig.h:45-50lists why the helper returns false ("no RTS0 chunk, no Xbox high byte, a malformed/truncated header, total_size != size, or a non-zero incoming DXBC hash that does not match"). It does not mention the new unknown-RTS0-version rejection or the chunk-table/chunk_sizerejections, andd3d12_xs.cpp:114forwards the original blob on false — so the header is what tells a caller whether a false means "nothing to do" or "this blob is not safe to re-sign". Worth a clause.root_sig_test.cppcovers the version check or the three chunk-shape rejections; the zero-checksum block is the only new green. The four cases above are ~20 lines next to it and would pin the "fail closed" table this PR says it keeps.I also ran
check_no_game_data.pyon both changed files: clean.No game files. AI-assisted.