leonida_mods: hash names as the pinned latin-1 joaat does #22

Manually merged
github merged 1 commit from gh-pr/22/head into gh-pr/22/base 2026-11-26 08:40:53 +00:00
Owner

@⁠wavehs on GitHub · 2026-11-24 01:55 UTC · original
wavehs:mods-joaat-latin1 → main · +7 −4 · 1 files · 1 commits · merged 2026-11-24 02:26 UTC

Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches tools/leonida_mods.py.

Depends on: none.

What and why

tests/test_joaat_agreement.py imports every def joaat( in tools/ and compares it with tools/hashdict.py, the dictionary the rest of the pipeline is pinned to. leonida_mods.joaat is the one copy that disagrees, on every name with a non-ASCII character:

FAILED (failures=6)
AssertionError: 2425794034 != 4009490211 : leonida_mods hashes 'café' differently from hashdict.joaat

It encoded the name to UTF-8 and ASCII-lowercased the bytes; the rule is name.lower().encode("latin-1", "replace") (tools/hashdict.py:44, and what audio_config/world_names/awc_names do since 0a8c08a56). The consequence in the tool: parse_model_id (the only caller, for from_name/to_name in a swap) returns an id no package entry has when a manifest spells a name with an accent, and nothing reports it.

The copy now follows the pinned rule, including ? for characters outside latin-1. ASCII names are unchanged: the two pinned expectations in tests/test_leonida_mods.py (player_story000_00 = 0xE472B687, cs_mandy = 0xD7C0CDFF) still pass.

Tested

main@9ec34cdff, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files:

tree tests/test_joaat_agreement.py tests/test_leonida_mods.py
main@9ec34cdff FAILED (failures=6) OK
this commit Ran 2 tests ... OK OK

python -I tools/leonida_mods.py --help still works (exit 0). Not run: Windows, any GPU test, the translator suite.

AI-assisted: yes.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator change.)
**@⁠wavehs** on GitHub · 2026-11-24 01:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/22) `wavehs:mods-joaat-latin1` → `main` · +7 −4 · 1 files · 1 commits · merged 2026-11-24 02:26 UTC Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches `tools/leonida_mods.py`. Depends on: none. ### What and why `tests/test_joaat_agreement.py` imports every `def joaat(` in `tools/` and compares it with `tools/hashdict.py`, the dictionary the rest of the pipeline is pinned to. `leonida_mods.joaat` is the one copy that disagrees, on every name with a non-ASCII character: ``` FAILED (failures=6) AssertionError: 2425794034 != 4009490211 : leonida_mods hashes 'café' differently from hashdict.joaat ``` It encoded the name to UTF-8 and ASCII-lowercased the bytes; the rule is `name.lower().encode("latin-1", "replace")` (`tools/hashdict.py:44`, and what `audio_config`/`world_names`/`awc_names` do since `0a8c08a56`). The consequence in the tool: `parse_model_id` (the only caller, for `from_name`/`to_name` in a swap) returns an id no package entry has when a manifest spells a name with an accent, and nothing reports it. The copy now follows the pinned rule, including `?` for characters outside latin-1. ASCII names are unchanged: the two pinned expectations in `tests/test_leonida_mods.py` (`player_story000_00` = `0xE472B687`, `cs_mandy` = `0xD7C0CDFF`) still pass. ### Tested `main@9ec34cdff`, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files: | tree | `tests/test_joaat_agreement.py` | `tests/test_leonida_mods.py` | |---|---|---| | `main@9ec34cdff` | `FAILED (failures=6)` | OK | | this commit | `Ran 2 tests ... OK` | OK | `python -I tools/leonida_mods.py --help` still works (exit 0). Not run: Windows, any GPU test, the translator suite. AI-assisted: yes. ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable: no translator change.)
The copy encoded the name to UTF-8 and lowercased ASCII bytes only, so every
accented name hashed differently from tools/hashdict.py and from
audio_config, awc_names and world_names: 'café' gave 2425794034 here and
4009490211 there, and a mod manifest naming a model or swap with an accent
would resolve to an id no package entry has.

Leonida's joaat is over the lowercased latin-1 bytes; characters outside
latin-1 hash as '?', as hashdict.joaat does.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:40:51 +00:00
github manually merged commit 0c7beb7e57 into gh-pr/22/base 2026-11-26 08:40:53 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.