Skip to content

spec: IS_WH - #1003

Merged
erik-3milabs merged 5 commits into
spec/mainfrom
spec/is_b48
Sep 29, 2026
Merged

erik-3milabs merged 5 commits into
spec/mainfrom
spec/is_b48

Conversation

@erik-3milabs

Copy link
Copy Markdown
Collaborator

Introduces the IS_B48 interaction and backing chip, range checking a Word-Half tuple.
Particularly useful for range checking the top 48 bits of consecutive memory addresses: saves interactions and columns on the calling side, with interactions containing duplicate data stacking up on the IS_B48 chip.

Applied to the ECSM, KECCAK, and SHA256 chip, this already saves 49 columns and 98 interactions.

The MEMMOVE chip (currently under development at #986) and update to the ECSM chip (#932) also stand to benefit from using this chip, though both should be updated for the optimization to take effect.

@erik-3milabs
erik-3milabs changed the base branch from main to spec/main September 22, 2026 10:12
@erik-3milabs erik-3milabs self-assigned this Sep 22, 2026
@erik-3milabs erik-3milabs added the spec Updates and improvements to the spec document label Sep 22, 2026

@RobinJadoul RobinJadoul left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the name, as it points more towards a single field element containing a B48.

Comment thread spec/meta.typ Outdated
Comment thread spec/src/ecsm.toml
[[variables.input]]
name = "addr_xG"
type = ["DWordHL", 4]
type = ["DWordWHH", 4]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This affects one of the listed possible optimizations in ecsm.typ too

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. updated the section.
Reading through the list of potential optimizations, I noticed that we could ~ halve this chip's size by supporting B24 carries. Given the push to reduce the size of this table, might be worthwile to pursue, or at least raise during the next meeting. wdyt?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth discussing, depending on the current cost/load of this table on recursion

Comment thread spec/src/keccak.toml
Comment thread spec/meta.typ Outdated
Comment thread spec/src/is_wh.toml
Comment thread spec/src/ecsm.toml
[[variables.input]]
name = "addr_xG"
type = ["DWordHL", 4]
type = ["DWordWHH", 4]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. updated the section.
Reading through the list of potential optimizations, I noticed that we could ~ halve this chip's size by supporting B24 carries. Given the push to reduce the size of this table, might be worthwile to pursue, or at least raise during the next meeting. wdyt?

Comment thread spec/src/sha256.toml Outdated
Comment thread spec/src/ecsm.toml Outdated
Comment thread spec/src/ecsm.toml Outdated
Comment thread spec/src/ecsm.toml Outdated
Comment thread spec/src/ecsm.toml Outdated
Comment thread spec/src/ecsm.toml Outdated
Comment thread spec/src/ecsm.toml Outdated
Comment thread spec/src/sha256.toml Outdated
Comment thread spec/src/sha256.toml Outdated
Comment thread spec/src/sha256.toml Outdated
@RobinJadoul RobinJadoul changed the title spec: IS_B48 spec: IS_WH Sep 28, 2026
erik-3milabs and others added 2 commits September 29, 2026 08:16
Co-authored-by: Robin Jadoul <robin.jadoul@gmail.com>
@erik-3milabs
erik-3milabs merged commit fffb18d into spec/main Sep 29, 2026
2 checks passed
@erik-3milabs
erik-3milabs deleted the spec/is_b48 branch September 29, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec Updates and improvements to the spec document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants