hashes: add the 64-bit name hash (MurmurHash3 x64 128) #30

Open
github-bot wants to merge 1 commit from github-bot/gh-30 into main AGit
Owner

@⁠Justin-160inteva on GitHub · 2026-11-29 22:30 UTC · original
Justin-160inteva:feat/murmur3-64-name-hash → main · +101 −4 · 3 files · 1 commits · open

What

RPF9 entries carry two name hashes. This crate reads the 32-bit joaat column; the 8-byte
column 0x73bcb72dce74f11f has been listed as unidentified (entry.rs line ~147, and the
open issue "Identify the 64-bit TOC column 0x73bcb72dce74f11f").

That column is MurmurHash3 x64 128, low half, over the lowercased name. Two rules apply:

entry kind bytes hashed
typed resource (.#dr, .#bdr, .#map, .#td, .#bn, …) the stem — ma_sqr_merged.#dr hashes as ma_sqr_merged, because the extension lives in a separate TOC field
plain file (.awc, .xml, .dat, …) the full name including extension

Why it matters

Naming through the 32-bit column alone cannot resolve most entries. With this hash, a
hexhash name dictionary keyed on 64-bit values resolves 667,764 of 1,250,091 entries
(34.84% → 88.25%) on a retail Xbox install.

Validation

  • Reference vectors: "" → 0x0, "hello" → 0xcbd8a7b341bd9b02,
    "The quick brown fox jumps over the lazy dog" → 0xe34bbc7bbc071b6c
  • Live data: setup2.xml → 0x216b42926703a335, install.dat → 0x336373b5566693f1,
    each matching the entry it names
  • Lowercasing checked; cargo test --release passes (70 + 11)

Scope

Adds murmur3_x64_128 / name_hash64, their tests, and a --64 flag on forge9 hash so
64-bit dictionaries can be built. Wiring the column into catalog and list is a follow-up
PR — I did not touch entry.rs here to keep this reviewable.

**@⁠Justin-160inteva** on GitHub · 2026-11-29 22:30 UTC · [original](https://github.com/nineforge0/forge9/pull/30) `Justin-160inteva:feat/murmur3-64-name-hash` → `main` · +101 −4 · 3 files · 1 commits · open ## What RPF9 entries carry two name hashes. This crate reads the 32-bit `joaat` column; the 8-byte column `0x73bcb72dce74f11f` has been listed as unidentified (`entry.rs` line ~147, and the open issue "Identify the 64-bit TOC column 0x73bcb72dce74f11f"). That column is **MurmurHash3 x64 128, low half, over the lowercased name**. Two rules apply: | entry kind | bytes hashed | |---|---| | typed resource (`.#dr`, `.#bdr`, `.#map`, `.#td`, `.#bn`, …) | the **stem** — `ma_sqr_merged.#dr` hashes as `ma_sqr_merged`, because the extension lives in a separate TOC field | | plain file (`.awc`, `.xml`, `.dat`, …) | the **full name including extension** | ## Why it matters Naming through the 32-bit column alone cannot resolve most entries. With this hash, a `hexhash name` dictionary keyed on 64-bit values resolves **667,764 of 1,250,091 entries** (34.84% → 88.25%) on a retail Xbox install. ## Validation - Reference vectors: `""` → `0x0`, `"hello"` → `0xcbd8a7b341bd9b02`, `"The quick brown fox jumps over the lazy dog"` → `0xe34bbc7bbc071b6c` - Live data: `setup2.xml` → `0x216b42926703a335`, `install.dat` → `0x336373b5566693f1`, each matching the entry it names - Lowercasing checked; `cargo test --release` passes (70 + 11) ## Scope Adds `murmur3_x64_128` / `name_hash64`, their tests, and a `--64` flag on `forge9 hash` so 64-bit dictionaries can be built. Wiring the column into `catalog` and `list` is a follow-up PR — I did not touch `entry.rs` here to keep this reviewable.
RPF9 entries carry two name hashes: the 32-bit joaat column this crate already
reads, and an 8-byte column (0x73bcb72dce74f11f) whose function was unidentified.
That column is MurmurHash3 x64 128, low half, over the lowercased name.

Typed resources hash the stem only, because the extension lives in a separate TOC
field (ma_sqr_merged.#dr hashes as "ma_sqr_merged"); plain files such as .awc and
.xml hash the full name.

Adds murmur3_x64_128 / name_hash64 with reference-vector tests, and gives
`forge9 hash` a --64 flag so dictionaries for the 64-bit column can be built.

Checked against live data: setup2.xml -> 0x216b42926703a335,
install.dat -> 0x336373b5566693f1, both matching the entries they name.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 22:33:50 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/30/head:github-bot/gh-30'
git switch 'github-bot/gh-30'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-30'
git switch 'github-bot/gh-30'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-30'
git switch 'github-bot/gh-30'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-30'
git switch 'main'
git merge --squash 'github-bot/gh-30'
git switch 'main'
git merge --ff-only 'github-bot/gh-30'
git switch 'main'
git merge 'github-bot/gh-30'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.