fixed dangerous states to be applied

This commit is contained in:
2026-02-27 00:59:36 +01:00
parent 4ed7228355
commit 4c4026a600
9 changed files with 116 additions and 29 deletions

View File

@@ -7,6 +7,7 @@
use serde::{Serialize, Deserialize};
use std::collections::HashMap;
use std::path::PathBuf;
use tracing::warn;
pub mod formatters;
@@ -180,6 +181,18 @@ impl OptimizerEngine {
}
}
let best_pl = if max_score > f32::MIN {
best_pl
} else {
profile.points.last().map(|p| p.power_w).unwrap_or(15.0)
};
// Safety Floor: Never recommend a TDP below 5W, as this bricks system performance.
if best_pl < 5.0 {
warn!("Heuristic suggested dangerously low PL1 ({:.1}W). Falling back to 15W safety floor.", best_pl);
return 15.0;
}
best_pl
}
}