Skip to content

awc_names: report exact dialogue ambiguity counts on request - #6003

Open
kacper-serewis wants to merge 2 commits into
ItsNotRexed:mainfrom
kacper-serewis:feat/awc-ambiguity-report
Open

kacper-serewis wants to merge 2 commits into
ItsNotRexed:mainfrom
kacper-serewis:feat/awc-ambiguity-report

Conversation

@kacper-serewis

@kacper-serewis kacper-serewis commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Item ASSET-512 (AWC-NAMES-AMBIGUITY-REPORT) (claim).
Depends on: #5897

--ambiguity prints aggregate counts for repeated normalized exact dialogue words and distinct conflicting unsalted 29-bit IDs. Per inventory it reports how many conflicting IDs occur, how many distinct bank/ID pairs they affect, and how many IDs have no exact dialogue candidate. Counts precede family matching and control thresholds. CSV and JSON output are identical with the option enabled or omitted.

Tested on Windows, AMD Ryzen 5 9600X CPU. GPU and driver unused. All 32 awc_names tests passed, including a real CLI test with synthetic collisions, case and whitespace variants, duplicate table rows and two sources. Compared CSV bytes to #5897 on both private cached JSON inventories (3 banks / 42 streams and 98 banks / 2,098 streams). Both matched. Adding a synthetic colliding pair and a duplicate produced one dictionary conflict, one repeated input and zero affected IDs in either cache. No raw archive access.

19/20 opus_tags tests passed. The existing Windows directory-discovery assertion expects unescaped backslashes in the PermissionError text and also failed on #5897. No tagger code changed.

AI-assisted implementation and testing.

@Kev-Ball

Copy link
Copy Markdown

Ran ad9404ea with --ambiguity against the retail Xbox 1.0.2.1 inventories used for #5897. I supplied the 138,104 distinct conversation-derived wave names via --words. The CLI reported zero repeated inputs and 13 conflicting 29-bit IDs.

Inventory Banks Conflicting IDs present Affected bank/ID pairs Distinct IDs without an exact candidate
Story 63,861 13 22 40,215
Shared minigame 638 1 1 1,489
Story rest-of-world 15 0 0 55

I independently grouped normalized words by their masked hash and intersected the resulting sets with each bank’s distinct stream IDs. Every reported count matched, including the shared collision that appears in two inventories. The exported CSV from this head with reporting enabled was byte-identical to the #5897 resolver output, including all 122,456 assignments. CPU only, CachyOS, AI-assisted.

@leozinhoszg

Copy link
Copy Markdown
Contributor

Tested ad9404ea on Windows 11 Pro (26200), CPython 3.14.7, CPU only, no game files: pass.

  • tests/test_awc_names.py passes 32/32. compileall and git diff --check are clean. tests/test_opus_tags.py passes 19/20; the one failure is the Windows path-repr test, which fails on main too. The PR is stacked on awc_names: leave colliding exact dialogue waves unnamed #5897's head (737ac969) and says Depends on: #5897.
  • Negative control: with awc_names: leave colliding exact dialogue waves unnamed #5897's or main's tools/awc_names.py, the new test errors (no --ambiguity option). Five one-line mutations of the counting code (tools/awc_names.py:224-233, :425-427) each fail it: pairs counted as IDs, no strip before lowercasing, absent IDs counted per bank, no intersection with the inventory, no conflict check.
  • Counts are exact on synthetic input. I ran 25 random cases with 8 colliding pairs, case and whitespace duplicates, repeated stream rows, and a folder plus an awc_manifest JSON as two sources. Every printed number matched an independent count. The pair count also matched the rows dropped between main's CSV and this PR's CSV in every source. A three-way collision is counted as 1 ID. Without --ambiguity, stdout, CSV and JSON are byte-identical to awc_names: leave colliding exact dialogue waves unnamed #5897. With it, only the new lines are added.
  • Kev-Ball's retail run above closes the one thing I couldn't check here: 13 conflicting IDs and 22 + 1 bank/ID pairs, which matches the 23 removals counted on awc_names: leave colliding exact dialogue waves unnamed #5897. The pair count only equals removed names when the dialogue rule passes its control, which the docstring says (tools/awc_names.py:33-36).

AI-assisted.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed change in PR #6003: awc_names: report exact dialogue ambiguity counts on request.

Scope: tests/test_awc_names.py, tools/awc_names.py
Diff: +84 / -4 across 2 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @kacper-serewis - I went through awc_names: report exact dialogue ambiguity counts on request and the diff around tests/test_awc_names.py. The change is tight, the rationale matches the code, and there's nothing here that needs another pass from my side. Approved and squash-merging it into main now. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants