Skip to content

fix: adds more granular progress for validation#2006

Open
gpeacock wants to merge 2 commits intomainfrom
gpeacock/verify_progress
Open

fix: adds more granular progress for validation#2006
gpeacock wants to merge 2 commits intomainfrom
gpeacock/verify_progress

Conversation

@gpeacock
Copy link
Copy Markdown
Member

@gpeacock gpeacock commented Apr 2, 2026

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

gpeacock added 2 commits April 1, 2026 15:32
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
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 65.42056% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.37%. Comparing base (122110d) to head (105aad6).

Files with missing lines Patch % Lines
sdk/src/assertions/bmff_hash.rs 41.48% 55 Missing ⚠️
sdk/src/claim.rs 61.53% 10 Missing ⚠️
sdk/src/utils/hash_utils.rs 70.58% 5 Missing ⚠️
sdk/src/assertions/box_hash.rs 95.00% 1 Missing ⚠️
sdk/src/assertions/data_hash.rs 85.71% 1 Missing ⚠️
sdk/src/reader.rs 97.14% 1 Missing ⚠️
sdk/src/store.rs 90.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 2, 2026

Merging this PR will not alter performance

✅ 32 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing gpeacock/verify_progress (105aad6) with main (122110d)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant