d3d12: support unplaced buffer memory SRVs in device slot 70 #2387

Merged
Holastor merged 3 commits from upstream-pr/2395 into main 2026-11-25 20:47:46 +00:00
Holastor commented 2026-11-25 15:10:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T15:10:06Z.


Summary

Device slot 70 (device_memory_srv in d3d12_xs.dll) creates shader resource views from raw memory addresses. Previously, buffer SRVs required an existing placed buffer wrapper registered via slot 133 (CreatePlacedResourceX) or committed buffer via slot 127 (CreateCommittedResource). When an SRV was requested for raw or sub-allocated buffer addresses that were not explicitly placed via slot 133 (for example dynamic buffers or direct allocations in title memory heaps), calls were refused with buffer_unavailable.

This change adds backing for unplaced buffer memory SRVs:

  • unplaced_buffer_extent calculates 64 KiB page-aligned extents and spans with arithmetic overflow checks and a 256 MiB sanity limit.
  • unplaced_memory_buffer validates committed coverage via measure_placed_buffer and verifies no conflicting placed aliases exist in placed_buffer_range.
  • Zero-copy aliasing: on adapters supporting D3D12_FEATURE_EXISTING_HEAPS for MEM_PRIVATE memory, it opens the existing allocation heap via OpenExistingHeapFromAddress and creates a placed resource alias at the page-aligned offset.
  • Fallback: on WARP or adapters without existing heap support, it creates a committed buffer on D3D12_HEAP_TYPE_UPLOAD and synchronizes memory via host memcpy both at creation and upon reuse.
  • Cache & Lifecycle: cached entries are indexed per device and allocation base; re-verifying commit status ensures deallocated or reused title memory is not falsely matched. Cached entries and desktop D3D12 resources are safely cleared when the device wrapper is destroyed (clear_unplaced_buffers).
  • Tests: adds unit tests and negative controls (--mutate unplaced-extent, --mutate unplaced-covers) to startup_memory_srv_buffer_check, and leaves buf1 unplaced in draw_address_buffer_srvs to test unplaced buffer sampling on WARP and hardware in startup_address_buffer_srv_{warp,hardware}.

Verification

Commands executed locally (Windows 11 Build 26100, MSVC 19.51, AMD Radeon RX 6600M driver 32.0.21045.11001):

ctest --preset dev --no-tests=error -R 'startup_memory_srv_buffer|startup_address_buffer_srv' -V

Output:

  • startup_memory_srv_buffer: Passed
  • startup_memory_srv_buffer_height_control: Passed (negative control failed as expected)
  • startup_memory_srv_buffer_exact-fit_control: Passed (negative control failed as expected)
  • startup_memory_srv_buffer_first-32_control: Passed (negative control failed as expected)
  • startup_memory_srv_buffer_unplaced-extent_control: Passed (negative control failed as expected)
  • startup_memory_srv_buffer_unplaced-covers_control: Passed (negative control failed as expected)
  • startup_address_buffer_srv_warp: Passed (warp: buffer memory SRV (raw base, raw interior, unplaced buffer, structured, refused unaligned, refused acceleration structure view) exact)
  • startup_address_buffer_srv_hardware: Passed (hardware: buffer memory SRV (raw base, raw interior, unplaced buffer, structured, refused unaligned, refused acceleration structure view) exact)
python tests/docs_links_check.py
python tests/bidi_controls_check.py
git diff --check

