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
I modified the test in the package to run in an XCTestCase, and it crashes when adding a labeled vector at the line index.add(label: 42, vector: vectorA[...])
The package crashes at index.hpp line 889 with Thread 1: EXC_BAD_ACCESS (code=1, address=0x488)
Thread 1 Queue : com.apple.main-thread (serial)
#0 0x00000001183a6d80 in unum::usearch::sorted_buffer_gt<unum::usearch::index_gt<unum::usearch::index_punned_dense_metric_t, unsigned int, unsigned int, unum::usearch::aligned_allocator_gt<char, 64ul>, unum::usearch::memory_mapping_allocator_gt<1ul> >::candidate_t, unum::usearch::index_gt<unum::usearch::index_punned_dense_metric_t, unsigned int, unsigned int, unum::usearch::aligned_allocator_gt<char, 64ul>, unum::usearch::memory_mapping_allocator_gt<1ul> >::compare_by_distance_t, unum::usearch::aligned_allocator_gt<unum::usearch::index_gt<unum::usearch::index_punned_dense_metric_t, unsigned int, unsigned int, unum::usearch::aligned_allocator_gt<char, 64ul>, unum::usearch::memory_mapping_allocator_gt<1ul> >::candidate_t, 64ul> >::clear() at /Users/x/Developer/Projects/usearch/include/usearch/index.hpp:889
#1 0x00000001183a6678 in unum::usearch::index_gt<unum::usearch::index_punned_dense_metric_t, unsigned int, unsigned int, unum::usearch::aligned_allocator_gt<char, 64ul>, unum::usearch::memory_mapping_allocator_gt<1ul> >::add(unsigned int, unum::usearch::span_gt<char const>, unum::usearch::add_config_t) at /Users/x/Developer/Projects/usearch/include/usearch/index.hpp:1783
#2 0x00000001183a63bc in unum::usearch::index_gt<unum::usearch::index_punned_dense_metric_t, unsigned int, unsigned int, unum::usearch::aligned_allocator_gt<char, 64ul>, unum::usearch::memory_mapping_allocator_gt<1ul> >::add_result_t unum::usearch::index_punned_dense_gt<unsigned int, unsigned int>::add_<float>(unsigned int, float const*, unum::usearch::add_config_t, std::__1::function<bool (char const*, unsigned long, char*)> const&) at /Users/x/Developer/Projects/usearch/include/usearch/index_punned_dense.hpp:373
#3 0x00000001183a61c8 in unum::usearch::index_gt<unum::usearch::index_punned_dense_metric_t, unsigned int, unsigned int, unum::usearch::aligned_allocator_gt<char, 64ul>, unum::usearch::memory_mapping_allocator_gt<1ul> >::add_result_t unum::usearch::index_punned_dense_gt<unsigned int, unsigned int>::add_<float>(unsigned int, float const*, std::__1::function<bool (char const*, unsigned long, char*)> const&) at /Users/x/Developer/Projects/usearch/include/usearch/index_punned_dense.hpp:450
#4 0x000000011834aabc in unum::usearch::index_punned_dense_gt<unsigned int, unsigned int>::add(unsigned int, float const*) at /Users/x/Developer/Projects/usearch/include/usearch/index_punned_dense.hpp:258
#5 0x000000011834a984 in -[USearchIndex addSingle:vector:] at /Users/x/Developer/Projects/usearch/objc/USearchObjective.mm:126
#6 0x00000001183b0e50 in closure #1 in USearchIndex.add(label:vector:) at /Users/x/Developer/Projects/usearch/swift/Index+Sugar.swift:16
#7 0x0000000107bb0e7c in partial apply for closure #1 in USearchIndex.add(label:vector:) ()
#8 0x000000019d3c3d9c in ArraySlice.withContiguousStorageIfAvailable<τ_0_0>(_:) ()
#9 0x0000000107bb0d18 in USearchIndex.add(label:vector:) at /Users/x/Developer/Projects/usearch/swift/Index+Sugar.swift:15
#10 0x0000000107b49858 in Test.testUnit() at /Users/x/Developer/Projects/usearch/swift/Test.swift:18
I checked the CI output, actually, the test was not running.
warning: 'usearch': found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/Users/runner/work/usearch/usearch/swift/Test.swift
[0/1] Planning build
Building for debugging...
[1/3] Emitting module USearchTests
[2/3] Compiling USearchTests Test.swift
[2/3] Linking USearchPackageTests
Build complete! (7.68s)
Test Suite 'All tests' started at 2023-06-27 10:08:35.166
Test Suite 'All tests' passed at 2023-06-27 10:08:35.168.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.002) seconds
Steps to reproduce
wrap the testUnit() in swift/Test.swift in class Test: XCTestCase {}.
run the test
Expected behavior
No crash.
USearch version
v0.19.0
Operating System
macOS 13.4 (22F66)
Hardware architecture
Arm
Which interface are you using?
Other bindings
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
The text was updated successfully, but these errors were encountered:
I see. The problem is we have slightly different behavior depending on how close the programming language is to a systems language. In C/C++/Rust, we request the user use reserve before add-ing new vectors. We do it behind the curtains in Python, JS, and Java, assuming the users won't notice the performance penalty. With Swift and Objective-C being between the two worlds, I forgot to implement any of the variants.
Which do you think makes more sense, @intitni? I assume it would make sense to add a reserve function to Objective-C and Swift bindings.
Describe the bug
I modified the test in the package to run in an XCTestCase, and it crashes when adding a labeled vector at the line
index.add(label: 42, vector: vectorA[...])
The package crashes at index.hpp line 889 with Thread 1: EXC_BAD_ACCESS (code=1, address=0x488)
I checked the CI output, actually, the test was not running.
Steps to reproduce
testUnit()
inswift/Test.swift
inclass Test: XCTestCase {}
.Expected behavior
No crash.
USearch version
v0.19.0
Operating System
macOS 13.4 (22F66)
Hardware architecture
Arm
Which interface are you using?
Other bindings
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: