Skip to main content

SharedTimePointTile

Struct SharedTimePointTile 

Source
pub struct SharedTimePointTile<T: Copy + 'static> { /* private fields */ }

Implementations§

Source§

impl<T: Copy + 'static> SharedTimePointTile<T>

Source

pub fn create(path: impl AsRef<Path>) -> Result<Self, TileError>

Obtain the tile at path, initializing an empty one if the path does not yet exist and attaching to it if it does. Attaching leaves occupied slots and their versions in place; a region built for a different payload type is a LayoutMismatch. reset reinitializes.

Source

pub fn reset(path: impl AsRef<Path>) -> Result<Self, TileError>

Truncate the tile at path and initialize an empty one, discarding every slot a live peer holds. For a caller that knows it owns the path.

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self, TileError>

Source

pub fn header(&self) -> &TileHeader

Source

pub fn insert(&self, version: u64, value: T) -> Result<usize, TileError>

Atomic insert via CAS on the occupied bitmap. Returns the claimed lane index, or Err(Full).

Source

pub fn remove(&self, lane: usize)

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn is_full(&self) -> bool

Source

pub fn visible_mask(&self, snapshot: u64) -> u16

SIMD scan: return a 16-bit lane mask of entries with version <= snapshot AND currently occupied. AVX2 uses the unsigned- compare-via-sign-XOR trick because cmpgt_epi64 is signed.

Source

pub fn simd_visible_mask(versions: &[u64; 16], snapshot: u64) -> u16

SIMD visibility scan dispatcher. Picks AVX-512F (one ZMM per 8-lane half + mask-producing _mm512_cmple_epu64_mask) when present, AVX2 (4 YMM compares with sign-bit XOR trick) otherwise, scalar on non-x86 or feature-stripped builds.

Source

pub unsafe fn simd_visible_mask_avx512( versions: &[u64; 16], snapshot: u64, ) -> u16

AVX-512F path: TILE_CAP=16 covered by two 8-u64 chunks. Each chunk uses one _mm512_loadu_si512 and one _mm512_cmple_epu64_mask (returns __mmask8 directly - no sign-bit XOR trick needed because the instruction is unsigned natively). Two 8-bit masks pack into the 16-bit result via low | (high << 8).

§Safety

Caller must ensure AVX-512F is available.

Source

pub unsafe fn simd_visible_mask_avx2(versions: &[u64; 16], snapshot: u64) -> u16

AVX2 path: 4 chunks of 4 u64. Signed cmpgt_epi64 plus sign-bit XOR delivers the unsigned <= predicate; cmpeq handles the equality boundary.

§Safety

Caller must ensure AVX2 is available.

Source

pub fn simd_visible_mask_scalar(versions: &[u64; 16], snapshot: u64) -> u16

Scalar reference: always available, used as the fallback for non-x86 builds and as the ground-truth oracle in tests.

Source

pub fn at(&self, lane: usize) -> Option<(u64, T)>

Read the payload at lane if occupied.

Source

pub fn visible_count(&self, snapshot: u64) -> u32

Count visible at snapshot.

Source

pub fn flush(&self) -> Result<(), TileError>

Source

pub fn flush_async(&self) -> Result<(), TileError>

Non-blocking flush: schedules a writeback via the OS. Note: Windows is only partially async (sync to page cache, not to disk).

Trait Implementations§

Source§

impl<T: Copy + Send + Sync + 'static> AdaptiveInstance for SharedTimePointTile<T>

Source§

fn header(&self) -> &HandshakeHeader

Source§

fn ring(&self) -> &ObservationRing

Source§

fn make_policy(&self) -> Box<dyn Policy>

Source§

fn apply_migration(&self, new_tag: u32)

Called by the sidecar when the policy returns a new strategy tag. Default implementation: just set the tag on the header. Primitives that need heavier migration (data-layout swap) override this to perform the swap before (or after) updating the tag.
Source§

impl<T: Copy + Send + 'static> Send for SharedTimePointTile<T>

Source§

impl<T: Copy + Sync + 'static> Sync for SharedTimePointTile<T>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.