Repository navigation
Conversation
…se on safe next epoch
|
2026-10-23 M3.A CODE STATUS — isolated from checkpoint e820407 (SV/packet codec and Studio unchanged). Draft PR #290 head 71c134d. The implementation parks the running SOURCE/RECEIVER AUTO GPTimer and 1Hz phase observer while SV TX is OFF: disable 4kHz task notifications, keep PTP source lease/epoch generation and ISR grid, reuse at the next canonical smpCnt=0 boundary on START. Fail closed and rearm only on changed clock source/GM lease, incompatible profile/rate/mode, physical link loss or phase fault. Also handles rapid STOP→START overtaking the 200ms idle park by recognizing and silencing a still-owned timer before epoch launch; flush stale task notification count. Code: embedded/esp32p4_smv_injector/main/app_main.cpp; pure policy in include/ariec61850/time_sync/sv_ptp_phase_authority.hpp; portable 100-cycle/4k+4.8k/hot-start/fault regression in tests/test_sv_ptp_phase_authority.cpp. Scoped Draft CI exception ONLY branch M3A: ESP32 build + GCC/Clang PTP + paired Windows installer, routing policy guards cross-branch bypass. No main or checkpoint merge; no public release. One prior exact-head portable run PASS and firmware SUCCESS; final exact-head GCC/Clang PASS, policy PASS; final-source dual ESP32 + Windows run remains under way (https://github.com/masarray/arstack61850/actions/runs/39950300989). Important scope limit: this fixes CLOCK/GRID lifecycle, not external-auto BMCA (M3.C), power-on auto-start PTP policy (M3.B) or MAC descriptor reacquisition after resumed SV. The next source-fast MAC proof can still affect wire smpSynch in early live epochs; do NOT claim zero 2→0→2 until real STOP/START PCAP on physical ESP32 with source generation and SVSYNC log. Acceptance gate: 100 rapid + normal STOP/START; PTP Announce/Sync/FU continue, no SV during STOP, return at same timeline/selected GM, stable ARSAS/DigSub, no TX slot errors. Preserve previous FAT baseline checkpoint and external-IED lock requirement. |
|
Integrated into main through PR #299 — historical stacked review closed. Verified on 24 Oct 2026: this PR's exact HEAD This PR targeted an intermediate stacked branch, not |
M3.A phase-grid lifetime separation — no main/release merge
Baseline: physically PCAP-proven source
7c95f70c, checkpoint mergere82040716c549af887579b369965ba96a890a4dbfrom PR #288, with Studio AutoLive and 5-file forensic capture untouched.Root cause:
stop_sample_clock()deletes GPTimer and explicitly revokes SV phase on session STOP; previous preflight only covered the idle-before-start path, but an active clock could not be parked. PTP SOURCE itself continues.Changes (firmware only plus portable regression):
SvAutoPreflightPolicy::can_park_running_grid()— pure, constexpr, fail-closed reuse contract (timer+epoch+phase, unchanged source lease/profile/rate and healthy AUTO).smpCnt=0epoch. Flush queued pre-STOP task notifications. Genuine GM/lease/rate/link fault still tears down and requalifies.publisher_stoprevocation; cold preflight cannot claim SV MAC quality. Canonical SV encoder, PTP frame builder, Windows AutoLive, and Capture code untouched.Known remaining integration limits / gates: exact-source ESP32 CI must pass; PCAP proving no extra wire frames after STOP, no uncommanded START, PTP source generation remains fixed, no phase reset across 100 STOP/START, and real ARSAS/DigSub decoding. The current MAC-egress proof gate still conditions
smpSynchon live descriptor evidence after resume, so never claim nosmpSynchdip until physical FAT. Fully always-on clock from boot, external AUTO/BMCA and Advanced UI are M3.B/C/D — out of scope here.Do NOT auto-merge checkpoint or
main. Coordinate M3 issue #162 / design PR #289 / unrelated Draft #166 without cherry-picking untested code.