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

Add: Swift & Obj-C bindings for filteredSearch #471

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

vardhan
Copy link
Contributor

@vardhan vardhan commented Aug 22, 2024

Added a couple of tests in Swift to test both functions.

Tested with swift build && swift test -v

Issue: #470

@vardhan vardhan force-pushed the vardhan-filtered-search branch 2 times, most recently from 5420a81 to 100cf62 Compare August 22, 2024 14:41
@ashvardanian ashvardanian changed the base branch from main to main-dev August 22, 2024 15:32
@vardhan
Copy link
Contributor Author

vardhan commented Aug 24, 2024

gentle ping @ashvardanian 🙏

@ashvardanian
Copy link
Contributor

@vardhan, can you please refresh from main-dev, there are some patches that may help pass the tests on MacOS. Thanks!

@vardhan
Copy link
Contributor Author

vardhan commented Aug 25, 2024

@vardhan, can you please refresh from main-dev, there are some patches that may help pass the tests on MacOS. Thanks!

Rebased on top of latest main-dev. I'm not able successfully swift build though -- seems like some C++ duplicate definition failure? I tried checking out main-dev and doing a swift build too, but fails similarly, so I think its not related to my PR.

@ashvardanian
Copy link
Contributor

I can't run it locally right now, but the CI is failing.

Building for debugging...
[0/1] Compiling USearchObjective USearchObjective.mm
[2/4] Compiling USearch USearch.swift
[3/4] Emitting module USearch
[4/4] Compiling USearch Index+Sugar.swift
/Users/runner/work/usearch/usearch/swift/Index+Sugar.swift:137:20: error: cannot find 'getDouble' in scope
            return getDouble(
                   ^~~~~~~~~
/Users/runner/work/usearch/usearch/swift/Index+Sugar.swift:[19](https://github.com/unum-cloud/usearch/actions/runs/10550588738/job/29227007339?pr=471#step:14:20)9:13: error: cannot find 'filteredSearchDouble' in scope
            filteredSearchDouble(
            ^~~~~~~~~~~~~~~~~~~~
Error: Process completed with exit code 1.

This looks like it's coming from your changes, @vardhan.

Added a couple of tests in Swift to test both functions.

Issue: unum-cloud#470
@vardhan
Copy link
Contributor Author

vardhan commented Aug 25, 2024

Thanks! I fixed the issues that CI raised.

However, when I try to build (swift build), or even from a clean origin/main-dev, i get:

In file included from /Users/vardhan/github/usearch/objc/USearchObjective.mm:5:
In file included from /Users/vardhan/github/usearch/include/usearch/index_dense.hpp:12:
/Users/vardhan/github/usearch/include/usearch/index_plugins.hpp:1123:20: error: redefinition of 'cast_gt<signed char, __fp16>'
template <> struct cast_gt<i8_t, bf16_t> : public cast_from_i8_gt<bf16_t> {};
                   ^~~~~~~~~~~~~~~~~~~~~

though it doesnt look like CI is hitting this issue. Note that if I checkout an older commit (tag v2.14.0), I don't see any failures.

@ashvardanian
Copy link
Contributor

That looks like a mistake in the core implementation, that may even be coming from SimSIMD type definitions, where bf16 maps to fp16. That shouldn't happen.

@vardhan
Copy link
Contributor Author

vardhan commented Aug 26, 2024

That looks like a mistake in the core implementation, that may even be coming from SimSIMD type definitions, where bf16 maps to fp16. That shouldn't happen.

This was the error I mentioned earlier -- It doesn't seem like it's related to this PR though. Please let me know if CI throws any more issues (I don't have the ability to run it from my fork)

In case it matters, I'm building on an Apple Macbook w/ M3 (so arm64), Sonoma 14.6, and XCode 15.4

ashvardanian added a commit that referenced this pull request Aug 26, 2024
ashvardanian added a commit that referenced this pull request Aug 26, 2024
@ashvardanian ashvardanian merged commit 1abc8e8 into unum-cloud:main-dev Aug 26, 2024
11 of 26 checks passed
@ashvardanian
Copy link
Contributor

Thank you, @vardhan! Merged 😉

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