Rotom: Rolled Layout Representation - #3170
Merged
Merged
Conversation
edwjchen
force-pushed
the
rotom-pr-02
branch
2 times, most recently
from
July 7, 2026 21:03
da5c4fe to
60ec4c7
Compare
j2kun
approved these changes
Jul 9, 2026
Collaborator
|
Looks like this one is ready to be rebased |
Two roll-semantics extensions that make diagonal packings expressible beyond the square, equal-extent case: - The roll-by (second) dim may be any kind. Rolling by a replication or gap dim shifts by that dim's block index, so each block holds a distinct cyclic rotation of the rolled dim -- the layout materializes every rotation and downstream alignment becomes block selection (the replicate-then-roll expansion of a compact operand is pure rotations). A rolled-by gap claims its blocks: it contributes an existential address term and counts toward the ciphertext count, unlike a plain gap. Rolls apply on both the ciphertext and slot address lines, so a roll can place a diagonal on the ciphertext axis (one ciphertext per diagonal); a from-dim absent from a line drops out of that line's address. - Roll extents need not match: roll(i, j) rewrites dims[i]'s index to (idx_i - idx_j) mod extent(dims[i]), well-defined for any partner extent -- a smaller partner covers a prefix of the rotations, a larger one wraps. This unlocks rolled placements for rectangular (non-square k) contractions. A rolled-by gap is bounded to the rolled dim's extent (larger gaps would claim blocks holding repeated rotations that the accounting was never audited for); larger replication partners are the intended replicate-then-roll form and stay unbounded. Materialization unit tests cover roll-by-replication, roll-by-gap (claimed blocks), both unequal-extent orientations, and the verifier rules; lit tests cover the mod-from positive case and the gap bound.
Collaborator
Author
|
Rebased! |
j2kun
approved these changes
Jul 11, 2026
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.
Part 2 of #2980 and stacked on #3169
Two extensions to roll(from, by) semantics that make diagonal packings expressible beyond the square, equal-extent case.
Roll partners may be replication or gap dims. Previously both roll operands had to be traversal dims. Now the by (second) dim may also be a replication or gap dim.
Roll extents need not match (mod-from). roll(i, j) now rewrites dims[i]'s index to (idx_i - idx_j) mod extent(dims[i]), well-defined for any partner extent - a smaller partner covers a prefix of the rotations, a larger one wraps. This unlocks rolled placements for rectangular (non-square-k) contractions.
Rolled-by-gap bound. A rolled-by gap partner is bounded to the rolled dim's extent.