startup: say why --trace-calls 1 armed nothing, and pin the hooked export #2154
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2162"
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 rasptum on 2026-11-25T01:59:36Z.
Follow-up to #2021, from the review in https://github.com/R0Y00/Xbox2Windows/pull/2021#issuecomment-7147449636.
The banner.
debug_launch.pyarms the gaming-runtime and movie-player call hooks together with the file hooks:trace_calls = trace and --trace-calls == "1". With file tracing off (--offline 0without--trace-files 1),--trace-calls 1therefore arms nothing. The summary printedtrace_calls, so it already saidcall tracing: offin that case and was not wrong. But it gave no reason, so the flag looked silently ignored. The summary now printscall tracing: off: --trace-calls 1 needs file tracing (--trace-files 1, or offline mode, the default). Theonand plainofflines are unchanged.The hook list. The export names the launcher hooks move from two inline tuples into
RUNTIME_CALL_HOOKSandMOVIE_CALL_HOOKS(withRUNTIME_MODULEandMOVIE_MODULE). Behavior is unchanged.Tests (
tests/startup_debug_check.py):bink2scarlett.dll) must beMOVIE_MODULEand its export (BinkNextFrame) must be inMOVIE_CALL_HOOKS. A renamed or unhooked export now fails the check, instead of passing because nothing was hit. A control drops the export from a copy of the list and checks that the guard rejects it.calls-no-file-tracing: with--offline 0 --trace-calls 1, the probe's 7 export calls are not counted, and the summary carries the new reason.debug_launch.pymakes the check fail oncalls-no-file-tracing.docs/startup-runtime.mddescribes the conjunction and the new line.Test (Windows 10 19045, dev and release, build targets
startup_debug_probe startup_debug_calls startup_launch_probe):startup_debugreports 9 controls.X2W_VALLOC_MINcase, which sometimes logs the 256 MiB reservation with an empty caller list (callers:).mainfails it the same way, and this PR does not touch it.tests/docs_links_check.pypasses.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:08:37Z.
Review: COMMENTED
Review of head
0b9752a7283ce50d5173e157816bb757eefdced0(3 files, +52/-15).Summary: Small, behavior-preserving change. The hook names move into
RUNTIME_CALL_HOOKS/MOVIE_CALL_HOOKS, the summary gets a reason line, and the check gets a guard and a new case. I found no P1 and no P2.Checked by reading the diff
tools/startup/debug_launch.py: the banner has three branches (on, requested-but-unarmed, plainoff).calls_requestedis only true for--trace-calls 1, andtrace_calls = trace and calls_requested. So the new reason line prints exactly when the flag was given and file tracing is off. Theonand plainofftexts are unchanged.tests/startup_debug_check.py: the newbannersmap matches the three printed strings, andcalls-defaultstill matchescall tracing: off (. Thecalls-no-file-tracingcase expects nobink calls:line (want=None), which fits--offline 0with no file hooks. The guardrequire_hookedplus its control fails if the module or export is renamed or dropped.Commands executed locally (Linux)
gh pr checks 2162: Linux Python checks pass, gfx1013 fixtures pass, Windows build and test pass. The /O2 job and the chart job were skipped.python3 -c "import ast; ast.parse(open('tools/startup/debug_launch.py').read())": syntax ok.python3 tests/docs_links_check.py: Self-test passed. Checked 18 Markdown files and 398 links.python3 tests/bidi_controls_check.py: Self-test passed. Checked 1440 files, no bidirectional controls.git diff --check origin/main...HEAD: clean.Not run:
startup_debug_check.pyneeds Windows (ctypes.WinDLL; the launcher cannot even be imported on Linux). I did not run the Win2025 job. The PR changes only the Python launcher, and the Windows CI job passed. I tried a mutation (droppingBinkNextFramefrom the list). The edit did not apply to the hook tuple, so I treat it as not exercised and make no claim about it. By reading, the guard raises in that case.Nits (not blocking)
debug_launch.pybanner: the reason line says "or offline mode, the default". That is right today, but it repeats the default in a string. If the default changes, the text goes stale. Consider deriving it or dropping the parenthetical.tests/startup_debug_check.pyrequire_hooked: the control re-implements the drop inline. It is fine, just a little long.Verdict: no blocking findings. The merge decision is left to the maintainers.
AI-assisted; commands listed were executed locally.