tooling: audit GDK export coverage #3286

Manually merged
github merged 6 commits from github-bot/gh-3284 into gh-pr/3284/base 2026-11-28 11:28:07 +00:00 AGit
Owner

@⁠lambirou on GitHub · 2026-11-28 05:16 UTC · original
lambirou:gdk/export-coverage → main · +755 −0 · 5 files · 6 commits · merged 2026-11-28 11:15 UTC

The GDK knowledge plan needs an exhaustive export inventory and a matrix of which names the Xbox2Windows shims provide. This adds both, with the libraries and the full inventory kept outside the repository.

tools/gdk_exports.py parses captured dumpbin /exports text for a LIB or DLL, or reads a PE DLL through pefile. It records the module, file, SHA-256, ordinal and RVA. tools/gdk_shim_coverage.py compares the inventory with the .def files, separates functions from IID_/WKPDID_ data, lists local x2w_* extras, and prints the ordinals seen in the GDK file. When a module has both a .lib and a .dll, the tool merges their exports and deduplicates names.

Measured on the 261000 set (89 modules, 8,035 export names):

  • xmem: 36 GDK functions, 27 shim functions, 13 covered, 23 missing.
  • d3d12_xs: 28 GDK functions, 5 shim functions, 4 covered, 24 missing (union of the .lib and .dll).
  • acphal: 10/10, 9 covered, 1 missing.
  • xapu: 6/6, 5 covered, 1 missing.
  • chad: 7/5, 5 covered, 2 missing.
  • xg_xs: 27/2, 2 covered, 25 missing.
  • xcrdapi: 1/3, 1 covered, 0 missing.

The largest gaps remain xg_xs (layout, DCC, tile shape and descriptor helpers) and xmem (statistics, tags, Win32 heaps and configuration). d3d12_xs lacks the desktop entry points and several DXGIX helpers.

Commands:

python -B tests/gdk_exports_check.py
python -B tools/gdk_exports.py parse-dumpbin D:\gdk-oracle\dumpbin\xg_xs.txt --json out\xg_xs.json --kind dll
python -B tools/gdk_shim_coverage.py --exports D:\gdk-oracle\knowledge\exports-all.json --repo . --json out\coverage.json --markdown out\coverage.md

The check passed on Windows and runs on Linux without the GDK. The real matrix was regenerated from the existing 261000 inventory; the JSON and Markdown stay in D:\gdk-oracle\knowledge.

These are names, not signatures and not tests. A covered name can still be untested at runtime, and an ordinal import still needs the matching import library and a runtime check. Xbox One gen8 libraries are outside this table.

**@⁠lambirou** on GitHub · 2026-11-28 05:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284) `lambirou:gdk/export-coverage` → `main` · +755 −0 · 5 files · 6 commits · merged 2026-11-28 11:15 UTC The GDK knowledge plan needs an exhaustive export inventory and a matrix of which names the Xbox2Windows shims provide. This adds both, with the libraries and the full inventory kept outside the repository. tools/gdk_exports.py parses captured dumpbin /exports text for a LIB or DLL, or reads a PE DLL through pefile. It records the module, file, SHA-256, ordinal and RVA. tools/gdk_shim_coverage.py compares the inventory with the .def files, separates functions from IID_/WKPDID_ data, lists local x2w_* extras, and prints the ordinals seen in the GDK file. When a module has both a .lib and a .dll, the tool merges their exports and deduplicates names. Measured on the 261000 set (89 modules, 8,035 export names): - xmem: 36 GDK functions, 27 shim functions, 13 covered, 23 missing. - d3d12_xs: 28 GDK functions, 5 shim functions, 4 covered, 24 missing (union of the .lib and .dll). - acphal: 10/10, 9 covered, 1 missing. - xapu: 6/6, 5 covered, 1 missing. - chad: 7/5, 5 covered, 2 missing. - xg_xs: 27/2, 2 covered, 25 missing. - xcrdapi: 1/3, 1 covered, 0 missing. The largest gaps remain xg_xs (layout, DCC, tile shape and descriptor helpers) and xmem (statistics, tags, Win32 heaps and configuration). d3d12_xs lacks the desktop entry points and several DXGIX helpers. Commands: python -B tests/gdk_exports_check.py python -B tools/gdk_exports.py parse-dumpbin D:\gdk-oracle\dumpbin\xg_xs.txt --json out\xg_xs.json --kind dll python -B tools/gdk_shim_coverage.py --exports D:\gdk-oracle\knowledge\exports-all.json --repo . --json out\coverage.json --markdown out\coverage.md The check passed on Windows and runs on Linux without the GDK. The real matrix was regenerated from the existing 261000 inventory; the JSON and Markdown stay in D:\gdk-oracle\knowledge. These are names, not signatures and not tests. A covered name can still be untested at runtime, and an ordinal import still needs the matching import library and a runtime check. Xbox One gen8 libraries are outside this table.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:20:58 +00:00
Author
Owner

