startup: experimental runtime stand-ins for console executables #1128

Merged
denn0x merged 4 commits from upstream-pr/1135 into main 2026-11-24 03:30:59 +00:00
denn0x commented 2026-11-24 01:45:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T01:45:14Z.


Change

Adds experimental, opt-in desktop stand-ins under src/startup_stubs/ and a debugger launcher under
tools/startup/. With them, an x64 console executable can start on desktop Windows under a debugger, so its
startup path can be studied one missing piece at a time. Nothing changes unless the X2W_*_PERMISSIVE /
feature switches are set; without them, every unimplemented export traps with a named exit code.

This is not a port and does not make any executable playable. docs/startup-runtime.md describes the build,
run, switches and findings, and the shortcuts that are known to be wrong. A README row was added under
"Choose an experiment".

What it adds:

  • xmem: permissive reservation and mapping shapes; X2W_XMEM_GPU_MIRROR pairs a no-access graphics
    reservation with the read-write reservation before it and maps each page's section into both views.
  • D3D12 device stand-in: command-list recording, console present, view tracking, and an optional render
    path through translated pipelines (X2W_D3D12_RENDER, X2W_SHADER_CACHE).
  • DirectStorage: a per-queue worker that runs requests after Submit, in order with status and fence entries.
    Page-array entries that are 0 at enqueue are re-read at run time. zlib is inflated on the CPU; BCPack is
    zero-filled (shortcut).
  • XG, audio HAL/APU, GameInput (virtual pad, keyboard, XInput) and a gaming-runtime proxy: these log every
    call. The proxy answers the user and gamertag interfaces and the save API for one local user.
  • tools/startup/gfx2hlsl.py: a translator for pipeline requests, with constant-folded s_bfm_b32 inline
    samplers and 3D image resources.
  • tests/startup_stub_check.py (ctest startup_stubs): checks the stand-ins' exports, traps and permissive
    answers with a source-built consumer. No executable is needed.

Overlap with main: the trap entries for XMemTransferMemory / D3D12ConfigureVirtualMemoryX were dropped,
because main now implements them. d3d12_xs_shim gains the stand-in device source.

Open problems are split into issues that can be picked up independently (listed below).

Verification

Commit e658fe24 on top of main a7710b73. Built with a release configuration (MSVC 14.50, Windows SDK 10.0.26100.0,
Ninja, Python from requirements-dev.txt). Environment: AMD Radeon RX 9070 XT, driver 32.0.32015.7029,
Windows 11 build 26300, D3D12 debug layer off.

cmake --preset release
cmake --build --preset release
ctest --preset release --no-tests=error -R '^startup_stubs$' -V
ctest --preset release --no-tests=error -R 'xmem|era_|startup'
ctest --preset release --no-tests=error
  • startup_stubs: pass.
  • xmem|era_|startup: 43/43 pass. This includes cpu_native_xmem_default_pair; the stand-ins' switch reader
    now preserves the last-error value.
  • Full suite, failures. None of them loads a file this change touches; I did not re-run them on main:
    • dxr_opacity_hardware, gpu_alias_lookup_writes_hardware and pixel_aot_comparisons_hardware
      (offscreen_check, which links only the system D3D12; adapter-specific);
    • pe_package_import_closure (WinError 1314: the symlink privilege is missing).
  • Full suite, skips (77 / capability): xg_swizzle*, bvh_wave64_warp, wave_shuffle_warp, spirv_* and
    bc7_mode6_multiblock.

End-to-end check (local, no files from it are included): I ran tools/startup/run.ps1 -Render -FakeUser -GpuMirror -ContinueAsserts 5000 -Seconds 150 on one console executable in offline mode, where 4 network opens were refused.

  • The run reached the 150 s timeout without an unhandled exception, presenting at about 29 fps.
  • 10 pipelines were translated.
  • About 8 500 DirectStorage requests completed; 37 zlib requests failed and 37 BCPack requests were blank (see the issues).
  • The intro video plays, with wrong colours.

Evidence and follow-up

All fixtures are source-built (tests/startup_stub_consumer.cpp, MIT). The findings in the doc are measured on one
executable and are stated as hypotheses for others. Open issues:

  • Refs #1136: startup-runtime: soft assert in a chunked streaming read
  • Refs #1137: startup-runtime: black screen after the intro video
  • Refs #1138: startup-runtime: video plays with wrong colours
  • Refs #1139: startup-runtime: decode BCPack DirectStorage requests instead of zero-filling
  • Refs #1140: startup-runtime: XG layout queries return desktop footprints
  • Refs #1141: startup-runtime: gfx2hlsl does not support VOP2 SDWA
  • Refs #1142: startup-runtime: no shader translation for stream pipelines
  • Refs #1143: startup-runtime: dynamically indexed sampler and resource heap loads
  • Refs #1144: startup-runtime: zlib DirectStorage requests larger than the destination fail
  • Refs #1145: startup-runtime: audio produces no output
  • Refs #1146: startup-runtime: texture uploads are CPU-side and slow; null bindings remain
  • Refs #1147: startup-runtime: a store API method returns E_FAIL
  • Refs #1148: tests: offscreen hardware tests fail on an RDNA4 adapter
  • Refs #1149: ci: build the startup stand-ins and run their checks in CI
  • Refs #1150: startup-runtime: menu text renders broken

