{{ message }}
Repository navigation
Conversation
This branch has not been deployed
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.

Summary
Fix a replacement omission in the fixed-size hashsig heaps and add a regression test.
Reproduction
For an input with more than 127 runs,
hashsig_heap_insert()takes the full-heap replacement path. Before this change, it decrementedh->size, moved the last element to the root, and sifted down, but discarded the newly acceptedval. This leaves the heap short and causes later values to be admitted unconditionally.A regression test creates 600 distinct runs and compares the same runs in forward and reverse order. Since the signature is order-independent, the expected similarity is 100. Before this change, the test reported 49.
Cause
The full-heap path evicted the root without storing the replacement value.
Fix
Store
valat the root and sift it down without changing the heap size.Impact
Large signatures now retain the intended 127 extrema. Similarity and rename-detection results no longer depend on the order in which runs arrive because of the dropped replacement values.
Validation
core::hashsigsuite after fix: 3/3 passed.git diff --check: passed.ctest --test-dir build --output-on-failure: 67% passed (8/12 CTest groups). The four failing groups were environment/configuration-related: the build had no TLS backend, and the existing offline fixture reported a missing object plus an unrelatedgit_diff_optionsinitializer mismatch. The changed hashsig suite passed.Unverified
I did not run the online tests with a TLS backend configured.
Fixes #7375
Assisted-by: OpenClaw (opencode-go/gpt-5.6-luna)