EV-51 review: T45 sweeps N8 on own age for retries and phase-change closing currents; docs name the decision words and C23
T45: race order, 5 s and 10 s cycles, silence onset swept 1 s at a time,
(a) a raise the charger ignores (re-sends) and (b) a 1 -> 3 phase change
(closing current): no non-zero current write at own age > 30 s. Red on
5bff894 and on the reviewer's R4 (nz_block from the snapshot, C23 on own
age), green on head. T26 also checks the DECISIONS entry names every
decision word and the C23 value rule.
DECISIONS and the car_sun_own / _car_step_debug docstrings: snapshot values
are used only while the step's own age says fresh (C23); the decision words
are listed. No code change.
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""EV-51: every meter-age decision of a Solar writer step is judged on the
|
||||
step's OWN age (T1-T43; N1-N12 of reports/EV-51-test-plan.md).
|
||||
step's OWN age (T1-T45; N1-N12 of reports/EV-51-test-plan.md; T44 and T45
|
||||
from the round-1 formal check and the review).
|
||||
`python3 -B test_ev51.py`
|
||||
|
||||
The real Controller on `tools/ev20_sun.py` (the harness now takes a cycle
|
||||
@@ -574,6 +575,14 @@ check("T26: DECISIONS states the rule once: 0 A on the first car step whose own
|
||||
"bound 330 s + one cycle" not in doc
|
||||
and doc.count("EV-51: decided at the step's own meter age") == 1
|
||||
and "held steps included" in doc)
|
||||
_words = ("steady", "start", "raise", "lower", "pause", "hold", "wait-unknown",
|
||||
"wait-held")
|
||||
_ev51 = doc.split("EV-51: decided at the step's own meter age", 1)[-1].split("\n- **", 1)[0]
|
||||
check("T26 (review): the EV-51 entry names every decision word of the DEBUG "
|
||||
"line and says the snapshot values are unknown once the step's own age "
|
||||
"is past meter_max_age_s (C23)",
|
||||
all(f"`{w}`" in _ev51 for w in _words) and "(C23)" in _ev51
|
||||
and "only while the step's own age says the meter is fresh" in _ev51)
|
||||
|
||||
# =========================================================================== #
|
||||
print("\n5. THE DEBUG LINE (T28-T34; N9, N10, N11)")
|
||||
@@ -947,4 +956,49 @@ for cyc in (5, 10):
|
||||
f"({n_back} onsets start after back; {len(bad)} bad: {bad[:2]})",
|
||||
not bad and n_back >= 9)
|
||||
|
||||
# T45 (review, N8 / C22 on the paths that do not come from the plan's target):
|
||||
# (a) the re-send of an ignored write, (b) the closing current of a 1 -> 3
|
||||
# phase change. Race order, the silence onset swept 1 s at a time: no non-zero
|
||||
# current write at a step whose own age is > meter_max_age_s (30 s). The C23
|
||||
# hiding of spare/target cannot stop these; only `nz_block` on own age does.
|
||||
def _t45_retry(cyc):
|
||||
hits, resent = [], 0
|
||||
for onset in range(300, 440):
|
||||
r, st = run_log(go, onset=onset, dur=onset + 60, cyc=cyc, phase=0,
|
||||
race=True,
|
||||
sim=TSim(setpoint_a=0, windows=[(335.0, 900.0, "ignore")]),
|
||||
sun=lambda t: 3000.0 if t >= 340 else 2300.0)
|
||||
if len([a for s in st if s["now"] >= 340 for a, _t, _o in s["writes"]
|
||||
if a > 0.0]) >= 2:
|
||||
resent += 1 # the ignored raise was sent again
|
||||
if n8(st):
|
||||
hits.append((onset, n8(st)[:1]))
|
||||
return hits, resent
|
||||
|
||||
|
||||
def _t45_phase(cyc):
|
||||
hits, changed = [], 0
|
||||
for onset in range(240, 340):
|
||||
r, st = run_log(go, onset=onset, dur=onset + 60, cyc=cyc, phase=0,
|
||||
race=True, opts={"ev_phases": "auto"}, car_phases=3,
|
||||
sun=7600.0)
|
||||
if [s for s in st if s["phases"]]:
|
||||
changed += 1 # a 1 -> 3 phase change ran
|
||||
if n8(st):
|
||||
hits.append((onset, n8(st)[:1]))
|
||||
return hits, changed
|
||||
|
||||
|
||||
for cyc in (5, 10):
|
||||
hits, resent = _t45_retry(cyc)
|
||||
check(f"T45 retry [{cyc} s race]: a raise to 10 A at 340 the charger ignores, "
|
||||
f"silence onset 300-439: no re-send at own age > 30 ({resent} runs "
|
||||
f"re-sent; {len(hits)} onsets with a hit: {hits[:2]})",
|
||||
not hits and resent >= 20)
|
||||
hits, changed = _t45_phase(cyc)
|
||||
check(f"T45 phase change [{cyc} s race]: 1 -> 3 phases (sun 7600 W, 3-phase "
|
||||
f"car), silence onset 240-339: no closing current at own age > 30 "
|
||||
f"({changed} runs with a phase change; {len(hits)} onsets with a hit: "
|
||||
f"{hits[:2]})", not hits and changed >= 20)
|
||||
|
||||
report()
|
||||
|
||||
Reference in New Issue
Block a user