world_build: share locks across case and Unicode variants (WORLD-BUILD-CASE-LOCK) #1633

Merged
KoLolX3 merged 1 commit from upstream-pr/1633 into main 2026-11-28 19:40:14 +00:00
KoLolX3 commented 2026-11-25 06:34:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KoLolX3 on 2026-11-25T06:34:24Z.


Claimed in the coordination issue as: WORLD-BUILD-CASE-LOCK (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154885515)

What and why

On case-insensitive filesystems, two spellings of the same output can hash to different locks and allow concurrent publication. Normalize and case-fold the resolved output path before hashing it. This conservatively shares locks even for case or Unicode variants that are distinct on a case-sensitive volume, avoiding concurrent writes at the cost of possible unnecessary contention. A two-process test checks contention, release, and an unrelated output.

Tested

  • python -I tests/test_world_build_output_lock.py (5 tests, 1 Windows-only skip)
  • python -I tests/test_world_build.py (65 tests, 1 skip)
  • python -I scripts/run_semantic_tests.py tests/semantic (487 files, 6,279 tests, 0 files failed)
  • python -m compileall -q make_game.py tools tests, python -I make_game.py --help, python -I scripts/check_no_game_data.py tools/world_build.py tests/test_world_build_output_lock.py, and git diff --check
  • Linux; native APFS was not available.

GPUs tested: n/a

AI-assisted: yes (OpenAI Codex)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5486449701 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1633). Originally posted by [KoLolX3](https://github.com/KoLolX3) on 2026-11-25T06:34:24Z. --- Claimed in the coordination issue as: WORLD-BUILD-CASE-LOCK (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154885515) ### What and why On case-insensitive filesystems, two spellings of the same output can hash to different locks and allow concurrent publication. Normalize and case-fold the resolved output path before hashing it. This conservatively shares locks even for case or Unicode variants that are distinct on a case-sensitive volume, avoiding concurrent writes at the cost of possible unnecessary contention. A two-process test checks contention, release, and an unrelated output. ### Tested - `python -I tests/test_world_build_output_lock.py` (5 tests, 1 Windows-only skip) - `python -I tests/test_world_build.py` (65 tests, 1 skip) - `python -I scripts/run_semantic_tests.py tests/semantic` (487 files, 6,279 tests, 0 files failed) - `python -m compileall -q make_game.py tools tests`, `python -I make_game.py --help`, `python -I scripts/check_no_game_data.py tools/world_build.py tests/test_world_build_output_lock.py`, and `git diff --check` - Linux; native APFS was not available. GPUs tested: n/a AI-assisted: yes (OpenAI Codex) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable.)
whoalin1 commented 2026-11-25 10:17:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T10:17:49Z.


Independent verification (Windows, Python 3.11.9): _exclusive_output NFD-normalizes + casefolds the resolved path before the SHA-256 lock key — conservative direction (distinct folders that fold alike may contend but cannot publish concurrently). test_world_build_output_lock.py 5 OK incl. new case/unicode-variant test; test_world_build.py 65 OK; neighbors world_json_atomic/world_place/world_instancing all OK; merges cleanly; compileall + check_no_game_data clean. AI-assisted verification.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7159501395 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1633#issuecomment-7159501395). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-25T10:17:49Z. --- Independent verification (Windows, Python 3.11.9): `_exclusive_output` NFD-normalizes + casefolds the resolved path before the SHA-256 lock key — conservative direction (distinct folders that fold alike may contend but cannot publish concurrently). `test_world_build_output_lock.py` 5 OK incl. new case/unicode-variant test; `test_world_build.py` 65 OK; neighbors world_json_atomic/world_place/world_instancing all OK; merges cleanly; compileall + check_no_game_data clean. AI-assisted verification.
MoonEyes commented 2026-11-28 19:40:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:40:12Z.


Red/green: tests/test_world_build_output_lock.py fails 1 assertion on main (case and Unicode variants of the output folder take separate locks) and passes with the PR (cloud run on main 7daa4a4, re-run on Windows against main 8b318bd).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7244717348 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1633#issuecomment-7244717348). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T19:40:12Z. --- Red/green: tests/test_world_build_output_lock.py fails 1 assertion on main (case and Unicode variants of the output folder take separate locks) and passes with the PR (cloud run on main 7daa4a4, re-run on Windows against main 8b318bd). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
OreoFR commented 2026-11-28 21:52:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:52:42Z.


Verified by OreoFR

  • Base: main 4a54aedcb + PR head d1d01cb30
  • Test: python -I tests/test_world_build_output_lock.py
  • Red on main: 1 failure (a case/Unicode variant does not get the same lock)
  • Green with the PR: OK
  • Verdict: READY
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246338429 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1633#issuecomment-7246338429). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:52:42Z. --- **Verified by OreoFR** - Base: main `4a54aedcb` + PR head `d1d01cb30` - Test: `python -I tests/test_world_build_output_lock.py` - Red on main: 1 failure (a case/Unicode variant does not get the same lock) - Green with the PR: OK - Verdict: READY - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1633
No description provided.