Suggested repository changes (also filed as an issue):

  • run startup_stubs in the Windows CI job (no GPU or game files needed);
  • lint tools/startup/;
  • skip pe_package_import_closure when the symlink privilege is missing;
  • mark adapter-specific hardware tests;
  • add area labels;
  • keep a gfx1013 fixture for each translator feature.

Checklist

  • This pull request covers one reviewable behavior: the opt-in startup stand-ins and their launcher.
    It is large; I can split it per DLL if reviewers prefer.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture: trap exit codes, and permissive answers off by default.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572709513 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T01:45:14Z. --- ## Change Adds experimental, opt-in desktop stand-ins under `src/startup_stubs/` and a debugger launcher under `tools/startup/`. With them, an x64 console executable can start on desktop Windows under a debugger, so its startup path can be studied one missing piece at a time. Nothing changes unless the `X2W_*_PERMISSIVE` / feature switches are set; without them, every unimplemented export traps with a named exit code. This is not a port and does not make any executable playable. `docs/startup-runtime.md` describes the build, run, switches and findings, and the shortcuts that are known to be wrong. A README row was added under "Choose an experiment". What it adds: - **xmem:** permissive reservation and mapping shapes; `X2W_XMEM_GPU_MIRROR` pairs a no-access graphics reservation with the read-write reservation before it and maps each page's section into both views. - **D3D12 device stand-in:** command-list recording, console present, view tracking, and an optional render path through translated pipelines (`X2W_D3D12_RENDER`, `X2W_SHADER_CACHE`). - **DirectStorage:** a per-queue worker that runs requests after `Submit`, in order with status and fence entries. Page-array entries that are 0 at enqueue are re-read at run time. zlib is inflated on the CPU; BCPack is zero-filled (shortcut). - **XG, audio HAL/APU, GameInput (virtual pad, keyboard, XInput) and a gaming-runtime proxy:** these log every call. The proxy answers the user and gamertag interfaces and the save API for one local user. - **`tools/startup/gfx2hlsl.py`:** a translator for pipeline requests, with constant-folded `s_bfm_b32` inline samplers and 3D image resources. - **`tests/startup_stub_check.py`** (ctest `startup_stubs`): checks the stand-ins' exports, traps and permissive answers with a source-built consumer. No executable is needed. Overlap with `main`: the trap entries for `XMemTransferMemory` / `D3D12ConfigureVirtualMemoryX` were dropped, because `main` now implements them. `d3d12_xs_shim` gains the stand-in device source. Open problems are split into issues that can be picked up independently (listed below). ## Verification Commit e658fe24 on top of `main` a7710b73. Built with a release configuration (MSVC 14.50, Windows SDK 10.0.26100.0, Ninja, Python from `requirements-dev.txt`). Environment: AMD Radeon RX 9070 XT, driver 32.0.32015.7029, Windows 11 build 26300, D3D12 debug layer off. ```powershell cmake --preset release cmake --build --preset release ctest --preset release --no-tests=error -R '^startup_stubs$' -V ctest --preset release --no-tests=error -R 'xmem|era_|startup' ctest --preset release --no-tests=error ``` - `startup_stubs`: **pass**. - `xmem|era_|startup`: **43/43 pass**. This includes `cpu_native_xmem_default_pair`; the stand-ins' switch reader now preserves the last-error value. - Full suite, **failures**. None of them loads a file this change touches; I did not re-run them on `main`: - `dxr_opacity_hardware`, `gpu_alias_lookup_writes_hardware` and `pixel_aot_comparisons_hardware` (`offscreen_check`, which links only the system D3D12; adapter-specific); - `pe_package_import_closure` (WinError 1314: the symlink privilege is missing). - Full suite, **skips** (77 / capability): `xg_swizzle*`, `bvh_wave64_warp`, `wave_shuffle_warp`, `spirv_*` and `bc7_mode6_multiblock`. End-to-end check (local, no files from it are included): I ran `tools/startup/run.ps1 -Render -FakeUser -GpuMirror -ContinueAsserts 5000 -Seconds 150` on one console executable in offline mode, where 4 network opens were refused. - The run reached the 150 s timeout without an unhandled exception, presenting at about 29 fps. - 10 pipelines were translated. - About 8 500 DirectStorage requests completed; 37 zlib requests failed and 37 BCPack requests were blank (see the issues). - The intro video plays, with wrong colours. ## Evidence and follow-up All fixtures are source-built (`tests/startup_stub_consumer.cpp`, MIT). The findings in the doc are measured on one executable and are stated as hypotheses for others. Open issues: - Refs #1136: startup-runtime: soft assert in a chunked streaming read - Refs #1137: startup-runtime: black screen after the intro video - Refs #1138: startup-runtime: video plays with wrong colours - Refs #1139: startup-runtime: decode BCPack DirectStorage requests instead of zero-filling - Refs #1140: startup-runtime: XG layout queries return desktop footprints - Refs #1141: startup-runtime: gfx2hlsl does not support VOP2 SDWA - Refs #1142: startup-runtime: no shader translation for stream pipelines - Refs #1143: startup-runtime: dynamically indexed sampler and resource heap loads - Refs #1144: startup-runtime: zlib DirectStorage requests larger than the destination fail - Refs #1145: startup-runtime: audio produces no output - Refs #1146: startup-runtime: texture uploads are CPU-side and slow; null bindings remain - Refs #1147: startup-runtime: a store API method returns E_FAIL - Refs #1148: tests: offscreen hardware tests fail on an RDNA4 adapter - Refs #1149: ci: build the startup stand-ins and run their checks in CI - Refs #1150: startup-runtime: menu text renders broken Suggested repository changes (also filed as an issue): - run `startup_stubs` in the Windows CI job (no GPU or game files needed); - lint `tools/startup/`; - skip `pe_package_import_closure` when the symlink privilege is missing; - mark adapter-specific hardware tests; - add area labels; - keep a gfx1013 fixture for each translator feature. ## Checklist - [x] This pull request covers one reviewable behavior: the opt-in startup stand-ins and their launcher. It is large; I can split it per DLL if reviewers prefer. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture: trap exit codes, and permissive answers off by default. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-24 06:46:31 +00:00
