runtime: add title buffer window fixture #1177

Merged
lambirou merged 1 commit from upstream-pr/1184 into main 2026-11-24 03:35:21 +00:00
lambirou commented 2026-11-24 02:56:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T02:56:37Z.


Change

Add a title-buffer window fixture for console/UMA aliasing.

  • The fixture allocates 256 KiB of GPU-visible memory through era_heap, opens it with
    era_gpu_alias::open and covers it with an era_title_va::Table range.
  • It checks pages 0–2 and a 0x1e000-byte range at unaligned offset 0x11234, which spans
    pages 1 and 2. For every address, the low 16 CPU/GPU bits and the window-relative offset match,
    and the GPU address returns to the same CPU address. Absolute bases differ, so this is the
    desktop alias policy rather than numeric VA identity or a console MMU claim.
  • Both directions are byte-exact: CPU write → GPU copy → readback, and CPU upload → GPU copy into
    the window → title-pointer read. All bytes and 64 guard bytes on each side are compared.
  • Negative controls leave a sentinel readback unchanged: outside-window address E_BOUNDS,
    misaligned page E_INVALIDARG, reserve-only page ERROR_INVALID_ADDRESS, and opening a
    reserve-only page returns E_INVALIDARG with an empty alias.

Verification

  • cmake --build --preset dev --target offscreen_check passed.
  • ctest --preset dev --no-tests=error -R '^gpu_alias_window_' -V
    • WARP: passed, Microsoft Basic Render Driver 1414/008c, driver 10.0.26100.10068,
      relative_identity=yes roundtrip=yes negative_readback=unchanged mismatches=0.
    • Hardware: skip 77 because no physical adapter was visible in this run.
  • The broader gpu_alias|era_|xmem_|vm_translation run passed 60/60 with five hardware skips.
  • docs_links_check.py: Self-test passed., Checked 15 Markdown files and 263 links..
  • git diff --check origin/main...HEAD: clean.
  • Not run: hardware window validation, release preset, full CTest and console hardware.

Evidence and follow-up

  • Branch d3d12x/console-buffers, head 9b6d9da, based on 0ec94d5b (contains XCL-08/09).
  • The fixture validates the existing era_heap/era_gpu_alias/era_title_va policy;
    TitleWindow is source-owned test validation, not a new runtime API. No console MMU or
    production interface is claimed.
  • Public evidence: Microsoft OpenExistingHeapFromAddress, D3D12 buffers/copies and the
    Windows SDK d3d12.h; resources are synthetic and source-built.
  • docs/experiments.md records the window shape and negative controls; the capability matrix
    row is updated.
  • No XCL code, table or output; no game files, dumps, shader bytes or title paths.

Checklist

  • One reviewable behavior: CPU/GPU window identity and byte-exact round-trip.
  • Positive WARP and four named negative controls; hardware skip reported separately.
  • Documentation and capability matrix updated.
  • No game files, dumps, logs or secrets.
  • Provenance checked; no XCL code used.
  • AI-assisted (Codex).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6573579841 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1184). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-24T02:56:37Z. --- ## Change Add a title-buffer window fixture for console/UMA aliasing. - The fixture allocates 256 KiB of GPU-visible memory through `era_heap`, opens it with `era_gpu_alias::open` and covers it with an `era_title_va::Table` range. - It checks pages 0–2 and a `0x1e000`-byte range at unaligned offset `0x11234`, which spans pages 1 and 2. For every address, the low 16 CPU/GPU bits and the window-relative offset match, and the GPU address returns to the same CPU address. Absolute bases differ, so this is the desktop alias policy rather than numeric VA identity or a console MMU claim. - Both directions are byte-exact: CPU write → GPU copy → readback, and CPU upload → GPU copy into the window → title-pointer read. All bytes and 64 guard bytes on each side are compared. - Negative controls leave a sentinel readback unchanged: outside-window address `E_BOUNDS`, misaligned page `E_INVALIDARG`, reserve-only page `ERROR_INVALID_ADDRESS`, and opening a reserve-only page returns `E_INVALIDARG` with an empty alias. ## Verification - `cmake --build --preset dev --target offscreen_check` passed. - `ctest --preset dev --no-tests=error -R '^gpu_alias_window_' -V` - WARP: passed, Microsoft Basic Render Driver 1414/008c, driver 10.0.26100.10068, `relative_identity=yes roundtrip=yes negative_readback=unchanged mismatches=0`. - Hardware: skip 77 because no physical adapter was visible in this run. - The broader `gpu_alias|era_|xmem_|vm_translation` run passed 60/60 with five hardware skips. - `docs_links_check.py`: `Self-test passed.`, `Checked 15 Markdown files and 263 links.`. - `git diff --check origin/main...HEAD`: clean. - Not run: hardware window validation, release preset, full CTest and console hardware. ## Evidence and follow-up - Branch `d3d12x/console-buffers`, head `9b6d9da`, based on `0ec94d5b` (contains XCL-08/09). - The fixture validates the existing `era_heap`/`era_gpu_alias`/`era_title_va` policy; `TitleWindow` is source-owned test validation, not a new runtime API. No console MMU or production interface is claimed. - Public evidence: Microsoft `OpenExistingHeapFromAddress`, D3D12 buffers/copies and the Windows SDK `d3d12.h`; resources are synthetic and source-built. - `docs/experiments.md` records the window shape and negative controls; the capability matrix row is updated. - No XCL code, table or output; no game files, dumps, shader bytes or title paths. ## Checklist - [x] One reviewable behavior: CPU/GPU window identity and byte-exact round-trip. - [x] Positive WARP and four named negative controls; hardware skip reported separately. - [x] Documentation and capability matrix updated. - [x] No game files, dumps, logs or secrets. - [x] Provenance checked; no XCL code used. - [x] AI-assisted (Codex).
