Skip to content

added more tests with hashCode=0 collisions#41

Closed
jurgenvinju wants to merge 1 commit intomainfrom
some-more-collision-tests
Closed

added more tests with hashCode=0 collisions#41
jurgenvinju wants to merge 1 commit intomainfrom
some-more-collision-tests

Conversation

@jurgenvinju
Copy link
Member

@jurgenvinju jurgenvinju commented Jan 21, 2026

I'm debugging some issues with relation and map key removal on the vallang level and rascal level. They all relate to hashCode=0 collisions so I added some tests here to rule out a bug in capsule.

@jurgenvinju jurgenvinju self-assigned this Jan 21, 2026
@jurgenvinju
Copy link
Member Author

jurgenvinju commented Jan 21, 2026

Here we see that after deleting one of the colliding nodes, the remaining node and the original non-colliding node have switched printing order:

image

equals fails then on:

if (rawMap1() != that.rawMap1()) {

in BitmapIndexedSetMultimapNode::equals

But I have yet to construct a test on the capsule level that reproduces this behavior. In Rascal:

rascal>{<"A",[]>, <"\a00",[]>, <""(),[]>} - {<"\a00",[]>} == {<"A", []>, <""(),[]>}
bool: false
  • "\a00" and ""() both have hashCode zero
  • "A" does not collide with the others
  • it does not matter what the image values are with each key
  • it does not matter which of the two colliding keys we remove
  • if we remove the non-colliding key, they bug is not triggered

@msteindorfer
Copy link
Member

The information provided in this PR, describing the observed behaviour, expedited triaging and fixing the underlying issue in #42.

Closing this PR in favour of #42, which suggests that there is already sufficient coverage in the property-based test suite to trigger the observed behaviour. After adding the invariant explicitly, the suite exhibited failures.

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.

2 participants

Comments