tools/startup: add redacted 1-run telemetry summarizer (triage_run.py) #1464

Manually merged
github merged 4 commits from gh-pr/1464/head into gh-pr/1464/base 2026-11-26 23:09:22 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-24 11:58 UTC · original
tedin7:x2w-h-triage-run → main · +817 −0 · 5 files · 4 commits · merged 2026-11-24 12:49 UTC

Add tools/startup/triage_run.py, a zero-dependency Python 3 CLI tool that summarizes a startup log directory (and optional --shader-cache DIR) into a path-redacted, address-redacted, title-neutral Markdown report for issue triage.

What it summarizes

  • Device::slot70 memory SRV refusals grouped by (reason, dim, fmt, view_dim, view_fmt, layout, flags) (stripping raw guest addresses and pointers)
  • Unhandled/stubbed x2w-d3d12 / x2w-trap / x2w-noop calls and x2w-d3d12-debug messages
  • x2w-dstorage failure outcomes, entry/OpenFile/zlib failures, and StatusArray::GetHResult / EnqueueSignal HRESULT counts
  • x2w-runtime / x2w-api failing methods and HRESULTs
  • X2W_SHADER_CACHE .fail Unsupported(...) / fxc reasons when --shader-cache is supplied

Strict redaction

Redacts Windows drive/UNC paths, POSIX local paths, *.exe filenames, and 64-bit hex addresses (0x[0-9a-fA-F]{9,}).

Verification

  • Linux: python3 -B tests/startup_triage_run_check.py (0 failed), python3 -B tests/docs_links_check.py, python3 -B tests/bidi_controls_check.py, git diff --check origin/main..HEAD
  • CTest (startup_triage_run) and .github/workflows/windows.yml Python checks wired; Win2025 verification pending.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 11:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464) `tedin7:x2w-h-triage-run` → `main` · +817 −0 · 5 files · 4 commits · merged 2026-11-24 12:49 UTC Add `tools/startup/triage_run.py`, a zero-dependency Python 3 CLI tool that summarizes a startup log directory (and optional `--shader-cache DIR`) into a path-redacted, address-redacted, title-neutral Markdown report for issue triage. ### What it summarizes - `Device::slot70` memory SRV refusals grouped by `(reason, dim, fmt, view_dim, view_fmt, layout, flags)` (stripping raw guest addresses and pointers) - Unhandled/stubbed `x2w-d3d12` / `x2w-trap` / `x2w-noop` calls and `x2w-d3d12-debug` messages - `x2w-dstorage` failure outcomes, entry/OpenFile/zlib failures, and `StatusArray::GetHResult` / `EnqueueSignal` HRESULT counts - `x2w-runtime` / `x2w-api` failing methods and HRESULTs - `X2W_SHADER_CACHE` `.fail` `Unsupported(...)` / `fxc` reasons when `--shader-cache` is supplied ### Strict redaction Redacts Windows drive/UNC paths, POSIX local paths, `*.exe` filenames, and 64-bit hex addresses (`0x[0-9a-fA-F]{9,}`). ### Verification - Linux: `python3 -B tests/startup_triage_run_check.py` (`0 failed`), `python3 -B tests/docs_links_check.py`, `python3 -B tests/bidi_controls_check.py`, `git diff --check origin/main..HEAD` - CTest (`startup_triage_run`) and `.github/workflows/windows.yml` Python checks wired; Win2025 verification pending. AI-assisted; commands listed were executed locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:09:21 +00:00
github manually merged commit 0b47a18a6f into gh-pr/1464/base 2026-11-26 23:09:22 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 12:02 UTC · original

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit c44bd0ad785cc4a01110bd05360710fdf3a498f0:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev -- -j 6): 103.03s (configure 1.70s)
    • Test (ctest --preset dev -R '^startup_triage_run$' --parallel 4 --no-tests=error --output-on-failure): 1/1 passed (0.23s: startup_triage_run 0.16s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release -- -j 6): 125.84s (configure 1.74s)
    • Test (ctest --preset release -R '^startup_triage_run$' --parallel 4 --no-tests=error --output-on-failure): 1/1 passed (0.24s: startup_triage_run 0.16s)
  • sccache: 550/860 hits; wall 238.4s
**@⁠tedin7** on GitHub · 2026-11-24 12:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#issuecomment-7130887558) Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `c44bd0ad785cc4a01110bd05360710fdf3a498f0`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev -- -j 6`): `103.03s` (configure `1.70s`) - Test (`ctest --preset dev -R '^startup_triage_run$' --parallel 4 --no-tests=error --output-on-failure`): **1/1 passed** (`0.23s`: `startup_triage_run` `0.16s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release -- -j 6`): `125.84s` (configure `1.74s`) - Test (`ctest --preset release -R '^startup_triage_run$' --parallel 4 --no-tests=error --output-on-failure`): **1/1 passed** (`0.24s`: `startup_triage_run` `0.16s`) - `sccache`: 550/860 hits; wall `238.4s`
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 12:10 UTC · original

P1 Badge Redact complete diagnostic paths containing spaces

