startup: decode the MSVC C++ exception record into a sanitized summary #1932

Merged
tedin7 merged 7 commits from upstream-pr/1939 into main 2026-12-03 03:33:04 +00:00
tedin7 commented 2026-11-24 21:56:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T21:56:47Z.


Part of #1758 (and #870)

What this unblocks: the startup debugger can report which HRESULT a C++ exception carried when a run ends on 0xE06D7363, as a short public summary with no address, path or name from the title.

This is the decoder only: it is not wired into tools/startup/debug_launch.py (untouched, so it does not collide with the other open PRs that edit that file). The follow-up that calls it at the first-chance stop is a separate change.

Source: the MSVC runtime header ehdata.h (shipped with the Visual Studio C runtime sources) for the 0xE06D7363 parameters and the _ThrowInfo / _CatchableTypeArray / _CatchableType layout; Raymond Chen, The Old New Thing (Microsoft Dev Blogs), "Decoding the parameters of a thrown C++ exception (0xE06D7363)"; Microsoft Learn, "EXCEPTION_RECORD structure (winnt.h)"; Microsoft Learn, "DXGI_ERROR" and "Direct3D 12 return codes", and winerror.h (Windows SDK) for the HRESULT names and values.

Verification (head 49ca19e34, origin/main 9b45cbb44 merged in with a merge commit):

  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP), x2w_pipe.py win2025 1939 --host proxmox --regex '^startup_msvc_throw_info$':
    • dev: ctest --preset dev -R '^startup_msvc_throw_info$' --no-tests=error --output-on-failure: 1/1 passed (startup_msvc_throw_info).
    • release /O2: ctest --preset release -R '^startup_msvc_throw_info$' --no-tests=error --output-on-failure: 1/1 passed (startup_msvc_throw_info).
  • Linux: python3 -B tests/startup_msvc_throw_info_check.py PASS; tests/docs_links_check.py, tests/bidi_controls_check.py, tests/startup_tools_lint_check.py pass; git diff --check origin/main...HEAD clean.

What it does

tools/startup/msvc_throw_info.py turns a 0xE06D7363 exception record into a sanitized summary. #1758 needs the thrown HRESULT of the BVH builder, whose throw info says the catchable type is the built-in long (.J), without putting addresses or names from the title in a public comment.

decode_throw(exception_code, params, read_mem) follows the public MSVC x64 layout (ehdata.h): params[0] magic, [1] thrown object, [2] _ThrowInfo, [3] image base; _ThrowInfo → RVA of _CatchableTypeArray → RVAs of _CatchableType → RVA of type_info, whose decorated name is at offset 16. read_mem(address, size) -> bytes | None is the only access to memory, so the core has no Win32 dependency: in debug_launch.py it would be the existing read.

The record it returns has:

  • status: ok, not_msvc_exception, missing_parameters (fewer than four, so no image base), bad_magic, no_throw_info, unreadable, bad_throw_info, too_many_types (cap of 16, a safety limit).
  • types: one entry per catchable type. Built-in scalars and a short list of public library classes (std::runtime_error, _com_error, ...) are named; any other class is other, so a class of the title never appears.
  • value, only when the first catchable type is a 32-bit scalar (.J, .H, .I, .K) of size 4: the HRESULT as a public name (E_INVALIDARG, E_OUTOFMEMORY, DXGI_ERROR_DEVICE_REMOVED, DXGI_ERROR_DEVICE_HUNG, D3D12_ERROR_*, common HRESULT_FROM_WIN32(...)), or unrecognized_failure for a high-bit value outside the list (no bits, code or facility), with the facility category of a listed one (win32, dxgi, d3d12, other). A positive number above 65535 is not reported.
  • Never an address, a path, a name from the title or a number over 32 bits. describe(record) gives a one-line form made of those fields only.

Test

tests/startup_msvc_throw_info_check.py builds synthetic exception records in a fake address space (no title data) and checks 89 cases: ten HRESULTs through .J (E_INVALIDARG, E_OUTOFMEMORY, DXGI_ERROR_DEVICE_REMOVED, a generic one, ...), .H and .I, another exception code, wrong magic, three parameters, null throw info and image base, a read that fails at each of the four steps (and a callback that returns short data or raises), an RVA beyond the readable range and one that overflows 64 bits, a negative count, 16 and 17 catchable types, a zero RVA, runtime_error, _com_error, a class of the title, a long of the wrong size, malformed names, a name that ends before unmapped memory, and a sweep that no record contains an address, a path, long hex or a number over 32 bits.

It is registered in CMakeLists.txt after startup_triage_run and in the Python check list of .github/workflows/windows.yml next to startup_triage_run_check.py.