All passed cleanly.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6607599645 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-25T15:10:06Z. --- ### Summary Device slot 70 (`device_memory_srv` in `d3d12_xs.dll`) creates shader resource views from raw memory addresses. Previously, buffer SRVs required an existing placed buffer wrapper registered via slot 133 (`CreatePlacedResourceX`) or committed buffer via slot 127 (`CreateCommittedResource`). When an SRV was requested for raw or sub-allocated buffer addresses that were not explicitly placed via slot 133 (for example dynamic buffers or direct allocations in title memory heaps), calls were refused with `buffer_unavailable`. This change adds backing for unplaced buffer memory SRVs: - `unplaced_buffer_extent` calculates 64 KiB page-aligned extents and spans with arithmetic overflow checks and a 256 MiB sanity limit. - `unplaced_memory_buffer` validates committed coverage via `measure_placed_buffer` and verifies no conflicting placed aliases exist in `placed_buffer_range`. - Zero-copy aliasing: on adapters supporting `D3D12_FEATURE_EXISTING_HEAPS` for `MEM_PRIVATE` memory, it opens the existing allocation heap via `OpenExistingHeapFromAddress` and creates a placed resource alias at the page-aligned offset. - Fallback: on WARP or adapters without existing heap support, it creates a committed buffer on `D3D12_HEAP_TYPE_UPLOAD` and synchronizes memory via host `memcpy` both at creation and upon reuse. - Cache & Lifecycle: cached entries are indexed per device and allocation base; re-verifying commit status ensures deallocated or reused title memory is not falsely matched. Cached entries and desktop D3D12 resources are safely cleared when the device wrapper is destroyed (`clear_unplaced_buffers`). - Tests: adds unit tests and negative controls (`--mutate unplaced-extent`, `--mutate unplaced-covers`) to `startup_memory_srv_buffer_check`, and leaves `buf1` unplaced in `draw_address_buffer_srvs` to test unplaced buffer sampling on WARP and hardware in `startup_address_buffer_srv_{warp,hardware}`. ### Verification Commands executed locally (Windows 11 Build 26100, MSVC 19.51, AMD Radeon RX 6600M driver 32.0.21045.11001): ```powershell ctest --preset dev --no-tests=error -R 'startup_memory_srv_buffer|startup_address_buffer_srv' -V ``` Output: - `startup_memory_srv_buffer`: Passed - `startup_memory_srv_buffer_height_control`: Passed (negative control failed as expected) - `startup_memory_srv_buffer_exact-fit_control`: Passed (negative control failed as expected) - `startup_memory_srv_buffer_first-32_control`: Passed (negative control failed as expected) - `startup_memory_srv_buffer_unplaced-extent_control`: Passed (negative control failed as expected) - `startup_memory_srv_buffer_unplaced-covers_control`: Passed (negative control failed as expected) - `startup_address_buffer_srv_warp`: Passed (`warp: buffer memory SRV (raw base, raw interior, unplaced buffer, structured, refused unaligned, refused acceleration structure view) exact`) - `startup_address_buffer_srv_hardware`: Passed (`hardware: buffer memory SRV (raw base, raw interior, unplaced buffer, structured, refused unaligned, refused acceleration structure view) exact`) ```powershell python tests/docs_links_check.py python tests/bidi_controls_check.py git diff --check ``` All passed cleanly.
tedin7 commented 2026-11-25 17:01:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:16:37Z.

Review: COMMENTED


Review of head 2794451c (device slot 70: backing for buffer memory SRVs that are not placed in slot 133/127).