@⁠JohnConnorNPC on GitHub · 2026-11-28 07:59 UTC · original

Thanks for this. I reviewed head 0edc189c and a trial merge of it into current main (c3204a9c). git merge-tree --write-tree origin/main 0edc189c exits 0, and on the merged tree tests/gdk_exports_check.py prints gdk_exports_check: all checks passed, as it does in the Linux CI job. read_def on the seven default .def files gives the shim column in gdk-exports.md (xmem 27, d3d12_xs 5, acphal 10, xapu 6, chad 5, xg_xs 2, xcrdapi 3). Nothing gates on these tools, so I think this can merge. The points below would make the coverage numbers easier to trust, either here or in a follow-up:

  1. .def ordinals are never recorded. The repo writes XMemAlloc @1 with a space, but read_def tests "@" in name after split()[0], so the ordinal never reaches it. On src/xmem_shim.def it returns 27 names and 0 ordinals, while grep -cE '\s@[0-9]+' counts 27 ordinal lines. A C++-decorated name such as ?f@@YAXXZ would also be cut at the first @. The test still passes with if "@" in name: changed to if False:. Parsing the @N token and adding one ordinal to the fixture would pin it.
  2. Failed or partial reads look like full coverage. A UTF-16 capture (PowerShell 5.1 > redirection) parses to 0 exports, and the report then shows gdk_functions=0 missing=0 with --fail-on-missing exiting 0. A .def module with no inventory entry drops out of the table, again with exit 0. So do captures named d3d12_xs.lib.txt or d3d12_xs.dll.txt, because the merge keys on the file stem and not on the module field. dumpbin forwarder, [NONAME] and name = internal rows are skipped without a count. Counting unparsed rows per module, reporting 0-export and absent modules as unmeasured, and having --fail-on-missing fail on them would close this.
  3. The lib+dll merge is unpinned. The body says the tool "merges their exports and deduplicates names", but no fixture module has both a .lib and a .dll, and the test still passes with entry["exports"].extend(...) replaced by an assignment. Of the 8 mutants I ran on copies of the PR files, 3 fail the test: is_data returning False, the DLL ordinal set to None, and --fail-on-missing ignored.

Smaller things:

  • The docstring's report --exports … usage fails with error: unrecognized arguments: report.
  • parse-dumpbin hashes the .txt capture and stores that path as file, so the SHA-256 doesn't identify the LIB or DLL. The test checks only len(...) == 64, and it still passes with a constant hash.
  • "sdk": "261000" is hardcoded in collect_dumpbin, scan_pe and write_document. scan_pe has no test, and the LIB ordinal column and the stop at Summary or "Dump of file" are unpinned.
  • DEFAULT_DEFS leaves out src/xgameruntime_shim.def and src/startup_stubs/gameinput.def. Is that intended?
  • 789ee573 ("ci: retry the Windows smoke test") is empty. Squashing it on merge would drop it.

Environment: Linux, git objects, a trial merge, and pure-Python probes and mutants on copies of the PR files. I didn't run Windows, Wine, a GPU or a real GDK inventory, so the GDK columns are unmeasured, though each row's arithmetic adds up (GDK − covered = missing).

This comment was AI-assisted.