For a shader .fail line such as fxc ps: C:\Users\Alice Smith\PrivateTitle\shader.hlsl(1,1): error X3000, this regex stops at the first space, leaving <path> Smith\PrivateTitle\shader.hlsl(1,1): error X3000 in the report. gfx2hlsl.translate_to() writes compiler stderr verbatim into these files, so a cache path containing spaces can expose personal and title-specific directories in the supposedly path-redacted, title-neutral report intended for public issues. Redact the whole diagnostic path rather than only its first whitespace-delimited fragment.

AGENTS.md reference: AGENTS.md:L23-L24

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 12:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#discussion_r4679774263) **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Redact complete diagnostic paths containing spaces** For a shader `.fail` line such as `fxc ps: C:\Users\Alice Smith\PrivateTitle\shader.hlsl(1,1): error X3000`, this regex stops at the first space, leaving `<path> Smith\PrivateTitle\shader.hlsl(1,1): error X3000` in the report. `gfx2hlsl.translate_to()` writes compiler stderr verbatim into these files, so a cache path containing spaces can expose personal and title-specific directories in the supposedly path-redacted, title-neutral report intended for public issues. Redact the whole diagnostic path rather than only its first whitespace-delimited fragment. AGENTS.md reference: [AGENTS.md:L23-L24](https://github.com/R0Y00/Xbox2Windows/blob/c44bd0ad785cc4a01110bd05360710fdf3a498f0/AGENTS.md#L23-L24) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 12:10 UTC · original

P2 Badge Avoid counting mirrored log messages twice

For directories produced by run.ps1/debug_launch.py, stderr.txt and trap.log contain the same telemetry: the launcher sets X2W_TRAP_LOG while capturing stderr, and the shared and component loggers write each message to both destinations. Concatenating every discovered file therefore doubles the event counts; a synthetic run with one failed DirectStorage request mirrored in those two standard files reports two failures. Select a canonical stream per run or reconcile the mirrored sources while preserving genuine repeated calls.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 12:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#discussion_r4679774276) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Avoid counting mirrored log messages twice** For directories produced by `run.ps1`/`debug_launch.py`, `stderr.txt` and `trap.log` contain the same telemetry: the launcher sets `X2W_TRAP_LOG` while capturing stderr, and the shared and component loggers write each message to both destinations. Concatenating every discovered file therefore doubles the event counts; a synthetic run with one failed DirectStorage request mirrored in those two standard files reports two failures. Select a canonical stream per run or reconcile the mirrored sources while preserving genuine repeated calls. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 12:10 UTC · original

P2 Badge Exclude successful forwarded slots from unhandled events

For a successful forwarded Device::slot13 (CheckFeatureSupport) call, the log emitted by forward_slot() still matches this fallback and increments d3d12_unhandled. The same happens for successful create_slot() calls. These methods are wired to real desktop implementations in src/startup_stubs/d3d12_xs_device.cpp, so normal implemented operations inflate the unhandled/stubbed report and can displace actual refusals in the limited table. Only add messages establishing unhandled or stubbed behavior here, or report ordinary slot telemetry separately.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 12:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#discussion_r4679774285) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Exclude successful forwarded slots from unhandled events** For a successful forwarded `Device::slot13` (`CheckFeatureSupport`) call, the log emitted by `forward_slot()` still matches this fallback and increments `d3d12_unhandled`. The same happens for successful `create_slot()` calls. These methods are wired to real desktop implementations in `src/startup_stubs/d3d12_xs_device.cpp`, so normal implemented operations inflate the unhandled/stubbed report and can displace actual refusals in the limited table. Only add messages establishing unhandled or stubbed behavior here, or report ordinary slot telemetry separately. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 12:10 UTC · original

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-24T12:10:24.652915Z c44bd0a 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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 12:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#issuecomment-7131068383) <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"c44bd0ad785cc4a01110bd05360710fdf3a498f0","has_any_findings":true,"has_unresolved_findings":true,"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-24T12:10:24.652915Z">2026-11-24T12:10:24.652915Z</relative-time> | `c44bd0a` | 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>
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 12:16 UTC · original

Fixed in bf1b5b86: Unquoted diagnostic paths now redact whole directory components containing spaces (Windows and POSIX), so the full path is replaced; regression covers C:\Users\Alice Smith... and C:\Program Files\My App\shader.hlsl. Win2025 Debug and Release /O2: startup_triage_run 1/1 passed.

**@⁠tedin7** on GitHub · 2026-11-24 12:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#discussion_r4679846767) Fixed in bf1b5b86: Unquoted diagnostic paths now redact whole directory components containing spaces (Windows and POSIX), so the full path is replaced; regression covers C:\Users\Alice Smith\... and C:\Program Files\My App\shader.hlsl. Win2025 Debug and Release /O2: startup_triage_run 1/1 passed.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 12:16 UTC · original

Fixed in bf1b5b86: trap.log lines already present in the sibling stderr.txt are now skipped once each; genuine repeats beyond stderr.txt still count. Regression: one mirrored failure reports 1, a repeated one reports 2. Win2025 Debug and Release /O2: startup_triage_run 1/1 passed.

