gpu: verify raw vertex-buffer reads through copied descriptors #2712

Merged
R0Y00 merged 2 commits from upstream-pr/2720 into main 2026-11-26 03:38:57 +00:00
R0Y00 commented 2026-11-26 03:30:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T03:30:06Z.


Refs #2695.

This source-built fixture publishes full and short views of the same raw buffer, copies each into the active table slot through slot 24, and compares the destination's guest-visible descriptor bytes with the source. The vertex shader reads different words on opposite sides of byte 256. The 32-pixel readback distinguishes the full view, the stale 256-byte view, and restoration of the full view in successive bands. The short view leaves the in-range word intact and returns zero for the word at byte 288. It does not establish the original executable's descriptor writer.

On Windows Release, WARP and RTX 4060 Laptop (32.0.16.1656) passed the new draw and both adjacent fixture groups, 6/6 without skips. The desktop descriptor increments in this run were 64 and 32 bytes respectively. The existing stream harness disables the debug layer.

cmake --build --preset release --target startup_stream_consumer
ctest --preset release --no-tests=error -R '^startup_(copied_vertex_srv|address_buffer_srv|frame_copy)_(warp|hardware)$' -V
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6618878161 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2720). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T03:30:06Z. --- Refs #2695. This source-built fixture publishes full and short views of the same raw buffer, copies each into the active table slot through slot 24, and compares the destination's guest-visible descriptor bytes with the source. The vertex shader reads different words on opposite sides of byte 256. The 32-pixel readback distinguishes the full view, the stale 256-byte view, and restoration of the full view in successive bands. The short view leaves the in-range word intact and returns zero for the word at byte 288. It does not establish the original executable's descriptor writer. On Windows Release, WARP and RTX 4060 Laptop (32.0.16.1656) passed the new draw and both adjacent fixture groups, 6/6 without skips. The desktop descriptor increments in this run were 64 and 32 bytes respectively. The existing stream harness disables the debug layer. ```powershell cmake --build --preset release --target startup_stream_consumer ctest --preset release --no-tests=error -R '^startup_(copied_vertex_srv|address_buffer_srv|frame_copy)_(warp|hardware)$' -V ```
tedin7 commented 2026-11-26 03:31:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:31:53Z.

Review: COMMENTED


Review of head 3bffb4cb (code + fixture test only, no executable claims).

Checked:

  • draw_copied_vertex_buffer_srv: full and short raw views of one buffer, copied (op 24) into slot 0 from slots 1 and 2, destination bytes compared with source via memcmp. Return codes 54/55 give distinct failures.
  • Vertex shader reads words at byte 224 and 288 (either side of 256); expected bands full/short/full (57,181 / 57,0 / 57,181) distinguish a stale 256-byte view from the full one.
  • New env switch in startup_stream_draw.cpp and add_test in CMakeLists.txt follow the sibling startup_address_buffer_srv_* pattern (WARP + hardware, SKIP 77, TIMEOUT 90). draw_texture gained an optional vertex_hlsl without changing existing callers.
  • No other open or merged PR covers this slice (searched open+merged).

Commands run (Linux): git diff --check origin/main...HEAD, python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py (all clean). The new check needs the Windows consumer binary, so the draw itself is covered by the Win2025 run that follows.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068185749 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2720#pullrequestreview-6068185749). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:31:53Z. **Review:** COMMENTED --- Review of head 3bffb4cb (code + fixture test only, no executable claims). Checked: - `draw_copied_vertex_buffer_srv`: full and short raw views of one buffer, copied (op 24) into slot 0 from slots 1 and 2, destination bytes compared with source via memcmp. Return codes 54/55 give distinct failures. - Vertex shader reads words at byte 224 and 288 (either side of 256); expected bands full/short/full (57,181 / 57,0 / 57,181) distinguish a stale 256-byte view from the full one. - New env switch in `startup_stream_draw.cpp` and `add_test` in `CMakeLists.txt` follow the sibling `startup_address_buffer_srv_*` pattern (WARP + hardware, SKIP 77, TIMEOUT 90). `draw_texture` gained an optional `vertex_hlsl` without changing existing callers. - No other open or merged PR covers this slice (searched open+merged). Commands run (Linux): `git diff --check origin/main...HEAD`, `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py` (all clean). The new check needs the Windows consumer binary, so the draw itself is covered by the Win2025 run that follows. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 04:04:32 +00:00
tedin7 commented 2026-11-26 04:04:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:38:48Z.


Win2025 WARP receipt for head ee19cb84 after updating with main.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit ee19cb84ad6def5f74eb91daedffb10fd8bb0712:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target startup_stream_consumer -- -j 2): 133.72s (configure 3.92s)
    • Test (ctest --preset dev -R '^startup_(copied_vertex_srv|address_buffer_srv|frame_copy)_warp$' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (2.39s: startup_address_buffer_srv_warp 1.03s, startup_frame_copy_warp 1.88s, startup_copied_vertex_srv_warp 1.09s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target startup_stream_consumer -- -j 2): 239.38s (configure 4.31s)
    • Test (ctest --preset release -R '^startup_(copied_vertex_srv|address_buffer_srv|frame_copy)_warp$' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (2.36s: startup_address_buffer_srv_warp 1.00s, startup_frame_copy_warp 2.04s, startup_copied_vertex_srv_warp 1.10s)
  • sccache: 22/49 hits; wall 391.6s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181900536 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2720#issuecomment-7181900536). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:38:48Z. --- Win2025 WARP receipt for head ee19cb84 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `ee19cb84ad6def5f74eb91daedffb10fd8bb0712`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target startup_stream_consumer -- -j 2`): `133.72s` (configure `3.92s`) - Test (`ctest --preset dev -R '^startup_(copied_vertex_srv|address_buffer_srv|frame_copy)_warp$' --parallel 2 --no-tests=error --output-on-failure`): **3/3 passed** (`2.39s`: `startup_address_buffer_srv_warp` `1.03s`, `startup_frame_copy_warp` `1.88s`, `startup_copied_vertex_srv_warp` `1.09s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target startup_stream_consumer -- -j 2`): `239.38s` (configure `4.31s`) - Test (`ctest --preset release -R '^startup_(copied_vertex_srv|address_buffer_srv|frame_copy)_warp$' --parallel 2 --no-tests=error --output-on-failure`): **3/3 passed** (`2.36s`: `startup_address_buffer_srv_warp` `1.00s`, `startup_frame_copy_warp` `2.04s`, `startup_copied_vertex_srv_warp` `1.10s`) - `sccache`: 22/49 hits; wall `391.6s` 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!2712
No description provided.