1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! GPU-Resident Feature Store
//!
//! Implements Section A.1 of the spec: GPU Memory Persistence Strategy
//! Phase 1: In-memory storage (trueno-db integration in Phase 2)
use anyhow::Result;
/// GPU-resident feature store
///
/// Phase 1: Simple in-memory storage
/// Phase 2: trueno-db for GPU-resident columnar storage
pub struct GPUHotStore {
// Feature dimensions
feature_count: usize,
commit_count: usize,
}
impl GPUHotStore {
/// Create new hot store
pub fn new() -> Result<Self> {
Ok(Self {
feature_count: 0,
commit_count: 0,
})
}
/// Get feature dimensions
pub fn dimensions(&self) -> (usize, usize) {
(self.commit_count, self.feature_count)
}
}
impl Default for GPUHotStore {
fn default() -> Self {
Self::new().unwrap()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_hot_store_creation() {
let store = GPUHotStore::new();
assert!(store.is_ok());
}
#[test]
fn test_dimensions_initial() {
let store = GPUHotStore::new().unwrap();
assert_eq!(store.dimensions(), (0, 0));
}
}