test: cover a BC7 layout whose padded extent is not square #1735
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1742"
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:01:36Z.
What
write_bc7_4k_s_layoutinsrc/startup_stubs/xg_xs.cppwrites two padded extents into the layout:tests/startup_xg_bc7_layout_check.pyasserts both, but its two shapes are 81x69 and 64x64, which both pad to a squaregrid (32x32 and 16x16 blocks). With
padded_width == padded_heightin every case, writing the width into the heightfield is invisible:
Change
One case whose padded extent is not square, chosen from the shape already documented for this fixture:
200x72 blocks pad to 64x32 blocks (256x128), so the two fields differ and the assertion at
mip+0x24/mip+0x28becomes a real check.
Tested at
origin/main=68969ed8Negative control,
xg_xs.dllrebuilt each time (timestamp checked):The refusal controls inside
check_copyalso run for the new shape, so the added case is not just a layout read.Scope
One test file, no behaviour change.
Notes
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T18:20:31Z.
Review: COMMENTED
Verified at commit
4baa900255f1545c4cc8d8cfa21e344f62cddb70(tests/startup_xg_bc7_layout_check.pyonly; no production/tooling/workflow changes; clean-room and title-neutral).Scope & Code Review
check_layout(create, 200, 72, 256, 128)totests/startup_xg_bc7_layout_check.py, covering both layout metadata (padded_width=256,padded_height=128,pitch=1024) andCopyIntoSubresource+ refusal paths.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 (4.17s)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.78s;startup_xg_bc7_layout0.18s)/O2(--preset release):cmake --build --preset release --target startup_stream_consumer startup_stub_xg_xs -- -j 8: pass (1.32s)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.95s;startup_xg_bc7_layout0.16s)Mutation Check (Win2025 Debug)
src/startup_stubs/xg_xs.cpp:121inwrite_bc7_4k_s_layoutfromput32(mip + 0x28, surface.padded_height());toput32(mip + 0x28, surface.padded_width());.startup_xg_bc7_layout(ctest --preset dev -R '^startup_xg_bc7_layout$' --output-on-failure): failed as expected — the two existing square-padded shapes (81x69,64x64) still passed, and the new200x72case caught the regression (got (256, 1024, 4096, 256, 256, 1, 200, 72, 1), expected (256, 1024, 4096, 256, 128, 1, 200, 72, 1)).Note: Competing open PRs (#1746, #1748) also modify
tests/startup_xg_bc7_layout_check.py.AI-assisted; commands listed were executed locally.