organizational_intelligence_plugin/
gpu_store.rs

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