pub const ESP32_STATE_BYTES: usize = 279;
pub const ESP32_LOOKUP_NS: u64 = 8;
pub const ESP8266_LOOKUP_NS: u64 = 8;
pub const NEON_C_VS_RUST_SPEEDUP: f64 = 17.5;
pub const CARAPACE_HASH_NS: u64 = 128;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn esp32_state_under_300_bytes() {
assert!(
ESP32_STATE_BYTES < 300,
"ESP32 state must fit in <300 bytes, got {ESP32_STATE_BYTES}"
);
}
#[test]
fn esp32_state_is_279_bytes() {
assert_eq!(ESP32_STATE_BYTES, 279);
}
#[test]
fn esp32_lookup_under_10_ns() {
assert!(
ESP32_LOOKUP_NS < 10,
"ESP32 lookup must be <10ns, got {ESP32_LOOKUP_NS}ns"
);
}
#[test]
fn esp8266_lookup_matches_esp32() {
assert_eq!(
ESP8266_LOOKUP_NS, ESP32_LOOKUP_NS,
"ESP8266 and ESP32 lookup should both be 8ns"
);
}
#[test]
fn neon_c_beats_rust_by_17_5x() {
assert!(
(NEON_C_VS_RUST_SPEEDUP - 17.5).abs() < 0.1,
"NEON C vs Rust speedup must be 17.5x"
);
}
#[test]
fn carapace_hash_under_150_ns() {
assert!(
CARAPACE_HASH_NS < 150,
"Carapace hash must be <150ns, got {CARAPACE_HASH_NS}ns"
);
}
#[test]
fn carapace_hash_is_128_ns() {
assert_eq!(CARAPACE_HASH_NS, 128);
}
}