From e6745674a2ad2e9d54538fdd51c25bb41b0cf0c5 Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:42:49 +0100 Subject: [PATCH 1/2] vertex_types: ask report_paths for the report-path guard The tool carried its own `same_output_path` (realpath, normcase, samefile) while it already imported `report_paths.path_key`, so it answered the report-path question two ways; CONTRIBUTING.md asks a report writer to ask `same_report_path` instead of deriving it again. The private copy also missed the helper's folding-volume probe, so on a Linux mount that ignores case (vfat/exFAT/CIFS) `--json R.json` and `--json r.json` were two paths and the second overwrote the first. --- tools/vertex_types.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tools/vertex_types.py b/tools/vertex_types.py index 39b133e704..1eb86865d3 100644 --- a/tools/vertex_types.py +++ b/tools/vertex_types.py @@ -47,6 +47,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from meshlet_page import PageError, parse_group # noqa: E402 (same group validation as the 63 30 pages) from report_paths import path_key # noqa: E402 +from report_paths import same_report_path # noqa: E402 MAGIC = 0x4042 HEADER = 0x80 @@ -679,15 +680,6 @@ def summarise(T): return out -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 _walk_error(exc: OSError): # os.walk skips a directory it cannot list unless onerror raises; a scan must not report an # incomplete directory as complete. main() turns the OSError into one error line and exit 2. @@ -729,7 +721,7 @@ def main(argv=None): print(f"error: --json {args.json} is a directory", file=sys.stderr) return 2 for path in archives.values(): - if same_output_path(args.json, path): + if same_report_path(args.json, path): print(f"error: --json would overwrite the input {path}", file=sys.stderr) return 2 rng = random.Random(args.seed) From 4812d70e8826b6c9389255f64f0b557d084569d2 Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:42:49 +0100 Subject: [PATCH 2/2] tests: list vertex_types 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..9dc30be6ec 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", "vertex_types", "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.