Results (Linux, local; mutation and merge-tree runs at the earlier head 9a3c446bb)

  • python3 -B tests/startup_msvc_throw_info_check.py: 89 ok, PASS (head 49ca19e34).
  • Nine mutations of msvc_throw_info.py, each restored with git checkout --; all nine fail the test: magic not checked, facility 0x87A changed to 0x87B, cap >= instead of >, other classes reported by name, negative count accepted, type name read at +8, scalar size not checked, two DXGI names swapped, a raising callback not caught.
  • tests/docs_links_check.py and tests/bidi_controls_check.py pass; git diff --check origin/main...HEAD is clean.
  • git merge-tree of this branch against the head of every open PR (109, including #1408, #1787, #1788, #1789): no conflict that origin/main does not already have.

Not run, not established

  • No real exception record: the layout is the public one as documented, and the test builds records from it, so a difference in a real record would not show here. The first real use is the capture step of #1758.
  • The HRESULT list is short on purpose; a high-bit code outside it prints only as unrecognized_failure.
  • Rethrows (null throw info) and 32-bit records (three parameters) are reported as such and not decoded.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5481002610 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T21:56:47Z. --- Part of #1758 (and #870) What this unblocks: the startup debugger can report which HRESULT a C++ exception carried when a run ends on `0xE06D7363`, as a short public summary with no address, path or name from the title. This is the decoder only: it is not wired into `tools/startup/debug_launch.py` (untouched, so it does not collide with the other open PRs that edit that file). The follow-up that calls it at the first-chance stop is a separate change. Source: the MSVC runtime header `ehdata.h` (shipped with the Visual Studio C runtime sources) for the `0xE06D7363` parameters and the `_ThrowInfo` / `_CatchableTypeArray` / `_CatchableType` layout; Raymond Chen, The Old New Thing (Microsoft Dev Blogs), "Decoding the parameters of a thrown C++ exception (0xE06D7363)"; Microsoft Learn, "EXCEPTION_RECORD structure (winnt.h)"; Microsoft Learn, "DXGI_ERROR" and "Direct3D 12 return codes", and `winerror.h` (Windows SDK) for the HRESULT names and values. Verification (head `49ca19e34`, origin/main `9b45cbb44` merged in with a merge commit): - Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP), `x2w_pipe.py win2025 1939 --host proxmox --regex '^startup_msvc_throw_info$'`: - dev: `ctest --preset dev -R '^startup_msvc_throw_info$' --no-tests=error --output-on-failure`: 1/1 passed (`startup_msvc_throw_info`). - release `/O2`: `ctest --preset release -R '^startup_msvc_throw_info$' --no-tests=error --output-on-failure`: 1/1 passed (`startup_msvc_throw_info`). - Linux: `python3 -B tests/startup_msvc_throw_info_check.py` PASS; `tests/docs_links_check.py`, `tests/bidi_controls_check.py`, `tests/startup_tools_lint_check.py` pass; `git diff --check origin/main...HEAD` clean. ## What it does `tools/startup/msvc_throw_info.py` turns a `0xE06D7363` exception record into a sanitized summary. #1758 needs the thrown HRESULT of the BVH builder, whose throw info says the catchable type is the built-in `long` (`.J`), without putting addresses or names from the title in a public comment. `decode_throw(exception_code, params, read_mem)` follows the public MSVC x64 layout (`ehdata.h`): `params[0]` magic, `[1]` thrown object, `[2]` `_ThrowInfo`, `[3]` image base; `_ThrowInfo` → RVA of `_CatchableTypeArray` → RVAs of `_CatchableType` → RVA of `type_info`, whose decorated name is at offset 16. `read_mem(address, size) -> bytes | None` is the only access to memory, so the core has no Win32 dependency: in `debug_launch.py` it would be the existing `read`. The record it returns has: - `status`: `ok`, `not_msvc_exception`, `missing_parameters` (fewer than four, so no image base), `bad_magic`, `no_throw_info`, `unreadable`, `bad_throw_info`, `too_many_types` (cap of 16, a safety limit). - `types`: one entry per catchable type. Built-in scalars and a short list of public library classes (`std::runtime_error`, `_com_error`, ...) are named; any other class is `other`, so a class of the title never appears. - `value`, only when the first catchable type is a 32-bit scalar (`.J`, `.H`, `.I`, `.K`) of size 4: the HRESULT as a public name (`E_INVALIDARG`, `E_OUTOFMEMORY`, `DXGI_ERROR_DEVICE_REMOVED`, `DXGI_ERROR_DEVICE_HUNG`, `D3D12_ERROR_*`, common `HRESULT_FROM_WIN32(...)`), or `unrecognized_failure` for a high-bit value outside the list (no bits, code or facility), with the facility category of a listed one (`win32`, `dxgi`, `d3d12`, `other`). A positive number above 65535 is not reported. - Never an address, a path, a name from the title or a number over 32 bits. `describe(record)` gives a one-line form made of those fields only. ## Test `tests/startup_msvc_throw_info_check.py` builds synthetic exception records in a fake address space (no title data) and checks 89 cases: ten HRESULTs through `.J` (`E_INVALIDARG`, `E_OUTOFMEMORY`, `DXGI_ERROR_DEVICE_REMOVED`, a generic one, ...), `.H` and `.I`, another exception code, wrong magic, three parameters, null throw info and image base, a read that fails at each of the four steps (and a callback that returns short data or raises), an RVA beyond the readable range and one that overflows 64 bits, a negative count, 16 and 17 catchable types, a zero RVA, `runtime_error`, `_com_error`, a class of the title, a `long` of the wrong size, malformed names, a name that ends before unmapped memory, and a sweep that no record contains an address, a path, long hex or a number over 32 bits. It is registered in `CMakeLists.txt` after `startup_triage_run` and in the Python check list of `.github/workflows/windows.yml` next to `startup_triage_run_check.py`. ## Results (Linux, local; mutation and merge-tree runs at the earlier head 9a3c446bb) - `python3 -B tests/startup_msvc_throw_info_check.py`: 89 ok, PASS (head 49ca19e34). - Nine mutations of `msvc_throw_info.py`, each restored with `git checkout --`; all nine fail the test: magic not checked, facility `0x87A` changed to `0x87B`, cap `>=` instead of `>`, other classes reported by name, negative count accepted, type name read at +8, scalar size not checked, two DXGI names swapped, a raising callback not caught. - `tests/docs_links_check.py` and `tests/bidi_controls_check.py` pass; `git diff --check origin/main...HEAD` is clean. - `git merge-tree` of this branch against the head of every open PR (109, including #1408, #1787, #1788, #1789): no conflict that `origin/main` does not already have. ## Not run, not established - No real exception record: the layout is the public one as documented, and the test builds records from it, so a difference in a real record would not show here. The first real use is the capture step of #1758. - The HRESULT list is short on purpose; a high-bit code outside it prints only as `unrecognized_failure`. - Rethrows (null throw info) and 32-bit records (three parameters) are reported as such and not decoded. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-24 22:01:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T21:56:58Z.


Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T11:08:47.818074Z
We couldn’t complete this review. Comment @codex review to try again.
49ca19e 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:7145602536 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7145602536). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T21:56:58Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"49ca19e344de2afe87ecafbb4f0241bf0e081891","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ❌ **Failed** <relative-time datetime="2026-11-26T11:08:47.818074Z">2026-11-26T11:08:47.818074Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `49ca19e` | 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>
R0Y00 commented 2026-11-24 22:18:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T22:18:58Z.

Review: CHANGES_REQUESTED