**@⁠JohnConnorNPC** on GitHub · 2026-11-28 07:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284#issuecomment-7236294015) Thanks for this. I reviewed head `0edc189c` and a trial merge of it into current `main` (`c3204a9c`). `git merge-tree --write-tree origin/main 0edc189c` exits 0, and on the merged tree `tests/gdk_exports_check.py` prints `gdk_exports_check: all checks passed`, as it does in the Linux CI job. `read_def` on the seven default .def files gives the shim column in `gdk-exports.md` (xmem 27, d3d12_xs 5, acphal 10, xapu 6, chad 5, xg_xs 2, xcrdapi 3). Nothing gates on these tools, so I think this can merge. The points below would make the coverage numbers easier to trust, either here or in a follow-up: 1. **`.def` ordinals are never recorded.** The repo writes `XMemAlloc @1` with a space, but `read_def` tests `"@" in name` after `split()[0]`, so the ordinal never reaches it. On `src/xmem_shim.def` it returns 27 names and 0 ordinals, while `grep -cE '\s@[0-9]+'` counts 27 ordinal lines. A C++-decorated name such as `?f@@YAXXZ` would also be cut at the first `@`. The test still passes with `if "@" in name:` changed to `if False:`. Parsing the `@N` token and adding one ordinal to the fixture would pin it. 2. **Failed or partial reads look like full coverage.** A UTF-16 capture (PowerShell 5.1 `>` redirection) parses to 0 exports, and the report then shows `gdk_functions=0 missing=0` with `--fail-on-missing` exiting 0. A .def module with no inventory entry drops out of the table, again with exit 0. So do captures named `d3d12_xs.lib.txt` or `d3d12_xs.dll.txt`, because the merge keys on the file stem and not on the `module` field. dumpbin forwarder, `[NONAME]` and `name = internal` rows are skipped without a count. Counting unparsed rows per module, reporting 0-export and absent modules as unmeasured, and having `--fail-on-missing` fail on them would close this. 3. **The lib+dll merge is unpinned.** The body says the tool "merges their exports and deduplicates names", but no fixture module has both a .lib and a .dll, and the test still passes with `entry["exports"].extend(...)` replaced by an assignment. Of the 8 mutants I ran on copies of the PR files, 3 fail the test: `is_data` returning False, the DLL ordinal set to None, and `--fail-on-missing` ignored. Smaller things: - The docstring's `report --exports …` usage fails with `error: unrecognized arguments: report`. - `parse-dumpbin` hashes the `.txt` capture and stores that path as `file`, so the SHA-256 doesn't identify the LIB or DLL. The test checks only `len(...) == 64`, and it still passes with a constant hash. - `"sdk": "261000"` is hardcoded in `collect_dumpbin`, `scan_pe` and `write_document`. `scan_pe` has no test, and the LIB ordinal column and the stop at Summary or "Dump of file" are unpinned. - `DEFAULT_DEFS` leaves out `src/xgameruntime_shim.def` and `src/startup_stubs/gameinput.def`. Is that intended? - `789ee573` ("ci: retry the Windows smoke test") is empty. Squashing it on merge would drop it. Environment: Linux, git objects, a trial merge, and pure-Python probes and mutants on copies of the PR files. I didn't run Windows, Wine, a GPU or a real GDK inventory, so the GDK columns are unmeasured, though each row's arithmetic adds up (GDK − covered = missing). This comment was AI-assisted.
Author
Owner

@⁠pigalot on GitHub · 2026-11-28 08:18 UTC · original · requested changes

Independently reviewed 0edc189c integrated over main 1f07b2c1 (tree d2d58f50). The trial merge is clean and git diff --check is clean.

I read both tools against the repository's own .def files and against captures that fail to parse. python -B tests/gdk_exports_check.py passes (exit 0) on the trial merge on Windows. I can confirm the first three points JohnConnorNPC raised, with my own runs below. Two of them make a coverage matrix that looks complete when it isn't, and that matrix is what this PR is for.

1. read_def never records an ordinal from this repository's .def files. src/xmem_shim.def writes XMemAlloc @1, with a space. name = text.split("=", 1)[0].split()[0] keeps only XMemAlloc, so the "@" in name branch never runs.

  • On the seven DEFAULT_DEFS files, read_def returns 0 ordinals for every module.
  • src/xmem_shim.def has 27 @N lines.
  • So def_ordinals in the JSON is always empty.
  • Splitting on @ would also cut a decorated name such as ?f@@YAXXZ.
  • Suggested direction (unconfirmed): read the @N token from the whitespace-split fields, and add one @N line to the test's .def fixture.

