Repository navigation
core: text line diff, unified output and bench-diff - #668
Merged
Merged
Conversation
…bench-diff Part of fizzyedit/plans DIFF_PLAN step 1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011eSdUZNiSkni93mqVrUxy7
foxnne
marked this pull request as ready for review
October 19, 2026 20:35
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 19, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011eSdUZNiSkni93mqVrUxy7
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.
Part of fizzyedit/plans
plans/DIFF_PLAN.mdstep 1 (2.1-2.2, 3).What
Std-only
core.diff(core/diff.zig,core/diff/{Text,unified,tests}.zig):Text: reusable scratch; byte prefix/suffix trim with@Vector(32, u8), line interning (Wyhash, byte-exact on match), histogram diff (occurrence cap 64) with an explicit stack, Myers (linear space,max_costcap, then the range is replaced) when there is no anchor, hunk sliding to blank-line/low-indent boundaries. Hunks carry lines and bytes;Text.editgives a byte-rangeEdit;Text.rangeconverts to protocol positions through the owner's byte-to-position callback.unified.write: standard@@ -a,l +b,l @@with context,\ No newline at end of file, and amax_bytescap that drops whole trailing hunk groups and says... N more hunks.bench-diff+ tests (round trip over random edits on text/CRLF/no final newline/binary, scratch reuse allocates nothing, unified fixtures and cap), wired intobuild/app.zig.Not in this step (named seams):
budget_nspartial/resume, word/char refinement and merge (step 2),cmdWriteuntouched.Bench (
zig build bench-diff -Doptimize=ReleaseFast, 1.15 MB / 25k lines, Linux)Prior-art notes in the plan (git histogram, JGit, imara-diff) were not re-fetched; the implementation follows git's histogram scoring from memory and diff-match-patch's bisect for Myers.
Verified
scripts/check-fmt.sh,zig build test,check-web,check-tests-reachedpass. No SDK boundary change.Generated by Claude Code