[PR #168] leonida_mods: hash lower-cased Latin-1 bytes in joaat() #220

Open
opened 2026-11-26 20:17:11 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/168
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9902


📝 Commits (1)

  • 3b42026 leonida_mods: hash lower-cased Latin-1 bytes in joaat()

📊 Changes

1 file changed (+2 additions, -4 deletions)

View changed files

📝 tools/leonida_mods.py (+2 -4)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/168 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9902` --- ### 📝 Commits (1) - [`3b42026`](https://github.com/ubiquitarianism/leonida/commit/3b420268130b40f15c583802c8def1619d4ae062) leonida_mods: hash lower-cased Latin-1 bytes in joaat() ### 📊 Changes **1 file changed** (+2 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tools/leonida_mods.py` (+2 -4) </details> ### 📄 Description > 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#220
No description provided.