Please tighten the public summary allowlist. _describe_value treats every 32-bit scalar with bit 31 set as an HRESULT, then emits its raw hex in both the record and the one-line description. A thrown integer with that bit set can be private application data. Keep named, recognized HRESULTs such as E_INVALIDARG, and classify an unrecognized high-bit value without printing its bits in the shareable output. Add a synthetic scalar sentinel and check both the returned record and describe(). The core can still run independently of the startup debugger.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048301641 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#pullrequestreview-6048301641). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T22:18:58Z. **Review:** CHANGES_REQUESTED --- Please tighten the public summary allowlist. `_describe_value` treats every 32-bit scalar with bit 31 set as an HRESULT, then emits its raw hex in both the record and the one-line description. A thrown integer with that bit set can be private application data. Keep named, recognized HRESULTs such as E_INVALIDARG, and classify an unrecognized high-bit value without printing its bits in the shareable output. Add a synthetic scalar sentinel and check both the returned record and `describe()`. The core can still run independently of the startup debugger.
tedin7 commented 2026-11-25 01:02:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:49:02Z.


Addressed in 9a3c446b.

  • _describe_value now names only recognized public HRESULTs (E_INVALIDARG and the other table entries keep their name, facility and code).
  • Any other value with bit 31 set is reported as unrecognized_failure (value and category): no code, no bits, no facility, in both the record and describe().
  • Test: synthetic sentinels (0xDEADBEEF, 0x80041234, 0x887A9999, 0xCAFE0001) are checked in the returned record and in the describe() line, in hex, unsigned and signed decimal. It fails on the previous head (mismatch) and passes now.

Verification:

  • python3 -I tests/startup_msvc_throw_info_check.py: PASS locally (Linux).
  • python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 1939 --regex startup_msvc_throw_info: Win2025 (Build 26100, MSVC 14.44, WARP), Debug and Release ctest -R startup_msvc_throw_info 1/1 passed each, at 9a3c446b.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7148907864 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7148907864). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:49:02Z. --- Addressed in 9a3c446b. - `_describe_value` now names only recognized public HRESULTs (E_INVALIDARG and the other table entries keep their name, facility and code). - Any other value with bit 31 set is reported as `unrecognized_failure` (value and category): no code, no bits, no facility, in both the record and `describe()`. - Test: synthetic sentinels (`0xDEADBEEF`, `0x80041234`, `0x887A9999`, `0xCAFE0001`) are checked in the returned record and in the `describe()` line, in hex, unsigned and signed decimal. It fails on the previous head (mismatch) and passes now. Verification: - `python3 -I tests/startup_msvc_throw_info_check.py`: PASS locally (Linux). - `python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 1939 --regex startup_msvc_throw_info`: Win2025 (Build 26100, MSVC 14.44, WARP), Debug and Release `ctest -R startup_msvc_throw_info` 1/1 passed each, at 9a3c446b. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 14:04:20 +00:00
tedin7 commented 2026-11-25 14:05:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:50:39Z.


Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.

We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164371860 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7164371860). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:50:39Z. --- Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is. We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally.
upstream-sync reopened this pull request 2026-11-26 11:02:38 +00:00
tedin7 commented 2026-11-26 11:03:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:44:13Z.


Reopened and brought up to date: origin/main (9b45cbb44) merged into the branch with a merge commit (no force push). One conflict in CMakeLists.txt: main added runtime_startup_triage_run_cli_check at the same place as startup_msvc_throw_info; both tests are kept.

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev -- -j 2): 6.76 s (configure 2.52 s)
    • Test (ctest --preset dev -R '^startup_msvc_throw_info$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (startup_msvc_throw_info 0.11 s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release -- -j 2): 242.37 s (configure 2.26 s)
    • Test (ctest --preset release -R '^startup_msvc_throw_info$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (startup_msvc_throw_info 0.10 s)

Linux at the same head: python3 -B tests/startup_msvc_throw_info_check.py PASS (89 checks, including the unrecognized high-bit sentinels from the review: neither the record nor describe() prints their bits); tests/docs_links_check.py, tests/bidi_controls_check.py, tests/startup_tools_lint_check.py pass; git diff --check origin/main...HEAD clean.

The description now starts with the Part of, What this unblocks, Source: and Verification: lines. Still Draft until an independent second check passes.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7189766076 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7189766076). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T10:44:13Z. --- Reopened and brought up to date: origin/main (`9b45cbb44`) merged into the branch with a merge commit (no force push). One conflict in `CMakeLists.txt`: main added `runtime_startup_triage_run_cli_check` at the same place as `startup_msvc_throw_info`; both tests are kept. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `49ca19e344de2afe87ecafbb4f0241bf0e081891`: - Debug (`--preset dev`): - Build (`cmake --build --preset dev -- -j 2`): 6.76 s (configure 2.52 s) - Test (`ctest --preset dev -R '^startup_msvc_throw_info$' --parallel 2 --no-tests=error --output-on-failure`): **1/1 passed** (`startup_msvc_throw_info` 0.11 s) - Release `/O2` (`--preset release`): - Build (`cmake --build --preset release -- -j 2`): 242.37 s (configure 2.26 s) - Test (`ctest --preset release -R '^startup_msvc_throw_info$' --parallel 2 --no-tests=error --output-on-failure`): **1/1 passed** (`startup_msvc_throw_info` 0.10 s) Linux at the same head: `python3 -B tests/startup_msvc_throw_info_check.py` PASS (89 checks, including the unrecognized high-bit sentinels from the review: neither the record nor `describe()` prints their bits); `tests/docs_links_check.py`, `tests/bidi_controls_check.py`, `tests/startup_tools_lint_check.py` pass; `git diff --check origin/main...HEAD` clean. The description now starts with the `Part of`, `What this unblocks`, `Source:` and `Verification:` lines. Still Draft until an independent second check passes. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 12:04:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:08:42Z.


@MasterDomino Ready for review: head 49ca19e344de2afe87ecafbb4f0241bf0e081891 (decoder only; it is not wired into debug_launch.py).

Independent Stage-2 check on this exact head, Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP), Proxmox slots, dev and release /O2:

python3 x2w_pipe.py win2025 1939 --host proxmox --regex '^startup_msvc_throw_info$' --keep-release
ctest --preset dev     -R '^startup_msvc_throw_info$' --no-tests=error   -> 1/1 passed (startup_msvc_throw_info)
ctest --preset release -R '^startup_msvc_throw_info$' --no-tests=error   -> 1/1 passed (startup_msvc_throw_info)

