Skip to content

feat: rkyv implementation for smallvec - #814

Merged
alejandro-vaz merged 5 commits into
servo:v2from
GauravPawar101:rkyv
Oct 28, 2026
Merged

alejandro-vaz merged 5 commits into
servo:v2from
GauravPawar101:rkyv

Conversation

@GauravPawar101

Copy link
Copy Markdown
Collaborator

Closes #798

Signed-off-by: Gauravpawar101 <Gauravpawar2522@gmail.com>
Comment thread tests/rkyv.rs
Comment thread tests/rkyv.rs Outdated
Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
Signed-off-by: Gauravpawar101 <Gauravpawar2522@gmail.com>
Comment thread src/comparisons.rs
Comment thread src/lib.rs Outdated
Comment thread tests/rkyv.rs Outdated
Signed-off-by: Gauravpawar101 <Gauravpawar2522@gmail.com>
@GauravPawar101

Copy link
Copy Markdown
Collaborator Author

Miri is expected to fail:

  • rkyv achieves zero-copy deserialization by referencing an ArchivedVec<T> struct directly within a raw byte buffer. Stacked Borrows Restriction: Miri retags the archived reference (&ArchivedVec<T>). Under Stacked Borrows rules, that reference's valid provenance range is restricted strictly to the byte range of the ArchivedVec struct header itself (offsets [0xc..0x10]).
  • Out-of-Bounds Pointer Derivation: Inside ArchivedVec::as_slice(), rkyv calculates a relative pointer to access the vector items stored at offsets [0x0..0xc]. Because [0x0..0xc] falls outside the ArchivedVec struct reference boundary ([0xc..0x10]), Stacked Borrows treats deriving pointers to [0x0..0xc] from &self as illegal pointer retagging.

Been hitting this for almost an hour

@alejandro-vaz

Copy link
Copy Markdown
Collaborator

then tell miri to stfu like we do in tests/rayon.rs

Signed-off-by: Gauravpawar101 <Gauravpawar2522@gmail.com>
Comment thread tests/rkyv.rs Outdated
Signed-off-by: Gauravpawar101 <Gauravpawar2522@gmail.com>

@alejandro-vaz alejandro-vaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Image

peak commit names

@GauravPawar101

GauravPawar101 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

To not embaras ourselves we should use something like bors, to squash these like rust-lang.
Btw in my defense my keyboard has no g
How would that be, we are not big enough but would be fun tho

@alejandro-vaz

Copy link
Copy Markdown
Collaborator

hahahahhahha fair, no G

squash merging is the only type of merge allowed so don't worry

I'm not sure how you'd set up bors

I think we shouldn't. it'd add complexity and the ROI is basically zero

btw review #815

@alejandro-vaz
alejandro-vaz added this pull request to the merge queue Oct 28, 2026
Merged via the queue into servo:v2 with commit 7ca8ea5 Oct 28, 2026
8 checks passed
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.

implement rkyv feature for smallvec

2 participants