--thermal: Return data instead of only printing it #369
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 349 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.350
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #369"
general
weight: 0.35
blackdragoon26
Towards #357.
print_thermalandprint_thermal_thresholdsdid the EC reads, the decoding and the formatting in one function, so nothing but the commandline tool could get at the data.This splits them in two:
| Read the data | Print it |
| --- | --- |
|
get_thermal(&CrosEc) -> EcResult<ThermalInfo>|print_thermal(&CrosEc)||
get_thermal_thresholds(&CrosEc) -> Option<Vec<ThermalThresholds>>|print_thermal_thresholds(&CrosEc) -> Option<()>|The print functions keep their signatures and their output, they just call the getter and format what comes back.
The decoded values get types instead of raw memmap bytes:
TempSensorispubnow. It was private, so nothing outsidepower.rscould name a temperature reading even where one was already being returned.FanSpeed::{Rpm, Stalled, NotPresent}instead of comparing against0xFFFE/0xFFFFat print time.Nonerather than the string"-".Option<ApThrottleInfo>with real bools.So a consumer can now do:
One intentional behaviour change
print_thermalused.unwrap()on both memmap reads, so a failed read panicked. It now printsFailed to read thermal information: ...and returns.Verified
cargo fmt --all -- --checkis clean, and so iscargo clippy -p framework_lib -- -D warningscargo checkpasses for Linux, Windows, FreeBSD and UEFI (--features uefi)cargo docwithRUSTDOCFLAGS=-Dwarningsis cleancargo test -p framework_lib: 45 passed, 0 failedpower.rshad none before.Two things I could not check locally, both because I develop on macOS, which this project doesn't target: clippy on
framework_tool(itslibusb1-sysdependency needs a Linux C toolchain to cross-compile) and the EC reads themselves, since no machine here is a Framework one. CI covers the first. For the second, worth running--thermaland--thermalgetonce on real hardware before merging.Scope
I stopped at thermals because you said that file was the messiest and @mysticmalard mentioned it was where they were headed next. The same treatment still applies to
print_sensors,print_switches,get_and_print_power_info,get_and_print_pd_info,get_and_print_cypd_pd_infoand theprint_fw{12,13,16}_inputdeck_statusmethods.Happy to keep going if this shape looks right to you.