Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid: Memory alignment #159

Closed
2 tasks done
ashvardanian opened this issue Jul 21, 2023 · 1 comment · Fixed by #162
Closed
2 tasks done

Invalid: Memory alignment #159

ashvardanian opened this issue Jul 21, 2023 · 1 comment · Fixed by #162
Assignees
Labels
invalid This doesn't seem right

Comments

@ashvardanian
Copy link
Contributor

Describe the bug

There is a data alignment issue, that we have accounted for ahead of time, but haven't implemented the solution yet.
The index_config_t::vector_alignment controls, how to store vectors of add-ed elements in allocated memory.
Some platforms won't have an issue loading an 8-byte double, with an address that is not a multiple of 8.
Others will have that issue.
So the index_gt class has to be patched.

Steps to reproduce

Run the C++ unit test (available in VS code launchers) with -fsanitize=alignment address sanitizer flag set.

Expected behavior

No errors or warnings.

USearch version

v0.22.3

Operating System

Any

Hardware architecture

x86

Which interface are you using?

C++ implementation

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ashvardanian ashvardanian added the invalid This doesn't seem right label Jul 21, 2023
@mgevor mgevor pinned this issue Jul 21, 2023
@mgevor mgevor unpinned this issue Jul 24, 2023
@mgevor mgevor linked a pull request Jul 24, 2023 that will close this issue
@ashvardanian
Copy link
Contributor Author

This was resolved by implementing a completely new serialization form and using separate memory allocators for vectors and neighbors lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants