Skip to content

world_names: case-sensitive joaat uses the pinned Latin-1 bytes - #8011

Open
bobcatchris wants to merge 1 commit into
ItsNotRexed:mainfrom
bobcatchris:fix/joaat-case-latin1
Open

bobcatchris wants to merge 1 commit into
ItsNotRexed:mainfrom
bobcatchris:fix/joaat-case-latin1

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

Claim: #7804 (comment)

world_names.joaat(..., case_sensitive=True) hashed UTF-8, while the 0x7a schema copies (world_archetypes.joaat_cs, fog_volumes.joaat_cs) hash Latin-1. ASCII field names agreed, so the split was invisible; café gave 2425794034 here against 4009490211 in the schema copies. This changes only the case-sensitive branch and its docstring.

Verified at 6aad682a2 on Windows / CPython 3.13.12:

  • new tests/test_joaat_case_sensitive_agreement.py: 3/3 OK (ASCII, non-ASCII, mixed case, unchanged default hash, case still significant);
  • world_names case-sensitive field-name tests: 5/5 OK inside tests/test_world_names.py;
  • py_compile and git diff --check: clean.

Negative control on unpatched origin/main dde82f27e: four non-ASCII subtests fail with the UTF-8 hashes.

Pre-existing reds on this Windows host, untouched by this PR: tests/test_joaat_agreement.py fails on find_hash_lookup (covered by #6254/#7820/#7425), and tests/test_world_names.py has one path-repr failure (covered by #7425/#5760/#5927). #7425 also edits tools/world_names.py, but only the main() OSError path at line ~671; this patch is at joaat() lines 61-76.

Synthetic names only; no game data, GPU, keys or online services. AI-assisted.

@neoisg8

neoisg8 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 6aad682a2 on Windows 11 (CPython 3.14.3, CPU only, no game files): pass.

Negative control on main

On main (dde82f27e), world_names.joaat(text, case_sensitive=True) encoded to UTF-8 while the schema copies in world_archetypes.joaat_cs and fog_volumes.joaat_cs encode to Latin-1.
For non-ASCII names such as "café", this caused divergence:

  • world_names.joaat("café", case_sensitive=True): 2425794034 (UTF-8 bytes b"caf\xc3\xa9")
  • world_archetypes.joaat_cs("café") / fog_volumes.joaat_cs("café"): 4009490211 (Latin-1 bytes b"caf\xe9")

Verification with PR #8011

  • python -I tests/test_joaat_case_sensitive_agreement.py: all 3 tests pass cleanly. world_names.joaat(..., case_sensitive=True) now matches the schema copies across ASCII and non-ASCII test vectors (CMapData, archetypeName, café, Café, ÉLÉGIE, Señor).
  • test_default_lowercased_hash_is_unchanged: confirms that default lowercased hashes remain identical to hashdict.joaat.
  • test_case_remains_significant: confirms case-sensitivity is preserved.
  • Quality gates: python -m compileall -q tools/world_names.py tests/test_joaat_case_sensitive_agreement.py, python -I scripts/check_no_game_data.py, and git diff --check all exit 0. tests/test_joaat_case_sensitive_agreement.py confirmed LF-only.

LGTM!

AI-assisted.

@TieruYT

TieruYT commented Nov 23, 2026

Copy link
Copy Markdown

Windows, synthetic inputs. Tested 6aad682.

I inserted every Latin-1 byte value in turn between X and y in a synthetic name, then compared case-sensitive world_names.joaat with world_archetypes.joaat_cs. All 256 matched here; the parent matched 128/256. The three focused repository tests also passed.

AI-assisted verification · GPT-6.2 Astra Medium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants