Stops the board jumping when recenter shifts raw coordinates - #825
Open
Moltenfire wants to merge 1 commit into
Open
Moltenfire wants to merge 1 commit into
Moltenfire wants to merge 1 commit into
Conversation
Puts the donut on a diet (hiveboardgame#806) added Board::recenter(), which periodically translates every piece's raw coordinates to keep them inside the fixed-size storage window. The renderer draws raw coordinates directly and the camera was never adjusted to compensate, so any recenter reads as the whole board panning - reproducible at https://hivegame.com/game/nOxgGLxkSvqw?move=32 by stepping forward one move. Should now be fixed: the camera pans by the exact opposite pixel delta whenever the displayed board's accumulated recenter shift changes, so pieces, overlays, and annotations all land back where they were without touching hit-testing or move submission. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U4Y2jNZLSGwpvfWXVxQfzP
klautcomputing
added a commit
that referenced
this pull request
Sep 10, 2026
Coordinates were storage indices on a 32x32 torus, so keeping the hive clear of the seam meant re-basing every piece with `Board::recenter` - and the renderer draws those coordinates, so a recenter read as the whole board jumping (#825). Storage becomes a window onto the unbounded plane instead: `WindowArray` carries an origin, `reframe` slides it to follow the hive, and no piece ever changes coordinates. That drops `Position::wrap_around`, `canonical_hash::axis_origin`, and the recenter rebuild. Hashes are unchanged, and perft Base+MLP halves. Nothing wraps into `0..BOARD_SIZE` any more, so the drawing had to stop assuming it: halving a row now floors, and the pixel mapping is pinned by the property that says it - the same hive drawn anywhere looks the same.
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.
Puts the donut on a diet (#806) added Board::recenter(), which periodically translates every piece's raw coordinates to keep them inside the fixed-size storage window. The renderer draws raw coordinates directly and the camera was never adjusted to compensate, so any recenter reads as the whole board panning - reproducible at https://hivegame.com/game/nOxgGLxkSvqw?move=32 by stepping forward one move. Should now be fixed: the camera pans by the exact opposite pixel delta whenever the displayed board's accumulated recenter shift changes, so pieces, overlays, and annotations all land back where they were without touching hit-testing or move submission.