Affects Version/s: None
Fix Version/s: None
The first retraction of facts from a relation transforms the internal PersistentHashSet -set var+atom, which guarantees uniqueness, into a LazySeq which allows duplicate facts to be added. Once the first retraction occurs, a LazySeq persists for the rest of the life of the relation. Only the value of the primary -set var+atom is affected, not the -index var+atom values.
This issue is not an external correctness issue but does affect performance of subsequent duplicate fact additions which grow the size relation.
Without patch applied:
With patch applied:
I've filed this as a Minor issue as it does not affect core.logic correctness and degraded performance can be avoided by not re-asserting duplicate facts.
I will also issue a GitHub pull request which can be used or ignored at your convenience.