Checked (diff against origin/main):

  • unplaced_memory_buffer in d3d12_memory_srv.inl is only reached when existing_memory_buffer finds nothing, so placed and committed paths are unchanged.
  • Guards before creating anything: address_resource_overlap, unplaced_buffer_extent (64 KiB page extent, overflow checks, 256 MiB cap), measure_placed_buffer(...).covered, and placed_buffer_range (no alias conflict).
  • Cache: entries are matched on device, allocation base and unplaced_buffer_covers, then the committed status is re-measured. Upload-backed entries are re-copied on every hit, so the view sees title writes. Lock order is the same everywhere (unplaced_buffer_mutex, then placed_mutex).
  • Cleanup: clear_unplaced_buffers is called when the device wrapper reaches refs == 0 and drops the budget tickets and the wrapper reference.
  • Hardware path (existing heap alias) and WARP fallback (committed UPLOAD buffer plus copy) both end in the same adjusted FirstElement = (address - base) / element_bytes.
  • Tests: startup_memory_srv_buffer covers the two new pure helpers (extent, cover) and has two new negative controls (unplaced-extent, unplaced-covers) registered in CMake. startup_address_srv.cpp now leaves buf1 unplaced (a real VirtualAlloc page), so the existing startup_address_buffer_srv_* WARP run reads the buffer back through an unplaced SRV and compares exact bytes.
  • Docs in docs/startup-runtime.md match the code, and the check list there is updated.
  • No other open or merged PR covers this (#2338 is the Texture3D / placed buffer slice).

Notes (not blocking):

  • Each cache hit on the upload path copies the whole page span (up to 256 MiB) again. Fine for correctness, may be slow for large views.
  • The zero-copy alias path needs D3D12_FEATURE_EXISTING_HEAPS and is not reachable on WARP, so only the upload fallback is checked by the WARP run.

I found no correctness bug. Win2025 WARP dev and release run follows.

AI-assisted; commands listed were executed locally (python3 merge_check.py 2395, gh pr diff 2395, gh pr list --state all --search).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6061009886 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#pullrequestreview-6061009886). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:16:37Z. **Review:** COMMENTED --- Review of head 2794451c (device slot 70: backing for buffer memory SRVs that are not placed in slot 133/127). Checked (diff against origin/main): - `unplaced_memory_buffer` in `d3d12_memory_srv.inl` is only reached when `existing_memory_buffer` finds nothing, so placed and committed paths are unchanged. - Guards before creating anything: `address_resource_overlap`, `unplaced_buffer_extent` (64 KiB page extent, overflow checks, 256 MiB cap), `measure_placed_buffer(...).covered`, and `placed_buffer_range` (no alias conflict). - Cache: entries are matched on device, allocation base and `unplaced_buffer_covers`, then the committed status is re-measured. Upload-backed entries are re-copied on every hit, so the view sees title writes. Lock order is the same everywhere (`unplaced_buffer_mutex`, then `placed_mutex`). - Cleanup: `clear_unplaced_buffers` is called when the device wrapper reaches `refs == 0` and drops the budget tickets and the wrapper reference. - Hardware path (existing heap alias) and WARP fallback (committed UPLOAD buffer plus copy) both end in the same adjusted `FirstElement = (address - base) / element_bytes`. - Tests: `startup_memory_srv_buffer` covers the two new pure helpers (extent, cover) and has two new negative controls (`unplaced-extent`, `unplaced-covers`) registered in CMake. `startup_address_srv.cpp` now leaves `buf1` unplaced (a real `VirtualAlloc` page), so the existing `startup_address_buffer_srv_*` WARP run reads the buffer back through an unplaced SRV and compares exact bytes. - Docs in `docs/startup-runtime.md` match the code, and the check list there is updated. - No other open or merged PR covers this (#2338 is the Texture3D / placed buffer slice). Notes (not blocking): - Each cache hit on the upload path copies the whole page span (up to 256 MiB) again. Fine for correctness, may be slow for large views. - The zero-copy alias path needs `D3D12_FEATURE_EXISTING_HEAPS` and is not reachable on WARP, so only the upload fallback is checked by the WARP run. I found no correctness bug. Win2025 WARP dev and release run follows. AI-assisted; commands listed were executed locally (`python3 merge_check.py 2395`, `gh pr diff 2395`, `gh pr list --state all --search`).
KelboLive commented 2026-11-25 17:01:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-25T16:08:04Z.


APPROVED. Unplaced buffer memory SRVs in device slot 70.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167622592 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#issuecomment-7167622592). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-25T16:08:04Z. --- APPROVED. Unplaced buffer memory SRVs in device slot 70.
tedin7 commented 2026-11-25 17:01:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:22:16Z.


Win2025 WARP receipt for head bc6fa004 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit bc6fa0045d3e39f6f12b9e333a5c127bf3d09028:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2): 3.34s (configure 0.00s)
    • Test (ctest --preset dev -R 'startup_memory_srv_buffer|startup_address_buffer_srv|startup_address_srv|startup_memory_srv' --parallel 6 --no-tests=error --output-on-failure): 24/24 passed (1.29s: startup_memory_srv_diag_hardware 0.66s, startup_address_srv_warp 0.67s, startup_memory_srv_diag_supported_control_warp 0.69s, startup_memory_srv_census 0.02s, startup_memory_srv_as 0.02s, startup_memory_srv_buffer_exact-fit_control 0.01s, startup_memory_srv_buffer 0.01s, startup_memory_srv_as_alignment_control 0.01s, startup_memory_srv_buffer_first-32_control 0.01s, startup_memory_srv_report 0.01s, startup_memory_srv_as_offset_control 0.01s, startup_address_buffer_srv_hardware 0.75s, startup_memory_srv_as_state_control 0.02s, startup_memory_srv_buffer_height_control 0.02s, startup_memory_srv_buffer_unplaced-extent_control 0.02s, startup_memory_srv_diag_warp 0.79s, startup_memory_srv_buffer_unplaced-covers_control 0.03s, startup_memory_srv_volume 0.03s, startup_memory_srv_volume_layout_control 0.02s, startup_memory_srv_volume_2d-view_control 0.02s, startup_memory_srv_volume_3d-view_control 0.02s, startup_memory_srv_volume_mips-overflow_control 0.01s, startup_address_buffer_srv_warp 0.84s, startup_address_srv_hardware 0.51s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2): 1.38s (configure 0.00s)
    • Test (ctest --preset release -R 'startup_memory_srv_buffer|startup_address_buffer_srv|startup_address_srv|startup_memory_srv' --parallel 6 --no-tests=error --output-on-failure): 24/24 passed (1.17s: startup_memory_srv_buffer_first-32_control 0.02s, startup_memory_srv_as 0.02s, startup_memory_srv_report 0.02s, startup_memory_srv_as_alignment_control 0.02s, startup_memory_srv_buffer_height_control 0.02s, startup_memory_srv_buffer 0.02s, startup_memory_srv_buffer_exact-fit_control 0.02s, startup_memory_srv_as_state_control 0.02s, startup_memory_srv_as_offset_control 0.02s, startup_memory_srv_census 0.02s, startup_memory_srv_buffer_unplaced-extent_control 0.02s, startup_memory_srv_buffer_unplaced-covers_control 0.02s, startup_memory_srv_volume 0.02s, startup_memory_srv_volume_layout_control 0.02s, startup_memory_srv_volume_2d-view_control 0.02s, startup_memory_srv_volume_3d-view_control 0.02s, startup_memory_srv_volume_mips-overflow_control 0.02s, startup_address_srv_hardware 0.60s, startup_address_srv_warp 0.61s, startup_address_buffer_srv_warp 0.62s, startup_memory_srv_diag_warp 0.57s, startup_memory_srv_diag_supported_control_warp 0.56s, startup_memory_srv_diag_hardware 0.57s, startup_address_buffer_srv_hardware 0.46s)
  • sccache: 8/8 hits; wall 12.0s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167866150 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#issuecomment-7167866150). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:22:16Z. --- Win2025 WARP receipt for head bc6fa004 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `bc6fa0045d3e39f6f12b9e333a5c127bf3d09028`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2`): `3.34s` (configure `0.00s`) - Test (`ctest --preset dev -R 'startup_memory_srv_buffer|startup_address_buffer_srv|startup_address_srv|startup_memory_srv' --parallel 6 --no-tests=error --output-on-failure`): **24/24 passed** (`1.29s`: `startup_memory_srv_diag_hardware` `0.66s`, `startup_address_srv_warp` `0.67s`, `startup_memory_srv_diag_supported_control_warp` `0.69s`, `startup_memory_srv_census` `0.02s`, `startup_memory_srv_as` `0.02s`, `startup_memory_srv_buffer_exact-fit_control` `0.01s`, `startup_memory_srv_buffer` `0.01s`, `startup_memory_srv_as_alignment_control` `0.01s`, `startup_memory_srv_buffer_first-32_control` `0.01s`, `startup_memory_srv_report` `0.01s`, `startup_memory_srv_as_offset_control` `0.01s`, `startup_address_buffer_srv_hardware` `0.75s`, `startup_memory_srv_as_state_control` `0.02s`, `startup_memory_srv_buffer_height_control` `0.02s`, `startup_memory_srv_buffer_unplaced-extent_control` `0.02s`, `startup_memory_srv_diag_warp` `0.79s`, `startup_memory_srv_buffer_unplaced-covers_control` `0.03s`, `startup_memory_srv_volume` `0.03s`, `startup_memory_srv_volume_layout_control` `0.02s`, `startup_memory_srv_volume_2d-view_control` `0.02s`, `startup_memory_srv_volume_3d-view_control` `0.02s`, `startup_memory_srv_volume_mips-overflow_control` `0.01s`, `startup_address_buffer_srv_warp` `0.84s`, `startup_address_srv_hardware` `0.51s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2`): `1.38s` (configure `0.00s`) - Test (`ctest --preset release -R 'startup_memory_srv_buffer|startup_address_buffer_srv|startup_address_srv|startup_memory_srv' --parallel 6 --no-tests=error --output-on-failure`): **24/24 passed** (`1.17s`: `startup_memory_srv_buffer_first-32_control` `0.02s`, `startup_memory_srv_as` `0.02s`, `startup_memory_srv_report` `0.02s`, `startup_memory_srv_as_alignment_control` `0.02s`, `startup_memory_srv_buffer_height_control` `0.02s`, `startup_memory_srv_buffer` `0.02s`, `startup_memory_srv_buffer_exact-fit_control` `0.02s`, `startup_memory_srv_as_state_control` `0.02s`, `startup_memory_srv_as_offset_control` `0.02s`, `startup_memory_srv_census` `0.02s`, `startup_memory_srv_buffer_unplaced-extent_control` `0.02s`, `startup_memory_srv_buffer_unplaced-covers_control` `0.02s`, `startup_memory_srv_volume` `0.02s`, `startup_memory_srv_volume_layout_control` `0.02s`, `startup_memory_srv_volume_2d-view_control` `0.02s`, `startup_memory_srv_volume_3d-view_control` `0.02s`, `startup_memory_srv_volume_mips-overflow_control` `0.02s`, `startup_address_srv_hardware` `0.60s`, `startup_address_srv_warp` `0.61s`, `startup_address_buffer_srv_warp` `0.62s`, `startup_memory_srv_diag_warp` `0.57s`, `startup_memory_srv_diag_supported_control_warp` `0.56s`, `startup_memory_srv_diag_hardware` `0.57s`, `startup_address_buffer_srv_hardware` `0.46s`) - `sccache`: 8/8 hits; wall `12.0s` AI-assisted; commands listed were executed locally.
