Skip to content

Conversation

@jas14
Copy link
Collaborator

@jas14 jas14 commented Oct 24, 2025

Fixes #99.

This rewrites the hash diffing algorithm to leverage LCS on the hash keys, maintaining the goal of preserving the order of the actual keys where possible.

This causes a couple notable changes. Previously, changes to a shared key's value were sometimes rendered as separate deletes and inserts. These changes are now always visually colocated as a delete of the old value followed immediately by an insert of the new value.

Additionally, keys at the beginning of expected that are not in actual were previously rendered as deletes at the end of the diff. These are now rendered at the beginning, reflecting the key ordering relative to actual more accurately.

@jas14 jas14 merged commit 73bfa35 into main Oct 24, 2025
72 checks passed
@jas14 jas14 deleted the 99-lcs-rewrite-hash-diff-algo branch October 24, 2025 20:09
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.

Hash diffing algorithm is incorrect in certain cases

1 participant