test: refuse a null layout destination #1741
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1748"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T18:06:04Z.
What
computer_layoutinsrc/startup_stubs/xg_xs.cppstarts with a null check:tests/startup_xg_bc7_layout_check.pyonly ever passed a guarded buffer, so removing that check leaves it green:Change
One query with no destination, expecting
E_POINTER:The
& 0xFFFFFFFFis not cosmetic: ctypes hands the HRESULT back as a signed Python int (-2147467261), and the rest ofthe file already masks before comparing. Without it the new line reports a spurious mismatch.
Tested at
origin/main=68969ed8Scope
One test file, no behaviour change. The other two branches in this function that the fixture does not reach — the
max_mipsclamp and the~0ull / 0slice-size fallback — I left alone; the clamp would need a descriptor with more mipsthan a fixture currently builds, and the fallback needs a device answer of "no size", which the desktop path does not
produce. I would rather not guess at either.
Notes
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T18:26:32Z.
Review: COMMENTED
Verified at commit
11f3bb65a30adca55787299be95e8f8af8ae263a(tests/startup_xg_bc7_layout_check.pyonly; no production/tooling/workflow changes; clean-room and title-neutral).Scope & Code Review
check_layoutcallingGetResourceLayout(None)(vtable[2]) and assertingE_POINTER(0x80004003).if (!layout) return static_cast<long>(0x80004003);guard incomputer_layout(src/startup_stubs/xg_xs.cpp:156).Linux Checks
git diff --check origin/main...HEAD: passpython3 tests/docs_links_check.py: passpython3 tests/bidi_controls_check.py: passpython3 -m py_compile tests/startup_xg_bc7_layout_check.py: passWindows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)
--preset dev):cmake --build --preset dev --target startup_stream_consumer startup_stub_xg_xs -- -j 8: pass (3.87s)ctest --preset dev -R '^(startup_xg_bc7_layout|startup_xg_bc_array_warp|startup_xg_bc_chain_warp|startup_xg_bc_tiling|startup_xg_tile64_tiling)$' --parallel 6 --no-tests=error --output-on-failure: 5/5 passed (7.23s;startup_xg_bc7_layout0.15s)/O2(--preset release):cmake --build --preset release --target startup_stream_consumer startup_stub_xg_xs -- -j 8: pass (1.13s)ctest --preset release -R '^(startup_xg_bc7_layout|startup_xg_bc_array_warp|startup_xg_bc_chain_warp|startup_xg_bc_tiling|startup_xg_tile64_tiling)$' --parallel 6 --no-tests=error --output-on-failure: 5/5 passed (7.72s;startup_xg_bc7_layout0.14s)Mutation Check (Win2025 Debug)
src/startup_stubs/xg_xs.cpp:156incomputer_layoutfromif (!layout) return static_cast<long>(0x80004003);toif (!layout) return static_cast<long>(0x80070057);.startup_xg_bc7_layout(ctest --preset dev -R '^startup_xg_bc7_layout$' --output-on-failure): failed as expected (RuntimeError: GetResourceLayout(null) HRESULT: got 2147942487, expected 2147500035).Note: Competing open PRs (#1742, #1746) also modify
tests/startup_xg_bc7_layout_check.py.AI-assisted; commands listed were executed locally.