<div align="center">
# ◈ MEMKIT CO ◈
### `[ HETEROGENEOUS MEMORY COORDINATION ENGINE ]`
[](https://crates.io/crates/memkit-co)
[](https://docs.rs/memkit-co)
[](../LICENSE.md)
---
```
██████╗ ██████╗
██╔════╝ ██╔═══██╗
██║ ██║ ██║
██║ ██║ ██║
╚██████╗ ╚██████╔╝
╚═════╝ ╚═════╝
```
> *"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 START`](#◈-quick-start) • [`◈ ADVANTAGE`](#◈-the-coordination-advantage) • [`◈ ARCHITECTURE`](#◈-architecture)
</div>
---
## ◈ THE COORDINATION ADVANTAGE
| **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
```rust
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
```mermaid
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**.
---
<div align="center">
**[ Part of the ◈ MEMKIT ◈ Ecosystem ]**
</div>