meshlet_page: ask report_paths for the report-path guard #2639

Merged
breachato merged 2 commits from upstream-pr/2639 into main 2026-12-01 07:01:19 +00:00
breachato commented 2026-11-29 20:37:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-29T20:37:21Z.


Claimed in the coordination issue as: MESHLET-PAGE-SHARED-REPORT-PATH

What and why

tools/meshlet_page.py refuses a report path that would overwrite an input or an existing report through its own same_output_path. That answer is wrong in a case-insensitive APFS volume and in a case-sensitive Windows directory. The private function becomes an alias of report_paths.same_report_path; the file also gets the ROOT / sys.path.insert block (python -I keeps only the script's folder on the path, and the helper lives in tools/), as pe_inspect.py and world_census.py already do.

The tool also joins SHARED in tests/test_report_paths.py, so the no-private-copy test guards the change.

Tested

  • python -I tests/test_meshlet_page.py — OK
  • python -I tests/test_report_paths.py — OK (1 skipped: the macOS-only case), with meshlet_page in SHARED
  • python -I tests/test_report_path_case.py — OK (1 skipped, same)
  • python -I tools/meshlet_page.py --help — clean

Synthetic pages in a temporary folder; no game data.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic; nothing else touched.
  • No game data, keys or hardware results invented.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5554864017 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639). Originally posted by [breachato](https://github.com/breachato) on 2026-11-29T20:37:21Z. --- Claimed in the coordination issue as: MESHLET-PAGE-SHARED-REPORT-PATH ### What and why `tools/meshlet_page.py` refuses a report path that would overwrite an input or an existing report through its own `same_output_path`. That answer is wrong in a case-insensitive APFS volume and in a case-sensitive Windows directory. The private function becomes an alias of `report_paths.same_report_path`; the file also gets the `ROOT` / `sys.path.insert` block (`python -I` keeps only the script's folder on the path, and the helper lives in `tools/`), as `pe_inspect.py` and `world_census.py` already do. The tool also joins `SHARED` in `tests/test_report_paths.py`, so the no-private-copy test guards the change. ### Tested - `python -I tests/test_meshlet_page.py` — OK - `python -I tests/test_report_paths.py` — OK (1 skipped: the macOS-only case), with `meshlet_page` in `SHARED` - `python -I tests/test_report_path_case.py` — OK (1 skipped, same) - `python -I tools/meshlet_page.py --help` — clean Synthetic pages in a temporary folder; no game data. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; nothing else touched. - [x] No game data, keys or hardware results invented.
fiestorra commented 2026-11-30 00:38:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T00:38:08Z.


Verified on main b8bd37111 (Windows, Python 3.13): the two commits apply cleanly, the shared list still passes, and this tool's own tests pass.

cherry-pick (the 2 commits not in main)          -> clean
python3 -m pytest tests/test_report_paths.py -q  -> 26 passed, 23 subtests

This is the third of the five siblings I have checked (#2636, #2637 and here), all with the same shape and all correct individually. The one thing that will bite is the shared tuple: every one of the five adds its name to SHARED = (...) on the same line of tests/test_report_paths.py, so whichever merges after the first needs a rebase, and that conflict is mechanical - both names belong, alphabetically - rather than a disagreement between branches.

Nothing in this one needs a decision of its own.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7265444344 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7265444344). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T00:38:08Z. --- Verified on `main` `b8bd37111` (Windows, Python 3.13): the two commits apply cleanly, the shared list still passes, and this tool's own tests pass. ``` cherry-pick (the 2 commits not in main) -> clean python3 -m pytest tests/test_report_paths.py -q -> 26 passed, 23 subtests ``` This is the third of the five siblings I have checked (`#2636`, `#2637` and here), all with the same shape and all correct individually. The one thing that will bite is the shared tuple: every one of the five adds its name to `SHARED = (...)` on the same line of `tests/test_report_paths.py`, so whichever merges after the first needs a rebase, and that conflict is mechanical - both names belong, alphabetically - rather than a disagreement between branches. Nothing in this one needs a decision of its own. Written with an AI assistant.
aegish-zagi commented 2026-11-30 04:49:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-11-30T04:49:04Z.


VERIFY-2639 — PASS

  • PR: #2639 | head 644bcb54aa | merge state vs main 1d22590b9: CLEAN (scratch merge, no conflicts)
  • Tests run: python -I tests/test_report_paths.py (the test file this PR touches)
  • Red-on-main vs green-on-PR: PR test file on plain main code = 26 tests, FAILED (failures=1, skipped=1) — meshlet_page still carried its private copy; merged PR = 26 tests, OK (skipped=1)
  • Diff audit (READ IN CODE): tools/meshlet_page.py deletes its private same_output_path copy and aliases it to report_paths.same_report_path, adding the sys.path insert the import needs; the shared implementation is a superset (resolved-path + samefile, plus case-folding-volume handling the private copy lacked), so no call site loses behavior. Test change only adds meshlet_page to the SHARED tuple. python -I scripts/check_no_game_data.py on both changed files: pass; tool compiles.
  • Platform: Linux, Python 3.12.3, no GPU (Profile Z). MEASURED above; no GPU or game-dump work claimed.
    AI-assisted: yes (Muse Wonder, Muse by Meta)
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7269107556 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7269107556). Originally posted by [aegish-zagi](https://github.com/aegish-zagi) on 2026-11-30T04:49:04Z. --- VERIFY-2639 — PASS - PR: #2639 | head 644bcb54aa7bea5360f56333dc11216f81298c58 | merge state vs main 1d22590b9: CLEAN (scratch merge, no conflicts) - Tests run: `python -I tests/test_report_paths.py` (the test file this PR touches) - Red-on-main vs green-on-PR: PR test file on plain main code = 26 tests, FAILED (failures=1, skipped=1) — meshlet_page still carried its private copy; merged PR = 26 tests, OK (skipped=1) - Diff audit (READ IN CODE): tools/meshlet_page.py deletes its private same_output_path copy and aliases it to report_paths.same_report_path, adding the sys.path insert the import needs; the shared implementation is a superset (resolved-path + samefile, plus case-folding-volume handling the private copy lacked), so no call site loses behavior. Test change only adds meshlet_page to the SHARED tuple. `python -I scripts/check_no_game_data.py` on both changed files: pass; tool compiles. - Platform: Linux, Python 3.12.3, no GPU (Profile Z). MEASURED above; no GPU or game-dump work claimed. AI-assisted: yes (Muse Wonder, Muse by Meta)
fiestorra commented 2026-11-30 05:43:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T05:43:47Z.


Verified the two siblings that carry more than the tuple edit, because they add an import bootstrap and that is the part that can break a tool at startup.

#2639 (meshlet_page) and #2640 (skin_streams) both add, on top of the SHARED tuple line and the move:

ROOT = os.path.dirname(os.path.abspath(__file__))
if ROOT not in sys.path:
    sys.path.insert(0, ROOT)

which the smaller three do not need. That matters because these tools are run as scripts (python tools/meshlet_page.py …), where the tools directory is not on sys.path, so from report_paths import same_report_path fails without it.

#2639, applied to main 1d22590b9 and run here:

python3 -m pytest tests/test_report_paths.py -q   -> 26 passed, 22 subtests
python3 tools/meshlet_page.py --help              -> exit 0, usage line

So the bootstrap works: the tool imports the shared helper when started directly, and the test suite is unchanged.

What I also checked, since it is the risk in a move like this: I compared all five private same_output_path implementations against each other and against the shared same_report_path. The five private copies are the same logic (normcase(realpath(…)) == normcase(realpath(…)), then samefile, then False); the only difference is the shared helper's richer OSError branch, which I described separately. So these five are consistent with each other - there is no fourth variant hiding in one of them.

What I did not do: run the tools against real archives. --help proves the import path, not the output; the report-writing path needs game data.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7269948344 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7269948344). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T05:43:47Z. --- Verified the two siblings that carry more than the tuple edit, because they add an import bootstrap and that is the part that can break a tool at startup. **#2639** (`meshlet_page`) and **#2640** (`skin_streams`) both add, on top of the `SHARED` tuple line and the move: ```python ROOT = os.path.dirname(os.path.abspath(__file__)) if ROOT not in sys.path: sys.path.insert(0, ROOT) ``` which the smaller three do not need. That matters because these tools are run **as scripts** (`python tools/meshlet_page.py …`), where the tools directory is not on `sys.path`, so `from report_paths import same_report_path` fails without it. **#2639, applied to `main` `1d22590b9` and run here:** ``` python3 -m pytest tests/test_report_paths.py -q -> 26 passed, 22 subtests python3 tools/meshlet_page.py --help -> exit 0, usage line ``` So the bootstrap works: the tool imports the shared helper when started directly, and the test suite is unchanged. **What I also checked, since it is the risk in a move like this:** I compared all **five** private `same_output_path` implementations against each other and against the shared `same_report_path`. **The five private copies are the same logic** (`normcase(realpath(…)) == normcase(realpath(…))`, then `samefile`, then `False`); the only difference is the shared helper's richer `OSError` branch, which I described separately. So these five are consistent with each other - there is no fourth variant hiding in one of them. **What I did not do:** run the tools against real archives. `--help` proves the import path, not the output; the report-writing path needs game data. Written with an AI assistant.
fiestorra commented 2026-11-30 09:40:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T09:40:45Z.


