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
38
39
40
#![allow(clippy::disallowed_methods)]
//! F081-F100: Performance Regression Falsification Tests
//!
//! Per spec: docs/specifications/archive/qwen2.5-coder-showcase-demo.md S9.4
//!
//! STATUS: IMPLEMENTED - Infrastructure verified, hardware tests gracefully skip
//!
//! These tests verify performance targets (2x llama.cpp) are met.
//! Tests requiring GPU hardware skip gracefully when unavailable.
//!
//! FALSIFICATION: If performance doesn't meet targets, optimization incomplete.
use std::time::Instant;
/// Check if CUDA is available
fn cuda_available() -> bool {
std::path::Path::new("/proc/driver/nvidia/version").exists()
|| std::process::Command::new("nvidia-smi")
.output()
.map(|o| o.status.success())
.unwrap_or(false)
}
/// Calculate coefficient of variation
fn calculate_cv(samples: &[f64]) -> f64 {
if samples.is_empty() {
return 0.0;
}
let mean: f64 = samples.iter().sum::<f64>() / samples.len() as f64;
if mean == 0.0 {
return 0.0;
}
let variance: f64 =
samples.iter().map(|x| (x - mean).powi(2)).sum::<f64>() / samples.len() as f64;
let std_dev = variance.sqrt();
(std_dev / mean) * 100.0
}
include!("includes/falsification_performance_throughput.rs");
include!("includes/falsification_performance_quality_validation.rs");