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

Manually merged
github merged 1 commit from gh-pr/1937/head into gh-pr/1937/base 2026-11-26 23:43:50 +00:00
Owner

@⁠SuperCraft3M on GitHub · 2026-11-24 21:55 UTC · original
SuperCraft3M:test/placed-buffer-heap-layout → main · +22 −11 · 1 files · 1 commits · merged 2026-11-24 22:06 UTC

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.

**@⁠SuperCraft3M** on GitHub · 2026-11-24 21:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1937) `SuperCraft3M:test/placed-buffer-heap-layout` → `main` · +22 −11 · 1 files · 1 commits · merged 2026-11-24 22:06 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:43:47 +00:00
github manually merged commit 6ef541f3ef into gh-pr/1937/base 2026-11-26 23:43:50 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 22:05 UTC · original · reviewed

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.

**@⁠tedin7** on GitHub · 2026-11-24 22:05 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1937#pullrequestreview-6048146191) · **reviewed** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.