Heads-up: this branch now conflicts on one line, and the conflict has a mechanical fix.

main merged a sibling of this pull request (#2637, 3cd08cfc7 "tests: list bink_index in SHARED") at 08:33 today. #2636, #2638, #2639, #2640 and #2637 all edit the same tuple, so the other four now conflict against the merged one:

$ git merge-tree --write-tree origin/main refs/remotes/pr/2639
CONFLICT in tests/test_report_paths.py

What main has now:

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")

What this branch needs: insert "meshlet_page" in its alphabetical place in that tuple, and keep the rest of the branch unchanged. Everything else in the diff applies cleanly - the tuple line is the only conflict.

Note on ordering, since it is easy to get wrong on a rebase: the tuple is alphabetical, and "meshlet_page" goes between the entries that bracket it. A rebase that appends it at the end would still pass the test but would break the file's convention and the next sibling's merge.

Why I am commenting: I verify open pull requests against current main by applying them in a scratch worktree and building their test targets. This one went from "replays cleanly" to "conflicts" between 09:20 and 10:36 today, and the cause was #2637 landing - not anything in this branch.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7274536821 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7274536821). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T09:40:45Z. --- **Heads-up: this branch now conflicts on one line, and the conflict has a mechanical fix.** main merged a sibling of this pull request (#2637, `3cd08cfc7` "tests: list bink_index in SHARED") at 08:33 today. **#2636, #2638, #2639, #2640 and #2637 all edit the same tuple**, so the other four now conflict against the merged one: ``` $ git merge-tree --write-tree origin/main refs/remotes/pr/2639 CONFLICT in tests/test_report_paths.py ``` **What main has now:** ```python 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") ``` **What this branch needs:** insert "meshlet_page" in its alphabetical place in that tuple, and keep the rest of the branch unchanged. Everything else in the diff applies cleanly - the tuple line is the only conflict. **Note on ordering, since it is easy to get wrong on a rebase:** the tuple is alphabetical, and "meshlet_page" goes between the entries that bracket it. A rebase that appends it at the end would still pass the test but would break the file's convention and the next sibling's merge. **Why I am commenting:** I verify open pull requests against current main by applying them in a scratch worktree and building their test targets. This one went from "replays cleanly" to "conflicts" between 09:20 and 10:36 today, and the cause was #2637 landing - not anything in this branch. Written with an AI assistant.
KelboLive commented 2026-11-30 16:45:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:45:50Z.


Independent check on Windows at \644bcb54a: \python -I tests/test_report_paths.py\ — 26 tests OK (9.9 s). \meshlet_page\ is now covered by the shared report-path guard. Windows 11 26200.9711, Python 3.12.10. AI-assisted: yes (opencode).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7285189415 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7285189415). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T16:45:50Z. --- Independent check on Windows at \644bcb54a\: \python -I tests/test_report_paths.py\ — **26 tests OK** (9.9 s). \meshlet_page\ is now covered by the shared report-path guard. Windows 11 26200.9711, Python 3.12.10. AI-assisted: yes (opencode).
breachato commented 2026-11-30 19:23:54 +00:00 (Migrated from github.com)

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


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_meshlet_page.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:7289325645 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7289325645). Originally posted by [breachato](https://github.com/breachato) on 2026-11-30T19:23:54Z. --- 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_meshlet_page.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.
breachato commented 2026-11-30 21:21:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-30T21:21:18Z.


Rebased onto main after #2637 landed, so the SHARED tuple conflict is gone and the branch is two commits again on top of main (8f41d7d0; main is now d8ca1824, which does not touch tests/test_report_paths.py or tools/meshlet_page.py).

New head: e9b2529a967071dd54397352abcb1cf452661397.

Measured on that head, standard library only, Windows, Python 3.14, no game data:

python -I tests/test_report_paths.py   ->  Ran 26 tests, OK (skipped=1)
python -I tests/test_meshlet_page.py   ->  Ran 73 tests, OK

@fiestorra @aegish-zagi @KelboLive — your checks are on 644bcb54a, i.e. before the rebase. Could you re-run the guard on e9b2529a and approve if it still holds? Merging on the old head would land code none of you has looked at.

The diff is unchanged in substance: same two commits, same SHARED entry, only the tuple context under it moved.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7292282995 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7292282995). Originally posted by [breachato](https://github.com/breachato) on 2026-11-30T21:21:18Z. --- Rebased onto `main` after #2637 landed, so the `SHARED` tuple conflict is gone and the branch is two commits again on top of `main` (`8f41d7d0`; `main` is now `d8ca1824`, which does not touch `tests/test_report_paths.py` or `tools/meshlet_page.py`). New head: `e9b2529a967071dd54397352abcb1cf452661397`. Measured on that head, standard library only, Windows, Python 3.14, no game data: ``` python -I tests/test_report_paths.py -> Ran 26 tests, OK (skipped=1) python -I tests/test_meshlet_page.py -> Ran 73 tests, OK ``` @fiestorra @aegish-zagi @KelboLive — your checks are on `644bcb54a`, i.e. before the rebase. Could you re-run the guard on `e9b2529a` and approve if it still holds? Merging on the old head would land code none of you has looked at. The diff is unchanged in substance: same two commits, same `SHARED` entry, only the tuple context under it moved.
fiestorra commented 2026-11-30 21:33:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T21:33:28Z.


Verified on Windows at your new head e9b2529a9, and the change is load-bearing: with tools/meshlet_page.py from main the suite fails.

Cherry-picked onto main d8ca18240 in a clean worktree, Python 3.13.14:

python -m pytest tests/test_report_paths.py -q
  with this PR:                     26 passed, 24 subtests passed
  with tools/meshlet_page.py from main:      1 failed, 26 passed, 23 subtests passed

So the local guard this removes is not dead code that the tuple test happens to tolerate - the test reaches the path it replaces and fails when the old code is put back. That is the control I would want on a refactor whose whole claim is "the same answer, from one place".

Your rebase also holds: the tree applies without the SHARED tuple conflict, and the diff is two files (tools/meshlet_page.py and tests/test_report_paths.py), matching what you reported.

What I did not test: anything that needs a real report_paths target on disk - the other two PRs in this family cover that shape, and the three together are consistent, but each one alone only proves its own tool asks the same function.

AI-assisted: yes - DeepSeek v4.1 (flash) applied the head and ran both arms on the machine above.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7292573877 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7292573877). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T21:33:28Z. --- **Verified on Windows at your new head `e9b2529a9`, and the change is load-bearing: with `tools/meshlet_page.py` from `main` the suite fails.** **Cherry-picked onto `main` `d8ca18240` in a clean worktree, Python 3.13.14:** ``` python -m pytest tests/test_report_paths.py -q with this PR: 26 passed, 24 subtests passed with tools/meshlet_page.py from main: 1 failed, 26 passed, 23 subtests passed ``` **So the local guard this removes is not dead code that the tuple test happens to tolerate** - **the test reaches the path it replaces and fails when the old code is put back.** **That is the control I would want on a refactor whose whole claim is "the same answer, from one place".** **Your rebase also holds**: **the tree applies without the `SHARED` tuple conflict**, and **the diff is two files** (`tools/meshlet_page.py` and `tests/test_report_paths.py`), **matching what you reported.** **What I did not test:** **anything that needs a real `report_paths` target on disk** - **the other two PRs in this family cover that shape, and the three together are consistent**, **but each one alone only proves its own tool asks the same function.** **AI-assisted:** yes - DeepSeek v4.1 (flash) applied the head and ran both arms on the machine above. Written with an AI assistant.
MoonEyes commented 2026-12-01 07:01:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T07:01:16Z.


Merging. Head e9b2529a9 merges cleanly with main f918e5145 and does not force a rebase of #2566. CI green on this head. Red/green by fiestorra (Windows) on it, earlier ones by KelboLive and aegish-zagi on older heads; I ran it on main + PR (Windows, Python 3.14): test_report_paths and test_meshlet_page OK, and the shared list fails without this change. A tool and its test only, no game code. Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7303550879 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2639#issuecomment-7303550879). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-01T07:01:16Z. --- Merging. Head `e9b2529a9` merges cleanly with `main` `f918e5145` and does not force a rebase of #2566. CI green on this head. Red/green by fiestorra (Windows) on it, earlier ones by KelboLive and aegish-zagi on older heads; I ran it on main + PR (Windows, Python 3.14): test_report_paths and test_meshlet_page OK, and the shared list fails without this change. A tool and its test only, no game code. Merged by MoonEyes. AI-assisted (Claude Code).
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!2639
No description provided.