Next-Generation Memory Coherence
SpeakEZ’s Fidelity framework and its BAREWire native memory management are designed to take advantage of emerging memory coherence and interconnect technologies like CXL, NUMA, and recent PCIe enhancements. By combining BAREWire’s zero-copy architecture with these hardware innovations, Fidelity gives the developer fine-grained control over heterogeneous computing environments through the semantics of the Clef language.
BAREWire and CXL enable distributed model training by eliminating traditional memory management boundaries that have constrained AI workloads.
The CXL hardware is settled. The open problem is the software abstraction for programming it. C++ CXL libraries expose raw pointers and require manual tracking of which memory regions reside in which pools. The programmer maintains a mental model of coherence domains that the type system cannot verify. Rust improves memory safety, but its ownership model assumes a single coherent address space, and CXL’s multiple memory pools with different latency characteristics fall outside what the borrow checker can express. In our design, Fidelity’s type system encodes memory pool residency directly, making pool-aware allocation verifiable at compile time instead of debuggable at runtime.
BAREWire and CXL for Zero-Copy Computing
BAREWire’s premise of unified memory abstractions maps onto CXL’s hardware-level coherent memory access. Allocation queries the sysfs interface for CXL.mem availability and falls back to standard unified memory when the hardware is absent:
module BAREWire.CXL =
// Clef Extended Units of measure for memory safety
[<Measure>] type addr // Memory address
[<Measure>] type bytes // Size in bytes
[<Measure>] type cxl_mem // CXL memory space
[<Measure>] type cpu_mem // CPU memory space
[<Measure>] type unified // Unified memory space
// CXL-aware memory allocation with hardware coherency
let allocateCoherentBuffer<'T> (size: int<bytes>) : SharedBuffer<'T, unified> =
// Determine if CXL.mem is available through sysfs interface
let cxlAvailable = checkCXLAvailability()
if cxlAvailable then
// Use ioctl interface to allocate from CXL memory pool
let fd = openCXLDevice()
let cxlConfig = {
size = size
interleave_ways = 1
interleave_granularity = CXL_INTERLEAVE_GRANULARITY_256
restrictions = CXL_MEM_RESTRICT_TYPE_NORMAL
}
let ptr = allocateCXLMemory<'T>(fd, cxlConfig)
{
Address = ptr
Size = size
Layout = MemoryLayout.getOptimized<'T>()
MemoryType = MemoryType.CXL
}
else
// Fall back to standard unified memory
let ptr = allocateUnifiedMemory<'T>(size)
{
Address = ptr
Size = size
Layout = MemoryLayout.getOptimized<'T>()
MemoryType = MemoryType.Standard
}Applications written against BAREWire’s memory abstraction model are already structured for the kind of unified memory that CXL provides at the hardware level.
Compare this with the C++ approach using libcxlmem or similar libraries. The C++ programmer calls cxl_malloc() and receives a void pointer with no type-level indication of which memory pool it came from. When the allocation fails, the programmer checks errno and hopes they remembered to handle all the failure modes. The Fidelity approach encodes pool information in the type: SharedBuffer<'T, unified> vs SharedBuffer<'T, cxl_mem> vs SharedBuffer<'T, cpu_mem>. The compiler prevents passing a CPU-local buffer to code expecting CXL-coherent memory. The type system enforces the constraint at compile time, where C++ leaves the same check to programmer discipline.
Hardware Coherency and Memory Models
CXL Type 2 devices provide full bidirectional coherency, but C++ and Rust currently lack the toolchain support to use this capability safely. The hardware ensures cache coherence. The software must ensure that access patterns respect coherence domain boundaries. A C++ programmer might allocate from a CXL pool, pass the pointer to GPU code, and discover at runtime that the GPU cannot access CXL memory directly. The pointer type gives no indication. The failure manifests as a segfault or silent corruption.
When using CXL Type 2 devices, BAREWire can eliminate the need for explicit synchronization in many cases:
// Create CXL memory views that leverage hardware coherency
let createGPUView<'T> (buffer: SharedBuffer<'T, unified>) =
match buffer.MemoryType with
| MemoryType.CXL ->
// CXL Type 2 provides hardware coherency - no need for explicit synchronization
{ buffer with MemSpace = typedefof<gpu_mem>; CoherencyModel = CoherencyModel.Hardware }
| _ ->
// Fall back to software coherency model for non-CXL memory
{ buffer with MemSpace = typedefof<gpu_mem>; CoherencyModel = CoherencyModel.Software }Developer Abstractions
While the core BAREWire implementation deals with hardware-specific details, Clef developers don’t always have to wrestle with these lower-level abstractions. As conventions emerge, the framework will provide a constellation of supporting libraries that encapsulate these primitives into idiomatic Clef patterns familiar to application developers:
module Furnace =
// Create a tensor with optimal memory placement for current hardware
let tensor<'T> (dimensions: int list) : Tensor<'T> =
// Under the hood: Uses platform detection to determine
// optimal memory placement (CXL, NUMA, etc.)
let platform = PlatformDetection.current()
let size = dimensions |> List.fold (*) 1 |> fun s -> s * sizeof<'T>
// The developer doesn't need to know about the underlying memory model
let buffer = MemoryManager.allocateOptimal<'T>(size, platform)
Tensor<'T>(buffer, dimensions)
// Matrix multiplication with hardware acceleration
let matmul (a: Tensor<float32>) (b: Tensor<float32>) : Tensor<float32> =
// Automatically selects best implementation:
// - CXL-aware for systems with CXL memory
// - NUMA-optimized for multi-socket systems
// - GPU-accelerated when available
// - Fallback to optimized CPU implementation
Operations.createMatmul platform a b |> Operations.execute
let modelTraining() =
// Create tensors without worrying about memory placement
let weights = Furnace.tensor<float32>([1024; 1024])
let input = Furnace.tensor<float32>([128; 1024])
// Perform matrix multiplication - hardware details abstracted away
let output = Furnace.matmul weights inputA C++ tensor library might detect CXL at runtime and allocate appropriately, but the type signature of matmul remains unchanged: it accepts pointers and returns pointers. The programmer has no compile-time assurance that the tensors reside in compatible memory pools. A Rust tensor library might add lifetime annotations, but lifetimes track temporal validity, not spatial residency. When CXL introduces multiple memory pools with different access characteristics, neither language’s type system can express the constraints.
Fidelity’s actor model maps onto CXL architectures: each memory pool corresponds to an actor domain. Actors own their memory regions and communicate through message passing with explicit capabilities. When an actor in the CPU domain shares a tensor with an actor in the GPU domain, it sends a capability that encodes both ownership transfer and residency requirements. The capability’s type records whether the buffer is CXL-coherent, and the compiler checks the receiving actor’s accesses against that property. This capability-based ownership model expresses multi-pool memory constraints that fall outside what Rust’s borrow checker can track.
Memory Access Patterns Library
The Memory Access Patterns library provides constructs for common memory access scenarios:
module MemoryPatterns =
// Producer-consumer pattern with zero-copy semantics
let producerConsumer<'T> (producer: unit -> 'T[]) (consumer: 'T[] -> unit) =
use buffer = SharedRingBuffer.create<'T>(capacity = 1024)
// Start producer and consumer tasks
let producerTask =
async {
while true do
let data = producer()
// Zero-copy operation regardless of whether using CXL or not
buffer.EnqueueBatch(data)
}
let consumerTask =
async {
while true do
// Dequeue with zero-copy semantics
let data = buffer.DequeueBatch(batchSize = 128)
consumer(data)
}
// Run both tasks
[producerTask; consumerTask] |> Async.Parallel |> Async.IgnoreNUMA-Aware Memory Management
Fidelity’s platform configuration can include NUMA topology awareness, enabling optimal memory placement. NUMA-aware programming in C++ typically involves libnuma calls scattered throughout the codebase, with no type-level connection between where memory was allocated and where it is accessed. The programmer might allocate on NUMA node 0 and accidentally schedule the accessing thread on node 3. The code runs correctly but performs poorly, and nothing in the type system warns of the mismatch. Rust’s type system cannot express NUMA affinity: an allocation’s type carries no information about which node backs it.
Fidelity encodes NUMA topology in the platform configuration and carries allocation hints through the type system:
type NumaTopology = {
NodeCount: int
NodeDistances: int[,] // Distance matrix
CXLNodes: int list // NUMA nodes that represent CXL memory
}
let withNumaTopology (topology: NumaTopology) (config: PlatformConfig) =
{ config with NumaTopology = Some topology }
let allocateNuma<'T> (size: int<bytes>) (config: PlatformConfig) =
match config.NumaTopology with
| Some topology when topology.CXLNodes.Length > 0 ->
// Prioritize CXL memory for large buffers
if size > 1024L<bytes> * 1024L * 512L then
let cxlNode = topology.CXLNodes |> List.head
BAREWire.allocateOnNode<'T>(size, cxlNode)
else
// Use local NUMA node for smaller allocations
let localNode = getCurrentNumaNode()
BAREWire.allocateOnNode<'T>(size, localNode)
| Some topology ->
// Standard NUMA allocation strategy
let localNode = getCurrentNumaNode()
BAREWire.allocateOnNode<'T>(size, localNode)
| None ->
// Fall back to default allocation
BAREWire.allocate<'T>(size)High-Level NUMA Abstractions
Application code can be NUMA-aware without interacting directly with topology details:
type NumaAwareCollection<'T> =
static member Create(initialCapacity: int) : NumaAwareCollection<'T> =
// Internal implementation handles NUMA topology detection
// and optimal data placement
let platform = PlatformDetection.current()
NumaAwareCollection<'T>(initialCapacity, platform)
member this.Add(item: 'T) : unit =
// Placement logic hidden from developer
this.Internal.AddToOptimalNode(item)
// Parallel operations automatically respect NUMA topology
member this.ForAll(action: 'T -> unit) : unit =
// Executes the action in parallel across NUMA domains
this.Internal.NumaTopology(action)Resizable BAR for GPU Memory Access
Resizable BAR allows the CPU to map the entire GPU framebuffer into its address space, enabling direct access without staging buffers. C++ CUDA code can use Resizable BAR through unified memory APIs, but the programmer must still track whether a pointer refers to CPU memory, GPU memory, or unified memory. The type is always void* or T*. A function that expects GPU-resident data might receive a CPU pointer and fail silently or crash. Rust’s gpu-allocator crate improves matters somewhat, but the ownership model still cannot distinguish memory residency.
Our BAREWire technology can take advantage of Resizable BAR to enable zero-copy operations with GPU memory, with residency encoded in the type:
module BAREWire.GPU =
// Check if Resizable BAR is supported
let isResizableBarSupported() =
let pciDir = "/sys/bus/pci/devices/"
let gpuDevices = findGPUDevices(pciDir)
gpuDevices |> List.exists (fun dev ->
let resizableBarPath = /$"{pciDir}{dev}/resizable_bar"
if File.Exists(resizableBarPath) then
let content = File.ReadAllText(resizableBarPath).Trim()
content = "1" || content = "enabled"
else
false
)
// Create zero-copy buffer using Resizable BAR
let createGpuZeroCopyBuffer<'T> (size: int<bytes>) =
if isResizableBarSupported() then
let gpuMem = allocateGpuMemory<'T>(size, MemoryFlag.CPUAccessible)
{
Address = gpuMem.address
Size = size
Layout = MemoryLayout.getOptimized<'T>()
MemoryType = MemoryType.GPUResizableBAR
}
else
let gpuMem = allocateGpuMemory<'T>(size, MemoryFlag.Default)
{
Address = gpuMem.address
Size = size
Layout = MemoryLayout.getOptimized<'T>()
MemoryType = MemoryType.GPUStandard
}Transparent Hardware Acceleration
The Accelerate module wraps Resizable BAR handling and memory management behind array-level operations:
module Accelerate =
let map<'T, 'U> (mapping: 'T -> 'U) (input: 'T[]) : 'U[] =
// Under the hood: Uses Resizable BAR when available,
// falls back to explicit transfers when needed
let platform = PlatformDetection.current()
let kernel = Kernel.fromFunc mapping
// Execute with optimal memory strategy
GpuExecutor.execute kernel input platform
let filter<'T> (predicate: 'T -> bool) (input: 'T[]) : 'T[] =
// GPU-accelerated filter operation
GpuExecutor.executeFilter predicate input platform
let processImage (image: Image) =
let brightened =
image.Pixels
|> Accelerate.map (fun pixel ->
{ R = min 255 (pixel.R * 1.2);
G = min 255 (pixel.G * 1.2);
B = min 255 (pixel.B * 1.2) })
|> Image.fromPixelArray image.Width image.HeightUnified Platform for Heterogeneous Memory
Fidelity’s platform configuration is a functional composition model that can be extended to include CXL, NUMA, and PCIe capabilities:
type MemoryInterconnectCapabilities = {
HasCXL: bool
CXLVersion: CXLVersion option
ResizableBAR: bool
NumaTopology: NumaTopology option
}
let withCXLSupport (version: CXLVersion) (config: PlatformConfig) =
let interconnect = defaultArg config.MemoryInterconnect
{ HasCXL = false; CXLVersion = None; ResizableBAR = false; NumaTopology = None }
{ config with
MemoryInterconnect = Some { interconnect with HasCXL = true; CXLVersion = Some version } }
let withResizableBAR (config: PlatformConfig) =
let interconnect = defaultArg config.MemoryInterconnect
{ HasCXL = false; CXLVersion = None; ResizableBAR = false; NumaTopology = None }
{ config with
MemoryInterconnect = Some { interconnect with ResizableBAR = true } }
// A configuration for high-end data center with CXL 3.0
let dataCenter =
PlatformConfig.base'
|> withPlatform PlatformType.Server
|> withMemoryModel MemoryModelType.Abundant
|> withHeapStrategy HeapStrategyType.PerProcessGC
|> withCXLSupport CXLVersion.V3_0
|> withResizableBARConfiguration Presets and Automatic Detection
For most developers, even these configuration details are abstracted away through presets and automatic detection:
module AppConfig =
// Automatically detect and configure for current hardware
let autoDetect() =
let platform = PlatformDetection.current()
platform |> PlatformConfig.fromDetectedCapabilities
// Common configuration presets
let forDataScience() =
PlatformConfig.presets.DataScience
let forRealTimeProcessing() =
PlatformConfig.presets.LowLatency
let forEdgeDeployment() =
PlatformConfig.presets.EmbeddedHighPerformance
let startApplication() =
let config = AppConfig.autoDetect()
// Optoin to select from common presets with customization
let customConfig =
AppConfig.forDataScience()
|> withMemoryLimit (4L * 1024L * 1024L * 1024L) // 4GB limit
// Start application with optimal configuration
Application.start customConfigML Tensor Operations with CXL
In model training, parameter buffers need GPU access while the CPU modifies them, so they are candidates for CXL-coherent allocation:
let trainModelWithCXL (model: MLModel) (dataset: Dataset) (config: PlatformConfig) =
let parameterBuffer =
match config.MemoryInterconnect with
| Some { HasCXL = true } ->
// Use CXL memory for parameters as they need GPU access but are modified by CPU
BAREWire.CXL.allocateCoherentBuffer<float32>(model.ParameterCount * 4<bytes>)
| _ ->
// Fall back to standard memory with explicit transfers
BAREWire.allocate<float32>(model.ParameterCount * 4<bytes>)
// Create model with CXL-aware memory allocation
let cxlModel = {
Parameters = parameterBuffer
Architecture = model.Architecture
Config = config
}
// Train using data-parallel approach
DataParallel.train cxlModel dataset {
BatchSize = 128
Epochs = 10
Optimizer = Optimizer.Adam(LearningRate = 0.001)
}Clef Idioms for Deep Learning
For data scientists and ML engineers, Fidelity provides Clef-idiomatic libraries that keep memory management out of model code:
module DeepLearning =
let model = nn {
input [| 784 |]
dense 128 activation = Activation.ReLU
dense 64 activation = Activation.ReLU
dense 10 activation = Activation.Softmax
optimizer Adam {
learning_rate = 0.001
beta1 = 0.9
beta2 = 0.999
}
loss CrossEntropy
}
// Train model with automatic hardware optimization
let trainResult = model.Train(mnist, epochs = 10, batch_size = 128)
// The framework automatically:
// - Detects CXL availability and uses it if present
// - Optimizes memory placement across NUMA nodes
// - Leverages GPU acceleration with zero-copy where possible
// - Scales to multiple devices if available
let recognizeDigits() =
let mnist = Dataset.MNIST.load()
let model = nn {
// Model definition as above
}
// Train with automatic hardware optimization
let trainedModel = model.Fit(mnist.Train, epochs = 10)
// Evaluate
let accuracy = trainedModel.Evaluate(mnist.Test)
printfn "Test accuracy: %.2f%%" (accuracy * 100.0)BAREWire and CXL Memory Pooling
CXL 2.0 pools memory so a region can be assigned to one host at a time, which BAREWire can use for dynamic resource allocation. CXL 3.0 goes further with hardware-coherent memory sharing, where a single region is simultaneously accessible to multiple hosts and every host sees the most current data. CXL 3.1 refined the fabric manageability around it. That multi-host coherent share is the hardware realization of the virtual shared-memory space our RDMA note builds in software, and it makes distributed model training a memory-topology problem, with the data already resident where every host can reach it:
module BAREWire.MemoryPool =
let createPool (size: int<bytes>) (config: PlatformConfig) =
match config.MemoryInterconnect with
| Some { HasCXL = true; CXLVersion = Some v } when v >= CXLVersion.V2_0 ->
let fd = openCXLDevice()
let poolConfig = {
pool_id = 1
total_size = size |> int64
granularity = CXL_POOL_GRANULARITY_4K
}
let poolId = createCXLPool(fd, poolConfig)
{
PoolId = poolId
Size = size
Type = PoolType.CXL
}
| _ ->
{
PoolId = createStandardPool(size)
Size = size
Type = PoolType.Standard
}
let allocateFromPool<'T> (pool: MemoryPool) (size: int<bytes>) =
match pool.Type with
| PoolType.CXL ->
let fd = openCXLDevice()
let req = {
pool_id = pool.PoolId
size = size |> int64
}
let ptr = claimCXLMemory<'T>(fd, req)
{
Address = ptr
Size = size
Layout = MemoryLayout.getOptimized<'T>()
MemoryType = MemoryType.CXLPool
PoolId = Some pool.PoolId
}
| PoolType.Standard ->
let ptr = allocateFromStandardPool<'T>(pool.PoolId, size)
{
Address = ptr
Size = size
Layout = MemoryLayout.getOptimized<'T>()
MemoryType = MemoryType.StandardPool
PoolId = Some pool.PoolId
}The pooling case has now been measured on production silicon. Samsung’s CXL memory-pooling study (July 2026) aggregated CMM-D modules through a CXL switch into a 1 TB shared pool fronting NVIDIA Blackwell GPUs, and offloaded the LLM inference KV cache to it through vLLM and LMCache. The pool held approximately 92% of DRAM performance across eight GPUs while scaling capacity far past what host DRAM could hold. A DRAM-only baseline degraded once the KV cache outgrew it, paying recompute overhead the pool avoided. The result settles the open question these designs were written against: a coherent CXL pool can carry memory-intensive AI state at near-DRAM latency and past DRAM capacity.
Samsung’s stack decides KV-cache placement at runtime, through LMCache’s eviction and offload heuristics over an untyped pool. In our design the cache block’s pool residency is a compile-time coeffect, SharedBuffer<'T, cxl_mem> against unified, so which blocks live in the pool against GPU memory would be a placement the compiler proves against the value’s dimensional range rather than one the cache layer’s heuristics select at each step. The KV cache as a shared fabric region develops that inversion and its consequences for multi-agent inference.
Resource Pool Library
Application developers use these pooling capabilities through the Resources library:
module Resources =
type ResourcePool<'T> =
static member Create(initialCapacity: int) =
let platform = PlatformDetection.current()
let pool =
if platform.HasCXL && platform.CXLVersion.IsSome &&
platform.CXLVersion.Value >= CXLVersion.V2_0 then
CXLBackedPool<'T>(initialCapacity)
else
StandardPool<'T>(initialCapacity)
new ResourcePool<'T>(pool)
member this.Use(action: 'T -> 'R) : 'R =
use resource = this.Pool.Borrow()
action resource
member this.UseAsync(action: 'T -> Async<'R>) : Async<'R> =
async {
use! resource = this.Pool.BorrowAsync()
return! action resource
}
let processRequests() =
let bufferPool = Resources.ResourcePool<byte[]>.Create(initialCapacity = 10)
let processRequest (request: Request) =
bufferPool.Use(fun buffer ->
fillBufferWithRequestData(request, buffer)
transformData(buffer)
sendResponse(request.Id, buffer)
)Integration with the Olivier Actor Model
Fidelity’s Olivier actor model can be extended to derive process placement from CXL and NUMA topology:
module Olivier.Actors =
// Create an actor with awareness of memory topology
let createActor<'Msg, 'State> (initialState: 'State) (behavior: 'State -> 'Msg -> 'State) (config: PlatformConfig) =
// Determine optimal placement based on memory access patterns
let placement = match config.MemoryInterconnect, inferMemoryAccessPattern<'State, 'Msg>() with
| Some { NumaTopology = Some topo; HasCXL = true }, AccessPattern.GPUIntensive ->
let cxlNode = topo.CXLNodes |> List.head
ProcessPlacement.NumaNode cxlNode
| Some { NumaTopology = Some topo }, AccessPattern.MemoryIntensive ->
let localNode = getCurrentNumaNode()
ProcessPlacement.NumaNode localNode
| _ ->
ProcessPlacement.Default
// Create actor with optimal placement
Actor.create initialState behavior placementErlang-Inspired Concurrency with Clef Idioms
The developer-facing API for the actor system is idiomatic Clef:
module Olivier =
type CounterMsg =
| Increment
| Decrement
| Get of AsyncReplyChannel<int>
let createOptimalActor<'Msg> (config: PlatformConfig) (body: MailboxProcessor<'Msg> -> Async<unit>) =
let msgMemoryProfile = TypeAnalysis.getMemoryProfile<'Msg>()
match config.MemoryInterconnect, msgMemoryProfile with
| Some { NumaTopology = Some topo; HasCXL = true }, MemoryProfile.Large ->
// For large messages, use CXL memory if available
let node = topo.CXLNodes |> List.head
let options = MailboxProcessorOptions.Default
|> MailboxProcessorOptions.withNumaNode node
|> MailboxProcessorOptions.withZeroCopy true
MailboxProcessor.Start(body, options)
| Some { NumaTopology = Some topo }, _ ->
// Otherwise use local NUMA node
let node = getCurrentNumaNode()
let options = MailboxProcessorOptions.Default
|> MailboxProcessorOptions.withNumaNode node
MailboxProcessor.Start(body, options)
| _ ->
// Or fall back to standard MailboxProcessor
MailboxProcessor.Start(body)
let createCounter() =
createOptimalActor PlatformConfig.current (fun inbox ->
let rec loop count = async {
let! msg = inbox.Receive()
match msg with
| Increment ->
return! loop (count + 1)
| Decrement ->
return! loop (count - 1)
| Get reply ->
reply.Reply count
return! loop count
}
loop 0
)
let distributedProcessing() =
// Message type with zero-copy capability
type WorkerMsg =
| Process of ZeroCopyBuffer<float32>
| Shutdown
// Create worker
let createWorker() =
Olivier.createOptimalActor PlatformConfig.current (fun inbox ->
let rec loop() = async {
let! msg = inbox.Receive()
match msg with
| Process data ->
// Process data without copying
let result = processDataWithoutCopying data
return! loop()
| Shutdown ->
// Exit the loop
return ()
}
loop()
)
// Create worker pool
let workers = Array.init 10 (fun _ -> createWorker())
// Load-balancing round-robin dispatch
let dispatch (data: ZeroCopyBuffer<float32>) =
let index = Interlocked.Increment(&nextWorkerIndex) % workers.Length
workers.[index].Post(Process data)
// Process dataset with zero-copy where possible
dataset
|> Seq.iter (fun data ->
use buffer = ZeroCopyBuffer.fromArray data
dispatch buffer
)Fidelity and Next-Generation Memory Architectures
The integration of Fidelity and our BAREWire technology with CXL, NUMA, and PCIe optimizations is one approach to heterogeneous computing. By combining BAREWire’s zero-copy architecture with the hardware capabilities of CXL and Resizable BAR, Fidelity can deliver:
- True Zero-Copy Operations: Direct memory access across CPU and accelerators without transfers
- Optimal Memory Placement: Intelligent allocation across NUMA nodes including CXL memory
- Adaptive Memory Management: Graceful degradation when advanced hardware features aren’t available
- Type-Safe Memory Access: Units of measure ensuring memory safety without runtime overhead
- Platform-Specific Optimization: Memory strategies composed functionally to match hardware capabilities
C++ provides raw access to CXL through vendor libraries, but the type system does not record which memory pool a pointer refers to. Coherence domains and valid access patterns are equally untracked. The burden falls entirely on the programmer to maintain mental models of memory topology that grow increasingly complex as CXL deployments scale. Rust improves memory safety within a single coherent address space, but its ownership model predates multi-pool architectures. The borrow checker verifies lifetimes but cannot verify residency.
Fidelity’s approach anticipates the memory architectures that CXL makes possible. The actor model maps naturally to coherence domains: each actor owns its memory region and communicates through capabilities that encode both ownership and residency. Our PSG captures semantic information about data flow that enables automatic optimization of memory placement, and units of measure distinguish pool types at the type level. When the hardware provides multiple memory pools with different latency and bandwidth characteristics, Fidelity is prepared to use them safely. We anticipate this will give our users a significant advantage over projects constrained by toolchains designed for simpler memory models.
For application developers, these capabilities will eventually be exposed through Clef-idiomatic libraries that keep the language’s functional paradigm while drawing on advanced hardware features:
- Tensor Computing Library: For high-performance numerical operations
- GPU Acceleration Library: For transparent hardware acceleration
- Resource Management Library: For efficient pooling and sharing of resources
- Actor System Library: For distributed, fault-tolerant concurrency
- ML Framework: For deep learning with automatic hardware optimization
These libraries, and others like them, are intended to give application code the performance of memory technologies such as CXL without binding that code to specific hardware.
These capabilities target the next generation of heterogeneous computing, where the boundaries between different memory spaces are increasingly blurred by technologies like CXL. The pre-optimization approach of BAREWire is built to match the hardware coherency provided by CXL, giving high-performance native code the same foundation from data-center servers to edge deployments.
The systems programming community has long accepted that advanced memory architectures require advanced programming discipline. CXL tutorials warn developers to “carefully track which pointers point where” and “always verify coherence domain compatibility before access.” This guidance amounts to admitting that the toolchain cannot help. Our design takes the opposite premise. If the hardware provides multiple memory pools with different characteristics, the type system should encode those characteristics. If coherence domains constrain valid access patterns, the compiler should verify them. The cognitive burden that C++ and Rust place on developers working with CXL is not inherent to the problem. It reflects limitations in those languages’ type systems, and Fidelity’s type system is designed without those limitations.
CXL Fabric Observability
CXL.mem and CXL.cache move data along paths the operating system never observes. A peer read that crosses a coherence-domain boundary touches remote memory directly, and packet-oriented tools such as tcpdump and socket tracing are blind to it. The direct response in the field is wBPF (HCDS ‘25), a specialized eBPF runtime for CXL pooling systems that coordinates tracing across the compute nodes sharing a memory pool and captures rare memory and communication anomalies while holding telemetry overhead low. Related projects apply eBPF elsewhere: eGPU brings eBPF observability to inter-device GPU memory transfers, and TierBPF governs page-migration admission control in tiered memory that includes CXL. These attach un-typed probes reactively, sampling anomalies no static contract had ruled out.
Our design would invert that arrangement. The pool residency the type already carries, SharedBuffer<'T, cxl_mem> against unified against cpu_mem, is the same fact the coeffect discipline checks to admit an access at compile time. A CPU-local buffer reaching CXL-coherent code is caught at design time as a diagnostic, the very failure the C++ programmer discovers at runtime as a segfault or silent corruption. The runtime monitoring predicate would be the negation of the admissibility fact the compiler already discharged, derived rather than hand-authored and bolted on afterward. A kprobe or PMC probe on CXL.mem/CXL.cache peer transactions would then witness that the fabric behaved as proven, and the probe would watch exactly the transactions the type contract named.
This extends our BAREWire contract across a second boundary: the same schema-settled region that would cross the syscall boundary into the kernel would also cross a coherent interconnect, with the kernel probe as its witness. Observability would be a byproduct of the fabric type, verified where the compiler already reasoned, rather than the output of a separate telemetry program detecting anomalies after the fact.
The underlying technology, built on our “System and Method for Zero-Copy Inter-Process Communication Using BARE Protocol” (US 63/786,247), opens possibilities for AI systems that distribute computation across heterogeneous hardware while reducing the overhead traditionally associated with data movement. This software from SpeakEZ AI addresses distributed AI model training and heterogeneous computing.