Fix getHexagonRequiredNodeId2 formulas for even-k rings#589
Merged
chrxh merged 1 commit intofeatures/ConstructionSequencesfrom Apr 9, 2026
Merged
Conversation
… with even k Agent-Logs-Url: https://github.com/chrxh/alien/sessions/1fcbc40b-ff37-4de7-afc0-c07e18a0fa96 Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
chrxh
April 9, 2026 07:02
View session
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.
Two arithmetic bugs in
ShapeGenerator::getHexagonRequiredNodeId2produce wrong node IDs for rings with even k ≥ 4, breaking hexagon topology at larger sizes.Changes
(pos - 2)→((pos - 2) / 2)— missing halving caused values to decrease twice as fast as intended3*k*k - 6*k + 2 - pos→3*k*k - 7*k + 6 - pos— wrong coefficients introduced an offset that grows with ring sizeBoth bugs are latent for k=4 (only side 3 pos=2 is hit, where
(pos-2)/2 == pos-2 == 0; side 4 formulas coincide when k=4) and first manifest at k=6. Verified against the full 169-value expected sequence andgenerateHexagon_61cells_withSeparation.