Compare commits

...
2 Commits
Author SHA1 Message Date
noahandClaude Opus 4.8 8deecf3558 fix(gui): paused/stopped miners shown as broken (red) instead of paused (blue)
A miner an operator has stopped (e.g. 10.4.1.122, VNish miner_state "stopped" ->
OperatingState::Stopped) was read as broken: red hashboards and counted under "not
hashing" instead of "Paused".

Two causes:
1. is_paused() only matched the literal "pause" substring, so "Stopped"/"Stopping"/
   "Suspended" -- every other firmware's word for an intentional, resumable halt --
   fell through to not-paused. Now matches pause/stop/suspend (Error stays broken).
2. encode_component_health applied the paused-blue treatment to hashboards only
   (round 19 #19), so a paused miner's idle fans/power still rendered red. A stopped
   miner's off components are expected, not faults: colour every reported component
   blue when paused (an undetected/Unreachable one still stays grey -- "not present"
   is not "paused").

Verified live against 10.4.1.122 on a headless build: the row now shows all-blue
health (power grey, honestly unreachable) and counts under the Paused KPI, where it
previously showed red boards + "not hashing".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-24 13:08:18 -06:00
alkane-ci 3a6a190ce1 ci: refresh README badges [skip release] 2026-09-24 16:25:36 +00:00
4 changed files with 54 additions and 29 deletions
+9 -9
View File
@@ -1,11 +1,11 @@
{
"bench_parse_line_near_max_addrs": 11524996.0,
"bench_parse_targets_many_ranges_near_cap": 249042410.0,
"bench_render_cells": 23978036.0,
"bench_sort_by_each_column": 6301818.0,
"bench_targets_to_cidrs_large_range": 1660473.0,
"bench_upsert_cold_start_population": 51907853.0,
"bench_view_pipeline": 824155.0,
"bench_view_pipeline_default_sort": 2048491.0,
"bench_view_pipeline_with_filter": 1358661.0
"bench_parse_line_near_max_addrs": 5695489.0,
"bench_parse_targets_many_ranges_near_cap": 191917212.0,
"bench_render_cells": 18308797.0,
"bench_sort_by_each_column": 3640355.0,
"bench_targets_to_cidrs_large_range": 2033018.0,
"bench_upsert_cold_start_population": 55612455.0,
"bench_view_pipeline": 678730.0,
"bench_view_pipeline_default_sort": 1194398.0,
"bench_view_pipeline_with_filter": 1310830.0
}
+5 -5
View File
@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="147.5" height="20" role="img" aria-label="bench: +13.2% vs prev">
<title>bench: +13.2% vs prev</title>
<svg xmlns="http://www.w3.org/2000/svg" width="147.5" height="20" role="img" aria-label="bench: -19.6% vs prev">
<title>bench: -19.6% vs prev</title>
<linearGradient id="s" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
@@ -7,13 +7,13 @@
<clipPath id="r"><rect width="147.5" height="20" rx="3" fill="#fff"/></clipPath>
<g clip-path="url(#r)">
<rect width="44.5" height="20" fill="#555"/>
<rect x="44.5" width="103.0" height="20" fill="#fe7d37"/>
<rect x="44.5" width="103.0" height="20" fill="#4c1"/>
<rect width="147.5" height="20" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
<text x="22.2" y="15" fill="#010101" fill-opacity=".3">bench</text>
<text x="22.2" y="14">bench</text>
<text x="96.0" y="15" fill="#010101" fill-opacity=".3">+13.2% vs prev</text>
<text x="96.0" y="14">+13.2% vs prev</text>
<text x="96.0" y="15" fill="#010101" fill-opacity=".3">-19.6% vs prev</text>
<text x="96.0" y="14">-19.6% vs prev</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 955 B

After

Width:  |  Height:  |  Size: 952 B

+22 -2
View File
@@ -1046,8 +1046,20 @@ impl MinerRow {
/// counted as operator-paused when it is not currently mining and its raw
/// operating-state string says so (case-insensitively), shared by the live
/// scan (`scan::to_row`) and the fixtures/tests.
///
/// "Paused" covers every intentional, resumable halt -- operator- or
/// firmware-initiated -- not just the literal "Paused" state: a miner an operator
/// stopped is halted on purpose, not broken, so it must read blue in Health and
/// count under the Paused KPI rather than "not hashing". Firmwares spell it
/// differently: VNish reports "stopped", Braiins uses Paused/Stopped/Suspended,
/// others "paused". A failure is a distinct Error state (never matched here) and
/// still reads as broken (round 19 #19).
pub fn is_paused(operating_state: &str, is_mining: bool) -> bool {
!is_mining && operating_state.to_lowercase().contains("pause")
if is_mining {
return false;
}
let s = operating_state.to_lowercase();
s.contains("pause") || s.contains("stop") || s.contains("suspend")
}
/// The typed-confirmation gate for the irreversible firmware-flash action: the
@@ -3020,8 +3032,16 @@ mod tests {
fn is_paused_detection() {
assert!(is_paused("Paused", false));
assert!(is_paused("PAUSED (manual)", false));
assert!(!is_paused("Paused", true), "mining overrides an even stale 'paused' state string");
// Intentional halts other firmwares report: VNish "Stopped" (miner_state
// "stopped"), Braiins "Suspended", a "Stopping" transition (round 19 #19 /
// 10.4.1.122 read as broken before this).
assert!(is_paused("Stopped", false), "an operator-stopped miner is paused, not broken");
assert!(is_paused("Stopping", false));
assert!(is_paused("Suspended", false));
assert!(!is_paused("Stopped", true), "mining overrides a stale 'stopped' state string");
assert!(!is_paused("Mining", false));
assert!(!is_paused("Error", false), "a failure is broken, not paused");
assert!(!is_paused("Idling", false), "plain idle is not an explicit halt");
assert!(!is_paused("", false));
}
+18 -13
View File
@@ -439,27 +439,32 @@ fn encode_component_health(
max_boards: usize,
) -> String {
let mut segs: Vec<Segment> = Vec::new();
segs.push((Some(health_color(pal, r.power_health())), SHAPE_BOLT.to_string()));
segs.push((Some(health_color(pal, r.control_health())), SHAPE_BRAIN.to_string()));
// A paused/stopped miner is intentionally halted, not broken: every component
// it reports as idle (power off, fans spun down, boards not hashing) is
// expected, not a fault, so colour each one blue instead of its red/amber
// health colour -- otherwise a paused miner reads as broken (round 19 #19,
// extended: originally boards only, but idle fans/power still showed red).
// A genuinely undetected component (Unreachable) stays grey: even when paused,
// "not present" is not "paused".
let col = |h: crate::model::CompHealth| {
if r.paused && h != crate::model::CompHealth::Unreachable {
pal.accent
} else {
health_color(pal, h)
}
};
segs.push((Some(col(r.power_health())), SHAPE_BOLT.to_string()));
segs.push((Some(col(r.control_health())), SHAPE_BRAIN.to_string()));
let fans = r.fan_healths();
for h in &fans {
segs.push((Some(health_color(pal, *h)), SHAPE_FAN.to_string()));
segs.push((Some(col(*h)), SHAPE_FAN.to_string()));
}
for _ in fans.len()..max_fans {
segs.push((None, SHAPE_GAP.to_string()));
}
let boards = r.board_healths();
for h in &boards {
// A paused miner's boards are intentionally idle, not faulty: show every
// detected board blue instead of its (red) health colour, while every
// other component keeps its normal colour. A genuinely undetected board
// stays grey (round 19 #19).
let color = if r.paused && *h != crate::model::CompHealth::Unreachable {
pal.accent
} else {
health_color(pal, *h)
};
segs.push((Some(color), SHAPE_CHIP.to_string()));
segs.push((Some(col(*h)), SHAPE_CHIP.to_string()));
}
for _ in boards.len()..max_boards {
segs.push((None, SHAPE_GAP.to_string()));