2. A failed or partial read counts as "nothing missing", and --fail-on-missing still exits 0. I used a synthetic DLL capture, written as UTF-16 the way Windows PowerShell 5.1 > writes it:

  • parse_dumpbin_text returns 0 exports. The row for that module then reads | xg_xs | 0 | 1 | 0 | 0 |.
  • A module with a .def file but no inventory entry (xmem) is left out of the table.
  • So is a capture named d3d12_xs.lib.txt. load_exports keys on Path(file).stem, which is d3d12_xs.lib, and not on the module field.
  • In all three cases --fail-on-missing exits 0.
  • Suggested direction (unconfirmed):
    • key the merge on a normalised module name;
    • report modules with 0 exports, and modules that are absent, as unmeasured rows;
    • make --fail-on-missing fail on those rows too;
    • add one test case for each.

3. The lib+dll merge the body describes is untested. No fixture module has both a .lib and a .dll. The d3d12_xs row in docs/experiments/gdk-exports.md depends on that union.

Mutants. Each was applied alone to a copy of the three PR files, then tests/gdk_exports_check.py was run:

Mutant Result
is_data returns False killed: xg functions 3
--fail-on-missing ignored (return 0) killed: fail-on-missing exit
DLL row ordinal set to None killed: DLL parse mismatch
.def ordinal branch disabled (if False:) survives
entry["exports"].extend(...) replaced by an assignment survives
sha256 returns a constant survives
no stop at Summary / Dump of file survives
LIB row ordinal dropped survives

Smaller points, none of them blocking:

  • The gdk_shim_coverage.py docstring shows report --exports …, which exits 2 with unrecognized arguments: report.
  • parse-dumpbin hashes the .txt capture and stores the capture path as file, so the SHA-256 doesn't identify the LIB or DLL. The doc says the inventory records the SHA-256 without saying which file it is of.
  • "sdk": "261000" is hardcoded in three places, and scan_pe has no test.

Environment: Windows 11 25H2 build 26200.9974, Python 3.12.10. These are pure-Python tools: no build, no GPU and no real GDK inventory, so I couldn't measure the GDK columns in the doc.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on 0edc189c.

This reply was AI-assisted.

