mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #2371] page_index: a directory page is never a continuation (PAGE-INDEX-DIRECTORY-NOT-CONTINUATION) #2374
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2374
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2371
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/page-index-directory-not-continuation📝 Commits (1)
80c6f30page_index: a directory page is never a continuation (PAGE-INDEX-DIRECTORY-NOT-CONTINUATION)📊 Changes
2 files changed (+39 additions, -14 deletions)
View changed files
📝
tests/test_page_index.py(+29 -4)📝
tools/page_index.py(+10 -10)📄 Description
Claimed in the coordination issue as: PAGE-INDEX-DIRECTORY-NOT-CONTINUATION (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7197498211)
What and why
tools/page_index.pyfollows a0DRPpage whoseq38table or last record runs past its zlib stream into the next stream(s).index_streamsappended the next stream to the waiting page's continuations before asking whether that stream is a directory page of its own, so the check that exists for exactly this ("treat this stream as the new directory page instead of swallowing it as a continuation") ran too late:3eb5f8656to keep "the last continuation", which in that branch is always the new page).docs/page_directory.mdmeasured that no continuation stream is a0DRPpage: "A resource therefore extends forward by payload, not by nesting another directory."tools/navmesh_nodes.pyalready stops a resource at a stream that opens one of its own.index_streamsnow checksis_pagebefore appending. The waiting page is reported as parsed with the continuations it really had (the tuple inwaitingalways holds that parse) and markedresource ended before q38 was complete, and the stream is indexed as the new page. Archives where every page completes before the next one starts are unchanged.Different topic from #1566 (versions,
--limit, atomic writes), which also edits these files; the two merge cleanly.Tested
Windows 11, Python 3.14.7, synthetic RPF streams only:
python -I tests/test_page_index.py: 22 tests OK. Newtest_a_directory_page_is_not_taken_as_a_continuation_even_when_it_would_complete_one: onmainit gets one page (A complete, B as its continuation); with the fix A is incomplete with no continuation and B is indexed with its record. The existingtest_new_page_after_a_continuation_is_reported_with_both_streamsasserted the second page among the first page's continuations. It is renamed..._ends_the_previous_resourceand now expects the one real continuation and resource streams[page, continuation].tests/test_csv_line_endings.py(imports the tool) OK.tests/test_opus_tags.pyfails here onmaintoo, in an unrelated Windows path assertion.python -m compileall;scripts/check_no_game_data.pyon both files.Not measured: how many pages this recovers on real archives (no game files here). Where the docs' counts were taken, every continuation completed its page before the next page, which is the unchanged path.
GPUs tested: n/a (CPU-only tool)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).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.