Holastor commented 2026-11-25 20:04:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T19:53:33Z.


Rebased onto current main (6d2d3bed), dropping intermediate merge commits and resolving the conflict in release() (d3d12_xs_device.cpp) between clear_unplaced_buffers and retire_drop_recording.

Branch now carries only the 2 topic commits (733163c5 and 703102b4).

Verified on Windows 11 x64 (MSVC 19.44 + AMD Radeon RX 6600M & WARP):

  • ctest --preset dev -R 'startup_memory_srv_buffer|startup_address_buffer_srv|startup_address_srv|startup_memory_srv' --parallel 6 --no-tests=error --output-on-failure
    • 24/24 passed (1.16s)

PR is now marked mergeable.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7172906271 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#issuecomment-7172906271). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-25T19:53:33Z. --- Rebased onto current main (`6d2d3bed`), dropping intermediate merge commits and resolving the conflict in `release()` (`d3d12_xs_device.cpp`) between `clear_unplaced_buffers` and `retire_drop_recording`. Branch now carries only the 2 topic commits (`733163c5` and `703102b4`). Verified on Windows 11 x64 (MSVC 19.44 + AMD Radeon RX 6600M & WARP): - `ctest --preset dev -R 'startup_memory_srv_buffer|startup_address_buffer_srv|startup_address_srv|startup_memory_srv' --parallel 6 --no-tests=error --output-on-failure` - **24/24 passed** (1.16s) PR is now marked mergeable.
Makto94 commented 2026-11-25 20:04:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Makto94 on 2026-11-25T20:03:18Z.


