gpu: check live aliases with colliding low 40 address bits #1305

Manually merged
github merged 1 commit from gh-pr/1305/head into gh-pr/1305/base 2026-11-26 22:56:35 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 07:23 UTC · original
R0Y00:codex/gpu-va-high-bits → main · +73 −10 · 2 files · 1 commits · merged 2026-11-24 07:28 UTC

Refs #874. This extends the source-built GPU address regression for contributors working on guest address translation.

Two independently backed 256 KiB GPU buffers receive synthetic guest addresses differing only in bit 40. A dispatch writes 4,096 transformed words to the high range. A second launch deliberately clears bit 40 and writes the low range. Each launch checks both CPU-visible buffers and the guards. Removing the high range must preserve the low mapping.

Ran on Windows 11 build 26200.9974 at 6b8b7fa9 with the debug layer enabled. RTX 4060 Laptop driver 32.0.16.1656 and WARP 10.0.26100.9818 both passed with zero debug errors and warnings. Two passed, zero failed, zero skipped.

cmake --build --preset release --target offscreen_check
ctest --preset release --no-tests=error -R '^gpu_alias_(warp|hardware)$' -V

The guest addresses are synthetic. This test checks two separately backed D3D12 buffers and the address table, and makes no inference about address-space placement in other programs.

**@⁠R0Y00** on GitHub · 2026-11-24 07:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1305) `R0Y00:codex/gpu-va-high-bits` → `main` · +73 −10 · 2 files · 1 commits · merged 2026-11-24 07:28 UTC Refs #874. This extends the source-built GPU address regression for contributors working on guest address translation. Two independently backed 256 KiB GPU buffers receive synthetic guest addresses differing only in bit 40. A dispatch writes 4,096 transformed words to the high range. A second launch deliberately clears bit 40 and writes the low range. Each launch checks both CPU-visible buffers and the guards. Removing the high range must preserve the low mapping. Ran on Windows 11 build 26200.9974 at `6b8b7fa9` with the debug layer enabled. RTX 4060 Laptop driver 32.0.16.1656 and WARP 10.0.26100.9818 both passed with zero debug errors and warnings. Two passed, zero failed, zero skipped. ```powershell cmake --build --preset release --target offscreen_check ctest --preset release --no-tests=error -R '^gpu_alias_(warp|hardware)$' -V ``` The guest addresses are synthetic. This test checks two separately backed D3D12 buffers and the address table, and makes no inference about address-space placement in other programs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:56:32 +00:00
github manually merged commit 6b8b7fa95e into gh-pr/1305/base 2026-11-26 22:56:35 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 07:27 UTC · original · reviewed

Dual-platform review at commit 6b8b7fa95e890c2690689158c1ebe84f1ad1480e:

Verification

  • Linux:
    • git diff --check origin/main...HEAD: clean (exit 0)
    • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (16 Markdown files, 289 links)
    • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (1086 tracked files)
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev):
      • cmake --build --preset dev --target offscreen_check -- -j 6 (4.78s)
      • ctest --preset dev -R '^gpu_alias(_.*)?_warp$' --parallel 4 --no-tests=error --output-on-failure: 5/5 passed (0.16s: gpu_alias_warp, gpu_alias_window_warp, gpu_alias_lookup_warp, gpu_alias_lookup_writes_warp, gpu_alias_registry_warp)
    • Release /O2 (--preset release):
      • cmake --build --preset release --target offscreen_check -- -j 6 (2.25s)
      • ctest --preset release -R '^gpu_alias(_.*)?_warp$' --parallel 4 --no-tests=error --output-on-failure: 5/5 passed (0.16s: gpu_alias_warp, gpu_alias_window_warp, gpu_alias_lookup_warp, gpu_alias_lookup_writes_warp, gpu_alias_registry_warp)

Code Review Notes

  • tests/gpu_alias.cpp: Extracting dispatch(...) cleanly deduplicates the compute submission path, and if (dst_buffer != src_buffer) avoids redundant UAV/COMMON transitions when reading and writing the same alias.
  • check_address_width: Declares TitleAllocation high before era_gpu_alias::Alias high_alias, so RAII destruction releases the D3D12 resource/heap before releasing the underlying title allocation.
  • Synthetic colliding guest addresses (0x20000000 vs (1ull << 40) | 0x20000000), guard words (low_dst[-1], high_dst[-1], and count..count+guard_words-1), untouched-buffer assertions, and table.remove(high_address) isolation are all sound.
  • docs/experiments.md: Accurately documents the new bit-40 collision check and ctest invocation.
**@⁠tedin7** on GitHub · 2026-11-24 07:27 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1305#pullrequestreview-6035250076) · **reviewed** Dual-platform review at commit `6b8b7fa95e890c2690689158c1ebe84f1ad1480e`: ### Verification - **Linux**: - `git diff --check origin/main...HEAD`: clean (exit 0) - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: passed (16 Markdown files, 289 links) - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: passed (1086 tracked files) - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: - `cmake --build --preset dev --target offscreen_check -- -j 6` (`4.78s`) - `ctest --preset dev -R '^gpu_alias(_.*)?_warp$' --parallel 4 --no-tests=error --output-on-failure`: **5/5 passed** (`0.16s`: `gpu_alias_warp`, `gpu_alias_window_warp`, `gpu_alias_lookup_warp`, `gpu_alias_lookup_writes_warp`, `gpu_alias_registry_warp`) - **Release `/O2` (`--preset release`)**: - `cmake --build --preset release --target offscreen_check -- -j 6` (`2.25s`) - `ctest --preset release -R '^gpu_alias(_.*)?_warp$' --parallel 4 --no-tests=error --output-on-failure`: **5/5 passed** (`0.16s`: `gpu_alias_warp`, `gpu_alias_window_warp`, `gpu_alias_lookup_warp`, `gpu_alias_lookup_writes_warp`, `gpu_alias_registry_warp`) ### Code Review Notes - `tests/gpu_alias.cpp`: Extracting `dispatch(...)` cleanly deduplicates the compute submission path, and `if (dst_buffer != src_buffer)` avoids redundant UAV/COMMON transitions when reading and writing the same alias. - `check_address_width`: Declares `TitleAllocation high` before `era_gpu_alias::Alias high_alias`, so RAII destruction releases the D3D12 resource/heap before releasing the underlying title allocation. - Synthetic colliding guest addresses (`0x20000000` vs `(1ull << 40) | 0x20000000`), guard words (`low_dst[-1]`, `high_dst[-1]`, and `count..count+guard_words-1`), untouched-buffer assertions, and `table.remove(high_address)` isolation are all sound. - `docs/experiments.md`: Accurately documents the new bit-40 collision check and ctest invocation.
This discussion has been locked. Commenting is limited to contributors.
No description provided.