startup: translate slot 86 graphics streams and verify draw pixels #1167

Merged
R0Y00 merged 3 commits from upstream-pr/1174 into main 2026-11-24 04:14:52 +00:00
R0Y00 commented 2026-11-24 02:28:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T02:28:02Z.


Refs #1142, #1137. Depends on #1135. This PR targets the temporary review base at 5691fe81 so reviewers see only the stream work. After #1135 lands, rebase this topic onto main and retarget the PR before merging.

Slot 86 now reads the wrapped root and VS/PS bytecode while the caller owns the stream, checks each subobject extent, and publishes the three blobs in a deterministic order. The offline translator opens each bounded native program and checks its export against the declared stage. Cache hits are used by the existing translated draw path.

The source-built consumer submits a reverse-order stream, verifies the cache files, records a translated draw, submits the wrapped list and waits for its fence. A separate desktop queue reads back an 8×4 target. Red and green shaders each produce the expected 16 colored pixels and 16 blue background pixels on both backends. Swapping the shader changes exactly the 16 covered pixels. A truncated stream emits no request and swapped stage containers fail translation. The post-intro black screen remains under investigation in #1137.

Tested 6eb927e on Windows build 26200, release MSVC 19.51, with the debug layer off. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 both passed. A fresh CMake directory picked up the default in-tree fixture interpreter without a cache override. All three tests passed, zero skips.

python -m venv out/pe-env
.\tools\dev.ps1
cmake --preset release -B out/build/first-1142
cmake --build out/build/first-1142 --target startup_stream_consumer
ctest --test-dir out/build/first-1142 --no-tests=error -R '^startup_stream_(request|draw)_' --output-on-failure
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6573243194 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1174). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T02:28:02Z. --- Refs #1142, #1137. Depends on #1135. This PR targets the temporary review base at `5691fe81` so reviewers see only the stream work. After #1135 lands, rebase this topic onto `main` and retarget the PR before merging. Slot 86 now reads the wrapped root and VS/PS bytecode while the caller owns the stream, checks each subobject extent, and publishes the three blobs in a deterministic order. The offline translator opens each bounded native program and checks its export against the declared stage. Cache hits are used by the existing translated draw path. The source-built consumer submits a reverse-order stream, verifies the cache files, records a translated draw, submits the wrapped list and waits for its fence. A separate desktop queue reads back an 8×4 target. Red and green shaders each produce the expected 16 colored pixels and 16 blue background pixels on both backends. Swapping the shader changes exactly the 16 covered pixels. A truncated stream emits no request and swapped stage containers fail translation. The post-intro black screen remains under investigation in #1137. Tested `6eb927e` on Windows build 26200, release MSVC 19.51, with the debug layer off. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 both passed. A fresh CMake directory picked up the default in-tree fixture interpreter without a cache override. All three tests passed, zero skips. ```powershell python -m venv out/pe-env .\tools\dev.ps1 cmake --preset release -B out/build/first-1142 cmake --build out/build/first-1142 --target startup_stream_consumer ctest --test-dir out/build/first-1142 --no-tests=error -R '^startup_stream_(request|draw)_' --output-on-failure ```
tedin7 commented 2026-11-24 02:40:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:40:16Z.

Review: COMMENTED