**@⁠tedin7** on GitHub · 2026-11-24 12:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#discussion_r4679847361) Fixed in bf1b5b86: trap.log lines already present in the sibling stderr.txt are now skipped once each; genuine repeats beyond stderr.txt still count. Regression: one mirrored failure reports 1, a repeated one reports 2. Win2025 Debug and Release /O2: startup_triage_run 1/1 passed.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 12:16 UTC · original

Fixed in bf1b5b86: Forwarded/created slot lines ending in a successful result are no longer added to the unhandled table; failed results and untraced slot calls still are. Regression covers success, failure and untraced lines. Win2025 Debug and Release /O2: startup_triage_run 1/1 passed.

**@⁠tedin7** on GitHub · 2026-11-24 12:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#discussion_r4679848011) Fixed in bf1b5b86: Forwarded/created slot lines ending in a successful result are no longer added to the unhandled table; failed results and untraced slot calls still are. Regression covers success, failure and untraced lines. Win2025 Debug and Release /O2: startup_triage_run 1/1 passed.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 12:26 UTC · original

Fixed in 71ec5842ed: the report is now allowlist-only. It copies just known slot70 reasons and dstorage outcomes, decimal IDs and counts, hex HRESULT/format/flag codes, slot numbers, trap tags, and shader-failure categories (for mnemonics only the family prefix, e.g. v_*). Debug messages are reduced to severity/ID counts, with no context or message text. View-skipped, device-removed, entry-failed, OpenFile and runtime rows no longer carry free text, module names or object prefixes. Anything unrecognised is grouped as other (text omitted). The default redaction regexes are removed, and the docs now describe the allowlist contract.

New synthetic control in tests/startup_triage_run_check.py covers a bare private module name, an unprefixed address, an opaque object name, a Markdown link, and free-form debug/dstorage/shader text; none of it appears in the output.

Local: startup_triage_run_check, docs_links_check, bidi_controls_check, git diff --check and preflight pass. Windows Server 2025: Debug and Release /O2 startup_triage_run 1/1 passed.

**@⁠tedin7** on GitHub · 2026-11-24 12:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#issuecomment-7131436657) Fixed in 71ec5842ed23644e8ddabdd88ca7175645a66e20: the report is now allowlist-only. It copies just known slot70 reasons and dstorage outcomes, decimal IDs and counts, hex HRESULT/format/flag codes, slot numbers, trap tags, and shader-failure categories (for mnemonics only the family prefix, e.g. `v_*`). Debug messages are reduced to severity/ID counts, with no context or message text. View-skipped, device-removed, entry-failed, OpenFile and runtime rows no longer carry free text, module names or object prefixes. Anything unrecognised is grouped as `other (text omitted)`. The default redaction regexes are removed, and the docs now describe the allowlist contract. New synthetic control in `tests/startup_triage_run_check.py` covers a bare private module name, an unprefixed address, an opaque object name, a Markdown link, and free-form debug/dstorage/shader text; none of it appears in the output. Local: startup_triage_run_check, docs_links_check, bidi_controls_check, `git diff --check` and preflight pass. Windows Server 2025: Debug and Release /O2 `startup_triage_run` 1/1 passed.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 12:10 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c44bd0ad78

ℹ️ 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".

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".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 12:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#pullrequestreview-6038940957) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `c44bd0ad78` <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". 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". </details>
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 12:17 UTC · original · requested changes

The summary is described as ready for a public issue, but it still emits arbitrary debug text, shader failure lines and several untyped field values. Regex redaction cannot establish that those strings contain only public evidence. Please make the default report allowlist structured values such as known reasons, numeric format categories, counts, diagnostic IDs and status codes, grouping unknown text without copying it. Add a synthetic control with a bare private module name, an unprefixed address, an opaque object name and a Markdown link. Keep raw snippets local.

**@⁠R0Y00** on GitHub · 2026-11-24 12:17 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#pullrequestreview-6039044348) · **requested changes** The summary is described as ready for a public issue, but it still emits arbitrary debug text, shader failure lines and several untyped field values. Regex redaction cannot establish that those strings contain only public evidence. Please make the default report allowlist structured values such as known reasons, numeric format categories, counts, diagnostic IDs and status codes, grouping unknown text without copying it. Add a synthetic control with a bare private module name, an unprefixed address, an opaque object name and a Markdown link. Keep raw snippets local.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 12:43 UTC · original · approved these changes

The allowlist export passes the synthetic privacy tests. I added controls for a long numeral in a slot field and an address-shaped value in a status field. Both are omitted. Short and correctly sign-extended HRESULTs still combine. The triage, docs links, and bidi checks passed.

**@⁠R0Y00** on GitHub · 2026-11-24 12:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1464#pullrequestreview-6039395896) · **approved these changes** The allowlist export passes the synthetic privacy tests. I added controls for a long numeral in a slot field and an address-shaped value in a status field. Both are omitted. Short and correctly sign-extended HRESULTs still combine. The triage, docs links, and bidi checks passed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.