[WIP] Add ways of querying CustomOperations from C - #16808
Draft
raynelfss wants to merge 25 commits into
Draft
Conversation
- Add methods to the vtable.
- The new check makes sure that none of the pointers belonging to the `CustomOp` instance are null or unaligned.
CustomOperations from CCustomOperations from C
raynelfss
force-pushed
the
query-c-custom
branch
from
August 24, 2026 15:56
fdc9a91 to
5f0f8b5
Compare
…ations - Make `CustomOp` the private representation of `C Custom`. - Make `BoxedCustomOperation` public and use it as the way to expose `CustomOperation` to C as it already is a `Boxed` pointer. - Update each usage to leverage `Boxed` pointer. - Rename `qk_custom_op_new_vtable` to `qk_custom_op_vtable_new`.
- Initial functions to expose a `QkCustomOperation` directly from a circuit or dag in C. This also adds methods for querying properties associated with the `Operation` and `CustomOperation` traits in Rust.
- Renaming error `CCustomOperation` via the C API: `QkQkCustomOperation` is now `QkCustomOperation`. - All ``qk_custom_inst`` functions are now ``qk_custom_operation``. - ``qk_custom_operation`` methods will now decide whether the operation originated from Rust or C and behave accordingly. - Fixed how the ``qk_custom_operation_free`` function behaves, to not panic at null pointers. - Circuit querying methods now return mutable pointers instead of `const`.
raynelfss
force-pushed
the
query-c-custom
branch
from
August 28, 2026 20:11
0fbaf3e to
0c3cc42
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #16622
Based on top of #16549 (changes start at fdc9a91)
QkCustomOperationdirectly from a circuit or dag in C. This also adds methods for querying properties associated with theOperationandCustomOperationtraits in Rust.AI/LLM disclosure