**@⁠pigalot** on GitHub · 2026-11-28 08:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284#pullrequestreview-6096718930) · **requested changes** Independently reviewed `0edc189c` integrated over `main` `1f07b2c1` (tree `d2d58f50`). The trial merge is clean and `git diff --check` is clean. I read both tools against the repository's own `.def` files and against captures that fail to parse. `python -B tests/gdk_exports_check.py` passes (exit 0) on the trial merge on Windows. I can confirm the first three points JohnConnorNPC raised, with my own runs below. Two of them make a coverage matrix that looks complete when it isn't, and that matrix is what this PR is for. **1. `read_def` never records an ordinal from this repository's `.def` files.** `src/xmem_shim.def` writes `XMemAlloc @1`, with a space. `name = text.split("=", 1)[0].split()[0]` keeps only `XMemAlloc`, so the `"@" in name` branch never runs. - On the seven `DEFAULT_DEFS` files, `read_def` returns 0 ordinals for every module. - `src/xmem_shim.def` has 27 `@N` lines. - So `def_ordinals` in the JSON is always empty. - Splitting on `@` would also cut a decorated name such as `?f@@YAXXZ`. - Suggested direction (unconfirmed): read the `@N` token from the whitespace-split fields, and add one `@N` line to the test's `.def` fixture. **2. A failed or partial read counts as "nothing missing", and `--fail-on-missing` still exits 0.** I used a synthetic DLL capture, written as UTF-16 the way Windows PowerShell 5.1 `>` writes it: - `parse_dumpbin_text` returns 0 exports. The row for that module then reads `| xg_xs | 0 | 1 | 0 | 0 |`. - A module with a `.def` file but no inventory entry (`xmem`) is left out of the table. - So is a capture named `d3d12_xs.lib.txt`. `load_exports` keys on `Path(file).stem`, which is `d3d12_xs.lib`, and not on the `module` field. - In all three cases `--fail-on-missing` exits 0. - Suggested direction (unconfirmed): - key the merge on a normalised module name; - report modules with 0 exports, and modules that are absent, as unmeasured rows; - make `--fail-on-missing` fail on those rows too; - add one test case for each. **3. The lib+dll merge the body describes is untested.** No fixture module has both a `.lib` and a `.dll`. The d3d12_xs row in `docs/experiments/gdk-exports.md` depends on that union. **Mutants.** Each was applied alone to a copy of the three PR files, then `tests/gdk_exports_check.py` was run: | Mutant | Result | |---|---| | `is_data` returns `False` | killed: `xg functions 3` | | `--fail-on-missing` ignored (`return 0`) | killed: `fail-on-missing exit` | | DLL row ordinal set to `None` | killed: DLL parse mismatch | | `.def` ordinal branch disabled (`if False:`) | survives | | `entry["exports"].extend(...)` replaced by an assignment | survives | | `sha256` returns a constant | survives | | no stop at `Summary` / `Dump of file` | survives | | LIB row ordinal dropped | survives | Smaller points, none of them blocking: - The `gdk_shim_coverage.py` docstring shows `report --exports …`, which exits 2 with `unrecognized arguments: report`. - `parse-dumpbin` hashes the `.txt` capture and stores the capture path as `file`, so the SHA-256 doesn't identify the LIB or DLL. The doc says the inventory records the SHA-256 without saying which file it is of. - `"sdk": "261000"` is hardcoded in three places, and `scan_pe` has no test. Environment: Windows 11 25H2 build 26200.9974, Python 3.12.10. These are pure-Python tools: no build, no GPU and no real GDK inventory, so I couldn't measure the GDK columns in the doc. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `0edc189c`. This reply was AI-assisted.
Read .def ordinals from the @N token without cutting decorated names. Key inventory modules by their module field and strip .lib/.dll so LIB and DLL captures merge. Mark absent, empty and partially parsed modules as unmeasured, report them in the matrix, and fail --fail-on-missing on them. Add LIB+DLL, ordinal, decorated-name and unmeasured fixtures. Document that the dumpbin SHA-256 identifies the captured text.
Author
Owner

@⁠lambirou on GitHub · 2026-11-28 10:13 UTC · original

Fixed at f6d3396f.

  • .def ordinals: read_def now parses an @N token from the whitespace fields, so XMemAlloc @1 records ordinal 1. A decorated name such as ?XMemInternal@@YAXXZ is left intact. The fixture now pins both.
  • LIB+DLL merge: inventory keys use the module field, with a .lib/.dll suffix stripped from file-stem fallbacks. A fixture with both d3d12_xs.lib.txt and d3d12_xs.dll.txt checks the union, deduplication and coverage.
  • Unmeasured rows: a missing inventory entry, a capture with zero exports, or a partially parsed capture is marked unmeasured in the JSON and the Markdown table. --fail-on-missing now fails on those rows too. The fixtures cover an empty capture and an absent module.
  • Docs: the SHA-256 is documented as identifying the captured .txt for parse-dumpbin and the DLL for scan-pe; the matrix has a Status column.

Validation: python -B tests/gdk_exports_check.py passes (DLL/LIB parsing, ordinals, decorated names, LIB+DLL union, empty/absent rows and exit codes), and tests/docs_links_check.py passes on 143 files / 661 links.

scan_pe still has no fixture because it needs a PE and pefile; I left that as the non-blocking follow-up. DEFAULT_DEFS remains the seven measured modules.

