From 6a70b944cea18c9cbb8f87a15708ef5c916a3342 Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:42:56 +0100 Subject: [PATCH 1/2] ttpf_mips: ask report_paths for the report-path guard 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). --- tools/ttpf_mips.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tools/ttpf_mips.py b/tools/ttpf_mips.py index ebaa90fd27..0212fdea81 100644 --- a/tools/ttpf_mips.py +++ b/tools/ttpf_mips.py @@ -53,6 +53,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import bcpack # noqa: E402 import bcpack_tables_bptc as _bptc # noqa: E402 +from report_paths import same_report_path # noqa: E402 from tex_headers import ( # noqa: E402 array_surface_layout, compact_surface_layout, cubemap_surface_layout, decode_etpf_chunk_pages, etpf_streaming_padding, gfx10_tile_bytes, @@ -1493,15 +1494,6 @@ def analyze(pool, index, *, allow_bcpack=True): # --- commands -------------------------------------------------------------- -def same_output_path(first, second): - if os.path.normcase(os.path.realpath(first)) == os.path.normcase(os.path.realpath(second)): - return True - try: - return os.path.samefile(first, second) - except OSError: - return False - - def find_pools(arg): """Pools under a game root (data/ttdb and pack/*/data/ttdb), or, for any other folder such as data/ttdb itself or one pack, every .ttpf below it. A file is taken as a pool.""" @@ -2185,7 +2177,7 @@ def main(argv=None): print(f"ERROR: --json {a.json} is a directory", file=sys.stderr) return 2 for p in pools: - if same_output_path(a.json, p): + if same_report_path(a.json, p): print(f"ERROR: --json would overwrite the input {p}", file=sys.stderr) return 2 try: @@ -2205,7 +2197,7 @@ def main(argv=None): continue if label == "--history file" and not os.path.isfile(asset): continue - if same_output_path(a.out, asset): + if same_report_path(a.out, asset): print(f"ERROR: {a.out} would overwrite the {label} {asset}", file=sys.stderr) return 2 try: From 56fe8aa777210ba181a6f1f1e867462218d452d8 Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:42:57 +0100 Subject: [PATCH 2/2] tests: list ttpf_mips in SHARED 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. --- tests/test_report_paths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_report_paths.py b/tests/test_report_paths.py index 5a22fe2cc5..bc5d069152 100644 --- a/tests/test_report_paths.py +++ b/tests/test_report_paths.py @@ -22,7 +22,7 @@ # Tools that use report_paths and must not define their own copy again. SHARED = ("anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml", "gen_d3d12_stubs", - "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "world_index", + "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "ttpf_mips", "world_index", "world_lights_paths", "world_names") # The one tool that still carries its own copy (an open pull request edits its call site). Do not add to this list: # import report_paths instead.