build: startup_runtime target and runtime preset for a title run #2819
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2827"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:12:18Z.
Part of #870
Fixes #2826
What this unblocks: running a title needs only the eight stand-in DLLs and the build revision stamp, so
cmake --build --preset runtimereplaces a full build of every test executable.What changed
CMakeLists.txt: a custom targetstartup_runtimethat depends onxmem_shim,d3d12_xs_shim, the sixstartup_stub_*libraries andx2w_build_rev_generate: the filestools/startup/run.ps1copies next to the title (xmem.dll,d3d12_xs.dll,AcpHal.dll,XCRDAPI.dll,chad.dll,xapu.dll,xg_xs.dll,GameInput.dll) and the revision stamp. No test executable is a dependency.CMakePresets.json: build presetruntime(configure presetrelease, targetstartup_runtime).docs/startup-runtime.md: the Build and Run sections namecmake --build --preset runtime.tests/startup_runtime_target_check.py, registered asstartup_runtime_target: builds the target, checks that each of the eight DLLs is on disk, that their names are exactly the onesrun.ps1copies, and that Ninja's recursive inputs of the target contain no executable.Nothing else changes:
cmake --build --preset releasestill builds everything.Source
Source: CMake documentation,
add_custom_target,add_dependenciesand "cmake-presets(7)" (buildPresets,targets); Ninja manual,-t inputs.Verification
ctest -R '^startup_runtime_target$'passes (the target builds, 8 DLLs on disk, names matchrun.ps1, no executable among Ninja's inputs).startup_runtime_target1/1 each at headeb82f1d39; a control withxmem_shimdropped from the target dependencies fails the test.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:37:17Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
eb82f1d39ad7dee21f09660f367e07d78a48bbb7:--preset dev):cmake --build --preset dev --target startup_runtime -- -j 2):2.80s(configure0.00s)ctest --preset dev -R '^startup_runtime_target$' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (1.28s:startup_runtime_target1.16s)/O2(--preset release):cmake --build --preset release --target startup_runtime -- -j 2):28.60s(configure0.00s)ctest --preset release -R '^startup_runtime_target$' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (1.04s:startup_runtime_target0.91s)sccache: 9/13 hits; wall38.6sControl: with
xmem_shimdropped from the target's dependencies,startup_runtime_targetfails ("startup_runtime did not leave ...xmem.dll").AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T12:37:30Z.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
We couldn’t complete this review. Comment
@codex reviewto try again.eb82f1dℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T12:37:31Z.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T18:49:44Z.
Review: CHANGES_REQUESTED
Independently reviewed
eb82f1d3integrated overmain7832b98b(treee9e5bf36, clean merge).The target and preset look right. The
foreach ($dll in ...)list inrun.ps1on currentmainis still the same eight DLLs. Run alone,startup_runtime_targetpasses indevandrelease:ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^startup_runtime_target$'It printed
startup_runtime builds the 8 DLLs run.ps1 copies and no executable.Finding: the test breaks other tests that run at the same time.
startup_runtime_target_check.pydeletesxmem.dll,XCRDAPI.dlland the other six stand-ins from the shared build directory, then rebuilds them withcmake --build. Many other tests load those DLLs from the same directory:CMakeLists.txtpasses$<TARGET_FILE:...>of these targets to tests 98 times. Underctest --parallel, a test that starts in that window cannot load them.Repro on the trial merge, with the storage targets and
startup_runtimebuilt indev:startup_storage_page_end_countsandstartup_storage_consumer_pairfailed withcannot load .../out/build/dev/xmem.dll as xmem.dll, andstartup_storage_refusal_orderandstartup_storage_alloc_failurefailed withcannot load the DirectStorage stand-in.startup_storage_directory_batchfailed.startup_runtime_targetitself passed every time.-R '^(startup_storage.*)$'(the new test left out) passed 3 of 3 (15/15).PR CI doesn't show this because
ctest --preset prfilters to the smoke set, which doesn't includestartup_runtime_target. Themainpush job runsctest --preset dev --parallel 4 -E '_hardware$', and the release job runs the same with--preset release. Both include this test next to the DLL users, so I expect it to turn those jobs flaky once merged.Suggested direction (checked once): add
RUN_SERIAL TRUEtostartup_runtime_target. With that one change, the same-j 8command passed 3 of 3 (16/16). A test that doesn't delete build outputs would avoid the question entirely; that variant is untested. For example, check the target's inputs withninja -t inputsand a dry run (cmake --build ... --target startup_runtime -- -n) instead of rebuilding.Verdict: changes requested on
eb82f1d3, for the parallel-run interference only.Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10.
CI:
Build and test on Windowspasses oneb82f1d3(theprsmoke filter, which does not include this test).This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T21:28:13Z.
Thanks for the repro. Pushed
e93ec89ff:startup_runtime_targetnow hasRUN_SERIAL TRUE, so ctest runs it alone and it cannot delete the stand-in DLLs while other tests load them. The test itself is unchanged.Not yet re-run on Windows: your
-j 8command with-R '^(startup_runtime_target|startup_storage.*)$'.Commands run locally:
cmake -S . -B <tmp> -DDXC_EXECUTABLE=/bin/true,public_guard.py.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T21:47:20Z.
Verification: head
e93ec89ffafter the main merge and the latest fixes.Environment: Windows Server 2025 (build 26100), MSVC 14.44, D3D12 WARP and the hardware adapter, dev and release legs in parallel.
Commands (the same selection in both legs):
Result: 42 selected, no failures in both legs (4 skipped by capability);
startup_runtime_targetran withRUN_SERIALin an 8-way parallel ctest without disturbing the other tests. The narrower^(startup_runtime_target|startup_storage.*)$run also passed 16/16 in both legs.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:22:33Z.
Review: APPROVED
Re-reviewed
e93ec89fmerged over currentmaine582a9a4. The merge is clean andgit diff --cached --checkis clean.The finding from my review of
eb82f1d3is fixed.startup_runtime_targetis nowRUN_SERIAL TRUE, with a comment saying why. Underctest --parallel, it no longer runs beside the tests that load the eight DLLs it deletes and rebuilds.What I ran. I did a full build in
devandrelease. Run alone,startup_runtime_targetpasses in both presets. I then ran the same command as before ondev:4 of 4 runs pass (16/16 each).
Negative control. I removed only
RUN_SERIAL TRUE, reconfigured, and repeated the command. All 3 runs failed:startup_storage_alloc_failure,_refusal_order,_page_end_counts,_consumer_pair,_refused_reusewith their_accept_refused_controls, and_directory_batch.startup_storage_directory_batchfailed.I restored the file and reconfigured afterwards;
git diff --quietis clean.Verdict: approve on
e93ec89f.Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10. No GPU is involved in these tests.
CI:
Build and test on Windows,Assemble and translate gfx1013 fixturesandRun platform-independent Python checks on Linuxpass one93ec89f.This reply was AI-assisted.