tedin7 commented 2026-11-24 06:46:32 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed at e658fe24a0bf80adb6f5c62275945010a3538df3.

  • Diff structure & isolation: The experimental stand-ins are cleanly isolated behind opt-in switches (X2W_XMEM_PERMISSIVE, X2W_D3D12_PERMISSIVE, X2W_AUDIO_PERMISSIVE). Default behavior is preserved: d3d12_xs_XboxCreateDevice still returns E_INVALIDARG for non-null parameters without X2W_D3D12_PERMISSIVE, XMemAlloc only falls back to local_alloc when era_heap::allocate returns null with X2W_XMEM_PERMISSIVE, xmem_mapped_pages.cpp gates permissive paths on local_permissive(), and unimplemented stub exports trap with x2w-trap by default.
  • Docs & title-neutrality: docs/startup-runtime.md clearly documents the experimental scope, switches, findings, and known shortcuts in title-neutral terms.
  • Linux checks run: python3 -B tests/docs_links_check.py (16 files, 253 links), python3 -B tests/bidi_controls_check.py (965 files), python3 -B tests/gpu_report_format_check.py (10 tests), python3 -B tests/xgameruntime_table_check.py, and python3 -m py_compile tools/startup/*.py tests/startup_stub_check.py — all passed (startup_stub_check.py execution requires built Windows DLLs).
  • CI / Windows: Linux Python checks and Assemble and translate gfx1013 fixtures passed, while Build and test on Windows is currently FAILURE and Build and test on Windows at /O2 is IN_PROGRESS; Windows MSVC/DLL verification relies on CI.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6032634144 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#pullrequestreview-6032634144). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T02:15:46Z. **Review:** COMMENTED --- Reviewed at `e658fe24a0bf80adb6f5c62275945010a3538df3`. - **Diff structure & isolation**: The experimental stand-ins are cleanly isolated behind opt-in switches (`X2W_XMEM_PERMISSIVE`, `X2W_D3D12_PERMISSIVE`, `X2W_AUDIO_PERMISSIVE`). Default behavior is preserved: `d3d12_xs_XboxCreateDevice` still returns `E_INVALIDARG` for non-null parameters without `X2W_D3D12_PERMISSIVE`, `XMemAlloc` only falls back to `local_alloc` when `era_heap::allocate` returns null with `X2W_XMEM_PERMISSIVE`, `xmem_mapped_pages.cpp` gates permissive paths on `local_permissive()`, and unimplemented stub exports trap with `x2w-trap` by default. - **Docs & title-neutrality**: `docs/startup-runtime.md` clearly documents the experimental scope, switches, findings, and known shortcuts in title-neutral terms. - **Linux checks run**: `python3 -B tests/docs_links_check.py` (16 files, 253 links), `python3 -B tests/bidi_controls_check.py` (965 files), `python3 -B tests/gpu_report_format_check.py` (10 tests), `python3 -B tests/xgameruntime_table_check.py`, and `python3 -m py_compile tools/startup/*.py tests/startup_stub_check.py` — all passed (`startup_stub_check.py` execution requires built Windows DLLs). - **CI / Windows**: Linux Python checks and `Assemble and translate gfx1013 fixtures` passed, while `Build and test on Windows` is currently `FAILURE` and `Build and test on Windows at /O2` is `IN_PROGRESS`; Windows MSVC/DLL verification relies on CI.
rasptum commented 2026-11-24 06:50:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-24T02:04:49Z.


Verification on a second machine (NVIDIA, Windows 10). The source-built checks pass. The end-to-end run needed two changes to get past the first seconds here and then stops at a new fault; details and issues below.

Environment: commit e658fe24, release preset (Ninja, MSVC from the Visual Studio developer shell), NVIDIA GeForce RTX 3060, driver 32.0.15.9636, Windows 10 22H2 build 19045.6466, D3D12 debug layer off. Package on a slow volume (about 27 MB/s sequential).

Source-built checks (unmodified e658fe24)

cmake --preset release
cmake --build --preset release
ctest --preset release --no-tests=error -R '^startup_stubs$' -V
ctest --preset release --no-tests=error -R 'xmem|era_|startup'
  • startup_stubs: pass (all 8 stand-ins load with their exports; chad and xg_xs traps return their named exit codes; both controls exit 0).
  • xmem|era_|startup: 48/48 pass, no skips. (The PR reports 43; this build has the Python environment configured, which registers more tests.)
  • I did not run the full suite.

End-to-end, one console executable, offline (tools/startup/run.ps1 -Render -FakeUser -GpuMirror -ContinueAsserts 5000 -Seconds 240, package in a folder on another drive)

Run Change from e658fe24 Result
1 none stops at 0.51 s: package opens at the console's fixed drive letter return "not found" (that letter is another volume here), then an access violation in a C runtime fill. #1158
2 launcher maps the drive letter to the package folder stops at 6.53 s: the desktop CreateDescriptorHeap for a shader-visible view heap of 1,245,184 descriptors returns 0x8007000E on this adapter; the executable reads through the null result. #1159
3, 4 plus a 1,000,000-descriptor desktop heap fallback stop at 74.2 s and 75.1 s on the same instruction: a read at 0x68 through a null pointer inside the executable, right after a burst of user-interface runtime calls. #1160

Measured in runs 3 and 4 before the stop:

  • about 25 fps presented (995 frames in 40 s after the first present);
  • 3,220 DirectStorage requests completed, 0 failed, 0 BCPack-blank at that point;
  • 4 socket opens refused by offline mode, as in the PR;
  • 2 pipeline requests written; gfx2hlsl.py --pending translated both, and run 4 then recorded 1,182 translated draws;
  • stream pipelines fall back to the placeholder (#1142); 3D texture tiling queries return 0x80070057 (#1140);
  • the last presented surface (X2W_D3D12_DUMP_SURFACE) is black. I did not see the intro video before the stop, so I cannot confirm that part.

One more local experiment was active in runs 3 and 4 and should be read as a caveat: a debugger-side byte patch that disables a 30 s stall self-check in the executable. On this storage, start-up without it sometimes ends in that self-check before the first present. I have not measured runs 3 and 4 without it.

Not established here: anything after 75 s, the video, the first-run prompt, and the soft assert in #1136.

The two changes (drive mapping in debug_launch.py / run.ps1, and the capped view heap in d3d12_xs_device.cpp) are local for now. I can open them against this branch or wait for it to merge, whichever you prefer. I am also taking #1141, #1142 and #1147 (claims on the issues).

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119733870 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#issuecomment-7119733870). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-24T02:04:49Z. --- Verification on a second machine (NVIDIA, Windows 10). The source-built checks pass. The end-to-end run needed two changes to get past the first seconds here and then stops at a new fault; details and issues below. **Environment:** commit e658fe24, release preset (Ninja, MSVC from the Visual Studio developer shell), NVIDIA GeForce RTX 3060, driver 32.0.15.9636, Windows 10 22H2 build 19045.6466, D3D12 debug layer off. Package on a slow volume (about 27 MB/s sequential). **Source-built checks (unmodified e658fe24)** ```powershell cmake --preset release cmake --build --preset release ctest --preset release --no-tests=error -R '^startup_stubs$' -V ctest --preset release --no-tests=error -R 'xmem|era_|startup' ``` - `startup_stubs`: **pass** (all 8 stand-ins load with their exports; `chad` and `xg_xs` traps return their named exit codes; both controls exit 0). - `xmem|era_|startup`: **48/48 pass**, no skips. (The PR reports 43; this build has the Python environment configured, which registers more tests.) - I did not run the full suite. **End-to-end, one console executable, offline** (`tools/startup/run.ps1 -Render -FakeUser -GpuMirror -ContinueAsserts 5000 -Seconds 240`, package in a folder on another drive) | Run | Change from e658fe24 | Result | |---|---|---| | 1 | none | stops at 0.51 s: package opens at the console's fixed drive letter return "not found" (that letter is another volume here), then an access violation in a C runtime fill. #1158 | | 2 | launcher maps the drive letter to the package folder | stops at 6.53 s: the desktop `CreateDescriptorHeap` for a shader-visible view heap of 1,245,184 descriptors returns `0x8007000E` on this adapter; the executable reads through the null result. #1159 | | 3, 4 | plus a 1,000,000-descriptor desktop heap fallback | stop at 74.2 s and 75.1 s on the same instruction: a read at 0x68 through a null pointer inside the executable, right after a burst of user-interface runtime calls. #1160 | Measured in runs 3 and 4 before the stop: - about 25 fps presented (995 frames in 40 s after the first present); - 3,220 DirectStorage requests completed, 0 failed, 0 BCPack-blank at that point; - 4 socket opens refused by offline mode, as in the PR; - 2 pipeline requests written; `gfx2hlsl.py --pending` translated both, and run 4 then recorded 1,182 translated draws; - stream pipelines fall back to the placeholder (#1142); 3D texture tiling queries return `0x80070057` (#1140); - the last presented surface (`X2W_D3D12_DUMP_SURFACE`) is black. I did not see the intro video before the stop, so I cannot confirm that part. One more local experiment was active in runs 3 and 4 and should be read as a caveat: a debugger-side byte patch that disables a 30 s stall self-check in the executable. On this storage, start-up without it sometimes ends in that self-check before the first present. I have not measured runs 3 and 4 without it. **Not established here:** anything after 75 s, the video, the first-run prompt, and the soft assert in #1136. The two changes (drive mapping in `debug_launch.py` / `run.ps1`, and the capped view heap in `d3d12_xs_device.cpp`) are local for now. I can open them against this branch or wait for it to merge, whichever you prefer. I am also taking #1141, #1142 and #1147 (claims on the issues). AI-assisted (Claude Code).
mumba17 commented 2026-11-24 06:50:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-11-24T02:05:39Z.


NVIDIA retest of this branch at e658fe24, and one NVIDIA-specific blocker with a small fix.

Environment: RTX 3090 (10de:2204), driver 32.0.16.1664, Windows 11 Pro build 26300, MSVC 19.44.35207.1, release preset, D3D12 debug layer off. ctest --preset release -R '^startup_stubs$' passes.

Run setup: tools/startup/run.ps1 -Render -FakeUser -GpuMirror -ContinueAsserts 5000, with the package root mapped as G: and -StoragePath set to a local folder. Without G:, the title cannot open its package files and fails early with a large clear to a null allocation, so it may be worth a line in docs/startup-runtime.md that -DataDir should be the drive the title expects.

Blocker on NVIDIA: the title creates its main shader-visible CBV/SRV/UAV heap with 1,245,184 descriptors over title memory. On the RTX 3090, desktop CreateDescriptorHeap refuses that size with E_INVALIDARG (the adapter reports 1,000,000 for shader-visible view heaps). The stand-in returns the failure, the title gets a null heap and stops at a null read about 2 s in. On the RX 9070 XT the same size is accepted, which explains why it did not show up there.

Local fix (src/startup_stubs/d3d12_xs_device.cpp, 38 lines):

  • On E_INVALIDARG for a shader-visible CBV/SRV/UAV heap, read D3D12_OPTIONS19.MaxViewDescriptorHeapSize (default 1,000,000), create the desktop heap at that size and log the cap. The title's CPU side keeps its full size.
  • DescriptorRange gains desktop_bytes. desktop_cpu_handle maps title handles past the cap to one CPU-only sink slot, so view writes there are absorbed rather than landing past the desktop heap.
  • note_heap gets the capped count, so shadow and GPU table lookups stay inside the desktop heap.

Descriptors past index 1,000,000 are not bound on such adapters. I did not see any binding reach that range. I can push this as a commit to your branch, or a follow-up PR against main once this merges. Tell me which you prefer.

Result with the fix (local, no files attached):

  • 180 s runs to the timeout with no unhandled exception.
  • About 26–28 fps presented.
  • 3,260 DirectStorage requests completed (6,504 zlib inflations), 0 failed.
  • 4 network opens refused.
  • After one gfx2hlsl.py --pending round, both recorded pipelines translated and about 3,000 translated draws ran per run. The output window stays black.

The black output has two parts on this machine:

  • Per frame, the 2 translated draws run, plus one draw from a stream pipeline that stays a placeholder (no translation for stream shader). That is #1142, and it is probably the pass that reaches the window. No textures are uploaded in this phase.
  • The run stops making progress earlier than yours. DirectStorage stays at 3,260 completed requests from about 80 s onwards, in a 10-minute run with scripted A presses every 20 s and manual keyboard input. The title calls one user-provider method about 66 times a second for the rest of the run, and the proxy answers "local user" each time.

I have not established what it waits for. Possibilities on my side are the heap cap (if something binds above index 1,000,000) and input timing. If your run passes a specific screen with a known input at a known time, that would help me tell them apart.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119747541 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#issuecomment-7119747541). Originally posted by [mumba17](https://github.com/mumba17) on 2026-11-24T02:05:39Z. --- NVIDIA retest of this branch at `e658fe24`, and one NVIDIA-specific blocker with a small fix. **Environment:** RTX 3090 (`10de:2204`), driver 32.0.16.1664, Windows 11 Pro build 26300, MSVC 19.44.35207.1, `release` preset, D3D12 debug layer off. `ctest --preset release -R '^startup_stubs$'` passes. **Run setup:** `tools/startup/run.ps1 -Render -FakeUser -GpuMirror -ContinueAsserts 5000`, with the package root mapped as `G:` and `-StoragePath` set to a local folder. Without `G:`, the title cannot open its package files and fails early with a large clear to a null allocation, so it may be worth a line in `docs/startup-runtime.md` that `-DataDir` should be the drive the title expects. **Blocker on NVIDIA:** the title creates its main shader-visible CBV/SRV/UAV heap with 1,245,184 descriptors over title memory. On the RTX 3090, desktop `CreateDescriptorHeap` refuses that size with `E_INVALIDARG` (the adapter reports 1,000,000 for shader-visible view heaps). The stand-in returns the failure, the title gets a null heap and stops at a null read about 2 s in. On the RX 9070 XT the same size is accepted, which explains why it did not show up there. **Local fix** (`src/startup_stubs/d3d12_xs_device.cpp`, 38 lines): - On `E_INVALIDARG` for a shader-visible CBV/SRV/UAV heap, read `D3D12_OPTIONS19.MaxViewDescriptorHeapSize` (default 1,000,000), create the desktop heap at that size and log the cap. The title's CPU side keeps its full size. - `DescriptorRange` gains `desktop_bytes`. `desktop_cpu_handle` maps title handles past the cap to one CPU-only sink slot, so view writes there are absorbed rather than landing past the desktop heap. - `note_heap` gets the capped count, so shadow and GPU table lookups stay inside the desktop heap. Descriptors past index 1,000,000 are not bound on such adapters. I did not see any binding reach that range. I can push this as a commit to your branch, or a follow-up PR against `main` once this merges. Tell me which you prefer. **Result with the fix (local, no files attached):** - 180 s runs to the timeout with no unhandled exception. - About 26–28 fps presented. - 3,260 DirectStorage requests completed (6,504 zlib inflations), 0 failed. - 4 network opens refused. - After one `gfx2hlsl.py --pending` round, both recorded pipelines translated and about 3,000 translated draws ran per run. The output window stays black. The black output has two parts on this machine: - **Per frame**, the 2 translated draws run, plus one draw from a stream pipeline that stays a placeholder (`no translation for stream shader`). That is #1142, and it is probably the pass that reaches the window. No textures are uploaded in this phase. - **The run stops making progress earlier than yours.** DirectStorage stays at 3,260 completed requests from about 80 s onwards, in a 10-minute run with scripted A presses every 20 s and manual keyboard input. The title calls one user-provider method about 66 times a second for the rest of the run, and the proxy answers "local user" each time. I have not established what it waits for. Possibilities on my side are the heap cap (if something binds above index 1,000,000) and input timing. If your run passes a specific screen with a known input at a known time, that would help me tell them apart. AI-assisted (Claude Code).
R0Y00 commented 2026-11-24 06:50:08 +00:00 (Migrated from github.com)

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


I ran the source-built Release fixture on e658fe24 (Windows x64, MSVC 19.51): ctest --preset release --no-tests=error -R '^startup_stubs$' -V passed. All eight DLL export checks, the two trap exits and the permissive controls matched. This result is for the generated fixture. The independent startup observations stay in #870.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119786261 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#issuecomment-7119786261). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T02:07:56Z. --- I ran the source-built Release fixture on e658fe24 (Windows x64, MSVC 19.51): `ctest --preset release --no-tests=error -R '^startup_stubs$' -V` passed. All eight DLL export checks, the two trap exits and the permissive controls matched. This result is for the generated fixture. The independent startup observations stay in #870.
R0Y00 commented 2026-11-24 06:50:08 +00:00 (Migrated from github.com)

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


Independently rebuilt the startup DLLs and consumer from e658fe24 in Release on Windows 11 build 26200.9974 (MSVC 19.51). ctest --test-dir <release-build> --no-tests=error -R '^startup_stubs$' -V passed. The consumer loaded eight DLLs, observed the two expected named trap exits, and passed both control paths.

I also ran a source-built EXE through this PR's tools/startup/debug_launch.py with rendering and the permissive device enabled. On the RTX 4060 Laptop (616.56) and on WARP, it created the wrapped D3D12 device, direct queue and fence, observed the fence move from 0 to 7 after queue Signal, and exited with code 0. Debug layer off. With the device switch disabled, the same non-null creation parameters returned E_INVALIDARG with a null device. This checks the launcher/device/queue path. The intro playback observation in the PR description is still the author's separate run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119803813 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#issuecomment-7119803813). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T02:08:56Z. --- Independently rebuilt the startup DLLs and consumer from e658fe24 in Release on Windows 11 build 26200.9974 (MSVC 19.51). `ctest --test-dir <release-build> --no-tests=error -R '^startup_stubs$' -V` passed. The consumer loaded eight DLLs, observed the two expected named trap exits, and passed both control paths. I also ran a source-built EXE through this PR's `tools/startup/debug_launch.py` with rendering and the permissive device enabled. On the RTX 4060 Laptop (616.56) and on WARP, it created the wrapped D3D12 device, direct queue and fence, observed the fence move from 0 to 7 after queue Signal, and exited with code 0. Debug layer off. With the device switch disabled, the same non-null creation parameters returned E_INVALIDARG with a null device. This checks the launcher/device/queue path. The intro playback observation in the PR description is still the author's separate run.
R0Y00 commented 2026-11-24 06:50:08 +00:00 (Migrated from github.com)

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


Thanks for the RTX 3090 retest. Please submit the descriptor heap changes as a focused follow-up against main after this PR merges. #874 already tracks paging work. Please keep an explicit diagnostic for the first GPU-visible binding that crosses the physical limit, and include a synthetic case that reaches that range so an absorbed write cannot silently count as a pass.

For the black-window retest on the 3090, there is now a stream request translation candidate on top of this exact PR head: github.com/R0Y00/Xbox2Windows@72acbf0df7 . If you can run the same setup with that change and your local heap fix, the most useful comparison for #1137 is whether the third draw acquires a translated pipeline and whether the output changes. Please report those two observations separately; aggregate results are sufficient.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119847067 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#issuecomment-7119847067). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T02:11:30Z. --- Thanks for the RTX 3090 retest. Please submit the descriptor heap changes as a focused follow-up against main after this PR merges. #874 already tracks paging work. Please keep an explicit diagnostic for the first GPU-visible binding that crosses the physical limit, and include a synthetic case that reaches that range so an absorbed write cannot silently count as a pass. For the black-window retest on the 3090, there is now a stream request translation candidate on top of this exact PR head: https://github.com/R0Y00/Xbox2Windows/commit/72acbf0df765416d2a299622756f8cc9772bcd16 . If you can run the same setup with that change and your local heap fix, the most useful comparison for #1137 is whether the third draw acquires a translated pipeline and whether the output changes. Please report those two observations separately; aggregate results are sufficient.
R0Y00 commented 2026-11-24 06:50:09 +00:00 (Migrated from github.com)

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


Both Windows jobs on e658fe24 reported startup_stubs as Not Run because a fresh configure registered the test before INTAKE_PYTHON was initialized. I retested 5691fe81 from a fresh Release build directory with the preset default Python path and no INTAKE_PYTHON override. The DLLs and consumer built, and ctest --preset release --no-tests=error -R "^startup_stubs$" passed 1/1. GitHub is rerunning the full matrix.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120070172 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#issuecomment-7120070172). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T02:22:17Z. --- Both Windows jobs on e658fe24 reported startup_stubs as Not Run because a fresh configure registered the test before INTAKE_PYTHON was initialized. I retested 5691fe81 from a fresh Release build directory with the preset default Python path and no INTAKE_PYTHON override. The DLLs and consumer built, and ctest --preset release --no-tests=error -R "^startup_stubs$" passed 1/1. GitHub is rerunning the full matrix.
denn0x commented 2026-11-24 06:50:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T02:47:20Z.


@mumba17, on input timing. These are measured on the RX 9070 XT with the same switches; on this adapter the UI reaches the window, so each step was confirmed from presented-surface dumps, not from a fixed schedule:

  1. The first-run prompt appears between about 55 s and 93 s after launch, depending on storage speed and machine load. It shows three button hints; the one that advances is A. At that point DirectStorage has completed about 3,260 requests, the same plateau you saw. So your run was most likely waiting at this prompt, and the polled user-provider method is the prompt waiting for input.
  2. A timed A press does not work reliably: in two of my runs it landed before the prompt and was ignored. A press made after the prompt is on screen advances it every time.
  3. After A, the intro video plays (about 15 s), then a run of first-run setup pages (A on each), a legal notices page and a terms page, then a loading screen.

Two fixes from this testing are now on the branch:

  • 5691fe81 registers startup_stubs after INTAKE_PYTHON is defined. It was "Not Run" in CI.
  • 5e775dda stops an allocation failure on the DirectStorage worker from ending the process. It was a fast fail in XCRDAPI.dll about six minutes in, after the loading screen.

The zlib failures in #1144 turned out to be multi-page streams; the layout table is in https://github.com/R0Y00/Xbox2Windows/issues/1144#issuecomment-7120470386.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120479741 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#issuecomment-7120479741). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T02:47:20Z. --- @mumba17, on input timing. These are measured on the RX 9070 XT with the same switches; on this adapter the UI reaches the window, so each step was confirmed from presented-surface dumps, not from a fixed schedule: 1. The first-run prompt appears between about 55 s and 93 s after launch, depending on storage speed and machine load. It shows three button hints; the one that advances is **A**. At that point DirectStorage has completed about 3,260 requests, the same plateau you saw. So your run was most likely waiting at this prompt, and the polled user-provider method is the prompt waiting for input. 2. A **timed** A press does not work reliably: in two of my runs it landed before the prompt and was ignored. A press made after the prompt is on screen advances it every time. 3. After A, the intro video plays (about 15 s), then a run of first-run setup pages (A on each), a legal notices page and a terms page, then a loading screen. Two fixes from this testing are now on the branch: - `5691fe81` registers `startup_stubs` after `INTAKE_PYTHON` is defined. It was "Not Run" in CI. - `5e775dda` stops an allocation failure on the DirectStorage worker from ending the process. It was a fast fail in `XCRDAPI.dll` about six minutes in, after the loading screen. The zlib failures in #1144 turned out to be multi-page streams; the layout table is in https://github.com/R0Y00/Xbox2Windows/issues/1144#issuecomment-7120470386. AI-assisted (Claude Code).
Jess-Doit commented 2026-11-24 06:50:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T03:12:07Z.


Tested on Windows 10 22H2 19045.6456 with MSVC 19.44.35230, a GTX 1060 6 GB (10de:1c03, driver 32.0.15.6094, XBOX2WINDOWS_ADAPTER=1060) and in-box WARP (1414:008c, 10.0.19041.5794). This was a Debug (dev) build with the D3D12 debug layer enabled. Only the source-built ctest checks ran; no console executable was loaded.

da5884af (current head): ctest --preset dev --no-tests=error -R '^startup_stubs$' -V passes. The consumer loads all eight stand-ins (acphal 9/9, chad 5/5, xapu 5/5, xcrdapi 1/1, xg_xs 2/2, gameinput 1/1, xmem 7/7, d3d12_xs 1/1 exports). It sees the two expected trap codes (0xe2570200, 0xe2570501), and both controls exit 0. -R 'xmem|era_|startup' passes 48/48. This ran in the build directory from my earlier configure, so it doesn't add to your fresh-configure check of the registration fix.

e658fe24, full suite (ctest --preset dev --no-tests=error): 557 passed, 70 capability skips (exit 77, mostly mesh shaders and newer shader-model or wave features this adapter and WARP build don't expose), 8 failed. startup_stubs was Not Run (the registration-order issue, already fixed). The other 7 failures don't involve this PR:

Test Result on e658fe24 On main 645b9697, same host
gpu_alias_lookup_writes_warp array_atomics … expected=64 actual=256,256,256,256 (the #369 symptom, on this WARP build) same failure
pixel_aot_title_loads_warp WARP case statuses differ from the expected list same failure
compressed_scene_metadata, shader_metadata_probe, dxil_retarget_probe, dxil_retarget_probe_hardware root_probe.exe --container exits 4 (it can't load or use the SDK DXIL validator on this host) same failure
pe_package_import_closure WinError 1314 creating a symlink (no symlink privilege) passes; main already has the #1126 handling, so a rebase picks it up

Every _hardware test that ran on the 1060, rather than skipping, passed. The DXIL-validator and WARP failures are local to this host and also occur on main; I'll look at them separately.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120867383 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1135#issuecomment-7120867383). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-24T03:12:07Z. --- Tested on Windows 10 22H2 `19045.6456` with MSVC 19.44.35230, a GTX 1060 6 GB (`10de:1c03`, driver `32.0.15.6094`, `XBOX2WINDOWS_ADAPTER=1060`) and in-box WARP (`1414:008c`, `10.0.19041.5794`). This was a Debug (`dev`) build with the D3D12 debug layer enabled. Only the source-built ctest checks ran; no console executable was loaded. **`da5884af` (current head):** `ctest --preset dev --no-tests=error -R '^startup_stubs$' -V` passes. The consumer loads all eight stand-ins (acphal 9/9, chad 5/5, xapu 5/5, xcrdapi 1/1, xg_xs 2/2, gameinput 1/1, xmem 7/7, d3d12_xs 1/1 exports). It sees the two expected trap codes (`0xe2570200`, `0xe2570501`), and both controls exit 0. `-R 'xmem|era_|startup'` passes 48/48. This ran in the build directory from my earlier configure, so it doesn't add to your fresh-configure check of the registration fix. **`e658fe24`, full suite (`ctest --preset dev --no-tests=error`):** 557 passed, 70 capability skips (exit 77, mostly mesh shaders and newer shader-model or wave features this adapter and WARP build don't expose), 8 failed. `startup_stubs` was Not Run (the registration-order issue, already fixed). The other 7 failures don't involve this PR: | Test | Result on `e658fe24` | On `main` `645b9697`, same host | |---|---|---| | `gpu_alias_lookup_writes_warp` | `array_atomics … expected=64 actual=256,256,256,256` (the #369 symptom, on this WARP build) | same failure | | `pixel_aot_title_loads_warp` | WARP case statuses differ from the expected list | same failure | | `compressed_scene_metadata`, `shader_metadata_probe`, `dxil_retarget_probe`, `dxil_retarget_probe_hardware` | `root_probe.exe --container` exits 4 (it can't load or use the SDK DXIL validator on this host) | same failure | | `pe_package_import_closure` | `WinError 1314` creating a symlink (no symlink privilege) | passes; `main` already has the #1126 handling, so a rebase picks it up | Every `_hardware` test that ran on the 1060, rather than skipping, passed. The DXIL-validator and WARP failures are local to this host and also occur on `main`; I'll look at them separately. AI-assisted (Claude Code).
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!1128
No description provided.