1pub fn gpu_missing(detail: impl AsRef<str>) -> String {
5 format!(
6 "{}; falling back to bytecode / scalar CPU (no GPU this pass)",
7 detail.as_ref()
8 )
9}
10
11pub fn llm_missing(detail: impl AsRef<str>) -> String {
13 format!(
14 "{}; local model unavailable; consented remote is the only fallback and is not taken automatically",
15 detail.as_ref()
16 )
17}
18
19#[cfg(test)]
20mod tests {
21 use super::*;
22
23 #[test]
24 fn gpu_message_names_bytecode() {
25 let m = gpu_missing("gpu_init: no adapter");
26 assert!(m.contains("bytecode"));
27 assert!(m.contains("gpu_init"));
28 }
29
30 #[test]
31 fn llm_message_does_not_auto_remote() {
32 let m = llm_missing("Inference.load_model: not found");
33 assert!(m.contains("not taken automatically"));
34 assert!(m.contains("consented remote"));
35 }
36}