tests: check the launch tool's containment on a source-built probe #1254
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1261"
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 triggered02 on 2026-11-24T05:56:51Z.
Change
tools/startup/launch.pyruns one executable in a kill-on-close job with a timeout, a commit cap and captured stdout/stderr, but no source-built control read any of that back (#1149 asks for checks overtools/startup/). This adds one, with no GPU and no game files:tests/startup_launch_probe.cpp— the only executable the check needs. Modes: report a known exit code while writing known bytes to stdout, stderr andX2W_TRAP_LOG; sleep so the timeout has to kill it; ask for more memory than the job cap allows; start a helper process; or do nothing.tests/startup_launch_check.py(cteststartup_launch) — driveslaunch.pythrough each case:exit code 0x00000007in the report, andstdout.txt,stderr.txtandtrap.loghold exactly the probe's bytes;--timeout 1is reported askilled after 1 s timeoutwithexit code 0xdead0001, and the launcher returns in under 20 s;--memory-gib 0.5(error=1455) and succeeds under--memory-gib 4(allocate ok 1024 MiB);--max-processes 1(error=1816) and starts under--max-processes 2;CreateProcess failed: error ...with launcher exit code 2 instead of looking like a finished run.CMakePresets.json: theprbuild preset buildsstartup_launch_probeand theprtest filter includesstartup_launch, so the Windows jobs run it on pull requests. Main-branch runs pick it up with the rest of the suite.docs/startup-runtime.md: a short "Launcher check" section with the ctest command.Verification
Release configuration (MSVC 19.52, Windows 11, Ninja):
Measured controls (the limits, not the request, are what the check measures):
--memory-gib 0.5, allocate 1 GiBallocate failed error=1455--memory-gib 4, allocate 1 GiBallocate ok 1024 MiB--max-processes 1, spawn helperspawn failed error=1816--max-processes 2, spawn helperspawn okCreateProcess failed: error 2, launcher exit 2Negative controls: with the job memory and active-process limit flags removed from
launch.py, the check fails at the commit-cap assertion withAssertionError: allocate ok 1024 MiB; withX2W_TRAP_LOGremoved from the child environment it fails at the trap-log assertion withAssertionError: None. Both edits were reverted.Neighbouring startup tests still pass:
startup_draw_bmp(0.04 s) andstartup_plane_refresh_warp/startup_plane_refresh_hardware.I did not touch
tools/startup/gfx2hlsl.py,tools/startup/debug_launch.pyorsrc/startup_stubs/d3d12_xs_device.cpp. No game files, dumps or logs are involved; the probe and its output are source-built.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T06:00:17Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
7b9d561c8aℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:02:15Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:05:17Z.
Review: COMMENTED
Dual-platform peer review at
9d05702e6a7a232c120538610a7c12506aa73894:Checks
x2w-rev-venv):git diff --check HEAD~1..HEAD— passedpython -B tests/docs_links_check.py— passed (16 Markdown files, 281 links)python -B tests/bidi_controls_check.py— passed (1057 tracked files)python -B -m py_compile tests/startup_launch_check.py— passedstartup_launch_probectest --preset dev --no-tests=error -R '^startup_launch$': 1/1 passed (startup_launch, 2.80 s)ctest --preset release --no-tests=error -R '^startup_launch$': 1/1 passed (startup_launch, 1.90 s)Review Notes
tests/startup_launch_probe.cppandtests/startup_launch_check.pyform a self-contained, source-built fixture covering all five containment behaviors intools/startup/launch.py: exit code +stdout.txt/stderr.txt/trap.logcapture, 1 s timeout termination (0xdead0001), 0.5 GiB commit cap vs. 4 GiB control, 1-process limit vs. 2-process control, and missing-executable error reporting (exit code 2)._wgetenv,_wfopen,GetModuleFileNameW,CreateProcessW) intests/startup_launch_probe.cppensures Unicode paths fromlaunch.pyand temp/build directories work reliably.tests/startup_launch_check.pyandtests/startup_launch_probe.cppare missing a trailing newline at EOF.Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T05:59:34Z.
The pull-request Windows job ran it: run 45336851507 built
startup_launch_probe([158/169] linking) and ran7/23 Test #217: startup_launch ... Passed 1.63 sec. The wholeprsuite passed, so theprpreset wiring does put the test in front of every pull request.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T05:57:02Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
7b9d561ℹ️ 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 triggered02 on 2026-11-24T06:04:55Z.
The Codex P2 finding is addressed in
9d05702eand the thread is resolved: the probe now reads X2W_TRAP_LOG with _wgetenv, opens it with _wfopen, takes its module path with GetModuleFileNameW and starts the helper with CreateProcessW on a UTF-16 command line, with the printed lines unchanged. Only ests/startup_launch_probe.cpp changed.Local release run after the change: 1/1 Test #217: startup_launch ... Passed 1.89 sec. The pull-request Windows job rebuilt the probe at this head and ran 7/23 Test #222: startup_launch ... Passed 1.45 sec (run 45337467187); the whole job passed.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T06:00:17Z.
Code review location:
tests/startup_launch_probe.cpp; line 22On a Windows host whose temp or build path contains characters outside the active ANSI code page,
launch.pypasses a UnicodeX2W_TRAP_LOGpath, but this ANSI API and the followingfopencan turn it into an unusable path, causing the trap-log assertion instartup_launch_check.pyto fail;GetModuleFileNameA/CreateProcessAcan likewise break the spawn control for a Unicode build path. Use wide-character path APIs throughout the fixture.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:02:15Z.
Code review location:
tests/startup_launch_probe.cpp; line 22Fixed in
9d05702e. The fixture now readsX2W_TRAP_LOGwith_wgetenvand opens it with_wfopen, takes its module path withGetModuleFileNameW, and starts the helper withCreateProcessWon a UTF-16 command line. The printed lines are unchanged, sostartup_launch_check.pyreads the same output.Measured on Windows 11 with ANSI code page 1252,
TEMPunder anoutfolder whose name contains characters outside that code page:AssertionError: Noneat the trap-log assertion;ctest --preset release --no-tests=error -R '^startup_launch$' -V:1/1 Test #217: startup_launch ... Passed 1.89 sec.Only
tests/startup_launch_probe.cppchanged;tools/startup/launch.pyand the other launcher files are untouched.