merge_check: distinguish legacy-encoded lines before reporting duplicates #2197

Merged
EdenBendheim merged 1 commit from upstream-pr/2197 into main 2026-11-28 08:04:44 +00:00
EdenBendheim commented 2026-11-26 05:23:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-11-26T05:23:47Z.


Claimed in the coordination issue as: MERGE-CHECK-LOSSLESS-BLOB-COMPARISON (claim)

The merge checker rejected a clean PR when its new lines differed from existing text only in non-UTF-8 bytes. For example, CP1252 é and è both became the same replacement character before comparison. The checker now preserves those bytes during comparison and converts them for display only after identifying a real duplicate.

The regression uses a temporary Git repository with distinct and byte-identical blocks. On main a73a57e13 the distinct block triggered three false duplicate lines. On ead43b578, the distinct block passes and the identical block is still reported with printable samples. All 25 test_merge_check.py tests passed with Python 3.12 on macOS. The changed-file game-data check and git diff --check passed.

GPUs tested: n/a. All tests used synthetic inputs.

AI-assisted: yes. Created with gpt-6.2-astra in Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5504513366 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2197). Originally posted by [EdenBendheim](https://github.com/EdenBendheim) on 2026-11-26T05:23:47Z. --- Claimed in the coordination issue as: MERGE-CHECK-LOSSLESS-BLOB-COMPARISON ([claim](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7183431216)) The merge checker rejected a clean PR when its new lines differed from existing text only in non-UTF-8 bytes. For example, CP1252 `é` and `è` both became the same replacement character before comparison. The checker now preserves those bytes during comparison and converts them for display only after identifying a real duplicate. The regression uses a temporary Git repository with distinct and byte-identical blocks. On main `a73a57e13` the distinct block triggered three false duplicate lines. On `ead43b578`, the distinct block passes and the identical block is still reported with printable samples. All 25 `test_merge_check.py` tests passed with Python 3.12 on macOS. The changed-file game-data check and `git diff --check` passed. GPUs tested: n/a. All tests used synthetic inputs. AI-assisted: yes. Created with gpt-6.2-astra in Codex.
DeadlyChirp commented 2026-11-26 10:01:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-26T10:01:36Z.


Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_merge_check.py: 25 passed, 7 subtests passed (main: 24 passed, 5 subtests).

(AI-assisted test run; output checked by hand.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7188807612 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2197#issuecomment-7188807612). Originally posted by [DeadlyChirp](https://github.com/DeadlyChirp) on 2026-11-26T10:01:36Z. --- Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_merge_check.py`: 25 passed, 7 subtests passed (main: 24 passed, 5 subtests). (AI-assisted test run; output checked by hand.)
real-rusher commented 2026-11-26 10:06:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T10:06:33Z.


Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_merge_check.py: 25 tests OK. The PR's test file against main's scripts/merge_check.py: 1 failure, so the new test fails on main and passes with the fix. compileall clean.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7188918583 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2197#issuecomment-7188918583). Originally posted by [real-rusher](https://github.com/real-rusher) on 2026-11-26T10:06:33Z. --- Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_merge_check.py: 25 tests OK. The PR's test file against main's scripts/merge_check.py: 1 failure, so the new test fails on main and passes with the fix. compileall clean. AI-assisted: yes (Claude Code)
DadaCap commented 2026-11-28 08:04:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:04:47Z.


Merged into main (merge commit c74ac8a4b), approved by DadaCap (maintainer). Thanks!

Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (ead43b578).

AI-assisted (Claude Code), posted for DadaCap.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236348672 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2197#issuecomment-7236348672). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T08:04:47Z. --- Merged into `main` (merge commit c74ac8a4b), approved by DadaCap (maintainer). Thanks! Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (ead43b578). _AI-assisted (Claude Code), posted for DadaCap._
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2197
No description provided.