Skip to content

fix(semantic): number moved lines after the interned ids - #58

Merged
seatedro merged 1 commit into
masterfrom
rohit/diff-core-semantic-dense-ids
Nov 3, 2026
Merged

seatedro merged 1 commit into
masterfrom
rohit/diff-core-semantic-dense-ids

Conversation

@seatedro

@seatedro seatedro commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Every semantic diff region containing a moved line reserved about 8 GiB of memory, and about 48 GiB more when the line diff ran over budget, because moved lines got ids counting down from u32::MAX and the line diff sizes its per-id tables by the largest id. Moved lines are now numbered after the interned lines, so ids stay below the region's line count and the alignment comes out the same.

fill gave each moved line a fresh id counting down from u32::MAX, so
the line diff sized its per-id tables by that id: two 4 GiB arrays for
every region with a moved line, and three 16 GiB ones more when the
search ran over budget. They only survived through lazy zeroed pages.

Moved lines now get their ids after interning, counting up from the
number of interned lines, so the ids stay below the region's line
count. Equal ids are still exactly the equal unmoved lines, so the
alignment is unchanged.
@seatedro seatedro closed this Nov 3, 2026
@seatedro seatedro reopened this Nov 3, 2026
@seatedro
seatedro enabled auto-merge November 3, 2026 12:43
@seatedro
seatedro merged commit 71a3e3f into master Nov 3, 2026
14 of 15 checks passed
@seatedro
seatedro deleted the rohit/diff-core-semantic-dense-ids branch November 3, 2026 12:49
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.

1 participant