meshlet_page: validate RPF9 headers before scanning #2214

Closed
leonida/mandy
whoalin1 wants to merge 0 commits from meshlet-rpf9-header-validation into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

whoalin1 commented 2026-11-26 06:25:37 +00:00

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.

## 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

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)

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

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

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

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)

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)
Sign in to join this conversation.
No description provided.