Skip to content

anim_clips: ask report_paths for the report-path guard - #2636

Open
breachato wants to merge 2 commits into
ProjectLeonida:mainfrom
breachato:anim-clips-shared-report-path
Open

breachato wants to merge 2 commits into
ProjectLeonida:mainfrom
breachato:anim-clips-shared-report-path

Conversation

@breachato

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: ANIM-CLIPS-SHARED-REPORT-PATH

What and why

tools/anim_clips.py compares the archive it reads with the --out report through its own same_output_path:

os.path.normcase(os.path.realpath(a)) == os.path.normcase(os.path.realpath(b)) or os.path.samefile(a, b)

That answer is wrong in the two places tools/report_paths.py exists for. On a case-insensitive APFS volume anim/clips.json and anim/Clips.json are one file, but normcase keeps case on macOS, so the guard passes the pair and the second write truncates the first. In a case-sensitive Windows directory the two spellings are two files, but normcase folds them on Windows, so the guard refuses a pair that does not collide. CONTRIBUTING.md asks a report writer to call report_paths.same_report_path(a, b) rather than deriving the answer again.

The private function becomes an alias, same_output_path = same_report_path, so main() and any importer keep the old name. anim_clips also joins SHARED in tests/test_report_paths.py, so the no-private-copy test guards it from now on.

Tested

  • python -I tests/test_anim_clips.py — OK
  • python -I tests/test_report_paths.py — OK (1 skipped: the macOS-only case), with anim_clips in SHARED
  • python -I tests/test_report_path_case.py — OK (1 skipped, same)
  • python -I tools/anim_clips.py --help — clean

Synthetic archives built in a temporary folder; no game data.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic; nothing else touched.
  • No game data, keys or hardware results invented.

@fiestorra

Copy link
Copy Markdown
Contributor

Verified independently on main 452d1d1b6 (Windows, Python 3.13, no game data): the two commits apply cleanly and the tests pass.

git merge-tree origin/main refs/pull/2636/head      -> clean
cherry-pick f984b4606 fc1e720ea (the two commits not in main) -> clean
python3 -m pytest tests/test_report_paths.py -q     -> 26 passed, 23 subtests
python3 -m pytest tests/test_anim_clips.py -q       -> 54 passed

tools/anim_clips.py +10/-10 net -8: it now asks report_paths for the guard instead of keeping its own copy, and tests/test_report_paths.py lists anim_clips in SHARED so the shared list stays true.

