Skip to content

sparse_strips: Make tile size configurable, Variant 1#1655

Draft
LaurenzV wants to merge 1 commit into
mainfrom
laurenz/tile_size
Draft

sparse_strips: Make tile size configurable, Variant 1#1655
LaurenzV wants to merge 1 commit into
mainfrom
laurenz/tile_size

Conversation

@LaurenzV
Copy link
Copy Markdown
Collaborator

We've on various occasions discussed that we want to experiment with different tile sizes. This is especially relevant for vello_hybrid, but also at least worth trying for vello_cpu.

Before we can do that, the first step is to make tile sizes more configurable. Right now, the width and height of 4 is hardcoded as an associated constant in vello_common. This PR changes it so that they become const generics instead, such that different crates can choose their own sizes. In order to keep the diff small for now, we simply define type aliases in vello_hybrid and vello_cpu that link to the existing 4x4 tile. The main algorithms (tiling, strip rendering) for now also still assume 4x4, changing this will be a follow-up PR.

@LaurenzV LaurenzV marked this pull request as draft May 16, 2026 13:56
@LaurenzV LaurenzV force-pushed the laurenz/tile_size branch from 9bec80a to 954fbbe Compare May 16, 2026 13:58
@LaurenzV LaurenzV marked this pull request as ready for review May 16, 2026 14:02
@LaurenzV
Copy link
Copy Markdown
Collaborator Author

Do you guys think it makes sense to turn those into a generic instead with a sealed trait with variants for 4x4, 8x8 and 16x16 provided such that 1) Clients cannot accidentally create other tile sizes and 2) Later on when we will have to wire the generic through Tiles and StripGenerator, we only have 1 generic parameter instead of 2? I still think it makes sense to keep the distinction between Tile::WIDTH and Tile::HEIGHT internally, but not sure how much sense it makes to expose non-uniform tile sizes to the outside.

@LaurenzV LaurenzV changed the title sparse_strips: Make tile size a const generic instead of an associated constant sparse_strips: Make tile size a const generic instead of an associated constant, Variant 1 May 16, 2026
@LaurenzV LaurenzV marked this pull request as draft May 16, 2026 14:16
@LaurenzV LaurenzV changed the title sparse_strips: Make tile size a const generic instead of an associated constant, Variant 1 sparse_strips: Make tile size configurable, Variant 1 May 16, 2026
@LaurenzV
Copy link
Copy Markdown
Collaborator Author

LaurenzV commented May 16, 2026

I opened a second version here #1656. Curious to hear your thoughts @grebmeg @tomcur @taj-p.

I think I prefer the variant in this PR.

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