CLI: deduplicate lib-exports entries per case-normalized DLL #3012

Closed
fuzeofficlal wants to merge 1 commit from upstream-pr/3014 into main
fuzeofficlal commented 2026-11-26 03:26:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T03:26:44Z.


Summary

  • Group and deduplicate victory lib-exports imports by (&ImportSymbol, LibImportKind) within each ASCII-lowercased DLL bucket in apps/victory/src/inspect.rs::group_lib_exports, and compute the printed total export count from the deduplicated groups.
  • Fixes archives containing equivalent DLL names with differing ASCII casing (such as Example.dll and example.dll exporting the same symbol and kind) previously being counted twice in the summary and printed twice under --list.
  • Add two synthetic in-memory archive unit tests covering mixed-case duplicate collapsing and preservation of distinct symbols, import kinds (Code vs Data), and DLLs.

Verification

  • cargo test --locked -p victory: 16 unit tests + 4 integration tests passed.
  • cargo clippy --locked -p victory --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 191 files ok.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6618843382 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3014). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T03:26:44Z. --- ## Summary - Group and deduplicate `victory lib-exports` imports by `(&ImportSymbol, LibImportKind)` within each ASCII-lowercased DLL bucket in `apps/victory/src/inspect.rs::group_lib_exports`, and compute the printed total export count from the deduplicated groups. - Fixes archives containing equivalent DLL names with differing ASCII casing (such as `Example.dll` and `example.dll` exporting the same symbol and kind) previously being counted twice in the summary and printed twice under `--list`. - Add two synthetic in-memory archive unit tests covering mixed-case duplicate collapsing and preservation of distinct symbols, import kinds (`Code` vs `Data`), and DLLs. ## Verification - `cargo test --locked -p victory`: 16 unit tests + 4 integration tests passed. - `cargo clippy --locked -p victory --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 191 files ok.
kotekompotek commented 2026-11-26 05:03:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T04:38:24Z.

Review: APPROVED


LGTM — set keys on (export, kind) so same-name-different-kind imports stay distinct while true dups collapse; count sums set sizes so the headline matches the listing.

<!-- greyfinch-sync:Marvisak/VIctory:review:6068620856 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3014#pullrequestreview-6068620856). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T04:38:24Z. **Review:** APPROVED --- LGTM — set keys on (export, kind) so same-name-different-kind imports stay distinct while true dups collapse; count sums set sizes so the headline matches the listing.
futurepro62 commented 2026-11-26 05:04:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T04:31:04Z.


Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 1ae85a4 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 868 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: lib_exports_deduplicates_dll_names_with_different_case, lib_exports_preserves_distinct_symbols_kinds_and_dlls.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7182663794 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3014#issuecomment-7182663794). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T04:31:04Z. --- Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `1ae85a4` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **868 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `lib_exports_deduplicates_dll_names_with_different_case`, `lib_exports_preserves_distinct_symbols_kinds_and_dlls`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
upstream-sync closed this pull request 2026-11-26 07:01:08 +00:00
Marvisak commented 2026-11-26 07:01:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T06:18:09Z.


Automated triage for the maintainers.

inspect::lib_exports now groups imports through group_lib_exports, which puts each export into a BTreeSet<(&ImportSymbol, LibImportKind)> per lowercased DLL name and counts the set sizes. The code compiles by my reading: both types derive Ord.

What it needs:

  • A real case. The only motivation given is a synthetic archive where Example.dll and example.dll export the same symbol. Please describe an import library this tool is actually used on where such duplicates appear. Describe it in general terms, without naming files from any SDK. Without one, this changes the output of a diagnostics command for a case that may not occur.
  • Report what gets merged. The tool is careful not to drop anything without saying so: ImportLibrary reports other_members "so nothing is silently lost". Merging duplicates without telling the user goes against that. If the dedup stays, the summary line should also print how many duplicate entries were merged.

Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7184294926 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3014#issuecomment-7184294926). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T06:18:09Z. --- <!-- victory-triage v1 head=1ae85a4c9486792d4af12b81bf3bc83c0c39d42c verdict=needs-work at=2026-11-26T06:24:00Z --> Automated triage for the maintainers. `inspect::lib_exports` now groups imports through `group_lib_exports`, which puts each export into a `BTreeSet<(&ImportSymbol, LibImportKind)>` per lowercased DLL name and counts the set sizes. The code compiles by my reading: both types derive `Ord`. What it needs: - **A real case.** The only motivation given is a synthetic archive where `Example.dll` and `example.dll` export the same symbol. Please describe an import library this tool is actually used on where such duplicates appear. Describe it in general terms, without naming files from any SDK. Without one, this changes the output of a diagnostics command for a case that may not occur. - **Report what gets merged.** The tool is careful not to drop anything without saying so: `ImportLibrary` reports `other_members` "so nothing is silently lost". Merging duplicates without telling the user goes against that. If the dedup stays, the summary line should also print how many duplicate entries were merged. --- _Generated by [Claude Code](https://claude.ai/code)_
fuzeofficlal commented 2026-11-26 07:01:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T06:26:30Z.


Agreed — without a concrete import library hitting duplicate symbols under lib-exports, changing the diagnostics output and hiding duplicates without reporting them is unnecessary. Closing.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7184432078 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3014#issuecomment-7184432078). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T06:26:30Z. --- Agreed — without a concrete import library hitting duplicate symbols under `lib-exports`, changing the diagnostics output and hiding duplicates without reporting them is unnecessary. Closing.

Pull request closed

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
Marvisak/VIctory!3012
No description provided.