Repository navigation
Bound memory during ASC MHL rereads and XXH64 Saved Check - #24
Merged
Merged
Conversation
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.
A 512 MiB ASC MHL reread made BitMatch's physical memory footprint grow by 511 MiB. On exFAT, that reread is part of a normal verified transfer because BitMatch cannot safely reuse the earlier readback evidence. A separate XXH64 Saved Check read had the same problem. Both reads now release each chunk's Foundation buffer after hashing it, while keeping the destination reread, file checks, progress, cancellation and no-overwrite history rules.
Measured before and after, using the actual engine paths:
Run the isolated checks with
BITMATCH_MHL_MEMORY_TEST=1andBITMATCH_CHECK_MEMORY_TEST=1, respectively; exact commands and measurement limits are indocs/ISSUE23_MEMORY_AUDIT.md.Other local validation: the mounted-exFAT Standard copy → verification → MHL handoff passes; the full serial engine suite passes (126 XCTest cases, 17 intentional skips, no failures; 151 Swift Testing cases pass); the Mac app test build passes (1,099 passed, 13 skipped, zero failed); and the iPad/iPhone simulator build succeeds.
git diff --checkis clean.Related to #23. These are confirmed memory bugs, but the reporter has not yet supplied the app version, stage or diagnostics, so we cannot say which path caused the reported 55 GB footprint. The large memory tests use sparse APFS files; the separate mounted test covers the real exFAT driver with small media. Physical hardware and footage remain untested here.