Reviewed at commit 6eb927e64525d387338f7acf99c6372dd9dc3e24.

  • Code notes: stream_translation in src/startup_stubs/d3d12_draw.inl validates stream bounds/alignment, subobject sizes/uniqueness, DXBC headers, and wrapped root blobs before sharing cached_translation with path 57; build_stream_pipeline also gains subobject bounds checks via shared stream_sizes. tools/startup/gfx2hlsl.py extracts DXIL containers in canonical (VS, PS) order and verifies stage/export agreement via classify.
  • Linux checks passed:
    • python3 tests/docs_links_check.py (253 links across 16 Markdown files)
    • python3 tests/bidi_controls_check.py (969 files)
    • python3 tests/gpu_report_format_check.py (10 tests)
    • python3 tests/xgameruntime_table_check.py
    • python3 -m py_compile tools/startup/gfx2hlsl.py tests/startup_stream_check.py tests/startup_stream_draw_check.py
    • python3 tests/pixel_aot_check.py
  • Not run on Linux: Windows MSVC build and startup_stream_request_warp / startup_stream_draw_{warp,hardware} CTest runs (no CI checks reported on this branch yet; those rely on Windows/CI).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6032871197 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1174#pullrequestreview-6032871197). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T02:40:16Z. **Review:** COMMENTED --- Reviewed at commit `6eb927e64525d387338f7acf99c6372dd9dc3e24`. - **Code notes**: `stream_translation` in `src/startup_stubs/d3d12_draw.inl` validates stream bounds/alignment, subobject sizes/uniqueness, DXBC headers, and wrapped root blobs before sharing `cached_translation` with path 57; `build_stream_pipeline` also gains subobject bounds checks via shared `stream_sizes`. `tools/startup/gfx2hlsl.py` extracts `DXIL` containers in canonical `(VS, PS)` order and verifies stage/export agreement via `classify`. - **Linux checks passed**: - `python3 tests/docs_links_check.py` (253 links across 16 Markdown files) - `python3 tests/bidi_controls_check.py` (969 files) - `python3 tests/gpu_report_format_check.py` (10 tests) - `python3 tests/xgameruntime_table_check.py` - `python3 -m py_compile tools/startup/gfx2hlsl.py tests/startup_stream_check.py tests/startup_stream_draw_check.py` - `python3 tests/pixel_aot_check.py` - **Not run on Linux**: Windows MSVC build and `startup_stream_request_warp` / `startup_stream_draw_{warp,hardware}` CTest runs (no CI checks reported on this branch yet; those rely on Windows/CI).
tedin7 commented 2026-11-24 04:21:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T04:21:42Z.

Review: COMMENTED


Retested delta 6eb927e6..6e07b1bf (head 6e07b1bf).

Delta audit (6eb927e6..6e07b1bf)

  • 81c377e5 merges main; f38599ca and 2f1fc946 carry the slot 86 stream translation, draw verification (tests/startup_stream_draw.cpp, tests/startup_stream_draw_check.py), and stream D3D12_BLEND_DESC subobject extraction (at + sizeof(type) = +4, matching stream_sizes[8] == 336).
  • 6e07b1bf moves find_program(STARTUP_FXC fxc) and startup_stream_request_warp / startup_stream_draw_{warp,hardware} CTest registrations inside if(EXISTS "${INTAKE_PYTHON}") in CMakeLists.txt so ${INTAKE_PYTHON} is resolved before use.
  • Diff is clean and title-neutral.

Checks run on Linux (6e07b1bf)

  • /root/.local/share/x2w-rev-venv/bin/python -B -m py_compile tools/startup/gfx2hlsl.py tests/startup_stream_check.py tests/startup_stream_draw_check.py: PASS.
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/rdna2_tools_check.py (pure-Python mode): PASS (128 tests: 113 passed, 15 skipped, 0 failed).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: PASS (16 Markdown files, 274 links).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: PASS (1022 files).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/form_coverage_check.py: PASS.
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/xgameruntime_table_check.py: PASS (28 exports).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/gpu_report_format_check.py: PASS (10/10).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/hardware_reports_check.py: PASS (11/11).

Note: Windows MSVC/D3D12 build and startup_stream_request_warp / startup_stream_draw_{warp,hardware} were not executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6033607985 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1174#pullrequestreview-6033607985). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T04:21:42Z. **Review:** COMMENTED --- Retested delta `6eb927e6..6e07b1bf` (head `6e07b1bf`). ### Delta audit (`6eb927e6..6e07b1bf`) - `81c377e5` merges `main`; `f38599ca` and `2f1fc946` carry the slot 86 stream translation, draw verification (`tests/startup_stream_draw.cpp`, `tests/startup_stream_draw_check.py`), and stream `D3D12_BLEND_DESC` subobject extraction (`at + sizeof(type)` = `+4`, matching `stream_sizes[8] == 336`). - `6e07b1bf` moves `find_program(STARTUP_FXC fxc)` and `startup_stream_request_warp` / `startup_stream_draw_{warp,hardware}` CTest registrations inside `if(EXISTS "${INTAKE_PYTHON}")` in `CMakeLists.txt` so `${INTAKE_PYTHON}` is resolved before use. - Diff is clean and title-neutral. ### Checks run on Linux (`6e07b1bf`) - `/root/.local/share/x2w-rev-venv/bin/python -B -m py_compile tools/startup/gfx2hlsl.py tests/startup_stream_check.py tests/startup_stream_draw_check.py`: **PASS**. - `/root/.local/share/x2w-rev-venv/bin/python -B tests/rdna2_tools_check.py` (pure-Python mode): **PASS** (128 tests: 113 passed, 15 skipped, 0 failed). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: **PASS** (16 Markdown files, 274 links). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: **PASS** (1022 files). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/form_coverage_check.py`: **PASS**. - `/root/.local/share/x2w-rev-venv/bin/python -B tests/xgameruntime_table_check.py`: **PASS** (28 exports). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/gpu_report_format_check.py`: **PASS** (10/10). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/hardware_reports_check.py`: **PASS** (11/11). Note: Windows MSVC/D3D12 build and `startup_stream_request_warp` / `startup_stream_draw_{warp,hardware}` were **not** executed locally.
upstream-sync closed this pull request 2026-11-24 06:46:41 +00:00
denn0x commented 2026-11-24 06:50:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T03:30:33Z.


