Treat thermal zones with never-changing readings as unavailable - #323
Open
HPoyisis wants to merge 2 commits into
Open
Treat thermal zones with never-changing readings as unavailable#323HPoyisis wants to merge 2 commits into
HPoyisis wants to merge 2 commits into
Conversation
Some firmware exposes an ACPI thermal zone that is not wired to a real sensor and always reports the same fixed value (e.g. 301 K / 27.85 C). Track whether performance counter readings have ever varied since startup; after 24 identical consecutive reads (~2 minutes at the current fetch cadence) treat the zone as a placeholder and hide the temperature instead of showing a misleading constant. Detection is self-correcting: if a reading later changes, the temperature is shown again permanently. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…available The whole-Kelvin Temperature counter can legitimately stay flat for minutes on an idle machine, which would misclassify a real sensor as a placeholder. The High Precision Temperature counter (0.1 K granularity) jitters on live sensors even at idle, so prefer it for variation tracking; fall back to the Temperature counter values when it is not available. The tracking source is fixed at construction so readings are never compared across the two counters' different scales. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context of Contribution
Summary of the Proposal
On some machines the ACPI thermal zone exposed through the "Thermal Zone Information" performance counter is not wired to a real sensor and always reports a fixed placeholder value. On a GIGABYTE AERO 15 KC (Windows 11), the only zone
\_TZ.TZ00constantly reports 301 K (27.85 °C) even under sustained full CPU load — while the real CPU package temperature at the same moment was 88 °C (verified with LibreHardwareMonitor). RunCat 365 therefore permanently shows a misleading ~28 °C in the notify icon tooltip and the system info menu.This PR tracks whether the thermal zone readings have ever changed since startup. After 24 identical consecutive reads (about 2 minutes at the current fetch cadence of one temperature update per 5 seconds), the zone is treated as a placeholder and the temperature entry is hidden — the same behavior as on machines that expose no thermal zone at all. Detection is self-correcting: readings are still taken on every update, and if any value ever changes, the temperature is shown again permanently.
To keep false positives out, variation is tracked on the "High Precision Temperature" counter of the same category (0.1 K granularity) when it is available: a live sensor jitters at that resolution even when the whole-Kelvin "Temperature" counter legitimately stays flat on an idle machine. When the high-precision counter is unavailable the tracking falls back to the Temperature counter values; the tracking source is fixed at construction so readings are never compared across the two counters' different scales. (On the affected machine the placeholder zone reports both counters bit-identical forever: Temperature = 301, High Precision = 3010.)
Residual trade-off: on firmware whose high-precision counter is just a ×10 copy of the whole-Kelvin value, a genuinely constant sensor could still be hidden after the 2-minute window until its reading first drifts. The failure mode is temporary hiding of a stale-looking value rather than showing wrong data, and it heals permanently on the first observed change.
Verified on the affected machine: with this change the placeholder zone is hidden after 2 minutes; the change builds with 0 errors and no new warnings, adds no dependencies, and does not alter behavior on machines whose thermal zones report real (varying) values.
Reason for the new feature
N/A (bug fix).
Checklist