Hardware run and Windows 11 MSVC build at head 8ebd5da8.

Environment: Windows 11 Pro build 26300.9974, Debug (dev preset), MSVC toolset 14.44.35207 (cl 19.44.35230.0), driver 32.0.16.2101. The three hardware tests print adapter=NVIDIA GeForce RTX 3070 Ti driver=32.0.16.2101. The runs were serial (-j1).

Build: cmake --build --preset dev exited 0 (this PR changes C++ in src/startup_stubs/, so the build was rerun at this head).

Tests:

  • ctest --preset dev --no-tests=error -j1 -R '^startup_memory_srv_buffer|^startup_address_buffer_srv_warp$|^startup_address_srv_warp$' -E hardware -V: 8/8 passed. These are startup_memory_srv_buffer, its five controls (height, exact-fit, first-32, unplaced-extent, unplaced-covers) and the two WARP tests, startup_address_srv_warp and startup_address_buffer_srv_warp.
  • ctest --preset dev --no-tests=error -j1 -R '^startup_address_buffer_srv_hardware$|^startup_address_srv_hardware$|^startup_memory_srv_diag_hardware$' -V: 3/3 passed. 0 capability skips (77).

The five controls run startup_memory_srv_buffer_check.exe --mutate <name> and each prints its FAIL line (for example FAIL resource height 2 and FAIL unplaced extent crossing page); the test passes because the control fails as designed.

The hardware tests print:

  • startup_address_buffer_srv_hardware: buffer memory SRV (raw base, raw interior, unplaced buffer, structured, refused unaligned, refused acceleration structure view) exact.
  • startup_address_srv_hardware: ordinary view, alternating addresses, zero/interior/mismatched updates; all 32 RGBA pixels exact.
  • startup_memory_srv_diag_hardware: BC1 refusal counted and named past the line limit; zero entry counted for pipeline 4599b146e6d5a03f with zero words; R8 accepted and sampled. Its census lists memory SRV refusals (slot 70): total 9 (null_address 8, unsupported_description 1) and memory SRV writes (slot 70): calls 1, distinct entries 1.

The WARP tests print adapter=Microsoft Basic Render Driver driver=10.0.26100.9818 and the same exact-result lines.

These logs do not show whether the unplaced buffer used the existing-heap alias or the UPLOAD fallback, and they do not print a debug-layer status; I make no claim about either from this run.

On the PR so far: the author's comment reports 24/24 passed on AMD Radeon RX 6600M and WARP. A WARP receipt on Windows Server 2025 appears for an earlier head. I found no NVIDIA run on this head.

