leonida_mods: hash lower-cased Latin-1 bytes in joaat() #168

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

@⁠Andretuta on GitHub · 2026-11-24 02:34 UTC · original
ubiquitarianism:old-pr/9902 → main · +2 −4 · 1 files · 1 commits · draft

Carried over from old PR 9902 by EspadaHD in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9902, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
EspadaHD: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116815084

What and why

tools/leonida_mods.py's joaat(name) encoded the string as UTF-8 first and only folded ASCII uppercase bytes (0x41..0x5A), diverging from tools/hashdict.py's canonical name.lower().encode("latin-1", "replace") on every non-ASCII name and causing 6 subtest failures in tests/test_joaat_agreement.py (copy='leonida_mods'). Hash name.lower().encode("latin-1", "replace") so leonida_mods.joaat agrees with hashdict.joaat.

Tested

  • python -I tests/test_joaat_agreement.py: all 10 copy='leonida_mods' subtests pass (0 failures for leonida_mods, down from 6; remaining 6 failures on main are in find_hash_lookup)
  • python -I tests/test_leonida_mods.py -v: ManifestTests (test_hashes_match_the_runtime_contract, test_manifest_validation_matches_runtime_rules) and SamplesAndGuiTests pass (9/10 pass; test_run_print_builds_gta6rt_command has an unrelated pre-existing Windows failure because its fixture creates gta6rt.sh)
  • python -m compileall -q tools/leonida_mods.py: exit 0
  • python -I scripts/check_no_game_data.py tools/leonida_mods.py: exit 0
  • Environment: Windows, CPU-only standard library tests, no game data, no GPU used.

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.
**@⁠Andretuta** on GitHub · 2026-11-24 02:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/168) `ubiquitarianism:old-pr/9902` → `main` · +2 −4 · 1 files · 1 commits · draft > Carried over from **old PR 9902** by `EspadaHD` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9902`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `EspadaHD`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116815084 ### What and why `tools/leonida_mods.py`'s `joaat(name)` encoded the string as UTF-8 first and only folded ASCII uppercase bytes (`0x41..0x5A`), diverging from `tools/hashdict.py`'s canonical `name.lower().encode("latin-1", "replace")` on every non-ASCII name and causing 6 subtest failures in `tests/test_joaat_agreement.py` (`copy='leonida_mods'`). Hash `name.lower().encode("latin-1", "replace")` so `leonida_mods.joaat` agrees with `hashdict.joaat`. ### Tested - `python -I tests/test_joaat_agreement.py`: all 10 `copy='leonida_mods'` subtests pass (0 failures for `leonida_mods`, down from 6; remaining 6 failures on `main` are in `find_hash_lookup`) - `python -I tests/test_leonida_mods.py -v`: `ManifestTests` (`test_hashes_match_the_runtime_contract`, `test_manifest_validation_matches_runtime_rules`) and `SamplesAndGuiTests` pass (9/10 pass; `test_run_print_builds_gta6rt_command` has an unrelated pre-existing Windows failure because its fixture creates `gta6rt.sh`) - `python -m compileall -q tools/leonida_mods.py`: exit 0 - `python -I scripts/check_no_game_data.py tools/leonida_mods.py`: exit 0 - Environment: Windows, CPU-only standard library tests, no game data, no GPU used. 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:47:13 +00:00
This pull request has changes conflicting with the target branch.
  • tools/leonida_mods.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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