From 0fc2050860a7f2b4517049f84666a53acb96e67e Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:42:54 +0100 Subject: [PATCH 1/2] shader_profile: ask report_paths for the report-path guard `same_output_path` was a second derivation of `report_paths.same_report_path`, which CONTRIBUTING.md asks a report writer to call, and it missed the helper's folding-volume probe (vfat/exFAT/CIFS). The name stays as a one-line delegation because `tests/test_shader_profile.py` calls it by name. --- tools/shader_profile.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/shader_profile.py b/tools/shader_profile.py index 0f049eee83..76fb6b6c50 100644 --- a/tools/shader_profile.py +++ b/tools/shader_profile.py @@ -24,6 +24,9 @@ import sys from collections import Counter, defaultdict +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from report_paths import same_report_path # noqa: E402 + FAMILIES = [("s_buffer_", "smem"), ("s_load", "smem"), ("s_", "scalar"), ("v_", "vector"), ("ds_", "lds"), ("buffer_", "buffer"), ("tbuffer_", "buffer"), ("image_", "image"), ("global_", "global"), ("flat_", "flat"), ("scratch_", "scratch"), ("exp", "export")] @@ -289,13 +292,10 @@ def stage_map(disasm_dir) -> dict: def same_output_path(first, second): - """True when writing ``second`` would truncate ``first`` (same file, path or hard link).""" - 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 + """True when writing ``second`` would truncate ``first``: one name (case-folded on a folding volume) or one + file through a hard link. `tools/report_paths.same_report_path` owns that answer; this keeps the name the rest + of the tool calls.""" + return same_report_path(first, second) def main(): From ad06108c6200b82cfe3b3cca01ba41179ec8ee4b Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:42:55 +0100 Subject: [PATCH 2/2] tests: list shader_profile 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 5a22fe2cc5..3343c8425b 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", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "world_index", - "world_lights_paths", "world_names") + "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "shader_profile", "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"}