**@⁠lambirou** on GitHub · 2026-11-28 10:13 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284#issuecomment-7237760462) Fixed at `f6d3396f`. - **`.def` ordinals**: `read_def` now parses an `@N` token from the whitespace fields, so `XMemAlloc @1` records ordinal 1. A decorated name such as `?XMemInternal@@YAXXZ` is left intact. The fixture now pins both. - **LIB+DLL merge**: inventory keys use the `module` field, with a `.lib`/`.dll` suffix stripped from file-stem fallbacks. A fixture with both `d3d12_xs.lib.txt` and `d3d12_xs.dll.txt` checks the union, deduplication and coverage. - **Unmeasured rows**: a missing inventory entry, a capture with zero exports, or a partially parsed capture is marked `unmeasured` in the JSON and the Markdown table. `--fail-on-missing` now fails on those rows too. The fixtures cover an empty capture and an absent module. - **Docs**: the SHA-256 is documented as identifying the captured `.txt` for `parse-dumpbin` and the DLL for `scan-pe`; the matrix has a Status column. Validation: `python -B tests/gdk_exports_check.py` passes (DLL/LIB parsing, ordinals, decorated names, LIB+DLL union, empty/absent rows and exit codes), and `tests/docs_links_check.py` passes on 143 files / 661 links. `scan_pe` still has no fixture because it needs a PE and pefile; I left that as the non-blocking follow-up. `DEFAULT_DEFS` remains the seven measured modules.
Author
Owner

@⁠lambirou on GitHub · 2026-11-28 10:17 UTC · original

CI is green on f6d3396f: Windows build/test, Linux Python checks and gfx1013 fixtures passed; /O2 and the coverage chart are skipped as usual. Ready for re-review.

**@⁠lambirou** on GitHub · 2026-11-28 10:17 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284#issuecomment-7237799235) CI is green on `f6d3396f`: Windows build/test, Linux Python checks and gfx1013 fixtures passed; `/O2` and the coverage chart are skipped as usual. Ready for re-review.
Add --sdk to parse-dumpbin and scan-pe instead of hardcoding 261000 in three places, and assert the value in the inventory fixture.
Author
Owner

@⁠lambirou on GitHub · 2026-11-28 10:22 UTC · original

One more non-blocking point: f75d806a adds --sdk to parse-dumpbin and scan-pe instead of hardcoding 261000, with a fixture assertion. CI is green on this head (Windows build/test, Linux Python, gfx1013). Ready for re-review.

**@⁠lambirou** on GitHub · 2026-11-28 10:22 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284#issuecomment-7237852008) One more non-blocking point: `f75d806a` adds `--sdk` to `parse-dumpbin` and `scan-pe` instead of hardcoding 261000, with a fixture assertion. CI is green on this head (Windows build/test, Linux Python, gfx1013). Ready for re-review.
Add GameInput (1/1 covered) to DEFAULT_DEFS. Document why xgameruntime is excluded: its .def is fixture-only and its thunk exports are generated, so a name comparison would report every GDK runtime export as missing.
Author
Owner

@⁠lambirou on GitHub · 2026-11-28 10:27 UTC · original

The DEFAULT_DEFS question is now answered in e759b2fc: gameinput is included (1 GDK function, 1 shim, 1 covered). xgameruntime stays out intentionally: its .def is fixture-only and its exported thunk names are generated from XGAMERUNTIME_THUNK_TABLE, so a name comparison would report every GDK runtime export as missing. A missing inventory entry is reported as unmeasured rather than covered. CI is rerunning on this head.

**@⁠lambirou** on GitHub · 2026-11-28 10:27 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284#issuecomment-7237905876) The DEFAULT_DEFS question is now answered in `e759b2fc`: `gameinput` is included (1 GDK function, 1 shim, 1 covered). `xgameruntime` stays out intentionally: its `.def` is fixture-only and its exported thunk names are generated from `XGAMERUNTIME_THUNK_TABLE`, so a name comparison would report every GDK runtime export as missing. A missing inventory entry is reported as unmeasured rather than covered. CI is rerunning on this head.
Author
Owner

@⁠romn4rch on GitHub · 2026-11-28 10:52 UTC · original

Could you please add the focused regression assertions from local commit a5f70cea932f7436b49de641059c50c4818328a0 to this branch? They cover partial dumpbin captures, .lib.txt fallback module normalization, parser section boundaries, and exact SHA-256 verification. My account cannot push to the PR head repository (GitHub returned 403), so I could not publish the commit.

