Skip to content

fix(canonicalize): break sort ties by symbol key - #31

Merged
AmitMY merged 2 commits into
mainfrom
canonicalize-tie-break-by-symbol
Aug 2, 2026
Merged

AmitMY merged 2 commits into
mainfrom
canonicalize-tie-break-by-symbol

Conversation

@shaltielshmid

Copy link
Copy Markdown
Contributor

Symbols stacked on one anchor point — eyes S31400 and mouth S33e00 both at 482x482 — share a sort key, so their order fell through to the input index. The same sign written two ways canonicalized two ways:

canonicalize("M518x517S31400482x482S33e00482x482")  # -> S31400 S33e00
canonicalize("M518x517S33e00482x482S31400482x482")  # -> S33e00 S31400

Appending the symbol key to _sort_key makes the order total. 49 of the 4,084 FSW signs in this repo's data contain such a stack.

No behavior change otherwise: category order, overlap constraints, centering and box are untouched. Verified across those 4,084 signs — canonicalization still leaves every render pixel-identical and is still idempotent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L5fpJJsMzwDHaHqysth3hi

shaltielshmid and others added 2 commits August 2, 2026 12:58
Symbols stacked on a single anchor point - eyes S31400 and mouth S33e00
both at 482x482 - share a sort key, so their order fell through to the
input index and the same sign written two ways canonicalized two ways.
Appending the symbol key to the sort key makes the order total.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5fpJJsMzwDHaHqysth3hi
The inline comment repeated the module docstring and README verbatim, and
the two-symbol ordering test was subsumed by the permutation one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5fpJJsMzwDHaHqysth3hi
@AmitMY
AmitMY merged commit d01fcb5 into main Aug 2, 2026
2 checks passed
@shaltielshmid
shaltielshmid deleted the canonicalize-tie-break-by-symbol branch August 2, 2026 11:27
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.

2 participants