Index: upgrade an older archive index in place instead of rescanning (SIX-196) #248
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!248
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/248/head"
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?
@holdmysocks on GitHub · 2026-11-25 06:11 UTC · original
holdmysocks:six-196-index-upgrade→master· +613 −28 · 5 files · 1 commits · merged 2026-11-25 06:23 UTCWhen
INDEX_VERSIONgoes up,sixng indexnow upgrades each archive's saved index instead of rescanning the whole archive. A full rescan is kept only where the scan itself changed.How
raw_runis tried (a few 64 KiB reads). If it finds a run, only that 256 MiB segment is scanned again. The upgraded segment is saved under the current scan version.<name>.#<tag>string are recovered again. Texture dictionary names and unnamed entries stay. Only the remaining entries go through the name pass.INDEX_STEPSlists every version step and what it needs (Regroup,RenameTaggedorRescan). A test fails when a version bump does not add its step. An index older than the first step is rebuilt from its segments, with every name recovered again.--forcestill rebuilds everything.sixng indexreports per archivestatus(reused,upgraded,resumed,rescannedornew), asummarysuch as "upgraded from 6 (7 of 284 segments scanned)", and segment and name counts. The same line goes to the log. The viewer's Jobs page lists it per archive for an index job.Checked on the full install
Seven archives were each built as an older version with that version's exe, upgraded with this branch, and compared field by field with a fresh
--forceindex built by this branch (8 threads).Before this change, the version 6 → 8 bump meant a full scan of
levels.rpf(about 6 min) and then a full name pass. The version 7 exe needed 569 s onlevels.rpfeven with its scan 2 segments saved. The version 7 indexes differ from the fresh ones in 316 names (levels.rpf) and 40 (data.rpf), which the 7 → 8 upgrade recovers again.Tests
scan::upgrade_testscovers:--forceand unknown versions;cargo check --workspace --all-targets,cargo check --no-default-features -p sixng-cli -p sixng-guiandcargo test -p sixng-core -p sixng-gui --releasepass.