Validate RPF9 archive headers before scanning meshlet pages #254

Closed
Andretuta wants to merge 1 commit from upstream-pr/254 into main
Andretuta commented 2026-11-24 02:53:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:53:54Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465189848 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/254). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:53:54Z. --- > 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
MoonEyes commented 2026-11-27 23:36:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T23:36:27Z.


Thanks a lot for carrying this over, @Andretuta. The same change is open in #1230, opened by IlyassRS3 (OLD-9986, claimed in #14) with lucastayaralvarenga-ui's commit kept and rebased on current main: both pull requests change the same two files with exactly the same lines, so nothing from this draft is lost.

I am closing this draft to keep the queue clear. Please continue in #1230, or reopen this one if something is missing there.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7230270067 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/254#issuecomment-7230270067). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T23:36:27Z. --- Thanks a lot for carrying this over, @Andretuta. The same change is open in #1230, opened by `IlyassRS3` (OLD-9986, claimed in #14) with `lucastayaralvarenga-ui`'s commit kept and rebased on current `main`: both pull requests change the same two files with exactly the same lines, so nothing from this draft is lost. I am closing this draft to keep the queue clear. Please continue in #1230, or reopen this one if something is missing there. AI-assisted (Claude Code, Claude Opus 5.5)

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!254
No description provided.