SAFETY-84: maintenance charge at N=2 no longer stalls
checks / unit (pull_request) Successful in 23m57s
infra-pin / fresh (pull_request) Successful in 2s

At N>=2 a cheap-window maintenance charge files a site `hi` (`charge`,
P_MAINT_SHAPE) equal to what the charging pack's own `hi` places, so the
other pack never has to give against it. The charge is sized to the
quarter's headroom under the peak aim so it yields to the peak guard, and
to 0 W under a site safety stop. N=1 byte-identical (safety84_identity).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-09-30 19:47:15 +02:00
co-authored by Claude Opus 5.5
parent 9d5b7d129a
commit 43a52e7f60
12 changed files with 709 additions and 17 deletions
+11 -1
View File
@@ -64,9 +64,19 @@ _default = rig.digests()
for k in ED739D4:
print(f" {k:7} margin 0 {'same' if _zero[k] == ED739D4[k] else 'DIFFERS'}"
f" {_zero[k][:16]}, default {_default[k][:16]}")
# SAFETY-84 changes n2_maint ON PURPOSE: on 9d5b7d1 its N=2 cheap-window
# charge was refused on 214 of 540 cycles (site at 0 W); now none is.
# Printed on the SAFETY-84 tree the same way (margin 0).
SAFETY84_N2_MAINT = \
"95722b262f1bcf504493d7b5babc3895799ac56cc15f5d2ccdbe7c9f04adfcbb"
check("⭐ at N=1 and N=2, with and without battery modes and with a "
"maintenance charge, margin 0 is "
"byte-identical to ed739d4", _zero == ED739D4)
"byte-identical to ed739d4 (n2_maint apart, below)",
{k: v for k, v in _zero.items() if k != "n2_maint"}
== {k: v for k, v in ED739D4.items() if k != "n2_maint"})
check("...and n2_maint at margin 0 is the SAFETY-84 digest: the N=2 charge "
"that 9d5b7d1 refused on 214 of 540 cycles now runs (test_safety84.py)",
_zero["n2_maint"] == SAFETY84_N2_MAINT != ED739D4["n2_maint"])
check("...and the default (key absent) changes every scenario, so the "
"scenarios do reach the margin", all(_default[k] != ED739D4[k]
for k in ED739D4))