Repository navigation
fix(svk): skip the self-heal when the battery read fails (0.2.5, 0.1.14) - #261
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
With control on, a failed battery-power read (34755) made the Solis self-heal raise: math.abs(nil) in 50-125k-svk, nil - committed in 50-125k-svk-slew. The whole poll failed, so one missed read cost all telemetry for that poll. The check now skips a poll with no battery reading and starts its count again. With a reading it works as before. 50-125k-svk-ac-slew already checked its AC reading. Not checked on hardware. Refs #252 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]>
frahlg
force-pushed
the
svk-selfheal-nil
branch
from
November 22, 2026 09:38
0df887b to
3aa944b
Compare
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.
With control on, a failed battery-power read (34755) made the Solis self-heal check raise an error inside
driver_poll:50-125k-svk:math.abs(bat_w)withbat_w = nil: "bad argument chore: harden public driver repository #1 to 'abs'".50-125k-svk-slew:bat_w - slew_committed_w: "attempt to perform arithmetic on a nil value".The whole poll failed, so one missed read cost all telemetry for that poll, not only the self-heal. I found this while working on #252.
Refs #252
Change
50-125k-svk0.2.5: the check needs a battery reading. Without one it falls to the existingelsebranch, which resets the count of disagreeing polls.50-125k-svk-slew0.1.14:err_wis nil without a reading, and the check then takes the sameelsebranch.self_heal_prev_committed_wstill updates every poll, as before.50-125k-svk-ac-slewis unchanged: its self-heal already checksac_w ~= nil.A poll with no reading is no evidence either way, so the run of disagreeing polls starts again. A self-heal can then fire only on consecutive readings, which is what
SELF_HEAL_RUN_REQUIREDmeans. With a reading, the self-heal works as before. No write, setpoint, slew or arm logic changed.Tests
drivers/tests/lua_harness/test_svk_selfheal_nil.lua, wrapped bydrivers/tests/test_svk_selfheal_nil.py, for both drivers. With control armed at 0 W:driver_polldoes not raise, nothing is written, and batteryWis not invented.origin/mainthe test fails at step 1 for both drivers with the errors quoted above.make test-driver ID=50-125k-svkandID=50-125k-svk-slew: pass. Absent-register and refused-write probes: settled.make check: 5054 passed, 929 skipped.#252 touches the same two files and bumps them to 0.3.0 and 0.2.0. Whichever merges second needs a rebase. Its version bumps and CHANGELOG entry already sit above these.
Not verified on hardware.
🤖 Generated with Claude Code