Skip to content

rbf0_tree: ask report_paths for the report-path guard (RBF0-TREE-SHARED-REPORT-PATH) - #1214

Open
breachato wants to merge 2 commits into
ProjectLeonida:mainfrom
breachato:rbf0-tree-shared-report-path
Open

breachato wants to merge 2 commits into
ProjectLeonida:mainfrom
breachato:rbf0-tree-shared-report-path

Conversation

@breachato

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: RBF0-TREE-SHARED-REPORT-PATH (#14 (comment))

Depends on: none

Fixes: none

What and why

tools/rbf0_tree.py derived report-path equality itself in same_output_path (:680, realpath + normcase +
samefile) and asked it at its four output guards: out against --csv (:702), out and --csv against
the source file (:706), out and --csv against a stream in the carve folder (:717), and --xml against
the source folder (:719). That is the one answer tools/report_paths.py exists to give, and CONTRIBUTING.md
asks a report writer to call same_report_path(a, b) rather than derive it again (~70 tools already import it;
#1084 does the same for anim_clips).

The private copy was also missing something the shared helper has: its folding-volume probe
(same_name_on_folding_volume). On a Linux mount that ignores case (vfat, exFAT, CIFS) normcase folds
nothing and pathconf answers only on macOS, so out.json and out.JSON passed as two report paths, and
--csv could replace the JSON report or a stream in the carve folder the decode was about to read.

The duplicated logic goes (5 insertions, 13 deletions). The tool already puts its own folder on sys.path
for rbf0_index, so the import is one line; no test calls same_output_path, so the name goes with the
duplication. No behaviour change on Windows, macOS or a case-sensitive Linux filesystem.

Tested

  • tests/test_rbf0_tree.py: 37 passed, 1 skipped, 17 subtests passed.
  • python -I tools/rbf0_tree.py --help: prints its usage (the import works under -I).
  • python -m compileall -q tools/rbf0_tree.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)

@PierreEbele

Copy link
Copy Markdown
Contributor

Reviewed 7e0adef: ran tests/test_rbf0_tree.py in the sandbox on both trees (38 OK each) plus
test_report_paths.py and test_report_path_case.py (the shared helper's own suites) here; a probe of
16 path pairs and five main() guard decisions behaves identically to main on this machine, and the
intended case-folding-volume refusal is described correctly but not reproducible without such a
mount. No findings. Suggestion: add rbf0_tree to SHARED in tests/test_report_paths.py so the
no-private-copy test covers it too.
AI-assisted review.

Recommendation: Merge

milk4sale pushed a commit to milk4sale/leonida that referenced this pull request Nov 27, 2026
…u-unaligned-output-ub

HLE: write decoded Opus samples through unaligned output buffers
@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Native Windows 11 NTFS Verification (7e0adef53c)

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

  • Red (origin/main c7753ed98a): Enabled real Windows 11 per-directory NTFS case sensitivity (fsutil.exe file setCaseSensitiveInfo <dir> enable) and probed rbf0_tree.same_output_path on src.rpf vs SRC.RPF: origin/main returned True (false collision) because os.path.normcase lowercased both paths before os.path.samefile.
  • Green (origin/main + 7e0adef53c): Using 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_rbf0_tree.py passed (38 ran, OK (skipped=1)).

AI-assisted.

@TheGeogeo

Copy link
Copy Markdown
Contributor

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

No blocker from my side.

AI-assisted (Claude Code).

@TheGeogeo

Copy link
Copy Markdown
Contributor

Tested 7e0adef merged (no commit) with main 0bc6e21: Python 3.12.4, Windows 11 10.0.26300, CPU only.

  • This PR adds no test. The test that covers it: add "rbf0_tree" 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 rbf0_tree ("'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

Copy link
Copy Markdown
Contributor Author

Added: rbf0_tree is now in SHARED in tests/test_report_paths.py in this PR (commit 4701b152).

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

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 30, 2026
@breachato
breachato force-pushed the rbf0-tree-shared-report-path branch from 4701b15 to b854dfc Compare November 30, 2026 19:17
@breachato

breachato commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

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

@github-actions github-actions Bot added needs rebase Conflicts with the base branch: rebase it on main and removed needs rebase Conflicts with the base branch: rebase it on main labels Nov 30, 2026

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

@breachato
breachato force-pushed the rbf0-tree-shared-report-path branch from b854dfc to c6b53f1 Compare December 1, 2026 17:53
@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Dec 1, 2026
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.
@breachato
breachato force-pushed the rbf0-tree-shared-report-path branch 2 times, most recently from 56fe8aa to d572224 Compare December 1, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants