Repository navigation
fix(tune): floor the bench freq median to whole kHz — awk sci-notation tripped the #62 throttle guard - #282
Merged
Merged
Conversation
…n tripped the #62 throttle guard Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
VijitSingh97
enabled auto-merge (squash)
July 17, 2026 02:49
This was referenced Jul 17, 2026
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.
Summary
_medianaverages the middle pair for an even sample count, and awk's OFMT prints large non-integral results (kHz clocks ~4.6e6) in scientific notation (4.6275e+06). The consumer'sbf=${bf%.*}floor mangled that into4→ 0 MHz → the #62 throttle guard falsely rejected healthy candidates, sotune --benchsilently kept the seed baseline on real hardware.Fix per the issue: floor at the one producer whose values are large (the freq writer in
_xmrig_bench), viaawk '{printf "%d", $0+0}'—$0+0parses the sci-notation back to 4627500 and%dprints whole kHz._medianitself is unchanged (its other consumers — hashrate/watts — never exceed 1e6). The now-stale consumer comment updated; its.-floor kept as a harmless belt.Tests
_xmrig_benchfreq-write path and asserts the file contains4627500(noe+).Both verified red against the unfixed writer (
4.6275e+06/ falselythrottled: true), green after.make test: 1336 passed, 0 failed; shellcheck + shfmt clean.Closes #266
🤖 Generated with Claude Code