- make
Section::freezea memory-protection transition rather than an implicit durability barrier;ByteArea::persistsynchronizes the complete backing file once when it is deliberately retained - fix soundness: changed
BytesandViewinternal data fields from&'static [u8]/&'static Tto raw pointers (*const [u8]/*const T) to fix undefined behavior under both Stacked Borrows and Tree Borrows whenBytesorViewis passed by value to a function (includingstd::mem::drop) while holding the last strong reference to the owner - removed
erase_lifetimehelper, now unnecessary with raw pointer storage - added Miri test suite (
tests/miri.rs) with 75 tests covering all unsafe code paths: lifetime erasure, weak reference upgrades,try_unwrap_ownerdata pointer reconstruction, view operations, complex drop orderings, thread safety (Send/Syncvalidation), allByteSourceimplementations (VecDeque,Cow,Box<[u8]>,&'static str),from_raw_parts/View::from_raw_partsdirect tests, edge cases (zero-length, single byte, exhaustive drain), winnowStreamoperations, and stress patterns (many clones, deeply nested slicing, overlapping slices) - added
scripts/miri.shfor running Miri tests with Tree Borrows - added optional
burnfeature withByteSourcesupport forburn_tensor::Bytes - added zero-copy conversion from
anybytes::Bytestoburn_tensor::Bytes - added burn-feature tests covering both conversion directions and sliced views
- added proptest coverage for prefix/suffix invariants and introduced a fuzz target for mutating
Bytesoperations - extended
verify.shto install cargo-fuzz and execute deterministic fuzz runs alongside Kani proofs - added Kani proofs ensuring
is_subsliceaccepts only slices from the original allocation - add Kani proof checking
Bytes::downcast_to_ownerfor matching and mismatched owners - added Kani verification harnesses for
Bytes::pop_frontandBytes::pop_back - avoid flushing empty memory maps in
Section::freezeto prevent macOS errors - derived zerocopy traits for
SectionHandleto allow storing handles inByteAreasections - added example demonstrating
ByteAreawith multiple typed sections, concurrent mutations, and freezing or persisting the area - added example combining Python bindings with winnow parsing
- added Python example demonstrating structured parsing with winnow's
view - added
SectionHandlefor reconstructing sections from a frozenByteArea - added
ByteSourcesupport forVecDeque<T>whenzerocopyis enabled and kept the deque as owner - added
ByteSourcesupport forCow<'static, T>whereT: AsRef<[u8]> - added
ByteAreafor staged file writes withSection::freeze()to returnBytes SectionWriter::reservenow accepts a zerocopy type instead of an alignment constantByteAreareuses previous pages so allocations align only to the element typeSection::freezeconverts the writable mapping to read-only instead of remapping- simplified
ByteAreaby introducingSectionWriterfor mutable access without interior mutability - tie
Sectionlifetime toByteAreato prevent dangling sections - allow multiple
ByteAreasections at once with non-overlapping byte ranges - documented all fields in
ByteArea,SectionWriterandSection - documented ByteArea usage under advanced usage with proper heading
- added
ByteArea::persistto rename the temporary file - removed the old
ByteBuffertype in favor ofByteArea - added tests covering
ByteAreasections, typed reserves and persistence - added test verifying alignment padding between differently aligned writes
- added property tests generating random
ByteAreasections and documented multi-typed section layouts - split Kani verification into
verify.shand streamlinepreflight.sh - clarify that
verify.shruns on a dedicated system and document avoiding async code - install
rustfmtand the Kani verifier automatically viacargo install - restore Kani proof best practices in
AGENTS.mdand note that proofs run viaverify.sh - limit Kani loop unwind by default and set per-harness bounds
ByteBuffer::pushnow accepts anyIntoBytes + Immutablevalue when thezerocopyfeature is enabled- increase unwind for prefix/suffix overflow proofs
- move weak reference and downcasting examples into module docs
- expand module introduction describing use cases
- document rationale for separating
ByteSourceandByteOwner - added optional
winnowfeature for parser integration - added
INVENTORY.mdfor tracking future work and noted it inAGENTS.md - documented safety rationale for
winnowintegration - implemented
Streamdirectly forByteswith a safeiter_offsetsiterator - added
pop_backandpop_fronthelpers and rewrote parser examples - added tests covering
pop_frontandpop_back - added tests covering
take_prefixandtake_suffix - removed the Completed Work section from
INVENTORY.mdand documented its use - added
Bytes::try_unwrap_ownerto reclaim the owner when uniquely held - simplified
Bytes::try_unwrap_ownerimplementation - added
ByteBufferfor owning aligned byte allocations - compile-time assertion that
ALIGNis a power of two - added
reserve_totaltoByteBufferfor reserving absolute capacity - fixed potential UB in
Bytes::try_unwrap_ownerfor custom owners - renamed
ByteArea::writertosectionsfor clarity - prevent dangling
databy dropping references before unwrapping the owner - refined
Bytes::try_unwrap_ownerto cast the data slice to a pointer only when the owner type matches - replaced
ByteOwner::as_anywith trait upcasting for simpler downcasting - rewrote
winnow::viewto use safe helpers and addedview_elems(count)parser winnow::view_elemsnow returns a Parser closure for idiomatic usage- replaced
ByteOwner::as_anywith trait upcasting toAny Bytes::downcast_to_ownerandView::downcast_to_ownernow returnResultand return the original value on failure in a dedicated AGENTS section- add tests for weak reference upgrade/downgrade and Kani proofs for view helpers
- add Kani proofs covering
Bytes::try_unwrap_ownerandWeakBytesupgrade semantics - add examples for quick start and PyAnyBytes usage
- add example showing how to wrap Python
bytesintoBytes - summarize built-in
ByteSources and show how to extend them - added tests verifying
WeakViewupgrade and drop semantics - clarify library overview and development instructions in README
- added crate-level examples for weak references and owner downcasting
- expanded module introduction describing use cases
- update bytes, ownedbytes, memmap2, zerocopy and pyo3 dependencies
- documented rationale for separating
ByteSourceandByteOwner - verify
cargo fmtavailability and installrustfmtvia rustup if missing - note that the
pyo3feature requires Python development libraries - documented safety requirements for
erase_lifetime - warn about missing documentation by enabling the
missing_docslint - derive
CloneandDebugforWeakBytesandWeakView - replaced
quickcheckproperty tests withproptest - added
ByteSourcesupport formemmap2::MmapMutandCow<'static, [T]>withzerocopy - split
CowByteSource tests into dedicated cases - skip Python examples when the
pyo3feature is disabled to fixcargo test - added
Bytes::map_filehelper for convenient file mapping (accepts anymemmap2::MmapAsRawDesc, e.g.&Fileor&NamedTempFile) - added
Bytes::map_file_regionto map a specific region of a file - reverted automatic installation of Python development packages in the
preflight script; rely on the system
python3-devpackage - set the preflight script to use Python 3.12 for building pyo3 code
- added README example demonstrating
Bytes::try_unwrap_owner - expanded
ByteOwnertrait docs to clarify lifetime requirements and trait upcasting for downcasting - removed rope-like store integration and async wrappers from the inventory
- noted new suggestions in
INVENTORY.mdfor future work - clarified that implementing
ByteSourceforArctypes would double wrap the owner and updatedINVENTORY.mdaccordingly - removed the
serdesupport idea from the inventory - removed the unsafe derive macro idea from the inventory
- removed the
Iteratorsupport idea from the inventory asBytesalready dereferences to[u8] - documented creating
BytesfromArcsources without an extra wrapper and removed the corresponding task from the inventory - implemented
bytes::BufforBytesandFrom<Bytes>forbytes::Bytesfor seamless integration with Tokio and other libraries - implemented
ExactSizeIteratorandFusedIteratorforBytesIterOffsets - added test exposing
PyAnyBytesas a read-onlymemoryview - renamed
PyByteswrapper toPyAnyBytesto avoid confusion - renamed
py_anybytesmodule topyanybytesfor consistency
- implemented
ErrorforViewError
- removed
Sizedconstraint from view methods
- removed
Sizedbound on.bytes()
- reworked
take_*helpers and updated conversions