fix: adds more granular progress for validation#2006
Open
Conversation
All _with_progress variants across BmffHash, DataHash, BoxHash, and hash_stream_by_alg_with_progress now take a mandatory generic &mut F: FnMut callback instead of Option<&mut dyn FnMut>. Callers that don't need progress pass &mut |_, _| Ok(()). Progress reporting is now chunk-level rather than pass-level: hash_stream_by_alg_with_progress fires once per 256 MB chunk with a pre-computed deterministic total, eliminating silent multi-second gaps when hashing large files. BMFF file-level hashes forward the callback directly into the hasher for sub-range granularity; Merkle paths tick once per hash operation via a new progress_tick helper. The BMFF verification path in claim.rs now reports VerifyingAssetHash N/M with a known total instead of a single indeterminate event. A new regression test verifies monotonically-increasing steps are emitted for BMFF assets.
This fully brackets the writing phase, Note that since we use io::copy we can't give progress or cancel in this phase.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2006 +/- ##
==========================================
- Coverage 77.45% 77.37% -0.09%
==========================================
Files 176 176
Lines 44142 44266 +124
==========================================
+ Hits 34192 34249 +57
- Misses 9950 10017 +67 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
Comparing Footnotes
|
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.
This will now report steps while hashing each 256 MB chunk so very large file hashing shows progress and can be canceled.
It also adds a step before and after writing with std::io::copy to bracket