Skip to content

Efficient signatures for patterns - #1270

Merged
Robotgiggle merged 11 commits into
FallingColors:1.21from
s5bug:efficient-signature
Sep 6, 2026
Merged

Efficient signatures for patterns#1270
Robotgiggle merged 11 commits into
FallingColors:1.21from
s5bug:efficient-signature

Conversation

@s5bug

@s5bug s5bug commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This needs an extra set of eyes and a bit of bug testing because I wrote all this while tired and hungry

Continuation of #1260, much thanks to @YukkuriC for the inspiration and motivation

@s5bug

s5bug commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

I would like to mention that due to object padding, HexSignature actually has room on it to store a cached Action. However, I don't know if it's safe to do that: I don't know where serialization boundaries are / what would happen if someone rerolled per-world patterns while a Signature had an old Action cached.

If it would be safe to do that, please let me know so I can implement it :)

@s5bug

s5bug commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

The other option (mentioned in Discord but not here) is to use that extra four bytes for int size; to not have to use TURNS_PER_ARRAY_ELEMENT * packedTurns.length. However, there's nothing that explicitly depends on the exact stroke count of a pattern to my knowledge.

@s5bug
s5bug force-pushed the efficient-signature branch from 33cf7d2 to 90ba468 Compare September 5, 2026 23:14

@s5bug s5bug left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can't get them done right now but need to do these before merge

Comment thread Common/src/main/java/at/petrak/hexcasting/api/casting/math/HexSignature.java Outdated

@Robotgiggle Robotgiggle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Robotgiggle
Robotgiggle added this pull request to the merge queue Sep 6, 2026
Merged via the queue into FallingColors:1.21 with commit 32c6515 Sep 6, 2026
7 of 8 checks passed
@github-project-automation github-project-automation Bot moved this from 📋 Backlog to ✅ Done in Hex Casting Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants