test: refuse a GPU virtual address floor of 16 bits #1720
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1727"
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-24T17:53:50Z.
What
src/d3d12_xs_range.cpprefuses a device whoseMaxGPUVirtualAddressBitsPerResourceis below 17:The device-free check (
tests/d3d12_xs_range_check.cpp) exercises the boundary from above — a fake device reporting17 bits creates the range — but never below it. Lowering the floor to 16 leaves the fixture green, so an adapter that
reports 16 bits would receive a range whose windows it cannot address, with nothing to notice.
Change
One case below the floor, next to the existing 17-bit case: a fake device with 16 bits must produce
E_FAIL, leave theout pointer untouched, and create no window.
requests.empty()is the part that distinguishes "refused up front" from "refused after the first window", and thesentinel output checks that a failure does not hand back a range.
Tested
The mutant run is the negative control: the point of the case is that it fails when the guard is weakened.
Scope
One test file, no behaviour change. The two other guards in
create(theUINTandmax_sizewindow-count check, andthe range's own
QueryInterfaceIID check) are also unwitnessed by this fixture; I left them alone to keep this to onebehaviour, and can send them separately if you want the whole function covered.
Notes
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T18:00:23Z.
Review: COMMENTED
Dual-platform verification at commit
ed9689bcd6d52d93f8162551093aeec8e9f69c95: 0 blocking issues.Summary
tests/d3d12_xs_range_check.cpp: adds a focused boundary check one bit below the 17-bitMaxGPUVirtualAddressBitsPerResourcefloor (Fixture below(16)), verifyingE_FAIL, nulling of a non-null sentinel out pointer,requests.empty(), andlive_windows == 0.src/changes, no weakened assertions).Verification
git diff --check: passed.python3 tests/docs_links_check.py: passed.python3 tests/bidi_controls_check.py: passed.--preset dev):cmake --build --preset dev --target d3d12_xs_range_check -- -j 6(3.86s);ctest --preset dev -R '^(d3d12_xs_range|d3d12_xs_range_full_last_window_control)$' --parallel 4 --no-tests=error --output-on-failure— 2/2 passed (0.11s)./O2(--preset release):cmake --build --preset release --target d3d12_xs_range_check -- -j 6(1.32s);ctest --preset release -R '^(d3d12_xs_range|d3d12_xs_range_full_last_window_control)$' --parallel 4 --no-tests=error --output-on-failure— 2/2 passed (0.10s).va.MaxGPUVirtualAddressBitsPerResource < 17to< 16insrc/d3d12_xs_range.cppcausesd3d12_xs_rangeto fail (***Exception: Numerical, divide-by-zero whenwindow == 0), confirming the new 16-bit case catches regressions on the floor guard; reverted cleanly.AI-assisted; commands listed were executed locally.