Skip to content

fix: correct + call - #61

Merged
cvigilv merged 1 commit into
mainfrom
hotfix/incorrect-output-on-overloaded-operations
Jul 13, 2026
Merged

fix: correct + call#61
cvigilv merged 1 commit into
mainfrom
hotfix/incorrect-output-on-overloaded-operations

Conversation

@cvigilv

@cvigilv cvigilv commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Previously, whenever one called + over more than 2 hypervectors, the operation worked at each pair, that is:

a + b + c + d +e = ((((a + b) + c) + d) + e)

This behavior breaks the binary hypervectors because, at each step, it introduces noise whenever there is a tie. This fix rewrites the + overload to correctly call the bundle function with an array of hypervectors rather than performing pairwise operations. Added some tests to cover this behavior.

Previously, whenever one called `+` over more than 2 hypervectors, the
operation worked at each pair, that is:

a+b+c+d+e = ((((a+b)+c)+d)+e)

This behaviour breaks the binary hypervectors because at each step it
introduced noise whenever we have a tie. This fix rewrites the `+`
overload so it correctly calls the `bundle` function as an array of
hypervectors instead of pairwise operations. Added some tests to cover
this behaviour.
@cvigilv
cvigilv merged commit 2f0a2a9 into main Jul 13, 2026
@cvigilv
cvigilv deleted the hotfix/incorrect-output-on-overloaded-operations branch July 13, 2026 15:17
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