One practical note for whoever merges the set: this is one of five pull requests from the same author (#2636-#2640) with the same shape, one per tool. They are independent files, so they do not conflict with each other, but they will each need the same review - if that is the intent, fine; if it was one change split five ways, a single pull request with five files would be one review instead of five.

Not tested: on the game data itself (none is available or needed here); the tests are the synthetic fixtures in the repository.

Written with an AI assistant.

@breachato

Copy link
Copy Markdown
Contributor Author

Thanks for the independent verification, and for measuring the tuple conflict — that is the useful part.

The split into five is deliberate: this repository asks for one topic per pull request, and each of these is a different tool with its own tests, so five reviews is the shape we chose rather than one change cut five ways. Nothing to re-plan there.

On merging: agreed, and it is what I will do. All five test-merge cleanly against main on their own right now, and the only collision is the SHARED tuple line in tests/test_report_paths.py. After each one lands I will rebase the next on main with git rebase --reapply-cherry-picks (the entry is one line of the same tuple, so a plain rebase would otherwise drop the commit as an already-applied cherry-pick) and force-push with --force-with-lease. Both additions belong in the tuple alphabetically, so there is no disagreement between the branches to resolve — a conflict here is just the queue, not a review question.

The head you verified is the current one: #2636 is at fc1e720ea (base edf0ff5d0), the pair f984b4606 / fc1e720ea.

For the record, the other four at the same moment, each 2 files and MERGEABLE: #2637 3cd08cfc7, #2638 91675f6e2, #2639 644bcb54a, #2640 0b2bab55f.

AI-assisted.

@aegish-zagi

Copy link
Copy Markdown
Contributor

VERIFY-2636 — PASS

  • PR: anim_clips: ask report_paths for the report-path guard #2636 | head fc1e720 | merge state vs main 1d22590: CLEAN (scratch merge, no conflicts)
  • Tests run: python -I tests/test_report_paths.py (the test file this PR touches)
  • Red-on-main vs green-on-PR: PR test file on plain main code = 26 tests, FAILED (failures=1, skipped=1) — anim_clips still carried its private copy; merged PR = 26 tests, OK (skipped=1)
  • Diff audit (READ IN CODE): tools/anim_clips.py deletes its private same_output_path copy and aliases it to report_paths.same_report_path; the shared implementation is a superset (resolved-path + samefile, plus case-folding-volume handling the private copy lacked), so no call site loses behavior. Test change only adds anim_clips to the SHARED tuple. python -I scripts/check_no_game_data.py on both changed files: pass; tool compiles.
  • Platform: Linux, Python 3.12.3, no GPU (Profile Z). MEASURED above; no GPU or game-dump work claimed.
    AI-assisted: yes (Muse Wonder, Muse by Meta)

@fiestorra

Copy link
Copy Markdown
Contributor

Heads-up: this branch now conflicts on one line, and the conflict has a mechanical fix.

main merged a sibling of this pull request (#2637, 3cd08cfc7 "tests: list bink_index in SHARED") at 08:33 today. #2636, #2638, #2639, #2640 and #2637 all edit the same tuple, so the other four now conflict against the merged one:

$ git merge-tree --write-tree origin/main refs/remotes/pr/2636
CONFLICT in tests/test_report_paths.py

What main has now:

SHARED = ("anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml", "gen_d3d12_stubs",
          "glb_inspect", "navmesh_index", "rpf_probe", "tile_probe", "world_index", "world_lights_paths",
          "world_names")

What this branch needs: insert "anim_clips" in its alphabetical place in that tuple, and keep the rest of the branch unchanged. Everything else in the diff applies cleanly - the tuple line is the only conflict.

Note on ordering, since it is easy to get wrong on a rebase: the tuple is alphabetical, and "anim_clips" goes between the entries that bracket it. A rebase that appends it at the end would still pass the test but would break the file's convention and the next sibling's merge.

Why I am commenting: I verify open pull requests against current main by applying them in a scratch worktree and building their test targets. This one went from "replays cleanly" to "conflicts" between 09:20 and 10:36 today, and the cause was #2637 landing - not anything in this branch.

Written with an AI assistant.

@KelboLive

Copy link
Copy Markdown

Independent check on Windows at \ c1e720ea: \python -I tests/test_report_paths.py\ — 26 tests OK (9.9 s). \�nim_clips\ is now covered by the shared report-path guard. Windows 11 26200.9711, Python 3.12.10. AI-assisted: yes (opencode).

@j-weiner j-weiner mentioned this pull request Nov 30, 2026
4 tasks done
@breachato
breachato force-pushed the anim-clips-shared-report-path branch from fc1e720 to d677a53 Compare November 30, 2026 19:21
@breachato

breachato commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto main (8f41d7d0) to clear the SHARED tuple conflict that #2637 (bink_index) opened for every sibling: the entry now sits in the tuple next to bink_index, and the branch is two commits again.

Verified on the new head:

  • python -I tests/test_report_paths.py — OK (26 tests, 1 skipped)
  • python -I tests/test_anim_clips.py — OK
  • git diff main — 2 files: the tool and tests/test_report_paths.py

No behaviour change beyond the shared helper.

Ready to merge: MERGEABLE / CLEAN, all five checks green. Every sibling PR touches the same SHARED line, so please merge one at a time — I'll rebase the remaining ones after each merge and keep them green.

@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 30, 2026
@breachato

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #2637 landed, so the SHARED tuple conflict is gone and the branch is two commits again on top of main (8f41d7d0; main is now d8ca1824, which does not touch tests/test_report_paths.py or tools/anim_clips.py).

New head: d677a53f19fbcd12453524c9a9081192b74d39b3.

Measured on that head, standard library only, Windows, Python 3.14, no game data:

python -I tests/test_report_paths.py  ->  Ran 26 tests, OK (skipped=1)
python -I tests/test_anim_clips.py    ->  Ran 54 tests, OK

@fiestorra @aegish-zagi @KelboLive — your checks are on fc1e720ea, i.e. before the rebase. Could you re-run the guard on d677a53f and approve if it still holds? Merging on the old head would land code none of you has looked at.

The diff is unchanged in substance: same two commits, same SHARED entry, only the tuple context under it moved.

@fiestorra

Copy link
Copy Markdown
Contributor

Verified on Windows at your new head d677a53f1, and the change is load-bearing: with tools/anim_clips.py from main the suite fails.

Cherry-picked onto main d8ca18240 in a clean worktree, Python 3.13.14:

python -m pytest tests/test_report_paths.py -q
  with this PR:                     26 passed, 24 subtests passed
  with tools/anim_clips.py from main:      1 failed, 26 passed, 23 subtests passed

So the local guard this removes is not dead code that the tuple test happens to tolerate - the test reaches the path it replaces and fails when the old code is put back. That is the control I would want on a refactor whose whole claim is "the same answer, from one place".

Your rebase also holds: the tree applies without the SHARED tuple conflict, and the diff is two files (tools/anim_clips.py and tests/test_report_paths.py), matching what you reported.

What I did not test: anything that needs a real report_paths target on disk - the other two PRs in this family cover that shape, and the three together are consistent, but each one alone only proves its own tool asks the same function.

AI-assisted: yes - DeepSeek v4.1 (flash) applied the head and ran both arms on the machine above.

Written with an AI assistant.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Dec 1, 2026

@aslan2142 aslan2142 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff against main: delegating the report-path guard in tools/anim_clips.py to report_paths.same_report_path is clean and clean-room verified, but this branch currently conflicts with main in tests/test_report_paths.py:8-12 (SHARED tuple updated by #2639 and earlier merges). Please rebase onto current main so CI runs cleanly.

(AI-assisted review.)

@breachato
breachato force-pushed the anim-clips-shared-report-path branch from d677a53 to 05dfffc Compare December 1, 2026 17:54
@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Dec 1, 2026
The reviewers' red test: with this entry on main,
test_switched_tools_import_the_helper_and_define_no_copy fails with
"'from report_paths import same_report_path' not found"; with this branch
it passes.
@breachato
breachato force-pushed the anim-clips-shared-report-path branch from 05dfffc to f866b19 Compare December 1, 2026 18:57
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.

5 participants