use u64 rather than usize in file hashing paths#485
Merged
assafvayner merged 2 commits intomainfrom Sep 8, 2025
Merged
Conversation
Collaborator
|
Our chunk size can never exceed u32::MAX because there's a upper limit at 128 KiB, why are these causing problems? |
Contributor
Author
The issue isn't with the chunk size, it's with the sizes of "segment" cuts made in the aggregated node hash computation. I went the simple route and just changed everything to u64 rather than only the particular piece. Is this a non-negotiable? we can keep u32 around with some extra work to convert when it matters. |
hoytak
reviewed
Sep 8, 2025
| // extern "C" { | ||
| // #[wasm_bindgen(js_namespace = console)] | ||
| // fn log(s: &str); | ||
| // } |
Contributor
Author
There was a problem hiding this comment.
yes, we do not log anything in the thin wasm right now.
It is extern "C" but really this is importing JS functionality
Collaborator
|
LGTM |
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.
Using the file hashing components in WASM found a bug that using 32 but usize causes errors when hashing the file.
This PR enforces the use of u64 everywhere along that path (and also pins the wasm-bindgen version)