refactor: introduce double word newtype - #3319
Open
zeapoz wants to merge 2 commits into
Open
Conversation
zeapoz
force-pushed
the
zeapoz/ref-double-word
branch
from
July 16, 2026 13:07
db140f4 to
41030ce
Compare
zeapoz
force-pushed
the
zeapoz/ref-double-word
branch
from
July 17, 2026 08:36
41030ce to
3ecd848
Compare
zeapoz
force-pushed
the
zeapoz/ref-double-word
branch
from
July 17, 2026 08:38
3ecd848 to
0f7c8e8
Compare
zeapoz
marked this pull request as ready for review
July 17, 2026 08:47
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.
Introduces a
DoubleWordnewtype (in the form of a low and high word) based on the existingWord, and replaces manual slice-and-reassemble patterns across 10 files*.Previously we often had a pattern like:
Vec::with_capacity(8)or create a new[Felt; 8].This PR replaces most of the trivial cases with the new type-safe
DoubleWordconstruct.Originally mentioned in #3298 (comment).
*we could more aggressively refactor a few places, but I think it might be better to do that in a follow-up PR as the changes would be more invasive than the scope of this PR.