[PR #1763] OLD-9905: navmesh: rule out stream lengths as the 4 KiB boundary selector (ASSET-445) #1778

Open
opened 2026-11-26 21:18:55 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1763
Author: @potatoe0100
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: carry/old-9905


📝 Commits (1)

  • 04f3f50 Measure the 4 KiB boundary cases in navmesh directories

📊 Changes

3 files changed (+30 additions, -8 deletions)

View changed files

📝 docs/navmesh.md (+15 -4)
📝 tests/test_navmesh_decode.py (+11 -2)
📝 tools/navmesh_decode.py (+4 -2)

📄 Description

Claimed in the coordination issue as: OLD-9905 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161295097)

What and why

Carries on old PR 9905 by @cdomergue (draft #170, branch old-pr/9905, listed in #17), rebased on current main with the author's commit kept.

docs/navmesh.md left open what decides u16@0x4e (stored pg or zero) on the 307 two-stream pages whose runtime data ends exactly on Stream 0's last 4 KiB boundary. The author's measurement rules out the obvious candidates: the ordered pair of inflated stream lengths, the 24-byte block map, and the distance from data_end to the end of Stream 0 all give both values. The doc now says so, with the steps to repeat it. tools/navmesh_decode.py --csv gains two columns, first_stream_bytes and runtime_data_end (the latter only when the block map check passes), which the repeat steps use; tests/test_navmesh_decode.py checks them. The selection rule stays open.

Tested

  • python -I tests/test_navmesh_decode.py: 17 tests OK. The other tests/test_navmesh*.py and all tests/test_docs*.py pass (two navmesh tests skip without game files).
  • python -m compileall -q make_game.py tools tests: clean. Python 3.13, Linux.
  • The page counts in the doc are the author's (from their own copy); not re-measured here, as there are no game files on this machine.

GPUs tested: n/a (no GPU code)

AI-assisted: yes (Claude rebased and tested; the original commit says AI-assisted too)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code


🔄 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/1763 **Author:** [@potatoe0100](https://github.com/potatoe0100) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-9905` --- ### 📝 Commits (1) - [`04f3f50`](https://github.com/ubiquitarianism/leonida/commit/04f3f50941e6ccc22638482d0e2a447b90ffe3f6) Measure the 4 KiB boundary cases in navmesh directories ### 📊 Changes **3 files changed** (+30 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/navmesh.md` (+15 -4) 📝 `tests/test_navmesh_decode.py` (+11 -2) 📝 `tools/navmesh_decode.py` (+4 -2) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9905 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161295097) ### What and why Carries on old PR 9905 by @cdomergue (draft #170, branch `old-pr/9905`, listed in #17), rebased on current `main` with the author's commit kept. `docs/navmesh.md` left open what decides `u16@0x4e` (stored `pg` or zero) on the 307 two-stream pages whose runtime data ends exactly on Stream 0's last 4 KiB boundary. The author's measurement rules out the obvious candidates: the ordered pair of inflated stream lengths, the 24-byte block map, and the distance from `data_end` to the end of Stream 0 all give both values. The doc now says so, with the steps to repeat it. `tools/navmesh_decode.py --csv` gains two columns, `first_stream_bytes` and `runtime_data_end` (the latter only when the block map check passes), which the repeat steps use; `tests/test_navmesh_decode.py` checks them. The selection rule stays open. ### Tested - `python -I tests/test_navmesh_decode.py`: 17 tests OK. The other `tests/test_navmesh*.py` and all `tests/test_docs*.py` pass (two navmesh tests skip without game files). - `python -m compileall -q make_game.py tools tests`: clean. Python 3.13, Linux. - The page counts in the doc are the author's (from their own copy); not re-measured here, as there are no game files on this machine. GPUs tested: n/a (no GPU code) AI-assisted: yes (Claude rebased and tested; the original commit says AI-assisted too) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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#1778
No description provided.