**@⁠romn4rch** on GitHub · 2026-11-28 10:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284#issuecomment-7238181989) Could you please add the focused regression assertions from local commit `a5f70cea932f7436b49de641059c50c4818328a0` to this branch? They cover partial dumpbin captures, `.lib.txt` fallback module normalization, parser section boundaries, and exact SHA-256 verification. My account cannot push to the PR head repository (GitHub returned 403), so I could not publish the commit.
github-bot changed target branch from main to gh-pr/3284/base 2026-11-28 11:28:03 +00:00
github manually merged commit e759b2fc54 into gh-pr/3284/base 2026-11-28 11:28:07 +00:00
Author
Owner

@⁠pigalot on GitHub · 2026-11-28 11:14 UTC · original · approved these changes

Retested e759b2fc integrated over main bc1da08d (tree 987377f3). The trial merge is clean and git diff --check is clean. This supersedes my changes-requested review on 0edc189c.

python -B tests/gdk_exports_check.py passes (exit 0) on the trial merge on Windows.

Earlier findings

  1. .def ordinals: addressed. read_def now returns 27 ordinals for src/xmem_shim.def (27 @N lines) and 1 for src/startup_stubs/gameinput.def. A decorated name such as ?XMemInternal@@YAXXZ stays whole. Both are pinned: disabling the @N token loop fails xmem def ordinals {}, and cutting the name at the first @ fails decorated name ['?XMemInternal'].
  2. Failed or partial reads: addressed. I reran my earlier cases through parse-dumpbin and then the coverage tool with --fail-on-missing:
    • a UTF-16 capture gives | xg_xs | ? | 2 | ? | ? | no exports parsed |, exit 1;
    • a .def module with no inventory entry gives | xmem | ? | 1 | ? | ? | no inventory entry |, exit 1;
    • captures named d3d12_xs.lib.txt and d3d12_xs.dll.txt both get module d3d12_xs and merge into one row (| d3d12_xs | 3 | 3 | 3 | 0 | ok |);
    • a capture with a forwarder row and a [NONAME] row gives 2 unparsed export line(s), an unmeasured row and exit 1.
  3. LIB+DLL merge: addressed. check_merge has a module with both files. Replacing extend with an assignment now fails merged exports.

The smaller points are addressed too: the report usage line is gone from the docstring, the doc says which file the SHA-256 is of, and --sdk replaces the hardcoded value (pinned for the module and the document). The shim column in docs/experiments/gdk-exports.md matches read_def on the eight DEFAULT_DEFS files (27, 5, 10, 6, 5, 2, 3, 1).

Mutants. Each was applied alone to a copy of the three PR files, then tests/gdk_exports_check.py was run. 26 mutants: 17 killed, 9 survive, none equivalent.

Killed (17):

  • .def @N token loop disabled; .def name cut at the first @; DATA keyword ignored;
  • merge extend replaced by an assignment; load_exports keyed on the raw file name;
  • --fail-on-missing ignoring unmeasured rows; --fail-on-missing ignoring missing names;
  • absent row not marked unmeasured; inventory errors not carried into the row; empty capture not marked as an error;
  • LIB ordinal dropped; DLL ordinal set to None;
  • module sdk ignored; document sdk ignored;
  • is_data returns False; GDK ordinals dropped from the row; extras dropped.

Survive (9), none blocking. My runs above show the code does the right thing in each case; the fixtures just don't pin it:

  • partial capture not marked as an error, and unparsed lines not counted (no fixture has an unparsed row);
  • .lib/.dll suffix kept by module_name, and by normalize_module (the merge fixture sets the module field, so the file-name fallback never runs);
  • no stop at Summary / Dump of file;
  • sha256 returns a constant (the test checks only the length);
  • the Markdown table shows numbers and not ? for an unmeasured row, and the Status column always says ok (the test reads only the Unmeasured: line);
  • gameinput removed from DEFAULT_DEFS (--repo has no test).

The first six are the cases romn4rch asked to have pinned in the comment at 10:52Z. I agree they are worth adding, here or in a follow-up; I don't see them as blocking, because the tool behaves correctly on each.

One more note, not blocking: read_def reads a name with a trailing @N and no space, such as _Foo@8, as name _Foo with ordinal 8. That would misread an x86 stdcall name. No .def file in the repository has one.

scan_pe still has no test, as the author said. I couldn't measure the GDK columns in the doc: I have no GDK inventory.

Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10. Pure-Python tools: no build and no GPU.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on e759b2fc.

