You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in issue #11, this PR adds a reproducible test case in CTOptimizedTrieTest.
Currently, the test fails because CTOptimizedTrie does not merge a parent and child node when a deletion leaves an intermediate node with only one child. This confirms the structural degradation and memory bloat.
Hey @jordanmontt, I've just pushed the fix to this same PR.
and it Green now
It overrides compressNode:ancestors: in CTOptimizedTrie to securely merge an intermediate node with its single child when a deletion leaves it redundant. This restores the Radix tree structure and makes the test pass locally. Let me know what you think.
HossamSaberr
changed the title
Add failing test for CTOptimizedTrie on deletion (#11)
Add radix merge logic to CTOptimizedTrie deletion
Feb 24, 2026
There is still no test that tests directly the compressNode:ancestors: method. We need some unit tests that test only that method and calling it directly :)
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
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
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.
As discussed in issue #11, this PR adds a reproducible test case in
CTOptimizedTrieTest.Currently, the test fails because
CTOptimizedTriedoes not merge a parent and child node when a deletion leaves an intermediate node with only one child. This confirms the structural degradation and memory bloat.