Skip to content

fix(svk): skip the self-heal when the battery read fails (0.2.5, 0.1.14) - #261

Merged
frahlg merged 1 commit into
mainfrom
svk-selfheal-nil
Nov 22, 2026
Merged

frahlg merged 1 commit into
mainfrom
svk-selfheal-nil

Conversation

@frahlg

@frahlg frahlg commented Nov 22, 2026

Copy link
Copy Markdown
Member

With control on, a failed battery-power read (34755) made the Solis self-heal check raise an error inside driver_poll:

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-svk 0.2.5: the check needs a battery reading. Without one it falls to the existing else branch, which resets the count of disagreeing polls.
  • 50-125k-svk-slew 0.1.14: err_w is nil without a reading, and the check then takes the same else branch. self_heal_prev_committed_w still updates every poll, as before.
  • 50-125k-svk-ac-slew is unchanged: its self-heal already checks ac_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_REQUIRED means. With a reading, the self-heal works as before. No write, setpoint, slew or arm logic changed.

Tests

  • New drivers/tests/lua_harness/test_svk_selfheal_nil.lua, wrapped by drivers/tests/test_svk_selfheal_nil.py, for both drivers. With control armed at 0 W:
    1. 34755 fails for several polls: driver_poll does not raise, nothing is written, and battery W is not invented.
    2. A failed read in the middle of a run of disagreeing polls restarts the count, so no self-heal fires.
    3. Enough disagreeing polls in a row still re-arm and rewrite, so the self-heal still works.
  • On origin/main the test fails at step 1 for both drivers with the errors quoted above.
  • make test-driver ID=50-125k-svk and ID=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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T09:33:19.817781Z 0df887b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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
frahlg merged commit fc249a5 into main Nov 22, 2026
5 checks passed
@frahlg
frahlg deleted the svk-selfheal-nil branch November 22, 2026 09:42
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.

1 participant