startup: report all slot70 refusal reasons and quote launch arguments #1591

Merged
tedin7 merged 1 commit from upstream-pr/1598 into main 2026-11-24 17:26:43 +00:00
tedin7 commented 2026-11-24 14:42:04 +00:00 (Migrated from github.com)

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


What

  • tools/startup/triage_run.py: the allowlist of Device::slot70 refusal reasons held 3 of the 8 reasons the runtime can log (src/startup_stubs/d3d12_memory_srv.inl). It now lists all 8 of them: null_destination, unreadable_resource, unreadable_view, null_address, unsupported_description, destination_outside_view_heaps, buffer_unavailable, texture_unavailable.
  • tools/startup/launch.py: the child's arguments (after --) were each wrapped as "<arg>" with no escaping. New quote_argument follows the rule the C runtime and CommandLineToArgvW use: a run of backslashes that ends the argument, or sits before a double quote, is doubled, and an embedded quote is escaped. Arguments without those characters are quoted exactly as before.

Why

  • Five of the eight reasons were counted under "other (text omitted)", so a report built from the field-by-field refusal line lost the one value that names the failing check.
  • An argument that ends in a backslash (for example a storage folder such as D:\saves\ or a drive root S:\) turned its own closing quote into an escaped quote and merged with the next argument. An argument containing a quote was split the same way.

Tested

Run on Linux:

python3 -B tests/startup_triage_run_check.py
python3 -B tests/startup_launch_check.py --unit
python3 -B tests/docs_links_check.py
python3 -B tests/bidi_controls_check.py
git diff --check

All pass. The new checks are check_every_slot70_reason_is_reported (one synthetic line per reason using the exact refusal phrases emitted by d3d12_memory_srv.inl; each must keep its own row) and the argument-quoting cases in run_unit_tests (expected command lines written out by hand: empty argument, spaces, tabs, trailing backslash, drive root, embedded quote, quotes-only argument, backslash before a quote, several trailing backslashes).

Negative control: check_private_text_never_echoed verifies that unknown slot70 reasons and free-form values outside the allowlist are folded into other (text omitted) / ? and never echoed. Against the base commit, the new tests fail because the 5 missing reasons collapse into other (text omitted) and quote_argument does not exist.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 88d49d51f02f8ab25ffab6d462a6083923d1df17 (including the native CommandLineToArgvW round-trip check in tests/startup_launch_check.py):

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target startup_launch_probe -- -j 6): 0.10s (configure 1.74s)
    • Test (ctest --preset dev -R '^(startup_launch|startup_triage_run)$' --parallel 4 --no-tests=error --output-on-failure): 2/2 passed (2.12s: startup_triage_run 0.22s, startup_launch 2.04s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target startup_launch_probe -- -j 6): 0.09s (configure 1.92s)
    • Test (ctest --preset release -R '^(startup_launch|startup_triage_run)$' --parallel 4 --no-tests=error --output-on-failure): 2/2 passed (2.04s: startup_triage_run 0.18s, startup_launch 1.97s)

Audited, nothing found

  • tools/startup/capture.py: the descriptor-table summary issue is covered by #1490; nothing else found.
  • launch.py job limits, handle cleanup and the fast-fail diagnostic, and the rest of triage_run.py (redaction of free text, HRESULT normalisation, the stderr/trap log de-duplication): no defect found.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6584347100 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1598). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T14:42:04Z. --- ## What - `tools/startup/triage_run.py`: the allowlist of `Device::slot70` refusal reasons held 3 of the 8 reasons the runtime can log (`src/startup_stubs/d3d12_memory_srv.inl`). It now lists all 8 of them: `null_destination`, `unreadable_resource`, `unreadable_view`, `null_address`, `unsupported_description`, `destination_outside_view_heaps`, `buffer_unavailable`, `texture_unavailable`. - `tools/startup/launch.py`: the child's arguments (after `--`) were each wrapped as `"<arg>"` with no escaping. New `quote_argument` follows the rule the C runtime and `CommandLineToArgvW` use: a run of backslashes that ends the argument, or sits before a double quote, is doubled, and an embedded quote is escaped. Arguments without those characters are quoted exactly as before. ## Why - Five of the eight reasons were counted under "other (text omitted)", so a report built from the field-by-field refusal line lost the one value that names the failing check. - An argument that ends in a backslash (for example a storage folder such as `D:\saves\` or a drive root `S:\`) turned its own closing quote into an escaped quote and merged with the next argument. An argument containing a quote was split the same way. ## Tested Run on Linux: ``` python3 -B tests/startup_triage_run_check.py python3 -B tests/startup_launch_check.py --unit python3 -B tests/docs_links_check.py python3 -B tests/bidi_controls_check.py git diff --check ``` All pass. The new checks are `check_every_slot70_reason_is_reported` (one synthetic line per reason using the exact refusal phrases emitted by `d3d12_memory_srv.inl`; each must keep its own row) and the argument-quoting cases in `run_unit_tests` (expected command lines written out by hand: empty argument, spaces, tabs, trailing backslash, drive root, embedded quote, quotes-only argument, backslash before a quote, several trailing backslashes). Negative control: `check_private_text_never_echoed` verifies that unknown `slot70` reasons and free-form values outside the allowlist are folded into `other (text omitted)` / `?` and never echoed. Against the base commit, the new tests fail because the 5 missing reasons collapse into `other (text omitted)` and `quote_argument` does not exist. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `88d49d51f02f8ab25ffab6d462a6083923d1df17` (including the native `CommandLineToArgvW` round-trip check in `tests/startup_launch_check.py`): - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target startup_launch_probe -- -j 6`): `0.10s` (configure `1.74s`) - Test (`ctest --preset dev -R '^(startup_launch|startup_triage_run)$' --parallel 4 --no-tests=error --output-on-failure`): **2/2 passed** (`2.12s`: `startup_triage_run` `0.22s`, `startup_launch` `2.04s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target startup_launch_probe -- -j 6`): `0.09s` (configure `1.92s`) - Test (`ctest --preset release -R '^(startup_launch|startup_triage_run)$' --parallel 4 --no-tests=error --output-on-failure`): **2/2 passed** (`2.04s`: `startup_triage_run` `0.18s`, `startup_launch` `1.97s`) ## Audited, nothing found - `tools/startup/capture.py`: the descriptor-table summary issue is covered by #1490; nothing else found. - `launch.py` job limits, handle cleanup and the fast-fail diagnostic, and the rest of `triage_run.py` (redaction of free text, HRESULT normalisation, the stderr/trap log de-duplication): no defect found. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-24 15:02:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T14:53:18Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T14:55:47.649837Z 88d49d5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7135112137 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1598#issuecomment-7135112137). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T14:53:18Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"88d49d51f02f8ab25ffab6d462a6083923d1df17","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T14:55:47.649837Z">2026-11-24T14:55:47.649837Z</relative-time> | `88d49d5` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
upstream-sync closed this pull request 2026-11-24 18:02:18 +00:00
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!1591
No description provided.