Distinguish named and ordinal imports in census missing reports #132

Manually merged
github merged 1 commit from github-bot/gh-132 into main 2026-11-26 08:21:46 +00:00 AGit
Owner

@⁠feanorsun on GitHub · 2026-11-26 06:18 UTC · original
feanorsun:fix/census-missing-import-identity → main · +61 −14 · 1 files · 1 commits · merged 2026-11-26 08:17 UTC

When a.exe imports the literal name #42 and b.exe imports ordinal 42 from the same DLL, the census summary counts two missing functions. Previously, --missing reported one row used by both images because both symbols formatted as #42.

Use the census's existing FunctionKey for the per-DLL detail counts as well as the summary. The report doubles a literal leading # in a name. Ordinary names and ordinals keep their existing spelling. Rows are still sorted by descending image count, then by DLL and displayed symbol.

The regression test uses two in-memory images, census-fixture.dll, and HostPolicy::none(). The delay imports in a.exe repeat the named import with a different PE hint. The test checks the summary and the exact set of images behind each displayed symbol.

Regression fixture Missing in summary Detail rows and image counts
Before 2 census-fixture.dll!#42 — 2 images (a.exe, b.exe)
After 2 census-fixture.dll!##42 — 1 image (a.exe)
census-fixture.dll!#42 — 1 image (b.exe)

On Windows, both the baseline with the regression test added and the fixed branch listed three census tests. The baseline run had two passes and one failure, in the new regression test. All three passed after the fix (zero failed, eight unrelated tests filtered out).

cargo test --offline --locked -j 1 -p victory --bin victory census::tests:: -- --list
cargo test --offline --locked -j 1 -p victory --bin victory census::tests:: -- --test-threads=1
**@⁠feanorsun** on GitHub · 2026-11-26 06:18 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/132) `feanorsun:fix/census-missing-import-identity` → `main` · +61 −14 · 1 files · 1 commits · merged 2026-11-26 08:17 UTC When `a.exe` imports the literal name `#42` and `b.exe` imports ordinal 42 from the same DLL, the census summary counts two missing functions. Previously, `--missing` reported one row used by both images because both symbols formatted as `#42`. Use the census's existing `FunctionKey` for the per-DLL detail counts as well as the summary. The report doubles a literal leading `#` in a name. Ordinary names and ordinals keep their existing spelling. Rows are still sorted by descending image count, then by DLL and displayed symbol. The regression test uses two in-memory images, `census-fixture.dll`, and `HostPolicy::none()`. The delay imports in `a.exe` repeat the named import with a different PE hint. The test checks the summary and the exact set of images behind each displayed symbol. | Regression fixture | Missing in summary | Detail rows and image counts | | --- | ---: | --- | | Before | 2 | `census-fixture.dll!#42` — 2 images (`a.exe`, `b.exe`) | | After | 2 | `census-fixture.dll!##42` — 1 image (`a.exe`)<br>`census-fixture.dll!#42` — 1 image (`b.exe`) | On Windows, both the baseline with the regression test added and the fixed branch listed three census tests. The baseline run had two passes and one failure, in the new regression test. All three passed after the fix (zero failed, eight unrelated tests filtered out). ```text cargo test --offline --locked -j 1 -p victory --bin victory census::tests:: -- --list cargo test --offline --locked -j 1 -p victory --bin victory census::tests:: -- --test-threads=1 ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:25:46 +00:00
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:55 UTC · original

Merged into main in the next push (tests pass); thanks.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:55 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/132#issuecomment-7185982795) Merged into main in the next push (tests pass); thanks.
github manually merged commit 2016f8de27 into main 2026-11-26 08:21:46 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.