Review result: records of a thrown long (named HRESULTs such as E_INVALIDARG and DXGI_ERROR_DEVICE_REMOVED), int, std::runtime_error and a class of the title decode as the public layout says; a failure code that is not a public HRESULT is classified without its bits; a class that is not a public library type is reported as other and never named. Wrong magic, missing image base, shifted throw info, a foreign image base, unreadable memory, a throwing read callback and an over-long name are all refused with a status and no exception; 4000 randomly mutated real records raised nothing and no address, path or title name appeared in any output.

Non-blocking: a thrown number up to 65535 is printed as a number (for example long=5); a private small error code would be visible there. The body already states this limit.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7190330458 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7190330458). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:08:42Z. --- @MasterDomino Ready for review: head `49ca19e344de2afe87ecafbb4f0241bf0e081891` (decoder only; it is not wired into `debug_launch.py`). Independent Stage-2 check on this exact head, Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP), Proxmox slots, dev and release `/O2`: ``` python3 x2w_pipe.py win2025 1939 --host proxmox --regex '^startup_msvc_throw_info$' --keep-release ctest --preset dev -R '^startup_msvc_throw_info$' --no-tests=error -> 1/1 passed (startup_msvc_throw_info) ctest --preset release -R '^startup_msvc_throw_info$' --no-tests=error -> 1/1 passed (startup_msvc_throw_info) ``` Review result: records of a thrown `long` (named HRESULTs such as `E_INVALIDARG` and `DXGI_ERROR_DEVICE_REMOVED`), `int`, `std::runtime_error` and a class of the title decode as the public layout says; a failure code that is not a public HRESULT is classified without its bits; a class that is not a public library type is reported as `other` and never named. Wrong magic, missing image base, shifted throw info, a foreign image base, unreadable memory, a throwing read callback and an over-long name are all refused with a status and no exception; 4000 randomly mutated real records raised nothing and no address, path or title name appeared in any output. Non-blocking: a thrown number up to 65535 is printed as a number (for example `long=5`); a private small error code would be visible there. The body already states this limit. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 12:04:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T11:08:53Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7190335183 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7190335183). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T11:08:53Z. --- You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage). To continue using code reviews, add credits to your account and enable them for code reviews in your [settings](https://chatgpt.com/settings/code-review).
pigalot commented 2026-11-27 22:04:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:04:25Z.

Review: APPROVED


Independently reviewed 49ca19e3 integrated over main ae078247 (tree 826dcb80). The merge is clean (CMakeLists.txt and .github/workflows/windows.yml auto-merged) and git diff --cached --check origin/main is clean.

Earlier finding (R0Y00, changes requested on 205803c2): addressed. In _describe_value, a 32-bit value with bit 31 set that is not in HRESULT_NAMES now returns only c_type, hresult=unrecognized_failure and category=unrecognized_failure. It has no code, no facility and no bits. describe() builds its line from those fields only. Named HRESULTs keep their name, facility category and code. The sentinels 0xDEADBEEF, 0x80041234, 0x887A9999 and 0xCAFE0001 are checked in both the returned record and the describe() line. Restoring the old branch (hresult_name(bits) plus code) fails them at unrecognized 0xdeadbeef is classified without its bits: MISMATCH.

What I traced. I checked the offsets against the public ehdata.h x64 layout:

  • _ThrowInfo: 16 bytes, with the _CatchableTypeArray RVA at +12.
  • _CatchableType: 28 bytes, with the type_info RVA at +4 and the size at +20.
  • TypeDescriptor: the decorated name at +16.

I checked the HRESULT table values against winerror.h and the DXGI/D3D12 return-code lists. Every refusal goes through _refused() with a status only. A class name not on the allowlist is reported as other.

What I ran.

. .\tools\dev.ps1; cmake --preset dev; cmake --preset release
ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R '^(startup_msvc_throw_info|startup_triage_run|runtime_startup_triage_run_cli_check)$'
.\out\pe-env\Scripts\python.exe -B tests/startup_msvc_throw_info_check.py
  • New test and neighbours: 3/3 pass in dev and in release. No skips.
  • Direct run: 89 checks ok, then PASS.
  • Before: on main ae078247, startup_msvc_throw_info is not registered.

Mutants (each applied alone to tools/startup/msvc_throw_info.py, check rerun, file restored from its raw bytes, git diff --quiet clean afterwards). Every one fails the check; the first mismatch is shown:

Mutant First mismatch
unrecognized high-bit value printed as HRESULT(0x…) with code (the pre-fix form) unrecognized 0xdeadbeef is classified without its bits
unrecognized value keeps its facility category same
high-bit branch removed same
describe() also prints code unrecognized 0xdeadbeef: describe line
small-number limit raised to 0x7FFFFFFF a large positive number is not reported
other classes reported by decorated name a class of the title is 'other'
scalar size not checked a long of the wrong size has no value
magic not checked wrong magic
type_info name read at +8 long 0x80070057 is E_INVALIDARG
raising read callback not caught traceback
type cap >= instead of > 16 catchable types is the cap

Non-blocking notes.

  • The body has not caught up with 9a3c446b. Under "What it does" and "Not run, not established" it still says an unlisted code prints as HRESULT(0x........) with its facility. The code no longer does that, so the body should say unrecognized_failure.
  • hresult_name() still returns HRESULT(0x%08X) for an unlisted value. Nothing in the decoder calls it, but the follow-up that wires this into debug_launch.py could reach for it and bring the bits back. Dropping it, or giving it the same unrecognized_failure answer, would close that.
  • Since #2655, new registrations can go in a tests/cmake/<family>.cmake fragment and a tests/checks/python-linux/<topic>.txt file. That keeps them off the shared lines of CMakeLists.txt and the workflow. Those files are optional, and this merge is clean as it is.

Verdict: approve on 49ca19e3.

Environment: Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10. No GPU is involved.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on 49ca19e3.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093789099 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#pullrequestreview-6093789099). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T22:04:25Z. **Review:** APPROVED --- Independently reviewed `49ca19e3` integrated over `main` `ae078247` (tree `826dcb80`). The merge is clean (`CMakeLists.txt` and `.github/workflows/windows.yml` auto-merged) and `git diff --cached --check origin/main` is clean. **Earlier finding (R0Y00, changes requested on `205803c2`): addressed.** In `_describe_value`, a 32-bit value with bit 31 set that is not in `HRESULT_NAMES` now returns only `c_type`, `hresult=unrecognized_failure` and `category=unrecognized_failure`. It has no code, no facility and no bits. `describe()` builds its line from those fields only. Named HRESULTs keep their name, facility category and code. The sentinels `0xDEADBEEF`, `0x80041234`, `0x887A9999` and `0xCAFE0001` are checked in both the returned record and the `describe()` line. Restoring the old branch (`hresult_name(bits)` plus `code`) fails them at `unrecognized 0xdeadbeef is classified without its bits: MISMATCH`. **What I traced.** I checked the offsets against the public `ehdata.h` x64 layout: - `_ThrowInfo`: 16 bytes, with the `_CatchableTypeArray` RVA at +12. - `_CatchableType`: 28 bytes, with the `type_info` RVA at +4 and the size at +20. - `TypeDescriptor`: the decorated name at +16. I checked the HRESULT table values against `winerror.h` and the DXGI/D3D12 return-code lists. Every refusal goes through `_refused()` with a status only. A class name not on the allowlist is reported as `other`. **What I ran.** ```powershell . .\tools\dev.ps1; cmake --preset dev; cmake --preset release ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R '^(startup_msvc_throw_info|startup_triage_run|runtime_startup_triage_run_cli_check)$' .\out\pe-env\Scripts\python.exe -B tests/startup_msvc_throw_info_check.py ``` - **New test and neighbours:** 3/3 pass in `dev` and in `release`. No skips. - **Direct run:** 89 checks `ok`, then `PASS`. - **Before:** on `main` `ae078247`, `startup_msvc_throw_info` is not registered. **Mutants** (each applied alone to `tools/startup/msvc_throw_info.py`, check rerun, file restored from its raw bytes, `git diff --quiet` clean afterwards). Every one fails the check; the first mismatch is shown: | Mutant | First mismatch | |---|---| | unrecognized high-bit value printed as `HRESULT(0x…)` with `code` (the pre-fix form) | `unrecognized 0xdeadbeef is classified without its bits` | | unrecognized value keeps its facility category | same | | high-bit branch removed | same | | `describe()` also prints `code` | `unrecognized 0xdeadbeef: describe line` | | small-number limit raised to `0x7FFFFFFF` | `a large positive number is not reported` | | other classes reported by decorated name | `a class of the title is 'other'` | | scalar size not checked | `a long of the wrong size has no value` | | magic not checked | `wrong magic` | | `type_info` name read at +8 | `long 0x80070057 is E_INVALIDARG` | | raising read callback not caught | traceback | | type cap `>=` instead of `>` | `16 catchable types is the cap` | **Non-blocking notes.** - The body has not caught up with `9a3c446b`. Under "What it does" and "Not run, not established" it still says an unlisted code prints as `HRESULT(0x........)` with its facility. The code no longer does that, so the body should say `unrecognized_failure`. - `hresult_name()` still returns `HRESULT(0x%08X)` for an unlisted value. Nothing in the decoder calls it, but the follow-up that wires this into `debug_launch.py` could reach for it and bring the bits back. Dropping it, or giving it the same `unrecognized_failure` answer, would close that. - Since #2655, new registrations can go in a `tests/cmake/<family>.cmake` fragment and a `tests/checks/python-linux/<topic>.txt` file. That keeps them off the shared lines of `CMakeLists.txt` and the workflow. Those files are optional, and this merge is clean as it is. **Verdict:** approve on `49ca19e3`. Environment: Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10. No GPU is involved. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `49ca19e3`. This reply was AI-assisted.
JohnConnorNPC commented 2026-11-28 08:18:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T08:18:25Z.


I reviewed 49ca19e3 (no MSVC build). Nothing here looks blocking to me. The code addresses R0Y00's requested change, so I think the PR only needs their re-review. Two small follow-ups are below; pigalot mentioned both as non-blocking.

What I checked

  • The merge into current main (1f07b2c1) is clean: git merge-tree --write-tree 1f07b2c1 49ca19e3 → rc=0. On that tree, python3 -B tests/startup_msvc_throw_info_check.py → 89 ok, PASS. The Linux CI job ran it too (tests/startup_msvc_throw_info_check.py (ok, 0.1s)).
  • The requested change: since 9a3c446b, an unlisted bit-31 value returns only unrecognized_failure, and the sentinels are checked in both the record and describe(). git diff 9a3c446b 49ca19e3 -- tools/startup/msvc_throw_info.py tests/startup_msvc_throw_info_check.py is empty.
  • Layout vs the CRT headers (ehdata_forceinclude.h, x64 _EH_RELATIVE_TYPEINFO 1): the ThrowInfo array RVA is at +12. CatchableType has pType at +4 and the size at +20 (28 bytes). The TypeDescriptor name is at +16, the magic is 0x19930520, and EH_EXCEPTION_PARAMETERS is 4. All 33 HRESULT_NAMES entries match the SDK's winerror.h.
  • Real records: a small clang-cl /MD probe under Wine threw 11 objects, and a vectored handler dumped each 0xE06D7363 record (12 with the rethrow). The decoder gave the expected line for all of them, with no address or class name in any output. Examples: long=E_INVALIDARG category=win32, unsigned_int=unrecognized_failure, types=other,other count=2 for a private class, no_throw_info for the rethrow. That is clang-cl with Wine's vcruntime, not MSVC on Windows, but it covers some of the "no real exception record" gap the body lists.

Suggestions

  1. The body still describes the earlier output in two places (grep -c 'HRESULT(0x' on the body → 2). Under "What it does": "or HRESULT(0x........), with its facility category". Under "Not run": "a code outside it prints as HRESULT(0x........) with its facility". Both could now say unrecognized_failure.
  2. hresult_name() still returns HRESULT(0x%08X) for an unlisted code. Nothing calls it yet, but the debug_launch.py follow-up might, and that would bring the bits back. The test checks it only with a listed value, so a mutant that returns unrecognized_failure there still passes. Returning UNRECOGNIZED_HRESULT (or dropping the helper) plus one unlisted-sentinel check would pin it.
  3. Minor: three more spots where a mutant still passes the test.
    • The 65535 limit the body states: raising SMALL_VALUE_LIMIT to 0xFFFFFF, or <= → <.
    • .K: removing it from SCALARS_32.
    • S_FALSE: a thrown int 1 is reported as S_FALSE category=success, because the table lookup runs before the small-number branch.
      Cases for 65535 and 65536, one .K and one int 1 would cover them.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236497294 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7236497294). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T08:18:25Z. --- I reviewed `49ca19e3` (no MSVC build). Nothing here looks blocking to me. The code addresses R0Y00's requested change, so I think the PR only needs their re-review. Two small follow-ups are below; pigalot mentioned both as non-blocking. **What I checked** - The merge into current `main` (`1f07b2c1`) is clean: `git merge-tree --write-tree 1f07b2c1 49ca19e3` → rc=0. On that tree, `python3 -B tests/startup_msvc_throw_info_check.py` → 89 `ok`, `PASS`. The Linux CI job ran it too (`tests/startup_msvc_throw_info_check.py (ok, 0.1s)`). - The requested change: since `9a3c446b`, an unlisted bit-31 value returns only `unrecognized_failure`, and the sentinels are checked in both the record and `describe()`. `git diff 9a3c446b 49ca19e3 -- tools/startup/msvc_throw_info.py tests/startup_msvc_throw_info_check.py` is empty. - Layout vs the CRT headers (`ehdata_forceinclude.h`, x64 `_EH_RELATIVE_TYPEINFO 1`): the ThrowInfo array RVA is at +12. CatchableType has `pType` at +4 and the size at +20 (28 bytes). The TypeDescriptor name is at +16, the magic is `0x19930520`, and `EH_EXCEPTION_PARAMETERS` is 4. All 33 `HRESULT_NAMES` entries match the SDK's `winerror.h`. - Real records: a small clang-cl `/MD` probe under Wine threw 11 objects, and a vectored handler dumped each 0xE06D7363 record (12 with the rethrow). The decoder gave the expected line for all of them, with no address or class name in any output. Examples: `long=E_INVALIDARG category=win32`, `unsigned_int=unrecognized_failure`, `types=other,other count=2` for a private class, `no_throw_info` for the rethrow. That is clang-cl with Wine's vcruntime, not MSVC on Windows, but it covers some of the "no real exception record" gap the body lists. **Suggestions** 1. The body still describes the earlier output in two places (`grep -c 'HRESULT(0x'` on the body → 2). Under "What it does": "or `HRESULT(0x........)`, with its facility category". Under "Not run": "a code outside it prints as `HRESULT(0x........)` with its facility". Both could now say `unrecognized_failure`. 2. `hresult_name()` still returns `HRESULT(0x%08X)` for an unlisted code. Nothing calls it yet, but the `debug_launch.py` follow-up might, and that would bring the bits back. The test checks it only with a listed value, so a mutant that returns `unrecognized_failure` there still passes. Returning `UNRECOGNIZED_HRESULT` (or dropping the helper) plus one unlisted-sentinel check would pin it. 3. Minor: three more spots where a mutant still passes the test. - The 65535 limit the body states: raising `SMALL_VALUE_LIMIT` to `0xFFFFFF`, or `<=` → `<`. - `.K`: removing it from `SCALARS_32`. - `S_FALSE`: a thrown `int` 1 is reported as `S_FALSE category=success`, because the table lookup runs before the small-number branch. Cases for 65535 and 65536, one `.K` and one `int` 1 would cover them. This comment was AI-assisted.
tedin7 commented 2026-11-28 21:58:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T21:58:13Z.


Thanks @JohnConnorNPC. Pushed b055cab96 (origin/main merged with a merge commit, no force push).

What changed:

  • Suggestion 1: the PR body no longer mentions HRESULT(0x........); it says unrecognized_failure.
  • Suggestion 2: hresult_name() now returns unrecognized_failure for an unlisted value, so no caller can bring the bits back.
  • Suggestion 3: new cases for 65535 (reported) and 65536 (not reported), an unsigned long (.K) scalar, a thrown int 1 (the listed S_FALSE), and an unlisted value through hresult_name.
  • Mutants that now fail: SMALL_VALUE_LIMIT raised, <= changed to <, .K removed from SCALARS_32, hresult_name printing bits again.

Verification:

  • Linux: python3 -B tests/startup_msvc_throw_info_check.py -> PASS.
  • Windows Server 2025 (D3D12 WARP), dev and release, head b055cab96: x2w_pipe.py win2025 1939 --regex '^startup_msvc_throw_info$' -> 1/1 passed in both legs.

@MasterDomino ready for review and merge when you have time. The earlier changes-requested review by @R0Y00 (unrecognized high-bit values) is fixed on this head and approved by pigalot.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7246403193 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7246403193). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-28T21:58:13Z. --- Thanks @JohnConnorNPC. Pushed `b055cab96` (origin/main merged with a merge commit, no force push). What changed: - Suggestion 1: the PR body no longer mentions `HRESULT(0x........)`; it says `unrecognized_failure`. - Suggestion 2: `hresult_name()` now returns `unrecognized_failure` for an unlisted value, so no caller can bring the bits back. - Suggestion 3: new cases for 65535 (reported) and 65536 (not reported), an unsigned long (`.K`) scalar, a thrown int 1 (the listed `S_FALSE`), and an unlisted value through `hresult_name`. - Mutants that now fail: `SMALL_VALUE_LIMIT` raised, `<=` changed to `<`, `.K` removed from `SCALARS_32`, `hresult_name` printing bits again. Verification: - Linux: `python3 -B tests/startup_msvc_throw_info_check.py` -> PASS. - Windows Server 2025 (D3D12 WARP), dev and release, head `b055cab96`: `x2w_pipe.py win2025 1939 --regex '^startup_msvc_throw_info$'` -> 1/1 passed in both legs. @MasterDomino ready for review and merge when you have time. The earlier changes-requested review by @R0Y00 (unrecognized high-bit values) is fixed on this head and approved by pigalot. AI-assisted; commands listed were executed locally.
pigalot commented 2026-11-29 05:35:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T05:35:48Z.

