meshlet_page: validate RPF9 headers before scanning #2214

Closed
whoalin1 wants to merge 1 commit from upstream-pr/2214 into main
whoalin1 commented 2026-11-26 06:25:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-26T06:25:37Z.


Summary

  • reject inputs shorter than the fixed RPF9 header instead of silently reporting zero pages
  • reject a non-RPF9/9FPR magic before scanning for zlib streams
  • reject a data-start offset outside the archive, while still allowing a valid header-only archive to yield zero pages
  • add synthetic CLI regressions that no report is written for invalid inputs

Item: MESHLET-PAGE-RPF9-HEADER

This carries forward the still-uncarried fix in old-pr/9986, originally written by lucastayaralvarenga-ui, reapplied and verified on current main.

Tests

Under the local machine coordination lock:

  • control: the new invalid-header regressions fail on the unpatched tool (invalid inputs exit 0)
  • fixed: python -I tests/test_meshlet_page.py — 73 tests, OK
  • python -m compileall -q tools/meshlet_page.py tests/test_meshlet_page.py — pass
  • git diff --cached --check — pass

No game files or GPU.

AI-assisted with Devin.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5505145185 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2214). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-26T06:25:37Z. --- ## Summary - reject inputs shorter than the fixed RPF9 header instead of silently reporting zero pages - reject a non-`RPF9`/`9FPR` magic before scanning for zlib streams - reject a data-start offset outside the archive, while still allowing a valid header-only archive to yield zero pages - add synthetic CLI regressions that no report is written for invalid inputs Item: MESHLET-PAGE-RPF9-HEADER This carries forward the still-uncarried fix in old-pr/9986, originally written by lucastayaralvarenga-ui, reapplied and verified on current main. ## Tests Under the local machine coordination lock: - control: the new invalid-header regressions fail on the unpatched tool (invalid inputs exit 0) - fixed: `python -I tests/test_meshlet_page.py` — 73 tests, OK - `python -m compileall -q tools/meshlet_page.py tests/test_meshlet_page.py` — pass - `git diff --cached --check` — pass No game files or GPU. AI-assisted with Devin.
real-rusher commented 2026-11-26 10:06:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T10:06:29Z.


Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_meshlet_page.py: 73 tests OK. The PR's test file against main's tools/meshlet_page.py: 5 failures, so the new tests fail on main and pass with the fix. compileall clean.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7188917098 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2214#issuecomment-7188917098). Originally posted by [real-rusher](https://github.com/real-rusher) on 2026-11-26T10:06:29Z. --- Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_meshlet_page.py: 73 tests OK. The PR's test file against main's tools/meshlet_page.py: 5 failures, so the new tests fail on main and pass with the fix. compileall clean. AI-assisted: yes (Claude Code)
DeadlyChirp commented 2026-11-26 10:50:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-26T10:50:05Z.


Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_meshlet_page.py: 73 passed, 17 subtests passed (main: 71 passed, 12 subtests).

(AI-assisted test run; output checked by hand.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7189899129 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2214#issuecomment-7189899129). Originally posted by [DeadlyChirp](https://github.com/DeadlyChirp) on 2026-11-26T10:50:05Z. --- Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_meshlet_page.py`: 73 passed, 17 subtests passed (main: 71 passed, 12 subtests). (AI-assisted test run; output checked by hand.)
MoonEyes commented 2026-11-27 19:44:36 +00:00 (Migrated from github.com)

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


Thanks a lot for this, @whoalin1. The same change is already open in #1230: it carries lucastayaralvarenga-ui's commit from old-pr/9986 with the same diff to tools/meshlet_page.py and tests/test_meshlet_page.py, and it was claimed in #14 as OLD-9986 two days before this PR.

I am closing this one so the review happens in one place. Please continue the discussion on #1230, or reopen this one if you see something it misses.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226827188 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2214#issuecomment-7226827188). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T19:44:36Z. --- Thanks a lot for this, @whoalin1. The same change is already open in #1230: it carries lucastayaralvarenga-ui's commit from `old-pr/9986` with the same diff to `tools/meshlet_page.py` and `tests/test_meshlet_page.py`, and it was claimed in #14 as OLD-9986 two days before this PR. I am closing this one so the review happens in one place. Please continue the discussion on #1230, or reopen this one if you see something it misses. 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!2214
No description provided.