Validate RPF9 archive headers before scanning meshlet pages #254

Open
github-bot wants to merge 1 commit from github-bot/gh-254 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:53 UTC · original
ubiquitarianism:old-pr/9986 → main · +39 −3 · 2 files · 1 commits · draft

Carried over from old PR 9986 by lucastayaralvarenga-ui in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9986, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
lucastayaralvarenga-ui: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Restores #3822 after the repository-transfer closure. The original PR cannot be reopened by its author (viewerCanReopen: false). This resubmission uses the same branch and unchanged head e990c82092612cb10d28284a52bfb7ecbb127c3e. Original independent review/test evidence: https://github.com/ProjectLeonida/Leonida/pull/3822#pullrequestreview-6025207478.

Changes

An explicit .rpf needs a complete eight-byte header, RPF9 magic, and a data start from the header end through EOF. Invalid input exits 2 with its path before writing a report. An empty file now exits 2 instead of being silently skipped. In a run with several inputs, one invalid archive stops the run before report publication. A valid header-only archive still reports zero pages.

Coordination claim.

Rebased onto main after #3170 merged. The existing report-alias protection is retained.

Checks

At e990c8209, python -I tests/test_meshlet_page.py: 68 passed on Windows with Python 3.12. The synthetic cases cover malformed headers, a valid header-only archive, directory and archive scans, and report aliases. The five malformed-header cases returned success before this change. git diff --check passed.

CPU-only tests, no game data. AI-assisted (Codex).

Fresh integration verification against ProjectLeonida/Leonida main "d083a2cc3": clean merge, tests/test_meshlet_page.py: 68 tests passed. Whitespace and changed-file game-data checks passed. Windows, Python 3.12.16, CPU only, synthetic inputs; no GPU run. AI-assisted (Codex).

Resubmission claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116960294

**@⁠Andretuta** on GitHub · 2026-11-24 02:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/254) `ubiquitarianism:old-pr/9986` → `main` · +39 −3 · 2 files · 1 commits · draft > Carried over from **old PR 9986** by `lucastayaralvarenga-ui` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9986`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `lucastayaralvarenga-ui`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Restores `#3822` after the repository-transfer closure. The original PR cannot be reopened by its author (`viewerCanReopen: false`). This resubmission uses the same branch and unchanged head `e990c82092612cb10d28284a52bfb7ecbb127c3e`. Original independent review/test evidence: https://github.com/ProjectLeonida/Leonida/pull/3822#pullrequestreview-6025207478. ## Changes An explicit `.rpf` needs a complete eight-byte header, RPF9 magic, and a data start from the header end through EOF. Invalid input exits 2 with its path before writing a report. An empty file now exits 2 instead of being silently skipped. In a run with several inputs, one invalid archive stops the run before report publication. A valid header-only archive still reports zero pages. [Coordination claim](https://github.com/ProjectLeonida/Leonida/issues/3796#issuecomment-7086353446). Rebased onto main after `#3170` merged. The existing report-alias protection is retained. ## Checks At `e990c8209`, `python -I tests/test_meshlet_page.py`: 68 passed on Windows with Python 3.12. The synthetic cases cover malformed headers, a valid header-only archive, directory and archive scans, and report aliases. The five malformed-header cases returned success before this change. `git diff --check` passed. CPU-only tests, no game data. AI-assisted (Codex). Fresh integration verification against ProjectLeonida/Leonida main "d083a2cc3": clean merge, tests/test_meshlet_page.py: 68 tests passed. Whitespace and changed-file game-data checks passed. Windows, Python 3.12.16, CPU only, synthetic inputs; no GPU run. AI-assisted (Codex). Resubmission claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116960294
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:50:39 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/254/head:github-bot/gh-254'
git switch 'github-bot/gh-254'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-254'
git switch 'github-bot/gh-254'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-254'
git switch 'github-bot/gh-254'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-254'
git switch 'main'
git merge --squash 'github-bot/gh-254'
git switch 'main'
git merge --ff-only 'github-bot/gh-254'
git switch 'main'
git merge 'github-bot/gh-254'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.