Not covered by this run: NVIDIA only (RTX 3070 Ti); no AMD or Intel GPU; no Release build; the wider ctest -R '^startup_' suite was not run; the fail-first run on main was not repeated; the debug-layer status and the alias versus fallback path were not observed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173123904 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#issuecomment-7173123904). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T20:03:18Z. --- Hardware run and Windows 11 MSVC build at head `8ebd5da8`. Environment: Windows 11 Pro build 26300.9974, Debug (`dev` preset), MSVC toolset 14.44.35207 (cl 19.44.35230.0), driver 32.0.16.2101. The three hardware tests print `adapter=NVIDIA GeForce RTX 3070 Ti driver=32.0.16.2101`. The runs were serial (`-j1`). Build: `cmake --build --preset dev` exited 0 (this PR changes C++ in `src/startup_stubs/`, so the build was rerun at this head). Tests: - `ctest --preset dev --no-tests=error -j1 -R '^startup_memory_srv_buffer|^startup_address_buffer_srv_warp$|^startup_address_srv_warp$' -E hardware -V`: 8/8 passed. These are `startup_memory_srv_buffer`, its five controls (`height`, `exact-fit`, `first-32`, `unplaced-extent`, `unplaced-covers`) and the two WARP tests, `startup_address_srv_warp` and `startup_address_buffer_srv_warp`. - `ctest --preset dev --no-tests=error -j1 -R '^startup_address_buffer_srv_hardware$|^startup_address_srv_hardware$|^startup_memory_srv_diag_hardware$' -V`: 3/3 passed. 0 capability skips (77). The five controls run `startup_memory_srv_buffer_check.exe --mutate <name>` and each prints its `FAIL` line (for example `FAIL resource height 2` and `FAIL unplaced extent crossing page`); the test passes because the control fails as designed. The hardware tests print: - `startup_address_buffer_srv_hardware`: `buffer memory SRV (raw base, raw interior, unplaced buffer, structured, refused unaligned, refused acceleration structure view) exact`. - `startup_address_srv_hardware`: `ordinary view, alternating addresses, zero/interior/mismatched updates; all 32 RGBA pixels exact`. - `startup_memory_srv_diag_hardware`: `BC1 refusal counted and named past the line limit; zero entry counted for pipeline 4599b146e6d5a03f with zero words; R8 accepted and sampled`. Its census lists `memory SRV refusals (slot 70): total 9` (`null_address 8`, `unsupported_description 1`) and `memory SRV writes (slot 70): calls 1, distinct entries 1`. The WARP tests print `adapter=Microsoft Basic Render Driver driver=10.0.26100.9818` and the same exact-result lines. These logs do not show whether the unplaced buffer used the existing-heap alias or the UPLOAD fallback, and they do not print a debug-layer status; I make no claim about either from this run. On the PR so far: the author's comment reports `24/24 passed` on `AMD Radeon RX 6600M` and WARP. A WARP receipt on Windows Server 2025 appears for an earlier head. I found no NVIDIA run on this head. Not covered by this run: NVIDIA only (RTX 3070 Ti); no AMD or Intel GPU; no Release build; the wider `ctest -R '^startup_'` suite was not run; the fail-first run on `main` was not repeated; the debug-layer status and the alias versus fallback path were not observed.
upstream-sync closed this pull request 2026-11-25 21:00:51 +00:00
tedin7 commented 2026-11-25 21:00:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:15:43Z.

Review: COMMENTED


Review of head 8ebd5da8 (comment only).

Checked:

  • Page extent math (unplaced_buffer_extent, unplaced_buffer_covers): overflow guards, 64 KiB alignment and the 256 MiB cap look correct.
  • Backing path: commit coverage and placed-alias checks run before any resource is created. Existing-heap aliasing is only used when the adapter supports it. The UPLOAD copy fallback re-syncs on cache reuse. Cache entries are cleared when the device wrapper is released.
  • Tests: the unit test has two new negative controls (unplaced-extent, unplaced-covers). The WARP and hardware draw test now leaves buf1 unplaced, so the new path is read back on a real device.
  • No other open or merged PR covers this slice of slot 70.
  • Note (not a blocker): cached entries are only freed when the device is released, so a title that maps many distinct buffers keeps them until then.
  • This does not claim startup progress, so no game run is needed.

Commands executed locally: gh pr update-branch, python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, git diff --check origin/main...HEAD. The C++ test needs D3D12 headers, so it was not built on Linux. Its negative controls are exercised on Win2025 (receipt in the next comment).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6064324299 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#pullrequestreview-6064324299). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T20:15:43Z. **Review:** COMMENTED --- Review of head 8ebd5da8 (comment only). Checked: - Page extent math (`unplaced_buffer_extent`, `unplaced_buffer_covers`): overflow guards, 64 KiB alignment and the 256 MiB cap look correct. - Backing path: commit coverage and placed-alias checks run before any resource is created. Existing-heap aliasing is only used when the adapter supports it. The UPLOAD copy fallback re-syncs on cache reuse. Cache entries are cleared when the device wrapper is released. - Tests: the unit test has two new negative controls (`unplaced-extent`, `unplaced-covers`). The WARP and hardware draw test now leaves `buf1` unplaced, so the new path is read back on a real device. - No other open or merged PR covers this slice of slot 70. - Note (not a blocker): cached entries are only freed when the device is released, so a title that maps many distinct buffers keeps them until then. - This does not claim startup progress, so no game run is needed. Commands executed locally: `gh pr update-branch`, `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py`, `git diff --check origin/main...HEAD`. The C++ test needs D3D12 headers, so it was not built on Linux. Its negative controls are exercised on Win2025 (receipt in the next comment). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 21:00:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:42:17Z.

Review: COMMENTED


Review of the PR change (head before the branch update: f3ab4035; the update only merges main).

