Skip to content

ttpf_mips: ask report_paths for the report-path guard (TTPF-MIPS-SHARED-REPORT-PATH) - #1173

Open
breachato wants to merge 2 commits into
ProjectLeonida:mainfrom
breachato:rpt-ttpf-mips
Open

breachato wants to merge 2 commits into
ProjectLeonida:mainfrom
breachato:rpt-ttpf-mips

Conversation

@breachato

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: 7142221628 (#14 (comment))

Depends on: none

Fixes: none

What and why

Both output guards of tools/ttpf_mips.py (:2188, :2208) compared paths with a private
same_output_path (:1496), a second derivation of tools/report_paths.same_report_path that
CONTRIBUTING.md asks a report writer to call, and one that missed the helper's folding-volume probe: on a
Linux mount that ignores case (vfat, exFAT, CIFS) --json R.json and --json r.json were two report paths
and the second overwrote the first. Both sites now call same_report_path; no test calls the private
name.

Tested

  • tests/test_ttpf_mips.py: 93 passed, 156 subtests passed.
  • python -I tools/ttpf_mips.py --help: prints its usage.
  • python -m compileall -q tools/ttpf_mips.py: clean.
  • Not tested: the folding-volume case this fixes, which needs a case-folding mount (vfat/exFAT/CIFS);
    this machine is NTFS, where normcase already folds case. tests/test_report_paths.py covers the
    helper's own folding-volume answer.
  • No game files, no GPU; nothing was built.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

@abnalstlll-byte abnalstlll-byte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed and verified. Standardizes --json and --out report destination guards in tools/ttpf_mips.py against overwriting input archives or texture pools via canonical tools/report_paths.py:same_report_path. 100% clean-room.

@Deedlyy

Deedlyy commented Nov 24, 2026

Copy link
Copy Markdown

Recommendation: [MERGE]

Reasoning: Both output guards in ttpf_mips call report_paths.same_report_path instead of a private copy. Net -8 lines, part of the #1162 series. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

MoonEyes pushed a commit to MoonEyes/leonida that referenced this pull request Nov 27, 2026
…th guard (TTPF-MIPS-SHARED-REPORT-PATH)

From ProjectLeonida#1173 (head 9ad892f), applied as a reviewed patch.

Co-authored-by: breachato <breachato@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale pushed a commit to milk4sale/leonida that referenced this pull request Nov 27, 2026
…ery-and-signature

GPU: add synthetic unit tests for query.rs and signature.rs
@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Native Windows 11 NTFS Verification (9ad892fddd)

Verified 9ad892fddde02d5bc1671e1592a6e117d03016b0 merged cleanly onto origin/main (c7753ed98a56677f10e34078b37eab0540e190ec, git merge-tree --write-tree rc=0) on native Windows 11 (26200) + NTFS:

  • Red (origin/main c7753ed98a): Enabled real Windows 11 per-directory NTFS case sensitivity (fsutil.exe file setCaseSensitiveInfo <dir> enable) and probed ttpf_mips.same_output_path on pool.ttpf vs pool.TTPF: origin/main returned True (false collision) because os.path.normcase lowercased both paths before os.path.samefile.
  • Green (origin/main + 9ad892fddd): Using report_paths.same_report_path returned False on the live case-sensitive NTFS directory while still returning True on a standard case-insensitive NTFS directory; python -I tests/test_ttpf_mips.py passed 93/93 OK.

AI-assisted.

@TheGeogeo

Copy link
Copy Markdown
Contributor

Checked 9ad892fdd merged (no commit) with main 87a39df94: Python 3.12.4, Windows 11 10.0.26300, CPU only. check_no_game_data.py is clean.

No blocker from my side.

AI-assisted (Claude Code).

@OreoFR

OreoFR commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7, PR head 9ad892f : red none / green OK

No test in the PR:

  • Merge: clean (git merge-tree).
  • Diff: same_output_path (normcase + samefile) is replaced by report_paths.same_report_path in both places (scan --json and the export output). No game data.
  • No red: no test covers it; ttpf_mips is not in SHARED in tests/test_report_paths.py. A local simulation of that check fails on main and passes on the merge.
  • Guard checked by hand with a fake pool.ttpf (MEASURED): scan pool.ttpf --json POOL.TTPF and export pool.ttpf 0 Pool.ttpf --force are refused on main and on the merge; the pool is untouched. On main samefile already caught these (the guarded inputs exist), so the gain is consistency (and Windows cases), not a macOS fix.
  • Neighbours (test_report_paths, test_tool_startup, navmesh*/ttpf*/dds/zero_span/staging tests): 102 OK, 7 skipped (rpf9dump not built, bcpack_calibration dylib absent, one Windows-only case-sensitivity test), 1 failure — test_tool_startup psin_dialogue (ModuleNotFoundError: psin_data), identical on main (MEASURED n=3), unrelated.
  • Suggestion: add ttpf_mips to SHARED in tests/test_report_paths.py as the red test.

Verdict: NO RED (correct refactor, no test).

AI-assisted: Claude Code

@TheGeogeo

TheGeogeo commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Correction: not in main. Its squash commit ee23a4041 landed on 2026-11-27, but 00131bb85 ("main keeps its own runtime, tools and tests; the branch's variants stay on port/d3d12-nvidia") restored tools/ttpf_mips.py the same day, so main does not have this change. I took the earlier verdict from the history (git cherry and the squash title), not from the tree. Re-checked on main c22a0a732: git merge-tree --write-tree of main and this branch gives a tree that still differs from main in tools/ttpf_mips.py.

New verdict: ready for testing. It merges cleanly with main c22a0a732.

The test that is missing, and fails on main on any OS: add "ttpf_mips" to SHARED in tests/test_report_paths.py. Checked here: on main, test_switched_tools_import_the_helper_and_define_no_copy then fails for this tool. With this branch it passes. My earlier note that such a test can only fail on a patched folding volume was wrong.

AI-assisted (Claude Code).


Earlier comment, superseded by the correction above:

Already in main: squashed as ee23a4041 (2026-11-27, "PR #1173: ttpf_mips: ask report_paths for the report-path guard") in main bd643e46e. git cherry finds this branch's patch there.

On the missing-test question: like #1162, a case-folded report-path test (as #1430 added) is what is missing for ttpf_mips, and it can only fail with report_paths' volume probe patched to report folding. main's old guard already folded case on Windows and macOS.

AI-assisted (Claude Code).

@TheGeogeo

Copy link
Copy Markdown
Contributor

Tested 9ad892fdd merged (no commit) with main c22a0a732: Python 3.12.4, Windows 11 10.0.26300, CPU only.

This is the red test named in the correction above: "ttpf_mips" added to SHARED in tests/test_report_paths.py, running test_switched_tools_import_the_helper_and_define_no_copy.

  • Red on main: it fails with 'from report_paths import same_report_path' not found in tools/ttpf_mips.py.
  • Green with this PR: it passes.

The test edit is mine, not part of the PR. Adding that SHARED entry to the PR would give it its own red test.

AI-assisted (Claude Code).

@MoonEyes

Copy link
Copy Markdown
Collaborator

Tested 9ad892fdd merged (no commit) with main 4364a4fa6: Python 3.12, Windows 11 10.0.26300, CPU only.

  • Red test: "ttpf_mips" added to SHARED in tests/test_report_paths.py, then python -I tests/test_report_paths.py.
  • Red on main: 'from report_paths import same_report_path' not found in tools/ttpf_mips.py.
  • Green with this PR: OK (1 skipped).
  • That SHARED entry is my edit, not part of the PR. Adding it to the PR would give the PR its own red test.

AI-assisted (Claude Code).

@breachato

Copy link
Copy Markdown
Contributor Author

Added: ttpf_mips is now in SHARED in tests/test_report_paths.py in this PR (commit cf5af0fa).

  • python -I tests/test_report_paths.py — OK (1 skipped), with the entry in place.
  • python -I tests/test_ttpf_mips.py — OK.
  • The red is the one you described: the same entry without this branch fails with 'from report_paths import same_report_path' not found.

Every PR in this series now touches that SHARED line, so I expect to rebase the rest as merges land; say the word if you would rather keep the list to a single follow-up.

AI-assisted.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 30, 2026
@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_ttpf_mips.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
@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/ttpf_mips.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.)

@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Dec 1, 2026
Both output guards compared paths with a private `same_output_path`, a second derivation of `report_paths.same_report_path` that CONTRIBUTING.md asks a report writer to call, and one that missed the helper's folding-volume probe (vfat/exFAT/CIFS).
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 rpt-ttpf-mips branch 2 times, most recently from ad06108 to 56fe8aa Compare December 1, 2026 18:56
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.

8 participants