Enum MemoryTopology
pub enum MemoryTopology {
Unified {
zero_copy: bool,
},
Discrete {
staging_required: bool,
},
}Expand description
Defines the topology of the underlying memory allocator.
§Implementation status (honest scope, plan §2)
Plan §2 calls for differentiated memory paths: “larger persistent slabs with
zero-copy for unified memory, pinned staging rings with async copy_buffer for
discrete PCIe devices.” What is implemented and verified today is the
classification plus the topology-aware, lap-safe ring/slab allocator
(QualiaSlabAllocator, proven not to lap its read head under sustained
dispatch — see sustained_dispatch_never_laps_read_head).
What is NOT yet implemented is the differentiation of the physical copy
path by topology. The zero_copy / staging_required flags are descriptive
tags only: the wgpu backend (super::wgpu) uses the same uniform path on
both topologies — queue.write_buffer for host→device uploads and
copy_buffer_to_buffer for readback — regardless of the variant here. That
path is correct on both unified and discrete hardware; it is simply not yet
optimised per topology.
This is a deliberate measurement-honesty decision: the development host is a discrete-only NVIDIA RTX A2000 (no unified memory), so a unified zero-copy persistent-mapped path cannot be exercised or verified here, and shipping unverified memory-mapping code would over-claim. The differentiated paths (zero-copy persistent-mapped slabs for unified; pinned staging ring + async copy for discrete) are documented future work, to be built and benchmarked on unified-memory hardware where the benefit is actually measurable.
Variants§
Unified
Memory is shared between host and device (e.g., Apple Silicon, APUs). Zero-copy mapping is preferred in principle but not yet implemented — see the type-level note above. Currently classified, not yet exploited.
Discrete
Memory requires a staging buffer (PCIe transfer to discrete VRAM). A pinned
staging ring with async copy_buffer is intended but not yet implemented
— see the type-level note above. Currently classified, not yet exploited.
Trait Implementations§
§impl Clone for MemoryTopology
impl Clone for MemoryTopology
§fn clone(&self) -> MemoryTopology
fn clone(&self) -> MemoryTopology
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MemoryTopology
§impl Debug for MemoryTopology
impl Debug for MemoryTopology
impl Eq for MemoryTopology
§impl PartialEq for MemoryTopology
impl PartialEq for MemoryTopology
impl StructuralPartialEq for MemoryTopology
Auto Trait Implementations§
impl Freeze for MemoryTopology
impl RefUnwindSafe for MemoryTopology
impl Send for MemoryTopology
impl Sync for MemoryTopology
impl Unpin for MemoryTopology
impl UnsafeUnpin for MemoryTopology
impl UnwindSafe for MemoryTopology
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more