Skip to content

meshlet_page: ask report_paths for the report-path guard (MESHLET-PAGE-SHARED-REPORT-PATH) - #1431

Open
Dashhhhhhhh wants to merge 2 commits into
ProjectLeonida:mainfrom
Dashhhhhhhh:fix/meshlet-page-report-path
Open

Dashhhhhhhh wants to merge 2 commits into
ProjectLeonida:mainfrom
Dashhhhhhhh:fix/meshlet-page-report-path

Conversation

@Dashhhhhhhh

Copy link
Copy Markdown
Contributor

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

What and why

tools/meshlet_page.py compared report paths with os.path.normcase, which does not fold case on macOS, and os.path.samefile, which cannot see a file that has not been created. --json CARVE/index.json for a folder created as carve is that folder's carve manifest on APFS, and the check used to allow it.

The tool now uses tools/report_paths.py.

Tested

python -I tests/test_meshlet_page.py CliTests (14 tests) on macOS APFS. The new test refuses CARVE/index.json for a folder created as carve. No game files.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md (not a translator change).

Made with Cursor

On a case-insensitive volume, normcase left carve/index.json and CARVE/index.json as two paths, so --json could write the carve manifest. The shared report-path check refuses that spelling.

Co-authored-by: Cursor <cursoragent@cursor.com>
…lder.

The manifest check folded case, but a page.bin inside the folder was still compared with normcase(abspath()), which keeps the typed case on macOS. CARVE/0000.bin could replace carve/0000.bin.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PierreEbele

Copy link
Copy Markdown
Contributor

Reviewed ba4e7ef: meshlet_page.py's --json guard now uses report_paths (same_report_path and path_key). Ran in a sandbox on the branch and on origin/main with the new tests copied in: tests/test_meshlet_page.py (73 OK, 2 skipped on this case-sensitive volume), tests/test_report_paths.py (22 OK), tests/test_report_path_case.py (4 OK, 1 skipped), and compileall clean; tests/test_tool_stdout_encoding.py passes on the branch (fails on current origin/main only over tools/compute_heap_layout_census.py, added after the fork). Under the MacVolumeTests folded-volume patch, main accepts --json CARVE/index.json (rc=0, creates the manifest) where the branch refuses it (rc=2) and refuses CARVE/0000.bin upfront at the guard; existing CARVE/index.json refuses at the guard via samefile on both, while existing valid CARVE/0000.bin refuses via walk-time samefile on main (so the second new test also passes there as a regression lock). AI-assisted review.
Recommendation: Merge

@OreoFR

OreoFR commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Verified by OreoFR

  • Base: main 3408969a7 + PR head ba4e7ef65
  • Test: python -I tests/test_meshlet_page.py
  • Red on main: 73 OK
  • Green with the PR: 73 OK
  • Verdict: NO RED
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

@zmasi

zmasi commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

#1431 | head ba4e7ef (merged cleanly onto origin/main a3484ce) | Windows 11 (10.0.26200.9974, NTFS), Python 3.12.10 | AI-assisted: yes

Independent Verification (Windows 11 + NTFS)

  • Diff & safety audit: Inspected 100% of the diff across tools/meshlet_page.py and tests/test_meshlet_page.py updating same_output_path and is_scanned_input to use report_paths.same_report_path and report_paths.path_key. python -I scripts/check_no_game_data.py tools/meshlet_page.py tests/test_meshlet_page.py passed (rc=0).
  • Native Windows 11 NTFS execution (including both previously skipped case-insensitive tests):
    • python -I tests/test_meshlet_page.py -> 75/75 passed (OK, 0 skipped) on a real case-insensitive NTFS volume, executing both test_json_cannot_create_the_manifest_under_another_case (carve vs CARVE\index.json) and test_json_cannot_replace_a_page_under_another_case_of_the_folder (carve\0000.bin vs CARVE\0000.bin).
    • Live NTFS directory junction + case-alias probe: Created carve\0000.bin and an NTFS directory junction mklink /J CarveJunc carve, verifying is_scanned_input("...\\CarveJunc\\INDEX.JSON", carve) == True, is_scanned_input("...\\CarveJunc\\0000.BIN", carve) == True, and is_scanned_input("...\\report.json", carve) == False.

@TheGeogeo

Copy link
Copy Markdown
Contributor

Ready for testing: merges cleanly with main 3535eb5c4. Not in main yet: git cherry finds 2 commit(s) not there, and 13 of the 35 lines it adds are already present. No duplicate found: its claim MESHLET-PAGE-SHARED-REPORT-PATH appears in no other open pull request and in no main commit.

AI-assisted (Claude Code).

@enlight3d

Copy link
Copy Markdown
Contributor

RUN report for #1431 (MESHLET-PAGE-SHARED-REPORT-PATH)

Kind: Python (tools/meshlet_page.py plus its test tests/test_meshlet_page.py).

Heads: PR head ba4e7ef65, based on 1154976d4; origin/main c22a0a732 (merged locally with git merge --no-edit --no-ff, clean, 2 files; main changed both files since the base, no conflict).

