metrics: stale work is the batch in flight at cancellation, not the whole search #15
Reference in New Issue
Block a user
Delete Branch "metrics/stale-semantics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Correction to #14, found on the first hour of live data.
miner_stale_hashes_totalwas recorded in the QUIC loop for every result whose job id no longer matched the current one. That is every cancelled search, because a worker interrupted by a new job reports the whole search under the old id. On benjy it flagged 18.3 G of 24.7 G hashes as stale, 74 percent, which is the loop's notion of a stale result and not wasted work: those hashes were done while the job was current.The wasted work is the batch that completes after the job was superseded, at most one per job switch per worker. That is now recorded in the engine at the cancellation check, per device and kernel, and the loop-level accounting is gone. Expected value is about one batch per job, so with 1M batches at 144 MH/s roughly 7 ms of work per job switch. This is the number #6 trades against batch size.
Label change:
miner_stale_hashes_total{engine}becomesminer_stale_hashes_total{device, kernel}. The rulequantus:stale_hash_fraction:rate1hsums by instance and is unaffected.clippy, fmt and tests clean. The bench workflow runs on this PR since engine-gpu changed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CBgs2nSi4H2mdh8kD8vMX5
quantus-bench
20749c622bon benjy.hanzalova.internaltotal median: 143.99 MH/s (batch 1000000, 5 x 30s, engine gpu-wgpu)
--- resume miner ---
active