#memory-allocator #transfer #gpu #coordinator #graphics

memkit-co

CPU-GPU memory coordination for the memkit ecosystem

4 releases

0.2.0-beta.1 Feb 2, 2026
0.1.1-beta.1 Feb 2, 2026
0.1.0-beta.1 Feb 2, 2026
0.1.0-alpha.1 Dec 27, 2025

#556 in Memory management


Used in memkit-bevy

MPL-2.0 license

280KB
6K SLoC

◈ MEMKIT CO ◈

[ HETEROGENEOUS MEMORY COORDINATION ENGINE ]

Crates.io Documentation License


 ██████╗  ██████╗ 
██╔════╝ ██╔═══██╗
██║      ██║   ██║
██║      ██║   ██║
╚██████╗ ╚██████╔╝
 ╚═════╝  ╚═════╝ 

"The bridge between deterministic logic and hardware execution."

The coordination engine of the Memkit ecosystem. Seamlessly synchronizes CPU allocations with GPU resource lifecycles through automated staging and pipelined buffering.

QUICK STARTADVANTAGEARCHITECTURE


◈ THE COORDINATION ADVANTAGE

Feature Manual Sync Memkit CO Impact
Transfers Ad-hoc / Risky Batched Zero stalls
Buffering Custom boiler Native Triple Max throughput
Safety Sync barriers Async-Lockfree Thread safety
Workflow Fragile Structured Logic-focused

◈ FEATURES

┌─────────────────────────────────────────────────────────────────────────┐
│  ◆ PIPELINING   │  Native support for double and triple buffering.      │
│                │  Smooth frame delivery without CPU/GPU contention.      │
├─────────────────────────────────────────────────────────────────────────┤
│  ◆ TELEPORT     │  Allocations on the CPU frame arena can be "staged"    │
│                │  for automatic mirroring to GPU device memory.          │
├─────────────────────────────────────────────────────────────────────────┤
│  ◆ SCHEDULING   │  Automated transfer coalescing. Minimizes driver       │
│                │  overhead by batching many small uploads.               │
└─────────────────────────────────────────────────────────────────────────┘

◈ QUICK START

use memkit_co::{MkCoordinator, CoordinatorConfig, BufferingMode};
use memkit_gpu::DummyBackend;

// Initialize Triple Buffering Coordinator
let config = CoordinatorConfig {
    buffering: BufferingMode::Triple,
    ..Default::default()
};
let mut coordinator = MkCoordinator::new(DummyBackend::new(), config);

// Single-call "Upload & Forget"
let vertices: &[f32] = &[0.0, 0.5, 1.0, -0.5, -0.5, 1.0];
let gpu_buffer = coordinator.upload_slice(vertices).unwrap();

// Structured Frame Workflow
coordinator.begin_frame();
{
    let transform = coordinator.frame_alloc::<[f32; 16]>();
    *transform = [1.0; 16];
    
    // Automatically stage for GPU at end of frame
    coordinator.stage_for_upload(transform);
}
coordinator.end_frame().unwrap(); // Batch transfers & rotate buffers

◈ ARCHITECTURE

graph LR
    CPU([memkit Core]) --> Manager[memkit-co Manager]
    Manager --> GPU([memkit-gpu Backend])
    GPU -- Completion --> Manager
    Manager -- Stats --> CPU

◈ LICENSE

Licensed under the Mozilla Public License 2.0.


[ Part of the ◈ MEMKIT ◈ Ecosystem ]

Dependencies

~0.4–2.2MB
~43K SLoC