Skip to content

feature/ui-graphs-logging: graphs, CSV logging, driver diagnostics, i… - #6

Merged
manupawickramasinghe merged 6 commits into
masterfrom
feature/ui-graphs-logging
Jul 22, 2026
Merged

feature/ui-graphs-logging: graphs, CSV logging, driver diagnostics, i…#6
manupawickramasinghe merged 6 commits into
masterfrom
feature/ui-graphs-logging

Conversation

@manupawickramasinghe

Copy link
Copy Markdown
Member

…cons

Graphs & logging (HWiNFO "Show Graph" / "Start Logging"):

  • ui/graph_window.rs: per-sensor history line chart (deferred viewport, hand-painted autoscaled polyline + axis labels + live value); right- click a sensor row → Show/Hide Graph
  • logging.rs: CsvLogger (one column/sensor, one row/tick, UTF-8 BOM for Excel); Start/Stop toggle + red REC indicator in the Sensors toolbar; writes from the poll thread so UI never blocks on IO (+ unit test)

Sensor-zeros diagnosis:

  • sidecar emits a first-line meta object {lhm_version, is_elevated, ring0_report}; lhm_bridge.rs parses it; SensorSource::diagnostics() surfaces it in Settings → Driver Management with actionable guidance (not elevated → run as admin; driver blocked → PawnIO link)
  • NOTE: the all-cores-100% in the prior screenshot was REAL — World Community Grid (wcgrid) is maxing the CPU; not a bug

Robustness: sidecar now watches SENSORVIEW_PARENT_PID + broken-pipe and self-exits when the app dies (no more elevated orphan sidecars).

Icons/tidy: painted category glyphs (CPU/GPU/RAM/drive/NIC…) and vendor text badges (AMD/NVIDIA/Intel/Corsair…, trademark-safe) in the Sensors group bands.

Verified (demo source): cargo test 3/3; graph window renders a live autoscaled line; CSV log = header + N rows with correct values; Sensors window shows category + type icons and the REC toggle.

…cons

Graphs & logging (HWiNFO "Show Graph" / "Start Logging"):
- ui/graph_window.rs: per-sensor history line chart (deferred viewport,
  hand-painted autoscaled polyline + axis labels + live value); right-
  click a sensor row → Show/Hide Graph
- logging.rs: CsvLogger (one column/sensor, one row/tick, UTF-8 BOM for
  Excel); Start/Stop toggle + red REC indicator in the Sensors toolbar;
  writes from the poll thread so UI never blocks on IO (+ unit test)

Sensor-zeros diagnosis:
- sidecar emits a first-line meta object {lhm_version, is_elevated,
  ring0_report}; lhm_bridge.rs parses it; SensorSource::diagnostics()
  surfaces it in Settings → Driver Management with actionable guidance
  (not elevated → run as admin; driver blocked → PawnIO link)
- NOTE: the all-cores-100% in the prior screenshot was REAL — World
  Community Grid (wcgrid) is maxing the CPU; not a bug

Robustness: sidecar now watches SENSORVIEW_PARENT_PID + broken-pipe and
self-exits when the app dies (no more elevated orphan sidecars).

Icons/tidy: painted category glyphs (CPU/GPU/RAM/drive/NIC…) and vendor
text badges (AMD/NVIDIA/Intel/Corsair…, trademark-safe) in the Sensors
group bands.

Verified (demo source): cargo test 3/3; graph window renders a live
autoscaled line; CSV log = header + N rows with correct values; Sensors
window shows category + type icons and the REC toggle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

manupawickramasinghe and others added 5 commits July 22, 2026 18:27
Addresses the "sensors read zero" confusion (root cause: not elevated —
confirmed against the user's own HWiNFO CSV, which shows every value is
reachable; HVCI is disabled so PawnIO isn't needed):

- Sensors window shows a prominent amber banner when the bridge reports
  is_elevated=false, explaining that CPU package/per-core power, effective
  clocks, Tctl/Tdie, per-core temps and fan/voltage sensors need admin
- System Summary now fills previously-blank fields from CPUID:
  Codename ("Raphael (Zen 4)") + CPUID signature ("00A60F12") — both match
  HWiNFO exactly — plus a live Package Power row (sysinfo::cpuid_info /
  codename_for, covering AMD Zen 2–5 and Intel)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The elevation banner wrongly showed even when Run as administrator: it
relied on the sidecar's self-reported is_elevated, but the running
sidecar is the pre-diagnostics build (its file was locked by orphaned
elevated instances), so no meta line arrived and the code defaulted to
"not elevated".

Fix: detect elevation in the Rust app itself via OpenProcessToken +
GetTokenInformation(TokenElevation) (sysinfo::is_elevated), stored on
Shared. The sidecar is our child so it inherits our token — this is
authoritative regardless of sidecar version. Banner + Driver Management
tab now use it; the unused Diagnostics.elevated field is dropped.

Verified: non-elevated run shows the banner (correct); elevated run
hides it and the SMU sensors populate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The CI failed 3/3 with a cargo-packager manifest parse error: `resources`
was placed under [package.metadata.packager.windows], but that table only
accepts signing fields — `resources` is a top-level key. A parse error
failed every platform.

- Cargo.toml: move `resources` to the top-level packager table and make it
  a glob (`sidecar/publish/*.exe`) so it bundles the sidecar on Windows and
  resolves to nothing (no error) on Linux/macOS where it isn't published
- add a 1024px assets/icon.png so cargo-packager can generate proper
  Linux .desktop / macOS .icns icons (previously only a 32x32 was listed)
- logging.rs: CSV logger writes via start_in() + a Documents→Desktop→temp
  fallback that creates the dir; the unit test now uses the temp dir so it
  passes on headless runners without ~/Documents (the likely Linux/macOS
  `cargo test` failure)

Verified locally on Windows: `cargo packager --formats nsis` produces
sensorview_0.1.0_x64-setup.exe with the sidecar bundled; cargo test 3/3.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… W/0 MHz)

Root cause of "CPU clocks/power read 0 while VIDs work" even when elevated:
orphaned sidecar processes from a previous crash keep the WinRing0 driver /
AMD SMU open, and a freshly spawned sidecar then contends for it — zeroing
exactly the SMU-derived sensors (package/core power, effective clocks).

LhmBridge::spawn now force-kills any existing sensorview-bridge.exe before
starting its own (taskkill /F /IM, Windows) and waits briefly for the driver
to release. Run elevated, this also clears elevated orphans. Combined with the
existing parent-PID/broken-pipe watchdog, orphans no longer accumulate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… icons

- Diagnose the real "0 W / 0 MHz" cause: Windows' vulnerable-driver
  blocklist (VulnerableDriverBlocklistEnable=1, on by default) blocks
  WinRing0, so LHM's driver can't load even when elevated. Confirmed the
  bundled LHM 0.9.6 supports PawnIO (PawnIODriver/PawnIOModule).
- Sensors window now shows a second banner when elevated but CPU
  clock/power sensors are all zero: "kernel driver blocked — install
  PawnIO" with a link to pawnio.eu (driver install stays a user action).
- Main window device tree: painted per-device icons (computer / CPU /
  motherboard / RAM / GPU / drive / network) replacing plain bullets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@manupawickramasinghe
manupawickramasinghe merged commit 1fc6009 into master Jul 22, 2026
@manupawickramasinghe
manupawickramasinghe deleted the feature/ui-graphs-logging branch July 22, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants