Skip to content

Improve tile representation - #291

Merged
maleadt merged 3 commits into
mainfrom
tb/empty_tiles
Aug 7, 2026
Merged

Improve tile representation#291
maleadt merged 3 commits into
mainfrom
tb/empty_tiles

Conversation

@maleadt

@maleadt maleadt commented Aug 7, 2026

Copy link
Copy Markdown
Member

In #290 I introduced the concept of "empty tiles", i.e., tiles with a 0 extent. Ideally this shouldn't be necessary, and the type would be a ghost type because of its size being zero. However, our Tile type doesn't really have fields, and is currently a mutable type to avoid becoming a singleton. I experimented with making it immutable giving it a fictitious field (necessitating a length typevar a la StaticArrays since Julia doesn't support computed field tiles) so that Julia's understanding of the struct's layout matches what we need, but that seemed questionable: all tfuncs needed to be made aware of that additional typevar, and unused fields are pretty questionable.

So instead I reverted all of that and kept the bugfixes and improvements I collected along the way, alongside with one simplification: make Tile a primitive type instead of a mutable one. We retain the quirk that both zero-size objects and tiles with a zero extent (again, not actually represented as a zero-size object, see previous paragraph) generate ghost values during compilation, but I don't see an easy way around that.

maleadt added 3 commits August 6, 2026 21:47
Use the release containing the CFG structurization fixes needed by the new branch and tuple-flow regressions.
Keep invalid zero-volume intrinsics visible to their emitters, reject empty tiles at kernel boundaries, and carry compiler ghosts through structured control flow without creating Tile IR values.
Replace the fieldless mutable identity object with a one-byte immutable handle. The payload is never observed; it only prevents singleton folding while Tile IR carries the actual value.
@maleadt
maleadt merged commit 25eefe7 into main Aug 7, 2026
1 check failed
@maleadt
maleadt deleted the tb/empty_tiles branch August 7, 2026 07:22
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