Test report for 6eb927e6: Windows 11 Pro 26300, MSVC 14.50 (VS 18 Build Tools), Ninja, Release, debug layer off.

  • cmake --build out/build/release: built with no errors or failures.
  • ctest --no-tests=error -R startup: 8/8 passed, 0 failed, no skips.

Not tested yet: a run with the console executable. Runs on this machine currently run out of system commit before the menus (#1199). I will add the executable result here once that is resolved.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121164332 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1174#issuecomment-7121164332). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T03:30:33Z. --- Test report for `6eb927e6`: Windows 11 Pro 26300, MSVC 14.50 (VS 18 Build Tools), Ninja, Release, debug layer off. - `cmake --build out/build/release`: built with no errors or failures. - `ctest --no-tests=error -R startup`: 8/8 passed, 0 failed, no skips. Not tested yet: a run with the console executable. Runs on this machine currently run out of system commit before the menus (#1199). I will add the executable result here once that is resolved. AI-assisted (Claude Code).
lambirou commented 2026-11-24 06:50:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T04:23:40Z.


Independent retarget check: the #1174 diff applies cleanly to main at b5cb8800 in a fresh worktree. The worktree builds in Release with Windows 10.0.26300.10075 and MSVC 19.44.35228.0.

ctest --preset release --no-tests=error -R '^startup_stream_' -V

  • startup_stream_request_warp: passed. Stage order, compiled VS/PS, truncated and swapped controls pass.
  • startup_stream_draw_warp: passed on WARP (Microsoft Basic Render Driver). Red and green draws matched 32 RGBA pixels each; the swapped shader differed at 16 of 32.
  • startup_stream_draw_hardware: passed on AMD Radeon RX 9060 XT 32.0.32029.2010 with the same results.
  • 3/3 passed, 0 failed, 0 skips.

The PR still targets codex/pr1135-review-base (5691fe81), so it has no CI against main. Please retarget/rebase it to main; the local apply was clean. Note that #1177 touches the same four files (CMakeLists.txt, docs/startup-runtime.md, d3d12_draw.inl, d3d12_xs_device.cpp), so merge one and rebase the other.

No game files, dumps or private logs were used. AI-assisted (Codex).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121977837 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1174#issuecomment-7121977837). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-24T04:23:40Z. --- Independent retarget check: the #1174 diff applies cleanly to `main` at `b5cb8800` in a fresh worktree. The worktree builds in Release with Windows 10.0.26300.10075 and MSVC 19.44.35228.0. `ctest --preset release --no-tests=error -R '^startup_stream_' -V` - `startup_stream_request_warp`: passed. Stage order, compiled VS/PS, truncated and swapped controls pass. - `startup_stream_draw_warp`: passed on WARP (Microsoft Basic Render Driver). Red and green draws matched 32 RGBA pixels each; the swapped shader differed at 16 of 32. - `startup_stream_draw_hardware`: passed on AMD Radeon RX 9060 XT 32.0.32029.2010 with the same results. - 3/3 passed, 0 failed, 0 skips. The PR still targets `codex/pr1135-review-base` (`5691fe81`), so it has no CI against `main`. Please retarget/rebase it to `main`; the local apply was clean. Note that #1177 touches the same four files (`CMakeLists.txt`, `docs/startup-runtime.md`, `d3d12_draw.inl`, `d3d12_xs_device.cpp`), so merge one and rebase the other. No game files, dumps or private logs were used. AI-assisted (Codex).
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!1167
No description provided.