Review: APPROVED


Retested b055cab9 integrated over main 212d4b5f (tree 29bf8761). The merge is clean and git diff --cached --check origin/main is clean. This follows my approval on 49ca19e3.

What changed since 49ca19e3. git diff 49ca19e3 b055cab9 on the PR's two files is 3 lines of code and 11 lines of test:

  • hresult_name() returns unrecognized_failure for an unlisted value. It no longer formats the bits.
  • New checks: 65535 reported and 65536 not, a .K scalar, a thrown int 1 as the listed S_FALSE, and hresult_name of an unlisted value (unsigned and signed).

The merge of main (d45d241a) has an empty git show --remerge-diff, so it resolved nothing by hand.

Earlier findings.

  • R0Y00's changes request on 205803c2 (an unrecognized high-bit value printed its bits): still addressed. _describe_value is unchanged since 9a3c446b, and the four sentinel checks on the record and on describe() still pass.
  • My non-blocking note on hresult_name(): addressed. grep for HRESULT(0x in the tree finds nothing now.
  • My non-blocking note on the body: addressed for HRESULT(0x........). Two smaller leftovers are under "Non-blocking" below.

What I ran.

. .\tools\dev.ps1; cmake --preset dev; cmake --preset release
ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R '^(startup_msvc_throw_info|startup_triage_run|runtime_startup_triage_run_cli_check)$'
.\out\pe-env\Scripts\python.exe -B tests/startup_msvc_throw_info_check.py
  • Test and neighbours: 3/3 pass in dev and in release. No skips.
  • Direct run: 94 checks ok, then PASS.
  • Also pass: tests/docs_links_check.py, tests/bidi_controls_check.py, tests/startup_tools_lint_check.py.
  • Negative control: the new test against the module from 49ca19e3 fails with one line, hresult_name of an unlisted value prints no bits: MISMATCH. The other four new checks pass there, as expected: they pin behaviour that was already right.

Mutants (each applied alone to tools/startup/msvc_throw_info.py, check rerun, file restored from its raw bytes, git diff --quiet clean afterwards).

Killed (11), with the first failing check:

Mutant First failure
hresult_name prints HRESULT(0x…) again hresult_name of an unlisted value prints no bits
hresult_name without the 32-bit mask hresult_name wraps to 32 bits
SMALL_VALUE_LIMIT raised to 0xFFFFFF a thrown long 65536 is not reported
SMALL_VALUE_LIMIT raised to 0x10000 same
SMALL_VALUE_LIMIT lowered to 0xFFFE a thrown long 65535 is reported
<= changed to < same
.K removed from SCALARS_32 KeyError: 'value' in the .K check
.K named unsigned int an unsigned long is a scalar
S_FALSE removed from the table KeyError: 'hresult' in the int 1 check
table lookup only for values with bit 31 set same
every small number given category success a small number is reported as a number

Surviving: none.

Equivalent (1): .K marked signed. The value is masked with 0xFFFFFFFF straight after struct.unpack, so the signed flag cannot change any output.

Non-blocking.

  • The body's "Verification" header still names head 49ca19e34, and "Test" still says 89 cases. It is 94 at this head.
  • A thrown int 1 is reported as S_FALSE category=success. The new check pins that on purpose. A thrown 1 that is a plain number reads as an HRESULT there, which is harmless for the summary but worth knowing when reading one.

No title run: this PR adds a standalone Python decoder and its check, and nothing in the runtime or the launcher calls it.

Verdict: approve on b055cab9. I am not merging it in this pass. R0Y00's changes request from 205803c2 is still formally open on the PR; the code has met it since 9a3c446b.

Environment: Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10. No GPU is involved.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on b055cab9.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6101592505 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#pullrequestreview-6101592505). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-29T05:35:48Z. **Review:** APPROVED --- Retested `b055cab9` integrated over `main` `212d4b5f` (tree `29bf8761`). The merge is clean and `git diff --cached --check origin/main` is clean. This follows my approval on `49ca19e3`. **What changed since `49ca19e3`.** `git diff 49ca19e3 b055cab9` on the PR's two files is 3 lines of code and 11 lines of test: - `hresult_name()` returns `unrecognized_failure` for an unlisted value. It no longer formats the bits. - New checks: 65535 reported and 65536 not, a `.K` scalar, a thrown `int` 1 as the listed `S_FALSE`, and `hresult_name` of an unlisted value (unsigned and signed). The merge of `main` (`d45d241a`) has an empty `git show --remerge-diff`, so it resolved nothing by hand. **Earlier findings.** - R0Y00's changes request on `205803c2` (an unrecognized high-bit value printed its bits): still addressed. `_describe_value` is unchanged since `9a3c446b`, and the four sentinel checks on the record and on `describe()` still pass. - My non-blocking note on `hresult_name()`: addressed. `grep` for `HRESULT(0x` in the tree finds nothing now. - My non-blocking note on the body: addressed for `HRESULT(0x........)`. Two smaller leftovers are under "Non-blocking" below. **What I ran.** ```powershell . .\tools\dev.ps1; cmake --preset dev; cmake --preset release ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R '^(startup_msvc_throw_info|startup_triage_run|runtime_startup_triage_run_cli_check)$' .\out\pe-env\Scripts\python.exe -B tests/startup_msvc_throw_info_check.py ``` - **Test and neighbours:** 3/3 pass in `dev` and in `release`. No skips. - **Direct run:** 94 checks `ok`, then `PASS`. - **Also pass:** `tests/docs_links_check.py`, `tests/bidi_controls_check.py`, `tests/startup_tools_lint_check.py`. - **Negative control:** the new test against the module from `49ca19e3` fails with one line, `hresult_name of an unlisted value prints no bits: MISMATCH`. The other four new checks pass there, as expected: they pin behaviour that was already right. **Mutants** (each applied alone to `tools/startup/msvc_throw_info.py`, check rerun, file restored from its raw bytes, `git diff --quiet` clean afterwards). Killed (11), with the first failing check: | Mutant | First failure | |---|---| | `hresult_name` prints `HRESULT(0x…)` again | `hresult_name of an unlisted value prints no bits` | | `hresult_name` without the 32-bit mask | `hresult_name wraps to 32 bits` | | `SMALL_VALUE_LIMIT` raised to `0xFFFFFF` | `a thrown long 65536 is not reported` | | `SMALL_VALUE_LIMIT` raised to `0x10000` | same | | `SMALL_VALUE_LIMIT` lowered to `0xFFFE` | `a thrown long 65535 is reported` | | `<=` changed to `<` | same | | `.K` removed from `SCALARS_32` | `KeyError: 'value'` in the `.K` check | | `.K` named `unsigned int` | `an unsigned long is a scalar` | | `S_FALSE` removed from the table | `KeyError: 'hresult'` in the `int` 1 check | | table lookup only for values with bit 31 set | same | | every small number given category `success` | `a small number is reported as a number` | Surviving: none. Equivalent (1): `.K` marked signed. The value is masked with `0xFFFFFFFF` straight after `struct.unpack`, so the signed flag cannot change any output. **Non-blocking.** - The body's "Verification" header still names head `49ca19e34`, and "Test" still says 89 cases. It is 94 at this head. - A thrown `int` 1 is reported as `S_FALSE category=success`. The new check pins that on purpose. A thrown 1 that is a plain number reads as an HRESULT there, which is harmless for the summary but worth knowing when reading one. No title run: this PR adds a standalone Python decoder and its check, and nothing in the runtime or the launcher calls it. **Verdict:** approve on `b055cab9`. I am not merging it in this pass. R0Y00's changes request from `205803c2` is still formally open on the PR; the code has met it since `9a3c446b`. Environment: Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10. No GPU is involved. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `b055cab9`. This reply was AI-assisted.
JohnConnorNPC commented 2026-11-29 13:11:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:11:07Z.


Thanks for b055cab9. I re-checked it against current main (c04e0dd6). All three suggestions from my 11-28 comment are answered:

  • python3 -B tests/startup_msvc_throw_info_check.py on the head gives PASS (rc=0, 94 ok lines).
  • The four mutants that passed before now fail (each rc=1). Raising SMALL_VALUE_LIMIT to 0xFFFFFF fails a thrown long 65536 is not reported: MISMATCH. Changing bits <= SMALL_VALUE_LIMIT to < fails a thrown long 65535 is reported: MISMATCH. Removing .K from SCALARS_32 makes the check raise. Making hresult_name() print HRESULT(0x%08X) again fails hresult_name of an unlisted value prints no bits: MISMATCH.
  • The decoder is still not wired into the launcher, so the default run path is unchanged.

The branch conflicts with main again, in CMakeLists.txt only: git merge-tree --write-tree c04e0dd6 b055cab9 exits 1. #3198 added startup_refusal_census at the same spot where this PR adds startup_msvc_throw_info, and keeping both add_test blocks resolves it. Could you merge main (or rebase)? After that, R0Y00's changes request on 205803c2 still needs their re-review, since the code meets it.

Environment: Linux only: git objects, git merge-tree, and the Python check with four mutants on scratch copies.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7256350400 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7256350400). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T13:11:07Z. --- Thanks for `b055cab9`. I re-checked it against current `main` (`c04e0dd6`). All three suggestions from my 11-28 comment are answered: - `python3 -B tests/startup_msvc_throw_info_check.py` on the head gives `PASS` (rc=0, 94 `ok` lines). - The four mutants that passed before now fail (each rc=1). Raising `SMALL_VALUE_LIMIT` to `0xFFFFFF` fails `a thrown long 65536 is not reported: MISMATCH`. Changing `bits <= SMALL_VALUE_LIMIT` to `<` fails `a thrown long 65535 is reported: MISMATCH`. Removing `.K` from `SCALARS_32` makes the check raise. Making `hresult_name()` print `HRESULT(0x%08X)` again fails `hresult_name of an unlisted value prints no bits: MISMATCH`. - The decoder is still not wired into the launcher, so the default run path is unchanged. The branch conflicts with `main` again, in `CMakeLists.txt` only: `git merge-tree --write-tree c04e0dd6 b055cab9` exits 1. #3198 added `startup_refusal_census` at the same spot where this PR adds `startup_msvc_throw_info`, and keeping both `add_test` blocks resolves it. Could you merge `main` (or rebase)? After that, R0Y00's changes request on `205803c2` still needs their re-review, since the code meets it. Environment: Linux only: git objects, `git merge-tree`, and the Python check with four mutants on scratch copies. This comment was AI-assisted.
tedin7 commented 2026-11-30 13:57:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-30T13:57:22Z.


