batch_glb: catch colliding output names before conversion #1750

Merged
kirigayakazima merged 2 commits from upstream-pr/1750 into main 2026-11-29 03:37:29 +00:00
kirigayakazima commented 2026-11-25 11:14:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-25T11:14:16Z.


Claimed in the coordination issue as: BATCH-GLB-OUTPUT-NAME-COLLISION

What and why

The converter drops the final OBJ extension when naming the output. On a source that contains both car.obj and car.OBJ, both workers therefore publish car.glb. The old summary counted two successful exports. The batch now checks potentially colliding stems before starting any workers. It tests similar names in a temporary directory on the output volume, so distinct output spellings remain available where the filesystem supports them.

Tested

On the baseline the duplicate-stem regression completed conversion instead of raising. On the branch it identifies both inputs, preserves an existing GLB, and leaves an unrelated output untouched. A second test checks case-distinct stems against the local volume. On Windows the test simulates the case-sensitive source directory listing.

  • python -I tests/test_batch_glb.py passed all 18 tests on this branch (Windows, Python 3.14.7).
  • git diff --check and the repository game-data scan of all changed paths passed.
  • The five independent changes were also merged locally. Both affected test files passed together (50 tests) and the three character-model consumer suites passed (28 tests). The shared base at bcaa13da passed 6,287 semantic tests across 488 files.

GPUs tested: N/A (CPU-only asset tooling).
AI-assisted: Yes.

Checklist

  • Based on current upstream main.
  • One topic.
  • Only synthetic test fixtures. No game data, keys or decryption.
  • Translator contract table: N/A.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5490249017 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1750). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-25T11:14:16Z. --- Claimed in the coordination issue as: [BATCH-GLB-OUTPUT-NAME-COLLISION](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7160621714) ### What and why The converter drops the final OBJ extension when naming the output. On a source that contains both `car.obj` and `car.OBJ`, both workers therefore publish `car.glb`. The old summary counted two successful exports. The batch now checks potentially colliding stems before starting any workers. It tests similar names in a temporary directory on the output volume, so distinct output spellings remain available where the filesystem supports them. ### Tested On the baseline the duplicate-stem regression completed conversion instead of raising. On the branch it identifies both inputs, preserves an existing GLB, and leaves an unrelated output untouched. A second test checks case-distinct stems against the local volume. On Windows the test simulates the case-sensitive source directory listing. - `python -I tests/test_batch_glb.py` passed all 18 tests on this branch (Windows, Python 3.14.7). - `git diff --check` and the repository game-data scan of all changed paths passed. - The five independent changes were also merged locally. Both affected test files passed together (50 tests) and the three character-model consumer suites passed (28 tests). The shared base at `bcaa13da` passed 6,287 semantic tests across 488 files. GPUs tested: N/A (CPU-only asset tooling). AI-assisted: Yes. ### Checklist - [x] Based on current upstream main. - [x] One topic. - [x] Only synthetic test fixtures. No game data, keys or decryption. - Translator contract table: N/A.
lixonik commented 2026-11-25 11:19:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T11:19:56Z.

Review: COMMENTED


Independent check at "c50c856b". Windows: all 18 batch tests passed. I ran the name check separately on a case-insensitive Windows directory and a case-sensitive local Linux filesystem under WSL. car.obj plus car.OBJ was rejected on both. car.obj plus CAR.OBJ was rejected only on the insensitive directory. Both probes left the original directory entry intact.

AI-assisted review and CPU-only testing with synthetic inputs.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6056672069 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1750#pullrequestreview-6056672069). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-25T11:19:56Z. **Review:** COMMENTED --- Independent check at "c50c856b". Windows: all 18 batch tests passed. I ran the name check separately on a case-insensitive Windows directory and a case-sensitive local Linux filesystem under WSL. car.obj plus car.OBJ was rejected on both. car.obj plus CAR.OBJ was rejected only on the insensitive directory. Both probes left the original directory entry intact. AI-assisted review and CPU-only testing with synthetic inputs.
zmasi commented 2026-11-28 11:38:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T11:38:18Z.