upstream-sync closed this pull request 2026-11-24 06:46:45 +00:00
tedin7 commented 2026-11-24 06:46:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:03:57Z.

Review: COMMENTED


Technical review on Linux (Windows build and D3D12/WARP/hardware tests were not executed locally).

Checks run (Linux, commit 9b6d9dad)

  • python3 -B tests/docs_links_check.py: passed (Checked 15 Markdown files and 263 links.).
  • python3 -B tests/bidi_controls_check.py: passed (Checked 967 tracked source, script and build/CI files: no bidirectional controls.).
  • python3 -B tests/gpu_report_format_check.py: Ran 10 tests in 0.004s — OK.
  • python3 -B tests/hardware_reports_check.py: Ran 11 tests in 0.037s — OK.
  • python3 tests/rdna2_tools_check.py: Ran 111 tests ... — OK (skipped=11) (without LLVM_LIB).

Audit

  • AGENTS.md / documentation: Title-neutral throughout; docs/experiments.md and docs/xcl-capability-matrix.md are updated with the window shape, negative controls, and desktop-alias boundary.
  • C++/D3D12 (tests/gpu_alias_window.cpp, tests/offscreen_check.cpp):
    • TitleAllocation and ReservedRange RAII wrappers release era_heap and VirtualAlloc memory; ComPtr and D3D12_RANGE Map/Unmap calls are balanced.
    • Both copy directions check all 0x1e000 bytes at unaligned offset 0x11234 (spanning pages 1 and 2) plus 64 guard bytes on each side.
    • Negative controls verify E_BOUNDS (outside window), E_INVALIDARG (unaligned page run), ERROR_INVALID_ADDRESS (uncommitted page via VirtualQuery), E_INVALIDARG + empty alias on era_gpu_alias::open of a reserve-only page, and an unchanged 64-byte sentinel readback. E_NOTIMPL maps to capability skip (77).

No blocking issues found in static inspection.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6033053841 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1184#pullrequestreview-6033053841). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T03:03:57Z. **Review:** COMMENTED --- Technical review on Linux (Windows build and D3D12/WARP/hardware tests were **not** executed locally). ### Checks run (Linux, commit `9b6d9dad`) - `python3 -B tests/docs_links_check.py`: passed (`Checked 15 Markdown files and 263 links.`). - `python3 -B tests/bidi_controls_check.py`: passed (`Checked 967 tracked source, script and build/CI files: no bidirectional controls.`). - `python3 -B tests/gpu_report_format_check.py`: `Ran 10 tests in 0.004s — OK`. - `python3 -B tests/hardware_reports_check.py`: `Ran 11 tests in 0.037s — OK`. - `python3 tests/rdna2_tools_check.py`: `Ran 111 tests ... — OK (skipped=11)` (without `LLVM_LIB`). ### Audit - **AGENTS.md / documentation**: Title-neutral throughout; `docs/experiments.md` and `docs/xcl-capability-matrix.md` are updated with the window shape, negative controls, and desktop-alias boundary. - **C++/D3D12 (`tests/gpu_alias_window.cpp`, `tests/offscreen_check.cpp`)**: - `TitleAllocation` and `ReservedRange` RAII wrappers release `era_heap` and `VirtualAlloc` memory; `ComPtr` and `D3D12_RANGE` `Map`/`Unmap` calls are balanced. - Both copy directions check all `0x1e000` bytes at unaligned offset `0x11234` (spanning pages 1 and 2) plus 64 guard bytes on each side. - Negative controls verify `E_BOUNDS` (outside window), `E_INVALIDARG` (unaligned page run), `ERROR_INVALID_ADDRESS` (uncommitted page via `VirtualQuery`), `E_INVALIDARG` + empty alias on `era_gpu_alias::open` of a reserve-only page, and an unchanged 64-byte sentinel readback. `E_NOTIMPL` maps to capability skip (77). No blocking issues found in static inspection.
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!1177
No description provided.