Skip to content

refactor(types): attempt to make scalar rkyv::Archiveable #22961

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

BugenZhao
Copy link
Member

Signed-off-by: Bugen Zhao i@bugenzhao.comI hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

rkyv is a powerful library that enables zero-copy deserializing for arbitrary Rust types, which seems to be a good solution to #20017.

The main idea is, each type will have a corresponding Archived type. When a value is serialized into bytes with rkyv (which still incurs costs), the byte slice can then be directly interpreted as (transmuted into) a value in Archived type, with all fields are all in their Archived types. The Archived types are more like a view to the raw underlying serialized bytes, where we can easily access fields and perform operations just like on the original type.

Here's a demo:

https://github.com/BugenZhao/rust-playground/blob/1f42803c5697710aba2ff7980787e16268b62051/src/bin/rkyv_test.rs

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao BugenZhao requested a review from a team as a code owner August 21, 2025 10:40
@BugenZhao BugenZhao requested a review from cyliu0 August 21, 2025 10:40
@BugenZhao BugenZhao marked this pull request as draft August 21, 2025 10:40
@github-actions github-actions bot added the type/refactor Type: Refactoring. label Aug 21, 2025
@BugenZhao BugenZhao removed the request for review from cyliu0 August 22, 2025 06:40
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/refactor Type: Refactoring.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant