shader_profile: ask report_paths for the report-path guard (SHADER-PROFILE-SHARED-REPORT-PATH) #1172

Closed
breachato wants to merge 2 commits from upstream-pr/1172 into main
breachato commented 2026-11-24 19:32:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-24T19:32:47Z.


Claimed in the coordination issue as: 7142220859 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142220859)

Depends on: none

Fixes: none

What and why

tools/shader_profile.py derived report-path equality itself in same_output_path (:291, called at
:314 and :331), which is the answer tools/report_paths.same_report_path exists to give
(CONTRIBUTING.md asks a report writer to call it instead of deriving it again). The private copy missed
that helper's folding-volume probe, so on a Linux mount that ignores case (vfat, exFAT, CIFS) two reports
that differ only in case passed as two paths and the second overwrote the first. The tool now adds its own
folder to sys.path and delegates; same_output_path stays as a one-line wrapper because
tests/test_shader_profile.py:616 calls it by name.

Tested

  • tests/test_shader_profile.py: 41 passed, 99 subtests passed (it calls P.same_output_path
    directly, which is why the name stays).
  • python -I tools/shader_profile.py --help: prints its usage.
  • python -m compileall -q tools/shader_profile.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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478949484 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172). Originally posted by [breachato](https://github.com/breachato) on 2026-11-24T19:32:47Z. --- Claimed in the coordination issue as: 7142220859 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142220859) Depends on: none Fixes: none ### What and why `tools/shader_profile.py` derived report-path equality itself in `same_output_path` (`:291`, called at `:314` and `:331`), which is the answer `tools/report_paths.same_report_path` exists to give (CONTRIBUTING.md asks a report writer to call it instead of deriving it again). The private copy missed that helper's folding-volume probe, so on a Linux mount that ignores case (vfat, exFAT, CIFS) two reports that differ only in case passed as two paths and the second overwrote the first. The tool now adds its own folder to `sys.path` and delegates; `same_output_path` stays as a one-line wrapper because `tests/test_shader_profile.py:616` calls it by name. ### Tested - `tests/test_shader_profile.py`: **41 passed**, 99 subtests passed (it calls `P.same_output_path` directly, which is why the name stays). - `python -I tools/shader_profile.py --help`: prints its usage. - `python -m compileall -q tools/shader_profile.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 - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] 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 commented 2026-11-24 19:35:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:35:17Z.

Review: APPROVED


Reviewed and verified. Standardizes output path collision protection in tools/shader_profile.py via canonical tools/report_paths.py:same_report_path. 100% clean-room.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6046024702 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#pullrequestreview-6046024702). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:35:17Z. **Review:** APPROVED --- Reviewed and verified. Standardizes output path collision protection in `tools/shader_profile.py` via canonical `tools/report_paths.py:same_report_path`. 100% clean-room.
Deedlyy commented 2026-11-24 20:10:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:10:34Z.


Recommendation: [MERGE]

Reasoning: shader_profile replaces its private same_output_path with report_paths.same_report_path at both call sites. Small refactor in the #1162 series, same rationale and risk profile. 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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143146961 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1172#issuecomment-7143146961). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:10:34Z. --- **Recommendation:** [MERGE] **Reasoning:** `shader_profile` replaces its private `same_output_path` with `report_paths.same_report_path` at both call sites. Small refactor in the #1162 series, same rationale and risk profile. 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
zmasi commented 2026-11-28 22:29:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:29:09Z.


Native Windows 11 NTFS Verification (018df194ee)

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

  • Red (origin/main adfb3821a): Enabled real Windows 11 per-directory NTFS case sensitivity (fsutil.exe file setCaseSensitiveInfo <dir> enable) and probed shader_profile.same_output_path on prof.json vs PROF.JSON: origin/main returned True (false collision) because os.path.normcase lowercased both paths before os.path.samefile.
  • Green (origin/main + 018df194ee): Delegating same_output_path to 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_shader_profile.py passed 41/41 OK.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246767764 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#issuecomment-7246767764). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:29:09Z. --- ### Native Windows 11 NTFS Verification (`018df194ee`) Verified `018df194ee6a6ccf7adfbfb4254c7c129c8a0d8a` merged cleanly onto `origin/main` (`adfb3821a23612263c1c5b195453ed01c4c114db`, `git merge-tree --write-tree` `rc=0`) on native **Windows 11 (`26200`) + NTFS**: - **Red (`origin/main` `adfb3821a`)**: Enabled real Windows 11 per-directory NTFS case sensitivity (`fsutil.exe file setCaseSensitiveInfo <dir> enable`) and probed `shader_profile.same_output_path` on `prof.json` vs `PROF.JSON`: `origin/main` returned `True` (false collision) because `os.path.normcase` lowercased both paths before `os.path.samefile`. - **Green (`origin/main + 018df194ee`)**: Delegating `same_output_path` to `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_shader_profile.py` passed **`41/41 OK`**. AI-assisted.
TheGeogeo commented 2026-11-29 01:13:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T01:13:03Z.


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

  • This PR adds no test, so there is no red/green to show.
  • No regression: the existing tests that cover the tool give the same result on main and on the merge (test_shader_profile.py 41 OK, test_json_bom_inputs.py 10 OK; test_tool_stdout_encoding.py has 1 failure on main too).
  • The same pattern runs through #1162, #1170-#1173, #1214, #1215, #1227-#1229, #1243 and #1244. Each one replaces its tool's own copy of the same-path check with report_paths.same_report_path (tools/report_paths.py:117 on main). They share that one helper and touch one different tool each, so they do not depend on each other. Only #1228 conflicts with main.

No blocker from my side.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248638043 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#issuecomment-7248638043). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T01:13:03Z. --- Checked `018df194e` merged (no commit) with `main` `87a39df94`: Python 3.12.4, Windows 11 10.0.26300, CPU only. `check_no_game_data.py` is clean. - This PR adds no test, so there is no red/green to show. - No regression: the existing tests that cover the tool give the same result on `main` and on the merge (`test_shader_profile.py` 41 OK, `test_json_bom_inputs.py` 10 OK; `test_tool_stdout_encoding.py` has 1 failure on `main` too). - The same pattern runs through #1162, #1170-#1173, #1214, #1215, #1227-#1229, #1243 and #1244. Each one replaces its tool's own copy of the same-path check with `report_paths.same_report_path` (`tools/report_paths.py:117` on `main`). They share that one helper and touch one different tool each, so they do not depend on each other. Only #1228 conflicts with `main`. No blocker from my side. AI-assisted (Claude Code).
TheGeogeo commented 2026-11-29 14:46:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:46:42Z.


Correction: not in main. Its squash commit a12a845a1 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/shader_profile.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/shader_profile.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 "shader_profile" 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 a12a845a1 (2026-11-27, "PR #1172: shader_profile: 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 shader_profile, 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257568359 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#issuecomment-7257568359). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:46:42Z. --- **Correction: not in `main`.** Its squash commit `a12a845a1` 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/shader_profile.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/shader_profile.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 `"shader_profile"` 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 `a12a845a1` (2026-11-27, "PR #1172: shader_profile: 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 `shader_profile`, 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 commented 2026-11-29 15:24:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T15:24:45Z.


Tested 018df194e 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: "shader_profile" 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/shader_profile.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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258068475 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#issuecomment-7258068475). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T15:24:45Z. --- Tested `018df194e` 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: `"shader_profile"` 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/shader_profile.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).
TheGeogeo commented 2026-11-29 17:12:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T17:12:27Z.


Tested 018df194e merged (no commit) with main 0bc6e21a1: Python 3.12.4, Windows 11 10.0.26300, CPU only.

  • This PR adds no test. The test that covers it: add "shader_profile" to SHARED in tests/test_report_paths.py.
  • Red: with that line on main, test_switched_tools_import_the_helper_and_define_no_copy fails for shader_profile ("'from report_paths import same_report_path' not found").
  • Green: with that line on the merge, all 26 tests pass.
  • Without the line, main and the merge both pass (26 OK), so nothing guards the change yet. Please add the tool to SHARED in this PR.
  • No game data check passes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259507937 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#issuecomment-7259507937). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T17:12:27Z. --- Tested 018df194e merged (no commit) with main 0bc6e21a1: Python 3.12.4, Windows 11 10.0.26300, CPU only. - This PR adds no test. The test that covers it: add `"shader_profile"` to `SHARED` in `tests/test_report_paths.py`. - Red: with that line on main, `test_switched_tools_import_the_helper_and_define_no_copy` fails for `shader_profile` ("'from report_paths import same_report_path' not found"). - Green: with that line on the merge, all 26 tests pass. - Without the line, main and the merge both pass (26 OK), so nothing guards the change yet. Please add the tool to `SHARED` in this PR. - No game data check passes. AI-assisted (Claude Code).
breachato commented 2026-11-29 18:02:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-29T18:02:17Z.


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

  • python -I tests/test_report_paths.py — OK (1 skipped), with the entry in place.
  • python -I tests/test_shader_profile.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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260158943 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#issuecomment-7260158943). Originally posted by [breachato](https://github.com/breachato) on 2026-11-29T18:02:17Z. --- Added: `shader_profile` is now in `SHARED` in `tests/test_report_paths.py` in this PR (commit `b9bea588`). - `python -I tests/test_report_paths.py` — OK (1 skipped), with the entry in place. - `python -I tests/test_shader_profile.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.
breachato commented 2026-11-30 19:23:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-30T19:23:10Z.


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_shader_profile.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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7289305547 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#issuecomment-7289305547). Originally posted by [breachato](https://github.com/breachato) on 2026-11-30T19:23:10Z. --- 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_shader_profile.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.
aslan2142 commented 2026-12-01 11:48:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:48:26Z.

Review: CHANGES_REQUESTED


Reviewed the diff against main: delegating the report-path guard in tools/shader_profile.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.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130631456 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#pullrequestreview-6130631456). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:48:26Z. **Review:** CHANGES_REQUESTED --- Reviewed the diff against `main`: delegating the report-path guard in `tools/shader_profile.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.)*
aslan2142 commented 2026-12-02 05:10:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-02T05:10:11Z.


Thank you @breachato! Both commits from this PR (shader_profile) have been landed on main with full original authorship preserved in batch PR #3024 (commit 4dfd90c35), which consolidated all 15 tools/report_paths.py PRs together to avoid sequential tests/test_report_paths.py merge conflicts. Closing this PR now that it is merged!

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7335652851 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1172#issuecomment-7335652851). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-02T05:10:11Z. --- Thank you @breachato! Both commits from this PR (`shader_profile`) have been landed on `main` with full original authorship preserved in batch PR #3024 (commit `4dfd90c35`), which consolidated all 15 `tools/report_paths.py` PRs together to avoid sequential `tests/test_report_paths.py` merge conflicts. Closing this PR now that it is merged!

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1172
No description provided.