Repository navigation
feat: port over the dolphin junk seed recovery code - #25
Merged
encounter merged 3 commits intoJul 17, 2026
Merged
Conversation
RVZ junk detection seeded the LFG solely from the disc header's game ID. When a patch changes the game ID (e.g. region retagging in translation patches), no junk matches and ~1.2 GB of pseudo-random junk gets stored raw, ballooning output (observed 110 MB -> 1.32 GB). Port Dolphin's LaggedFibonacciGenerator::GetSeed (CC0-1.0): when the disc-ID-derived seed doesn't match, reconstruct the seed by running the generator backward over the junk bytes themselves, verify it through the reader code path, and store the recovered seed in the RVZ packed data.
check_block seeded junk detection with the outer disc header's game ID for all sectors, but read-time junk regeneration uses the partition's own disc header for sectors inside a partition. If the two ever differ (e.g. a modified disc), a block detected as junk at write time would be regenerated with different bytes at read time, silently corrupting CISO/WBFS round-trips. Use the partition header for partition data, matching read-side behavior and WIA/RVZ's per-partition JunkInfo.
Owner
|
Would you mind merging main? CI should pass then |
Contributor
Author
|
Done @encounter |
Owner
|
Looks great, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
👋🏻 Hi again, most of this code is based on what dolphin does. I ran into an issue using nod where I was getting some strand compression results on a rom hack (Kururin Squash Translation). Basically after the rom hack was applied the rom would not compress at all. narrowed it down to the junk data detection recovery.
For reference:
The LFG seed-recovery implementation is substantially ported to Rust from Dolphin’s LaggedFibonacciGenerator::GetSeed
(https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/DiscIO/LaggedFibonacciGenerator.cpp), originally introduced by JosJuice in
dolphin-emu/dolphin@4b74993 (dolphin-emu/dolphin@4b74993). That source is licensed under
CC0-1.0