Merged current main (077bff3ac) to resolve conflicts; sanitized exception decoder and triage checks pass locally. Ready for re-review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7280615916 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#issuecomment-7280615916). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-30T13:57:22Z. --- Merged current `main` (`077bff3ac`) to resolve conflicts; sanitized exception decoder and triage checks pass locally. Ready for re-review.
R0Y00 commented 2026-12-03 03:32:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T03:32:59Z.

Review: APPROVED


Re-reviewed 20910f46 in a clean trial merge onto aa70e516. This addresses my earlier request: _describe_value() emits the code only for names in HRESULT_NAMES, and both the record and its shareable line classify an unrecognized high-bit scalar without exposing the bits. The synthetic suite passed all 94 checks (python -B tests/startup_msvc_throw_info_check.py); the adjacent startup_triage_run_check.py and startup_tools_lint_check.py also passed. In the trial tree, adding the raw code back only in the unrecognized-failure record failed all four synthetic sentinel cases. The fixture remains registered in CTest and Linux CI.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6163260920 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1939#pullrequestreview-6163260920). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T03:32:59Z. **Review:** APPROVED --- Re-reviewed `20910f46` in a clean trial merge onto `aa70e516`. This addresses my earlier request: `_describe_value()` emits the code only for names in `HRESULT_NAMES`, and both the record and its shareable line classify an unrecognized high-bit scalar without exposing the bits. The synthetic suite passed all 94 checks (`python -B tests/startup_msvc_throw_info_check.py`); the adjacent `startup_triage_run_check.py` and `startup_tools_lint_check.py` also passed. In the trial tree, adding the raw `code` back only in the unrecognized-failure record failed all four synthetic sentinel cases. The fixture remains registered in CTest and Linux CI.
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!1932
No description provided.