Skip to content

P0: on-board SV/PTP LOCK flight recorder with exact revocation reasons in Studio - #261

Open
masarray wants to merge 19 commits into
fix/p0-studio-physical-flash-start-feedback-20261020from
fix/p0-sv-sync-onboard-flight-recorder-20261020
Open

masarray wants to merge 19 commits into
fix/p0-studio-physical-flash-start-feedback-20261020from
fix/p0-sv-sync-onboard-flight-recorder-20261020

Conversation

@masarray

@masarray masarray commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

P0 hardware-debugging continuation stacked on #260 → #258 → #257 → #256 → #254 → #252.

Why needed: Physical Studio capture 2026-10-20 confirms 499,696 SV frames/124.927s, 0 missing/duplicates, 375 PTP source frames, smpSynch 0→1 at +23.484s, 1→0 +28.488s, 0→1 +39.484s. SOURCE's PTP receiver-discipline UNLOCKED is not proof of SOURCE TX failure. Ethernet capture alone cannot determine the internal branch that revoked SV auto-qualified phase.

Real implementation, no log in 4kHz fast path:

  • Constant-memory lock-free 16-transition flight recorder in smp_synch_lab.cpp; bounded 32-bit atomic event slots, monotonically increasing sequence, on-board elapsed milliseconds, per-reason and total acquire/revoke counters.
  • Exact reason codes on publisher missed sample slot, Ethernet loss, canonical TX error, stale phase observation, PTP clock lease/source generation change, actual MAC egress evidence rejection, observer phase/MAC gate loss, STOP, mode switch and handoff.
  • 1Hz observer records phase error, uncertainty, MAC pair count, clean acquisition epochs, sample epoch, acceptance/tracking. telemetry_task emits at most one short SVSYNC FLIGHT warning each second only after an edge. No serial log/heap/mutex in normal 4kHz tick or ISR.
  • Read-only PTP DIAG exposes summary, nonzero reason counts, recent 16 acquisition/loss events from ESP32-P4 firmware itself.
  • Studio Time Sync → Inspect SV lock requests snapshot through existing SmartSessionController; UI displays causes and phase/MAC metrics. Latest automatically emitted fault also appears in Studio without a click, invalidates on USB reconnect, is included in Copy Diagnostics and in Capture JSON's 1Hz passive telemetry series (onboard_sync_flight_UNVERIFIED), correlated with PCAP. No scripts/external console for operator.
  • PTP Core portable GCC/Clang/MSVC tests cover 42 transitions and ring rollover, no synthetic lock assertion. Studio structural regression validates entire flow. Native firmware, GUI, Inno installer CI required at exact SHA before any user download.

Still unknown: historical 1→0 actual internal cause and external IED lock; those cannot be reverse-invented from PCAP. No algorithm lock threshold changed. No main merge/public release without new on-board flight recorder evidence and physical phase/IED acceptance.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-20T07:43:39.821950Z b251278 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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