batch_glb: catch colliding output names before conversion #1750

Merged
leonida/mandy
kirigayakazima merged 2 commits from codex/batch-glb-output-name-collision into main 2026-11-29 03:37:29 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-25 11:14:16 +00:00

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.
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 reviewed 2026-11-25 11:19:56 +00:00
lixonik left a comment
No description provided.
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

#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.

#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

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

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

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.

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 description provided.