test: construct a reserved prefix for placed buffer checks #1930

Merged
SuperCraft3M merged 1 commit from upstream-pr/1937 into main 2026-11-24 22:06:13 +00:00
SuperCraft3M commented 2026-11-24 21:55:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SuperCraft3M on 2026-11-24T21:55:31Z.


Follow-up to #1766.

On Windows 11 build 26300.9711, the heap-block case can start with committed pages. Both implementations then correctly return alias=1, while the fixture assumes a reserved prefix and expects 0. Keep the heap comparison against the full walk on the observed layout. Construct a separate reservation whose first 64 KiB is reserved and second 64 KiB is committed, with fixed refusals for a buffer in that suffix and one extending past the allocation.

Tested on Windows 11 build 26300.9711 using:

cmake --build C:/Xbox2Windows-build --target startup_placed_buffer_range_check
ctest --test-dir C:/Xbox2Windows-build --no-tests=error --output-on-failure -R '^startup_placed_buffer_range(_.*_control)?$'

All three cases passed on the local integration of 6ef541f3. The region-only negative control still accepts the reserved-prefix placement and the walk-only control still fails the zero-query cost check. The large-page subcase was unavailable due to Win32 error 1314.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6592189165 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1937). Originally posted by [SuperCraft3M](https://github.com/SuperCraft3M) on 2026-11-24T21:55:31Z. --- Follow-up to #1766. On Windows 11 build 26300.9711, the heap-block case can start with committed pages. Both implementations then correctly return alias=1, while the fixture assumes a reserved prefix and expects 0. Keep the heap comparison against the full walk on the observed layout. Construct a separate reservation whose first 64 KiB is reserved and second 64 KiB is committed, with fixed refusals for a buffer in that suffix and one extending past the allocation. Tested on Windows 11 build 26300.9711 using: ```powershell cmake --build C:/Xbox2Windows-build --target startup_placed_buffer_range_check ctest --test-dir C:/Xbox2Windows-build --no-tests=error --output-on-failure -R '^startup_placed_buffer_range(_.*_control)?$' ``` All three cases passed on the local integration of 6ef541f3. The region-only negative control still accepts the reserved-prefix placement and the walk-only control still fails the zero-query cost check. The large-page subcase was unavailable due to Win32 error 1314.
upstream-sync closed this pull request 2026-11-24 23:03:07 +00:00
tedin7 commented 2026-11-24 23:03:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T22:05:16Z.

Review: COMMENTED


Review of head 6ef541f3eface0a0ca41e54157a77fcfed2c77b9. No P1, no P2.

Change: test-only (tests/startup_placed_buffer_range_check.cpp). The heap case now compares the allocator's observed layout against the full walk (expect = -1), and the reserved-prefix case is built explicitly with VirtualAlloc (reserve 2 x 64 KiB, commit the second). No CMake change, no source change, clean-room.

Commands executed locally:

  • git merge-tree --write-tree --name-only origin/main HEAD: clean, no conflicts
  • python3 tests/docs_links_check.py: PASS (18 files, 386 links)
  • python3 tests/bidi_controls_check.py: PASS
  • git diff --check origin/main...HEAD: PASS
  • Windows Server 2025, Debug (dev) and Release /O2: build OK, startup_placed_buffer_range and both controls (region_only, walk_only) 3/3 PASS
  • GitHub CI: Windows build/test, Linux checks, gfx1013 fixtures pass (the /O2 and chart jobs are skipped there; /O2 was run on Win2025 above)

Mutations (applied on Win2025 via patch, then reverted):

  1. placed_buffer_range.h walk: drop region.State != MEM_COMMIT. Killed: main test 8 failures, walk_only control also fails.
  2. placed_buffer_range.h region path: out.covered = true instead of the width check. Killed: main test 4 failures, region_only control fails.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048146191 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1937#pullrequestreview-6048146191). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T22:05:16Z. **Review:** COMMENTED --- Review of head `6ef541f3eface0a0ca41e54157a77fcfed2c77b9`. No P1, no P2. Change: test-only (`tests/startup_placed_buffer_range_check.cpp`). The heap case now compares the allocator's observed layout against the full walk (expect = -1), and the reserved-prefix case is built explicitly with VirtualAlloc (reserve 2 x 64 KiB, commit the second). No CMake change, no source change, clean-room. Commands executed locally: - `git merge-tree --write-tree --name-only origin/main HEAD`: clean, no conflicts - `python3 tests/docs_links_check.py`: PASS (18 files, 386 links) - `python3 tests/bidi_controls_check.py`: PASS - `git diff --check origin/main...HEAD`: PASS - Windows Server 2025, Debug (dev) and Release /O2: build OK, `startup_placed_buffer_range` and both controls (region_only, walk_only) 3/3 PASS - GitHub CI: Windows build/test, Linux checks, gfx1013 fixtures pass (the /O2 and chart jobs are skipped there; /O2 was run on Win2025 above) Mutations (applied on Win2025 via patch, then reverted): 1. `placed_buffer_range.h` walk: drop `region.State != MEM_COMMIT`. Killed: main test 8 failures, walk_only control also fails. 2. `placed_buffer_range.h` region path: `out.covered = true` instead of the width check. Killed: main test 4 failures, region_only control fails. AI-assisted; commands listed were executed locally.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1930
No description provided.