Repository navigation
docs(tasks): file the check character overflowing a 32-bit sum - #1
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.
What
Files moid's first task,
docs/tasks/check-char-overflows-a-32-bit-sum.md, and thedocs/tasks/tasks.mdindex for it. The index follows the shape fig-css's uses. No code changes.Why
Alphabet::check_charaddsordinal × positioninto ausizeand reduces modulo the radix only at the end. On wasm32,usizeis 32 bits. Overnoid_xdigit, a body made entirely of the last symbol passesu32::MAXat about 17,500 symbols, and over a 255-symbol alphabet at about 5,800. moid-ts'scheckChartakes the remainder at every step for exactly this reason, so at those lengths the two implementations disagree.Reproduced with a scratch binary built for
wasm32-wasip1and run under Node'snode:wasi, using a 20,000-symbol body:'f', the same as the step-by-step reduction.moid/src/alphabet.rs:123.'w'.At 17,000 symbols all three give
'8'.The fix itself (reduce as it goes) is left to the task. The task's done-when also says the pinning test has to be run on a 32-bit target, because on x86_64 it passes either way.
Verified
The change is docs only. At this commit,
cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo test --workspace --all-features,cargo test -p moid --no-default-features,npm run checkandnpm test(49 pass) are all green.prov metaandprov linksread both new documents, and their links resolve.