[PR #254] Validate RPF9 archive headers before scanning meshlet pages #305

Open
opened 2026-11-26 20:17:27 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/254
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9986


📝 Commits (1)

  • e990c82 Validate RPF9 archive headers before scanning meshlet pages

📊 Changes

2 files changed (+39 additions, -3 deletions)

View changed files

📝 tests/test_meshlet_page.py (+32 -0)
📝 tools/meshlet_page.py (+7 -3)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/254 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9986` --- ### 📝 Commits (1) - [`e990c82`](https://github.com/ubiquitarianism/leonida/commit/e990c82092612cb10d28284a52bfb7ecbb127c3e) Validate RPF9 archive headers before scanning meshlet pages ### 📊 Changes **2 files changed** (+39 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_meshlet_page.py` (+32 -0) 📝 `tools/meshlet_page.py` (+7 -3) </details> ### 📄 Description > 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#305
No description provided.