Skip to content

docs/audio: document hashdict.py --lookup, the reverse name lookup (EGEN-HASHDICT-LOOKUP-DOC) - #6912

Merged
shayderrr merged 1 commit into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/7-hashdict-lookup-doc
Nov 23, 2026
Merged

shayderrr merged 1 commit into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/7-hashdict-lookup-doc

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

docs/audio.md names the dictionary tools/hashdict.py builds and the two commands that use it, but not the tool's other half: --lookup takes a dictionary path followed by one or more 32-bit joaat hashes and prints the name the dictionary holds for each, or ?. No page named the mode, its argument order, or that it needs no carve folder (tools/hashdict.py:70,72-93). That is the way to answer "which wave is this id" when another tool prints a hash and nothing else.

Adds four lines next to the two commands that build and consume the dictionary, with the source lines for a reader who wants to check the format.

Verification (docs-only, no new test; a hand-written dictionary, no game files)

Before the paragraph there was no documented way to run the mode. The command now documented, run from the branch:

python -I tools/hashdict.py --lookup C:\Temp\dict7.json e0a5b0ba 12345678 0
e0a5b0ba JoaatExample
12345678 ?
0
exit 0

(0 is the dictionary's entry for the empty string; 12345678 is absent, so it prints ?.) No carve folder was passed, as the paragraph says.

The doc lint CI runs also pass on the branch: tests/test_docs_*.py, 11 files, 0 failures, and tests/test_hashdict.py 35 tests OK.

No GPU is needed.

Notes

  • Placed it in docs/audio.md because that is where the dictionary is introduced and used; docs/rpf.md and docs/design.md only mention the file name. A new page for one flag would have added an index row for nothing.
  • One related defect I did not touch: --lookup reads the dictionary with plain utf-8 (tools/hashdict.py:82), so a dictionary re-saved with a UTF-8 BOM is refused with Unexpected UTF-8 BOM. That is the same class as the open hashdict: read a carve index.json saved with a UTF-8 BOM (EGEN-HASHDICT-INDEX-BOM) #6871 for the carve index.json in this file; I left it out so this PR stays docs-only. Documenting the mode against a dictionary the tool itself writes (no BOM) is correct as it stands.
  • Read the flag order in the code rather than guessing: the dictionary is the first value after --lookup (nargs="+"), which is why the example puts it there.

AI-assisted.

The dictionary the two commands here build could only be consumed by awc_names.py; hashdict.py itself takes --lookup <dict> <hash>... and prints the name it holds for each 32-bit joaat hash, or '?'. No page named the mode or its arguments.

@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.

Summary

docs/audio.md adds a paragraph next to the dictionary build/consume commands documenting tools/hashdict.py --lookup <dict.json> <hash>...: it takes a dictionary path followed by one or more hexadecimal 32-bit joaat hashes, prints each name or ?, and needs no carve folder. Source lines are cited for the reader who wants to verify the format.

Why merge

The reverse lookup mode is the way to answer "which wave is this id" when another tool prints only a hash, yet no page named the flag, its argument order, or its no-carve-folder property. Documenting it where the dictionary is introduced makes the tool's other half discoverable. Docs-only.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

docs/audio.md adds a paragraph next to the dictionary build/consume commands documenting tools/hashdict.py --lookup <dict.json> <hash>...: it takes a dictionary path followed by one or more hexadecimal 32-bit joaat hashes, prints each name or ?, and needs no carve folder. Source lines are cited for the reader who wants to verify the format.

Why merge

The reverse lookup mode is the way to answer "which wave is this id" when another tool prints only a hash, yet no page named the flag, its argument order, or its no-carve-folder property. Documenting it where the dictionary is introduced makes the tool's other half discoverable. Docs-only.

Verdict: Approve

@shayderrr
shayderrr merged commit 5f47ed2 into ItsNotRexed:main Nov 23, 2026
0 of 2 checks passed
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.

2 participants