This reply was AI-assisted.

**@⁠pigalot** on GitHub · 2026-11-28 11:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3284#pullrequestreview-6097425936) · **approved these changes** Retested `e759b2fc` integrated over `main` `bc1da08d` (tree `987377f3`). The trial merge is clean and `git diff --check` is clean. This supersedes my changes-requested review on `0edc189c`. `python -B tests/gdk_exports_check.py` passes (exit 0) on the trial merge on Windows. **Earlier findings** 1. **`.def` ordinals: addressed.** `read_def` now returns 27 ordinals for `src/xmem_shim.def` (27 `@N` lines) and 1 for `src/startup_stubs/gameinput.def`. A decorated name such as `?XMemInternal@@YAXXZ` stays whole. Both are pinned: disabling the `@N` token loop fails `xmem def ordinals {}`, and cutting the name at the first `@` fails `decorated name ['?XMemInternal']`. 2. **Failed or partial reads: addressed.** I reran my earlier cases through `parse-dumpbin` and then the coverage tool with `--fail-on-missing`: - a UTF-16 capture gives `| xg_xs | ? | 2 | ? | ? | no exports parsed |`, exit 1; - a `.def` module with no inventory entry gives `| xmem | ? | 1 | ? | ? | no inventory entry |`, exit 1; - captures named `d3d12_xs.lib.txt` and `d3d12_xs.dll.txt` both get module `d3d12_xs` and merge into one row (`| d3d12_xs | 3 | 3 | 3 | 0 | ok |`); - a capture with a forwarder row and a `[NONAME]` row gives `2 unparsed export line(s)`, an unmeasured row and exit 1. 3. **LIB+DLL merge: addressed.** `check_merge` has a module with both files. Replacing `extend` with an assignment now fails `merged exports`. The smaller points are addressed too: the `report` usage line is gone from the docstring, the doc says which file the SHA-256 is of, and `--sdk` replaces the hardcoded value (pinned for the module and the document). The shim column in `docs/experiments/gdk-exports.md` matches `read_def` on the eight `DEFAULT_DEFS` files (27, 5, 10, 6, 5, 2, 3, 1). **Mutants.** Each was applied alone to a copy of the three PR files, then `tests/gdk_exports_check.py` was run. 26 mutants: 17 killed, 9 survive, none equivalent. Killed (17): - `.def` `@N` token loop disabled; `.def` name cut at the first `@`; `DATA` keyword ignored; - merge `extend` replaced by an assignment; `load_exports` keyed on the raw file name; - `--fail-on-missing` ignoring unmeasured rows; `--fail-on-missing` ignoring missing names; - absent row not marked unmeasured; inventory errors not carried into the row; empty capture not marked as an error; - LIB ordinal dropped; DLL ordinal set to `None`; - module `sdk` ignored; document `sdk` ignored; - `is_data` returns `False`; GDK ordinals dropped from the row; extras dropped. Survive (9), none blocking. My runs above show the code does the right thing in each case; the fixtures just don't pin it: - partial capture not marked as an error, and unparsed lines not counted (no fixture has an unparsed row); - `.lib`/`.dll` suffix kept by `module_name`, and by `normalize_module` (the merge fixture sets the `module` field, so the file-name fallback never runs); - no stop at `Summary` / `Dump of file`; - `sha256` returns a constant (the test checks only the length); - the Markdown table shows numbers and not `?` for an unmeasured row, and the Status column always says `ok` (the test reads only the `Unmeasured:` line); - `gameinput` removed from `DEFAULT_DEFS` (`--repo` has no test). The first six are the cases romn4rch asked to have pinned in the comment at 10:52Z. I agree they are worth adding, here or in a follow-up; I don't see them as blocking, because the tool behaves correctly on each. One more note, not blocking: `read_def` reads a name with a trailing `@N` and no space, such as `_Foo@8`, as name `_Foo` with ordinal 8. That would misread an x86 stdcall name. No `.def` file in the repository has one. `scan_pe` still has no test, as the author said. I couldn't measure the GDK columns in the doc: I have no GDK inventory. Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10. Pure-Python tools: no build and no GPU. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `e759b2fc`. This reply was AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
No description provided.