From ef821956755d4773e89531b78a2f46ec63854eb2 Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:43:23 +0100 Subject: [PATCH 1/2] meshlet_page: ask report_paths for the report-path guard --- tools/meshlet_page.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/meshlet_page.py b/tools/meshlet_page.py index 1c925ca4df..0e51267cb3 100644 --- a/tools/meshlet_page.py +++ b/tools/meshlet_page.py @@ -76,6 +76,11 @@ import sys import zlib +ROOT = os.path.dirname(os.path.abspath(__file__)) +if ROOT not in sys.path: + sys.path.insert(0, ROOT) +from report_paths import same_report_path # noqa: E402 + BLOCK_MAGIC = 0x3063 OTHER_BLOCK_MAGIC = 0x4042 HEADER_SIZE = 0x60 @@ -919,13 +924,7 @@ def buffer(at): return {"vertex_block": vertex, "meshlet_group": index, "vertices": count} -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 +same_output_path = same_report_path # True when writing the second would truncate the first def is_scanned_input(path, input_path): From e9b2529a967071dd54397352abcb1cf452661397 Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:43:24 +0100 Subject: [PATCH 2/2] tests: list meshlet_page 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_report_paths.py b/tests/test_report_paths.py index a6b85b5049..5a22fe2cc5 100644 --- a/tests/test_report_paths.py +++ b/tests/test_report_paths.py @@ -22,8 +22,8 @@ # 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", "navmesh_index", "rpf_probe", "tile_probe", "world_index", "world_lights_paths", - "world_names") + "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "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. LEGACY_COPIES = {"navmesh_decode"}