#1750 | head c50c856bba (merged cleanly with main 4a54aedcb) | python -I tests/test_batch_glb.py | red on main: FAILED (failures=2) (ValueError not raised on colliding stems or Windows NTFS case-insensitive volume aliasing) | green on PR+main: 18 tests OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Audited _check_output_names and batch_convert in tools/batch_glb.py (grouping normalized stems and probing exclusive file creation in a temporary subdirectory on out_dir before converting so colliding OBJ inputs fail up front without touching existing GLB outputs; directly exercised the Windows NTFS case-insensitive volume path in test_case_distinct_outputs_follow_the_destination_volume). Also verified clean merge (0 conflicts) and combined execution with #1752 (20 tests OK; note a trivial import-block context overlap in tools/batch_glb.py if merged alongside #1751), plus tests/test_ci_registration.py (18 OK), tests/test_text_write_line_endings.py (3 OK), and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238683420 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1750#issuecomment-7238683420). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T11:38:18Z. --- #1750 | head c50c856bba75d33c0d88ecc7c7c17b0195235f73 (merged cleanly with main 4a54aedcb) | `python -I tests/test_batch_glb.py` | red on main: `FAILED (failures=2)` (`ValueError` not raised on colliding stems or Windows NTFS case-insensitive volume aliasing) | green on PR+main: `18 tests OK` | Windows 11, Python 3.12.10 | AI-assisted: yes Audited `_check_output_names` and `batch_convert` in `tools/batch_glb.py` (grouping normalized stems and probing exclusive file creation in a temporary subdirectory on `out_dir` before converting so colliding OBJ inputs fail up front without touching existing GLB outputs; directly exercised the Windows NTFS case-insensitive volume path in `test_case_distinct_outputs_follow_the_destination_volume`). Also verified clean merge (`0` conflicts) and combined execution with #1752 (`20 tests OK`; note a trivial `import`-block context overlap in `tools/batch_glb.py` if merged alongside #1751), plus `tests/test_ci_registration.py` (`18 OK`), `tests/test_text_write_line_endings.py` (`3 OK`), and `scripts/check_no_game_data.py`.
OreoFR commented 2026-11-29 03:13:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T03:13:56Z.


Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7b6, PR head 780c38390 : red 2 failures / green 22 OK

python3.12 -I tests/test_batch_glb.py (22 tests):

  • Merge: clean (git merge-tree).
  • Red (main + only this PR's test file): 2 failures: test_colliding_stems_leave_all_outputs_untouched, test_case_distinct_outputs_follow_the_destination_volume.
  • Green (main + git merge --no-ff): 22/22 OK, skipped 0. On this case-insensitive APFS volume the second test takes its "same GLB" branch.
  • (MEASURED n=3) both red failures reproduce 3/3.
  • Neighbours, same on main and merge: test_glb_inspect 45 OK (1 skipped, Windows write protection), test_report_paths 26 OK (1 skipped, needs Windows case sensitivity).
  • Diff: _check_output_names probes name collisions in a temp dir inside out_dir before any write (out_dir already exists via makedirs; a collision exits 2 through the existing except ValueError). Minor: the NFD/upper/casefold double normalisation is redundant but harmless. No game data.

Verdict: READY

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249921773 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1750#issuecomment-7249921773). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T03:13:56Z. --- Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7b6, PR head 780c38390 : red 2 failures / green 22 OK `python3.12 -I tests/test_batch_glb.py` (22 tests): - Merge: clean (`git merge-tree`). - **Red** (main + only this PR's test file): 2 failures: `test_colliding_stems_leave_all_outputs_untouched`, `test_case_distinct_outputs_follow_the_destination_volume`. - **Green** (main + `git merge --no-ff`): 22/22 OK, skipped 0. On this case-insensitive APFS volume the second test takes its "same GLB" branch. - (MEASURED n=3) both red failures reproduce 3/3. - Neighbours, same on main and merge: `test_glb_inspect` 45 OK (1 skipped, Windows write protection), `test_report_paths` 26 OK (1 skipped, needs Windows case sensitivity). - Diff: `_check_output_names` probes name collisions in a temp dir inside `out_dir` before any write (`out_dir` already exists via `makedirs`; a collision exits 2 through the existing `except ValueError`). Minor: the NFD/upper/casefold double normalisation is redundant but harmless. No game data. **Verdict: READY** AI-assisted: Claude Code
DadaCap commented 2026-11-29 03:37:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-29T03:37:26Z.


Merging, thank you @kirigayakazima! OreoFR's agent verified this head merged with current main: the test fails on main and passes with the PR (https://github.com/ProjectLeonida/mandy/pull/1750#issuecomment-7249921773), and it still merges cleanly.

AI-assisted (Claude Code, Claude Opus 5.5), on behalf of DadaCap.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7250160318 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1750#issuecomment-7250160318). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-29T03:37:26Z. --- Merging, thank you @kirigayakazima! OreoFR's agent verified this head merged with current main: the test fails on main and passes with the PR (https://github.com/ProjectLeonida/mandy/pull/1750#issuecomment-7249921773), and it still merges cleanly. AI-assisted (Claude Code, Claude Opus 5.5), on behalf of DadaCap.
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!1750
No description provided.