Repository navigation
fix(io_uring): allocate Vec<MaybeUninit<T>> for reads to fix alignment for T - #8353
Merged
Merged
Conversation
…t for T Refactor IoUringState::read to take generic T and item_offset/items_length instead of byte_offset/byte_length. Allocate Vec<MaybeUninit<T>> so the kernel writes into correctly aligned memory, then convert to Vec<T> in finalize. Fixes bytemuck::cast_vec alignment panic for types like u64. Made-with: Cursor
…r runtime - IoUringState and IoUringRuntime no longer generic over T - read<T>() allocates Vec<MaybeUninit<T>>, transmutes to Vec<MaybeUninit<u8>> for storage - finalize returns ReadBuffer; callers use .into_vec::<T>() to get Vec<T> - Write path unchanged (callers pass bytes via bytemuck::cast_slice) Made-with: Cursor
generall
approved these changes
Mar 12, 2026
timvisee
approved these changes
Mar 12, 2026
generall
added a commit
that referenced
this pull request
Mar 12, 2026
…t for T (#8353) * fix(io_uring): allocate Vec<MaybeUninit<T>> for reads to fix alignment for T Refactor IoUringState::read to take generic T and item_offset/items_length instead of byte_offset/byte_length. Allocate Vec<MaybeUninit<T>> so the kernel writes into correctly aligned memory, then convert to Vec<T> in finalize. Fixes bytemuck::cast_vec alignment panic for types like u64. Made-with: Cursor * refactor(io_uring): only make read/write methods generic, not state or runtime - IoUringState and IoUringRuntime no longer generic over T - read<T>() allocates Vec<MaybeUninit<T>>, transmutes to Vec<MaybeUninit<u8>> for storage - finalize returns ReadBuffer; callers use .into_vec::<T>() to get Vec<T> - Write path unchanged (callers pass bytes via bytemuck::cast_slice) Made-with: Cursor * Cleanup * review n1 * review n2 * fmt --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Roman Titov <[email protected]> Co-authored-by: Andrey Vasnetsov <[email protected]>
generall
added a commit
that referenced
this pull request
Mar 12, 2026
* Improvements for `IoUringFile` - handle read and write requests more explicitly - assert against partial reads/writes * Implement `read_multi`/`write_multi` * Implement `populate` and `clear_ram_cache` * Rename internal structures as `IoUringSomething` * [ai] Make `UniversalRead`/`UniversalWrite` impl generic over `T` * Handle `io_uring` initialization error * Check that `io_uring` is initialized and supported, when opening `IoUringFile` * fixup! Check that `io_uring` is initialized and supported, when opening `IoUringFile` Fix typo * test for reading u64 from file with uring * fmt * clippy * fix(io_uring): allocate Vec<MaybeUninit<T>> for reads to fix alignment for T (#8353) * fix(io_uring): allocate Vec<MaybeUninit<T>> for reads to fix alignment for T Refactor IoUringState::read to take generic T and item_offset/items_length instead of byte_offset/byte_length. Allocate Vec<MaybeUninit<T>> so the kernel writes into correctly aligned memory, then convert to Vec<T> in finalize. Fixes bytemuck::cast_vec alignment panic for types like u64. Made-with: Cursor * refactor(io_uring): only make read/write methods generic, not state or runtime - IoUringState and IoUringRuntime no longer generic over T - read<T>() allocates Vec<MaybeUninit<T>>, transmutes to Vec<MaybeUninit<u8>> for storage - finalize returns ReadBuffer; callers use .into_vec::<T>() to get Vec<T> - Write path unchanged (callers pass bytes via bytemuck::cast_slice) Made-with: Cursor * Cleanup * review n1 * review n2 * fmt --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Roman Titov <[email protected]> Co-authored-by: Andrey Vasnetsov <[email protected]> * use AHash instead of just hash * add ahash to deps --------- Co-authored-by: Andrey Vasnetsov <[email protected]> Co-authored-by: qdrant-cloud-bot <[email protected]> Co-authored-by: Cursor Agent <[email protected]>
generall
added a commit
that referenced
this pull request
Mar 26, 2026
* Improvements for `IoUringFile` - handle read and write requests more explicitly - assert against partial reads/writes * Implement `read_multi`/`write_multi` * Implement `populate` and `clear_ram_cache` * Rename internal structures as `IoUringSomething` * [ai] Make `UniversalRead`/`UniversalWrite` impl generic over `T` * Handle `io_uring` initialization error * Check that `io_uring` is initialized and supported, when opening `IoUringFile` * fixup! Check that `io_uring` is initialized and supported, when opening `IoUringFile` Fix typo * test for reading u64 from file with uring * fmt * clippy * fix(io_uring): allocate Vec<MaybeUninit<T>> for reads to fix alignment for T (#8353) * fix(io_uring): allocate Vec<MaybeUninit<T>> for reads to fix alignment for T Refactor IoUringState::read to take generic T and item_offset/items_length instead of byte_offset/byte_length. Allocate Vec<MaybeUninit<T>> so the kernel writes into correctly aligned memory, then convert to Vec<T> in finalize. Fixes bytemuck::cast_vec alignment panic for types like u64. Made-with: Cursor * refactor(io_uring): only make read/write methods generic, not state or runtime - IoUringState and IoUringRuntime no longer generic over T - read<T>() allocates Vec<MaybeUninit<T>>, transmutes to Vec<MaybeUninit<u8>> for storage - finalize returns ReadBuffer; callers use .into_vec::<T>() to get Vec<T> - Write path unchanged (callers pass bytes via bytemuck::cast_slice) Made-with: Cursor * Cleanup * review n1 * review n2 * fmt --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Roman Titov <[email protected]> Co-authored-by: Andrey Vasnetsov <[email protected]> * use AHash instead of just hash * add ahash to deps --------- Co-authored-by: Andrey Vasnetsov <[email protected]> Co-authored-by: qdrant-cloud-bot <[email protected]> Co-authored-by: Cursor Agent <[email protected]>
KShivendu
pushed a commit
that referenced
this pull request
Mar 30, 2026
* Improvements for `IoUringFile` - handle read and write requests more explicitly - assert against partial reads/writes * Implement `read_multi`/`write_multi` * Implement `populate` and `clear_ram_cache` * Rename internal structures as `IoUringSomething` * [ai] Make `UniversalRead`/`UniversalWrite` impl generic over `T` * Handle `io_uring` initialization error * Check that `io_uring` is initialized and supported, when opening `IoUringFile` * fixup! Check that `io_uring` is initialized and supported, when opening `IoUringFile` Fix typo * test for reading u64 from file with uring * fmt * clippy * fix(io_uring): allocate Vec<MaybeUninit<T>> for reads to fix alignment for T (#8353) * fix(io_uring): allocate Vec<MaybeUninit<T>> for reads to fix alignment for T Refactor IoUringState::read to take generic T and item_offset/items_length instead of byte_offset/byte_length. Allocate Vec<MaybeUninit<T>> so the kernel writes into correctly aligned memory, then convert to Vec<T> in finalize. Fixes bytemuck::cast_vec alignment panic for types like u64. Made-with: Cursor * refactor(io_uring): only make read/write methods generic, not state or runtime - IoUringState and IoUringRuntime no longer generic over T - read<T>() allocates Vec<MaybeUninit<T>>, transmutes to Vec<MaybeUninit<u8>> for storage - finalize returns ReadBuffer; callers use .into_vec::<T>() to get Vec<T> - Write path unchanged (callers pass bytes via bytemuck::cast_slice) Made-with: Cursor * Cleanup * review n1 * review n2 * fmt --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Roman Titov <[email protected]> Co-authored-by: Andrey Vasnetsov <[email protected]> * use AHash instead of just hash * add ahash to deps --------- Co-authored-by: Andrey Vasnetsov <[email protected]> Co-authored-by: qdrant-cloud-bot <[email protected]> Co-authored-by: Cursor Agent <[email protected]>
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.
Fixes the buffer allocation bug discussed in PR #8300 (CodeRabbit review).
IoUringState::readto take genericTanditem_offset/items_length(element range) instead of byte offset/length.Vec<MaybeUninit<T>>so the kernel writes into correctly aligned memory; convert toVec<T>infinalize.bytemuck::cast_vecalignment panic for types likeu64(align > 1).Made with Cursor