[PR #718] mods: hash a mod.json name as hashdict.joaat does (OLD-10050) #757

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/718
Author: @abnalstlll-byte
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: restore/old-10050-mods-joaat-latin1


📝 Commits (1)

  • 182e0bb mods: hash a mod.json name as hashdict.joaat does (lower-cased Latin-1, not UTF-8 bytes)

📊 Changes

2 files changed (+63 additions, -5 deletions)

View changed files

📝 runtime/src/mods.h (+48 -5)
📝 runtime/test/mods_test.cpp (+15 -0)

📄 Description

### Summary
Restores old upstream PR 10050 (OLD-10050, replaces draft #316) with original author attribution (@Conrage) preserved.

gta6rt's mods::joaat previously hashed the UTF-8 bytes of a mod.json name and only lower-cased ASCII. Consequently, non-ASCII names in an archetype swap produced a hash that differed from tools/hashdict.py (enforced by tests/test_joaat_agreement.py), causing swaps to silently miss their target.

This change decodes the UTF-8, applies lowercase normalization across Latin-1 code points, and hashes the Latin-1 bytes with '?' fallback, aligning C++ constexpr mods::joaat with hashdict.joaat.

Verification

  • Added 12 compile-time static_asserts in runtime/test/mods_test.cpp covering accented Latin-1, ligatures, and CJK characters.
  • Clean-room check: python -I scripts/check_no_game_data.py clean (0 issues).
  • Zero external runtime dependencies.
  • AI-assisted (Claude Code).

🔄 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/718 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `restore/old-10050-mods-joaat-latin1` --- ### 📝 Commits (1) - [`182e0bb`](https://github.com/ubiquitarianism/leonida/commit/182e0bb73876867681bc4d1a001434c806b39a3f) mods: hash a mod.json name as hashdict.joaat does (lower-cased Latin-1, not UTF-8 bytes) ### 📊 Changes **2 files changed** (+63 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/mods.h` (+48 -5) 📝 `runtime/test/mods_test.cpp` (+15 -0) </details> ### 📄 Description ### Summary Restores old upstream PR 10050 (OLD-10050, replaces draft #316) with original author attribution (@Conrage) preserved. `gta6rt`'s `mods::joaat` previously hashed the UTF-8 bytes of a `mod.json` name and only lower-cased ASCII. Consequently, non-ASCII names in an archetype swap produced a hash that differed from `tools/hashdict.py` (enforced by `tests/test_joaat_agreement.py`), causing swaps to silently miss their target. This change decodes the UTF-8, applies lowercase normalization across Latin-1 code points, and hashes the Latin-1 bytes with '?' fallback, aligning C++ `constexpr mods::joaat` with `hashdict.joaat`. ### Verification - Added 12 compile-time `static_assert`s in `runtime/test/mods_test.cpp` covering accented Latin-1, ligatures, and CJK characters. - Clean-room check: `python -I scripts/check_no_game_data.py` clean (0 issues). - Zero external runtime dependencies. - AI-assisted (Claude Code). --- <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#757
No description provided.