Commands (repo root, Python 3.13.12): python -I -B tests/test_meshlet_page.py, and the same one process per file for the tests of the tools that import meshlet_page, plus the report_paths ones: test_tool_stdout_encoding, test_analyze_4240_full, test_draw_ownership, test_missing_input_exit_codes, test_vertex_types, test_vertex_types_wide_group, test_report_paths, test_report_path_case.

Results:

  • GREEN at PR head: test_meshlet_page.py 73 tests OK; both new tests (test_json_cannot_create_the_manifest_under_another_case, test_json_cannot_replace_a_page_under_another_case_of_the_folder) ran and passed (not skipped: NTFS ignores case).
  • GREEN merged into origin/main: test_meshlet_page.py 75 tests OK, and all 8 other files OK (test_report_path_case and test_vertex_types with 1 skip each).
  • RED, real: not reachable on Windows. With tools/meshlet_page.py reverted to the PR base (tests kept), the file still passes 73 of 73 including the two new tests. Reason: on Windows realpath returns the on-disk case and normcase lowercases, so the old code already refused CARVE/...; the bug is the macOS path rules (case kept), which needs a macOS run.
  • RED, simulated (ad hoc script, not part of the PR, kind: behavioural, in-process on is_scanned_input): with os.path.normcase keeping case, os.path.realpath set to abspath and report_paths.case_insensitive_volume forced to True, the old code answers "NOT refused" for both CARVE/0000.bin and CARVE/index.json next to carve; the PR code answers "refused" for both. This shows the logic difference under macOS-like rules; it is not a macOS run.

Machine: Windows 11 Pro x64, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (python -I).

@TheGeogeo

TheGeogeo commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Tested ba4e7ef65 merged (no commit) with main 7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.

  • Green: tests/test_meshlet_page.py gives 75 tests OK (main's own: 73).
  • No red here: with tools/meshlet_page.py back to main, the 75 tests still pass on this Windows/NTFS machine. So the case this PR fixes is not covered here.
  • check_no_game_data.py is clean.

AI-assisted (Claude Code).

@OreoFR

OreoFR commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive, NFD), Python 3.12.16, main dd87aa4, PR head ba4e7ef : red 1 failure / green 75 OK, 0 skipped

Complements the Windows run (no red on NTFS there).

  • Merge: clean (git merge-tree); does not force a rebase of [integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6) #2566.
  • Red (main + this PR's test file): 74/75, 1 failure test_json_cannot_create_the_manifest_under_another_case (0 != 2) — APFS shows the red (MEASURED n=3). The other new test, test_json_cannot_replace_a_page_under_another_case_of_the_folder, already passes on main (likely covered by an existing guard).
  • Green: 75/75, 0 skipped. Neighbour test_tool_stdout_encoding: OK on both.
  • Diff: the local same_output_path is replaced by report_paths.same_report_path (samefile + folded key); is_scanned_input uses path_key; sys.path.insert of the tools folder so the import works under -I. No game data.

Verdict: READY

AI-assisted: Claude Code

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Dec 1, 2026
@MoonEyes

MoonEyes commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

@Dashhhhhhhh #2639 landed the first half of this (meshlet_page asks report_paths.same_report_path), so this branch now conflicts with main 501b3e6c5. It is not a duplicate: the other half is still missing there. is_scanned_input in main decides whether a path is inside the carve folder with os.path.normcase(os.path.abspath()), which keeps the typed case on macOS, and neither of your two tests is in main.

Could you merge main into this branch (a merge, no rebase or force-push) and keep what is left: path_key for the folder comparison, and the two tests? OreoFR saw one of them, test_json_cannot_create_the_manifest_under_another_case, fail on APFS before #2639; after the merge it is worth knowing whether it still fails on main, and whether the second one (test_json_cannot_replace_a_page_under_another_case_of_the_folder) does. Neither shows a red on Windows.

Posted by an AI agent (Claude Code) for MoonEyes.

@aslan2142 aslan2142 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against current main: #2639 has already merged the same_output_path = same_report_path delegation into tools/meshlet_page.py, causing conflicts here. However, tools/meshlet_page.py:937-939 on main still uses os.path.normcase(os.path.abspath(...)) in is_scanned_input rather than report_paths.path_key(...), so the case-insensitive folder guard (tools/meshlet_page.py:932-937 in this diff) and its two regression tests in tests/test_meshlet_page.py:1041-1083 are still valuable. Please rebase onto main keeping only the path_key fix and its tests and re-run CI.

(AI-assisted review.)

@breachato

Copy link
Copy Markdown
Contributor

This duplicates #2639: both make tools/meshlet_page.py ask report_paths.same_report_path, and both cover --json CARVE/index.json for a folder created as carve.

#2639 is the same change reduced to what the repository asks for (one topic: the tool plus its SHARED entry in tests/test_report_paths.py, no rewrite of tests/test_meshlet_page.py), rebased onto current main and green there. This branch is now CONFLICTING against main for the SHARED line alone — the same mechanical conflict every sibling had after #2637 landed, not a problem with the change itself.

Suggestion: merge #2639 and close this one, so the same behaviour lands once and the per-tool test additions can be their own PR. If you would rather keep this branch, it needs the tuple rebuilt from current main plus the added tests/test_meshlet_page.py cases rebased on top; I can do that instead if you say so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants