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
//! Recurrent engine stub (Mamba / RWKV).
//!
//! Fail-closed at load via [`crate::capability`] until a real state-machine
//! serve path lands. This module defines the engine shape so future work
//! has a single place to grow without touching GQA kernels.
use thiserror::Error;
#[derive(Debug, Error)]
#[error("recurrent engine not implemented for architecture {arch}")]
pub struct RecurrentUnavailable {
pub arch: String,
}
/// Placeholder for Mamba/RWKV serve. Calling any method returns
/// [`RecurrentUnavailable`].
pub struct RecurrentEngine {
pub arch: String,
}
impl RecurrentEngine {
pub fn reject(arch: &str) -> Result<(), RecurrentUnavailable> {
Err(RecurrentUnavailable {
arch: arch.to_string(),
})
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn reject_is_fail_closed() {
assert!(RecurrentEngine::reject("mamba2").is_err());
}
}