Repository navigation
Conversation
zipped_product splits the block and the repetition layout into modes and expects one of each per axis. With one-axis inputs the repetition complement(a) o b can have several flat modes (complement(3:2, 12) is (2,2):(1,6)), so blocked_product(3:2, 4:1), raked_product(4:2, 4:1) and make_layout_tv(4:2, 4:1) failed with "product: unexpected mode structure", although logical_product succeeds on the same inputs. For a single axis, pair the whole block with the whole repetition. Inputs that already worked produce the same layouts. Signed-off-by: 0z5a <dezhen.lu@student.uni-tuebingen.de>
0z5a
force-pushed
the
fix/cute-layout-one-axis-products
branch
from
November 5, 2026 09:57
ac12c01 to
ef00b70
Compare
This branch has not been deployed
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.
Summary
zipped_product(cute-layout/src/algebra/tiling.rs), which backsblocked_product,raked_productandmake_layout_tv, splits the block and the repetition layout returned bylogical_productinto modes and expects exactly one of each per axis. With one-axis inputs the repetitioncomplement(a) ∘ bcan have several flat modes, for examplecomplement(3:2, 12) = (2,2):(1,6), so valid inputs fail withAlgebraError("product: unexpected mode structure"):blocked_product(3:2, 4:1)(3,2,2):(2,1,6)raked_product(3:2, 4:1)(2,2,3):(1,6,2)raked_product(4:2, 4:1),make_layout_tv(4:2, 4:1)logical_productsucceeds on the same inputs (logical_product(4:2, 4:1) = (4,(2,2)):(2,(1,8))); only the pairing step fails.Changes
zipped_product: for a single axis, pair the whole block with the whole repetition instead of splitting them withmodes(). For one-axis layouts thatmodes()already split into one entry each, this is the same pair, so inputs that worked before give the same result.one_axis_products_accept_a_multi_mode_repetition: checks both results above element by element against their definition and that the twelve cells cover offsets 0..12 exactly once.C++ CuTe's
blocked_productaccepts this case; itsraked_productdoes not compile for it ("Mismatched Ranks" indetail::zip), so for the raked half this follows the definition and this crate's ownlogical_product.Testing
CPU only; the crate has no dependencies, so
rustc --edition 2024 --test --crate-name cute_layout src/lib.rs(rustc 1.95.0, aarch64 Linux), main at 44a85d3:product: unexpected mode structurecute-layoutunit testsrustfmt --check --edition 2024(1.9.0) is clean on both changed files. A Python port oflogical_productand the products, fuzzed against their definition over 3 × 20k cases (with #1712's guard applied), shows 88–121 spurious errors per 20k on main and none with this change.just -f cuda-oxide/Justfile checkpasses (the local mirror of CI: fmt, clippy, tests, guards, docs)cargo oxide run <example>passes, orcuda-oxide/scripts/smoketest.sh -o '^<example>$'Checklist
git commit -s)git commit -S)