aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / crates / aien-kv-store / src / lib.rs
| 1 | // SPDX-License-Identifier: Apache-2.0 |
| 2 | // Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | |
| 16 | //! Persistent KV cache: versioned chunk identity, the 256-byte record header in |
| 17 | //! its 4096-byte region, validation, and the `KvStore` contract with a |
| 18 | //! deterministic fake adapter. Binding design: `docs/adr/0003-persistent-kv-identity-storage-contract-and-ownership.md`. |
| 19 | //! |
| 20 | //! `no_std` + `alloc` for identity, codec, validation, pinned views and the |
| 21 | //! trait. The `std` feature (default) adds the in-memory fake adapter. |
| 22 | |
| 23 | #![cfg_attr(not(feature = "std"), no_std)] |
| 24 | |
| 25 | extern crate alloc; |
| 26 | |
| 27 | pub mod coalesce; |
| 28 | pub mod error; |
| 29 | #[cfg(feature = "std")] |
| 30 | pub mod fake; |
| 31 | pub mod holder; |
| 32 | #[cfg(all(feature = "std", unix))] |
| 33 | pub mod host_fs; |
| 34 | pub mod identity; |
| 35 | pub mod index; |
| 36 | pub mod pin; |
| 37 | pub mod record; |
| 38 | #[cfg(feature = "std")] |
| 39 | pub mod seal; |
| 40 | #[cfg(all(test, feature = "std", unix))] |
| 41 | mod seal_budget_tests; |
| 42 | #[cfg(all(test, feature = "std", unix))] |
| 43 | mod seal_nonce_tests; |
| 44 | pub mod store; |
| 45 | pub mod validate; |
| 46 | #[cfg(feature = "std")] |
| 47 | pub mod worker; |
| 48 | |
| 49 | pub use error::KvError; |
| 50 | pub use identity::{ |
| 51 | chunk_chain, chunk_key, BackendFormat, ChunkKey, ComputeConfig, EngineConfig, EngineIdentity, |
| 52 | HiddenAct, KvDtype, LayoutStrides, NamespaceFields, NamespaceId, RopeScaling, WeightFormat, |
| 53 | }; |
| 54 | pub use pin::{HolderGuard, HolderHandle, PinnedDest, PinnedSource}; |
| 55 | pub use record::{ |
| 56 | payload_root, segment_count, ChunkHeader, RecordHeader, HEADER_LEN, HEADER_REGION_LEN, MAGIC, |
| 57 | MAX_SEGMENTS, PAYLOAD_OFFSET, SEGMENT_TABLE_OFFSET, |
| 58 | }; |
| 59 | pub use store::{ |
| 60 | CancelOutcome, Capacity, Completion, DrainReport, Incarnation, JobId, JobStage, KvStore, |
| 61 | LandingHolder, PinToken, PublishOutcome, RecoveryProgress, StoreState, Terminal, UnfinishedJob, |
| 62 | }; |
| 63 | pub use validate::validate_record; |