Skip to content

C Scan API#32

Open
myrrc wants to merge 1 commit intodevelopfrom
myrrc/scan-api-c
Open

C Scan API#32
myrrc wants to merge 1 commit intodevelopfrom
myrrc/scan-api-c

Conversation

@myrrc
Copy link

@myrrc myrrc commented Mar 20, 2026

Copy link
Contributor

@connortsui20 connortsui20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to follow the template a bit more closely? It's less about following the exact template and more that it's a bit hard to understand what it being proposed and the different tradeoffs (alternatives) without some of the sections in the template. Basically, when reading through this I'm trying to figure out the "why" via the "what", and it should be the other way around.

Additionally, there is quite a lot of code here that is paired with high-level description. I think it would be helpful if some of the boilerplate-y code was removed so we could focus on things that are not obvious. That would help in making this easier to read as well.

Also as an aside: I'm not an FFI expert but I feel like there is a lack of ownership semantics described here. Shouldn't that be one of the main things we have to worry about with interop between Rust and C?

Comment on lines +233 to +236
typedef struct vx_scan_selection {
const size_t* idx;
size_t idx_len;
} vx_scan_selection;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a remnant of a revision (this exists above)

Comment on lines +212 to +213
```c
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty?

Comment on lines +205 to +206
However, as the future of such approach is unclear, a async-unfriendly option is
described below
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be valuable to actually think through what an async API looks like in practice, because it is almost certainly the case that the devil is in the details.

Otherwise, this should be in an unresolved questions section and we should acknowledge we are not going to work on this now.

Comment on lines +94 to +98
void* (*cache_init)(vx_error* err);
void (*cache_free)(void* cache, vx_error* err);
void (*cache_get)(void* cache, const char* key, void** value, vx_error* err);
void (*cache_put)(void* cache, const char* key, void* value, vx_error* err);
void (*cache_delete)(void* cache, const char* key, vx_error* err);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the way we want to expose a cache?

I feel like for Vortex arrays specifically this is way too generic to be useful. What exactly would we be storing in the cache? Just vortex arrays, or things like stats? Partitions? Array trees? And if we are passing around void * values then shouldn't there also be a size parameter somewhere? Also things related to ownership and eviction semantics, etc are missing.

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