Repository navigation
allow stack to grow dynamically - #48
Merged
Merged
Conversation
yuvalif
commented
May 19, 2026
Collaborator
- this should demonstrate how to call lancedb code from a boost asio coutoutine
- no async-io is implemented at this point
- it shows the necessary stack size needed for the datafusion sql interperter code
yuvalif
force-pushed
the
add-coroutine-example
branch
from
May 20, 2026 07:03
7047a5b to
3fd6bd7
Compare
yuvalif
force-pushed
the
add-coroutine-example
branch
from
June 8, 2026 15:41
3fd6bd7 to
b5be4f0
Compare
yuvalif
force-pushed
the
add-coroutine-example
branch
from
June 8, 2026 15:46
b5be4f0 to
0cfea9b
Compare
There was a problem hiding this comment.
Pull request overview
This PR demonstrates calling LanceDB C API from a Boost.Asio spawn coroutine, while also addressing coroutine stack limitations by allowing certain Rust FFI entrypoints to grow the stack dynamically.
Changes:
- Wrap
lancedb_table_merge_insertandlancedb_table_deleteexecution instacker::maybe_growto avoid stack overflows when called from small-stack coroutine contexts. - Add a new C++ example (
examples/asio_coroutine.cpp) showing upsert/delete/query flow structured as Asio spawn coroutines. - Update CMake and CI to build the new example and install Boost coroutine/context dependencies; add the
stackerRust dependency.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/table.rs |
Adds dynamic stack growth around high-stack operations (merge_insert, delete) in Rust FFI. |
examples/asio_coroutine.cpp |
New example demonstrating Boost.Asio coroutine structure around LanceDB operations. |
CMakeLists.txt |
Builds and links the new Boost.Asio coroutine example. |
Cargo.toml |
Adds stacker dependency to enable dynamic stack growth. |
Cargo.lock |
Lockfile updates reflecting the new dependency graph (including stacker). |
.github/workflows/ci.yml |
Installs Boost dependencies for example builds; disables examples for Windows cross-compile job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yuvalif
force-pushed
the
add-coroutine-example
branch
3 times, most recently
from
June 9, 2026 09:48
60e4cc0 to
da360ad
Compare
28 of 48 tasks
yuvalif
force-pushed
the
add-coroutine-example
branch
from
June 11, 2026 16:29
da360ad to
ead91d6
Compare
yuvalif
force-pushed
the
add-coroutine-example
branch
from
June 18, 2026 16:47
ead91d6 to
59f77fe
Compare
* this should demonstrate how to call lancedb code from a boost asio coutoutine * no async-io is implemented at this point * it shows the necessary stack size needed for the different operations Signed-off-by: Yuval Lifshitz <[email protected]>
this is to allow for deep call stacks that happening when the query planner is needed. and the invoking code has a limited stack size (e.g. when using boost asio coroutines). example of deep call (63 frames) stack backtrace in upsert: C++ --- frames 63-61 tokio --- frames 60-50 lancedb merge logic --- frames 49-45 lance execution --- frames 44-28 df physical planning --- frames 27-18 lance scanner --- frames 17-10 SessionState clone --- frames 9-0 backtrace: https://gist.github.com/yuvalif/7b3c78bd56765a03163f17377c20544b this also allow using the same increased size stack in multiple calls. e.g. when the same coroutine with limited stack size calls multiple apsi, this will avoid allocating and freeing the increased stack multiple times. also, fixes to memory handling in the example file Signed-off-by: Yuval Lifshitz <[email protected]>
yuvalif
force-pushed
the
add-coroutine-example
branch
from
June 18, 2026 17:19
59f77fe to
aa68879
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.