Skip to content

refactor: introduce double word newtype - #3319

Open
zeapoz wants to merge 2 commits into
nextfrom
zeapoz/ref-double-word
Open

refactor: introduce double word newtype#3319
zeapoz wants to merge 2 commits into
nextfrom
zeapoz/ref-double-word

Conversation

@zeapoz

@zeapoz zeapoz commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Introduces a DoubleWord newtype (in the form of a low and high word) based on the existing Word, and replaces manual slice-and-reassemble patterns across 10 files*.

Previously we often had a pattern like:

  1. Allocate a Vec::with_capacity(8) or create a new [Felt; 8].
  2. Assemble by pushing low word, pushing high word.

This PR replaces most of the trivial cases with the new type-safe DoubleWord construct.

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.

@zeapoz
zeapoz force-pushed the zeapoz/ref-double-word branch from db140f4 to 41030ce Compare July 16, 2026 13:07
@zeapoz
zeapoz force-pushed the zeapoz/ref-double-word branch from 41030ce to 3ecd848 Compare July 17, 2026 08:36
@zeapoz
zeapoz force-pushed the zeapoz/ref-double-word branch from 3ecd848 to 0f7c8e8 Compare July 17, 2026 08:38
@zeapoz
zeapoz marked this pull request as ready for review July 17, 2026 08:47
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