What I checked

  • unplaced_buffer_extent / unplaced_buffer_covers (memory_srv_buffer.h): overflow guards, 64 KiB alignment and the 256 MiB limit are correct; the end-of-range check cannot wrap.
  • unplaced_memory_buffer (d3d12_memory_srv.inl): refuses uncovered memory, overlap with live resources and nearby placed aliases; cache hits re-verify commit status and the allocation base; teardown in clear_unplaced_buffers releases budgets and refs.
  • The new buffer path is only tried after existing_memory_buffer fails, so the placed/committed paths are unchanged.
  • Tests: extends startup_memory_srv_buffer_check with two new negative controls (unplaced-extent, unplaced-covers) and leaves buf1 unplaced in the WARP/hardware readback test, so the sampled value is checked on a real D3D12 device.
  • No other open or merged PR covers this slice (#2338 and #2473 are different slots/features).

Non-blocking notes

  • On the UPLOAD fallback the data is a copy made at SRV creation (and refreshed on a cache hit). CPU writes to that memory between those two points are not seen by the GPU. Fine for the current fixture; worth a doc line if titles rewrite such buffers in place.
  • Cache entries live until the device wrapper is destroyed; a stale entry whose memory was freed is skipped on lookup (re-verify) but not dropped, so the list can grow on long runs.

Commands run locally (Linux, PR worktree)

  • git diff --check origin/main...HEAD: clean
  • python3 tests/docs_links_check.py: passed
  • python3 tests/bidi_controls_check.py: passed
  • Windows build/CTest is covered by the Win2025 run below. I did not run the code on any game binary.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6064700531 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#pullrequestreview-6064700531). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T20:42:17Z. **Review:** COMMENTED --- Review of the PR change (head before the branch update: f3ab4035; the update only merges main). What I checked - `unplaced_buffer_extent` / `unplaced_buffer_covers` (memory_srv_buffer.h): overflow guards, 64 KiB alignment and the 256 MiB limit are correct; the end-of-range check cannot wrap. - `unplaced_memory_buffer` (d3d12_memory_srv.inl): refuses uncovered memory, overlap with live resources and nearby placed aliases; cache hits re-verify commit status and the allocation base; teardown in `clear_unplaced_buffers` releases budgets and refs. - The new buffer path is only tried after `existing_memory_buffer` fails, so the placed/committed paths are unchanged. - Tests: extends `startup_memory_srv_buffer_check` with two new negative controls (`unplaced-extent`, `unplaced-covers`) and leaves `buf1` unplaced in the WARP/hardware readback test, so the sampled value is checked on a real D3D12 device. - No other open or merged PR covers this slice (#2338 and #2473 are different slots/features). Non-blocking notes - On the UPLOAD fallback the data is a copy made at SRV creation (and refreshed on a cache hit). CPU writes to that memory between those two points are not seen by the GPU. Fine for the current fixture; worth a doc line if titles rewrite such buffers in place. - Cache entries live until the device wrapper is destroyed; a stale entry whose memory was freed is skipped on lookup (re-verify) but not dropped, so the list can grow on long runs. Commands run locally (Linux, PR worktree) - `git diff --check origin/main...HEAD`: clean - `python3 tests/docs_links_check.py`: passed - `python3 tests/bidi_controls_check.py`: passed - Windows build/CTest is covered by the Win2025 run below. I did not run the code on any game binary. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 21:01:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:15:44Z.


Win2025 WARP receipt for head 8ebd5da8 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 8ebd5da8c89c8fbc4132d214ce4195ccc6e02dd9:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2): 62.31s (configure 0.00s)
    • Test (ctest --preset dev -R 'startup_memory_srv_buffer|startup_address_buffer_srv' --parallel 2 --no-tests=error --output-on-failure): 8/8 passed (1.93s: startup_memory_srv_buffer_height_control 0.07s, startup_memory_srv_buffer 0.12s, startup_memory_srv_buffer_first-32_control 0.03s, startup_memory_srv_buffer_exact-fit_control 0.04s, startup_memory_srv_buffer_unplaced-extent_control 0.02s, startup_memory_srv_buffer_unplaced-covers_control 0.03s, startup_address_buffer_srv_warp 1.41s, startup_address_buffer_srv_hardware 1.43s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2): 4.97s (configure 0.00s)
    • Test (ctest --preset release -R 'startup_memory_srv_buffer|startup_address_buffer_srv' --parallel 2 --no-tests=error --output-on-failure): 8/8 passed (1.44s: startup_memory_srv_buffer 0.05s, startup_memory_srv_buffer_height_control 0.02s, startup_memory_srv_buffer_exact-fit_control 0.02s, startup_memory_srv_buffer_first-32_control 0.02s, startup_memory_srv_buffer_unplaced-extent_control 0.02s, startup_memory_srv_buffer_unplaced-covers_control 0.02s, startup_address_buffer_srv_warp 1.06s, startup_address_buffer_srv_hardware 1.08s)
  • sccache: 6/59 hits; wall 78.0s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173410840 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#issuecomment-7173410840). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T20:15:44Z. --- Win2025 WARP receipt for head 8ebd5da8 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `8ebd5da8c89c8fbc4132d214ce4195ccc6e02dd9`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2`): `62.31s` (configure `0.00s`) - Test (`ctest --preset dev -R 'startup_memory_srv_buffer|startup_address_buffer_srv' --parallel 2 --no-tests=error --output-on-failure`): **8/8 passed** (`1.93s`: `startup_memory_srv_buffer_height_control` `0.07s`, `startup_memory_srv_buffer` `0.12s`, `startup_memory_srv_buffer_first-32_control` `0.03s`, `startup_memory_srv_buffer_exact-fit_control` `0.04s`, `startup_memory_srv_buffer_unplaced-extent_control` `0.02s`, `startup_memory_srv_buffer_unplaced-covers_control` `0.03s`, `startup_address_buffer_srv_warp` `1.41s`, `startup_address_buffer_srv_hardware` `1.43s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2`): `4.97s` (configure `0.00s`) - Test (`ctest --preset release -R 'startup_memory_srv_buffer|startup_address_buffer_srv' --parallel 2 --no-tests=error --output-on-failure`): **8/8 passed** (`1.44s`: `startup_memory_srv_buffer` `0.05s`, `startup_memory_srv_buffer_height_control` `0.02s`, `startup_memory_srv_buffer_exact-fit_control` `0.02s`, `startup_memory_srv_buffer_first-32_control` `0.02s`, `startup_memory_srv_buffer_unplaced-extent_control` `0.02s`, `startup_memory_srv_buffer_unplaced-covers_control` `0.02s`, `startup_address_buffer_srv_warp` `1.06s`, `startup_address_buffer_srv_hardware` `1.08s`) - `sccache`: 6/59 hits; wall `78.0s` AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 21:01:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:47:36Z.


Win2025 WARP receipt for head 2613d7a6 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 2613d7a6efde3e8e285d7c0cd8ec783b008f34d7:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2): 1.59s (configure 0.00s)
    • Test (ctest --preset dev -R 'startup_memory_srv_buffer|startup_address_buffer_srv_warp' --parallel 2 --no-tests=error --output-on-failure): 7/7 passed (0.99s: startup_memory_srv_buffer_unplaced-covers_control 0.02s, startup_memory_srv_buffer_unplaced-extent_control 0.01s, startup_memory_srv_buffer 0.01s, startup_memory_srv_buffer_exact-fit_control 0.02s, startup_memory_srv_buffer_height_control 0.01s, startup_memory_srv_buffer_first-32_control 0.02s, startup_address_buffer_srv_warp 0.83s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2): 1.73s (configure 0.00s)
    • Test (ctest --preset release -R 'startup_memory_srv_buffer|startup_address_buffer_srv_warp' --parallel 2 --no-tests=error --output-on-failure): 7/7 passed (0.86s: startup_memory_srv_buffer_first-32_control 0.01s, startup_memory_srv_buffer_unplaced-covers_control 0.01s, startup_memory_srv_buffer_unplaced-extent_control 0.01s, startup_memory_srv_buffer_exact-fit_control 0.01s, startup_memory_srv_buffer_height_control 0.01s, startup_memory_srv_buffer 0.01s, startup_address_buffer_srv_warp 0.70s)
  • sccache: 8/54 hits; wall 15.1s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174194505 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2395#issuecomment-7174194505). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T20:47:36Z. --- Win2025 WARP receipt for head 2613d7a6 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `2613d7a6efde3e8e285d7c0cd8ec783b008f34d7`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2`): `1.59s` (configure `0.00s`) - Test (`ctest --preset dev -R 'startup_memory_srv_buffer|startup_address_buffer_srv_warp' --parallel 2 --no-tests=error --output-on-failure`): **7/7 passed** (`0.99s`: `startup_memory_srv_buffer_unplaced-covers_control` `0.02s`, `startup_memory_srv_buffer_unplaced-extent_control` `0.01s`, `startup_memory_srv_buffer` `0.01s`, `startup_memory_srv_buffer_exact-fit_control` `0.02s`, `startup_memory_srv_buffer_height_control` `0.01s`, `startup_memory_srv_buffer_first-32_control` `0.02s`, `startup_address_buffer_srv_warp` `0.83s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_buffer_check startup_stream_consumer -- -j 2`): `1.73s` (configure `0.00s`) - Test (`ctest --preset release -R 'startup_memory_srv_buffer|startup_address_buffer_srv_warp' --parallel 2 --no-tests=error --output-on-failure`): **7/7 passed** (`0.86s`: `startup_memory_srv_buffer_first-32_control` `0.01s`, `startup_memory_srv_buffer_unplaced-covers_control` `0.01s`, `startup_memory_srv_buffer_unplaced-extent_control` `0.01s`, `startup_memory_srv_buffer_exact-fit_control` `0.01s`, `startup_memory_srv_buffer_height_control` `0.01s`, `startup_memory_srv_buffer` `0.01s`, `startup_address_buffer_srv_warp` `0.70s`) - `sccache`: 8/54 hits; wall `15.1s` 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!2387
No description provided.