Skip to content

M1–M3 software closeout + M4 ARStack SV/PTP interop screening and quiet Validation UI - #29

Merged
masarray merged 79 commits into
mainfrom
feat/m1-m2-sv-ptp-runtime-hardening-20261017
Oct 17, 2026
Merged

masarray merged 79 commits into
mainfrom
feat/m1-m2-sv-ptp-runtime-hardening-20261017

Conversation

@masarray

@masarray masarray commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Software M1–M3 closeout + M4 ARStack interop acceptance tooling

M1 – strict protocol and correct engineering semantics

  • Receive-only SV/GOOSE/PTP path with invalid 4I+4V quality suppression, TEST context, sample-counter policy independent of smpRate, multi-ASDU sequence/frame-rate integrity and strict PTP UDP/BER/APDU length checking.
  • PTP multi-domain/source isolation, bounded passive Sync→Follow_Up correlation, truthful timeout/status, no unsupported lock claims.
  • Canonical SCL-driven multicast VLAN/PCP/APPID/svID always separate from broadcast AR_DIAG_SV1 diagnostic mirror.

M2 – high-rate memory/CPU and bounded ownership

  • Amortized O(1) rolling jitter, cached SCL bindings, stack-local 4I4V channel values, lazy verbose debug formatting, shared immutable coherent waveform/RMS snapshot window.
  • Remove unused per-channel counter dictionary/1024 linear scan; remove two per-frame MAC formatting array allocations.
  • Bounded SV/GOOSE publisher catalogs, stale eviction and cache cleanup, bounded PTP buckets and event deduplication. 1Hz Npcap drop counters are separate from SV smpCnt anomalies.
  • Dedicated ordered capture worker retained; no unbounded/undocumented lossy worker queues introduced.

M3 – quiet, context-aware WPF interface

  • Single operator status strip and compact context footer, stream-specific correct RMS/phasor/waveform updates, exact-sample render coalescing without smoothing genuine transients.
  • Removed unused tween/interpolation loop, throttled SCL/diagnostics, bounded event history and virtualized SCL/Validation tables.
  • One-click “Inspect PCAP” in Validation: local file dialog and background worker, compares current loaded SCL with capture without UI stall; short result + tooltip evidence.

M4 – independently reproducible interop screening

  • PcapInteropInspector uses existing production decoder + existing classic-PCAP reader. Builds bounded per-stream wire facts (MAC, APPID, VLAN/PCP, confRev, nofASDU, payload dimensions, sample-counter continuity/wrap candidates and smpSynch observed bits) plus passive PTP source and two-step evidence.
  • SCL comparison statuses: WIRE_FIELDS_MATCH, MIRROR_ONLY, NOT_OBSERVED, CONFLICT, INCOMPLETE_INTENT, UNRESOLVED. Each distinguishes configured intent from observed wire and capture-path limitations.
  • tools/ProcessBus.InteropCli built in the main solution: offline --pcap ... --scl ... --json ... screening with local replay throughput, CPU/allocated bytes metrics and bounded maximum frames. No upload/network access.
  • scripts/measure-m4-bench.ps1 and docs/M4_ARSTACK_INTEROP_ACCEPTANCE.md provide an operator-runnable 60-minute ARStack SV+PTP + TAP/SPAN + subscriber/IED acceptance checklist.
  • Synthetic regression includes simultaneous canonical tagged SV + independent broadcast mirror + L2 PTP Announce/Sync/Follow_Up, counter roll candidate and conflict/mirror-only gating. No customer capture committed.

Evidence boundaries / release decision

Windows CI, full xUnit, repeated RuntimeStability, CodeQL and dependency review must pass on this exact final HEAD before merge. This is a SOFTWARE checkpoint only.

Not claimed as physically completed: independent preserved-VLAN TAP/SPAN capture, measured hardware timestamps/PTP lock, concurrent 60+ minute ARStack 4000/4800 SV + PTP run, real IED subscription, and quantified CPU/GC/working-set reduction on the same hardware. Synthetic PCAP results and USB-NIC diagnostic mirrors cannot establish these facts.

Original source invariants AGENTS.md and src/AGENTS.md remain binding. No publication/control/protection action added.

Copy link
Copy Markdown
Owner Author

M1/M2 software acceptance checkpoint — HEAD 10c5be19df4fa0402371370ce0c1a4d183afefe1:

  • Windows CI: PASS — build succeeded (0 errors), 82/82 xUnit tests passed.
  • Repeated Runtime Stability workflow: PASS.
  • Dependency Security Review: PASS.
  • CodeQL: running at this checkpoint; do not imply success before its conclusion.
  • Release candidate package: intentionally skipped for this draft PR.

The branch includes bounded stream isolation, 4I+4V quality truth, PTP source/domain truth, false multi-ASDU jitter suppression, cached/stack-local hot-path projections, SCL/UI coalescing, and deterministic regression evidence.

Physical ARStack canonical multicast/VLAN plus simultaneous SV/PTP soak, NIC drop telemetry, and hardware timestamp validation remain unproven and are not treated as blockers to software build testing, but are blockers to any field-readiness claim. Keep this PR draft until the remaining gates/review are resolved.

…dant WPF paints without quantizing transients

Copy link
Copy Markdown
Owner Author

M1/M2/M3 software acceptance checkpoint for HEAD 350146294dfdd63e002e76f6daf2b5dcb4548c6e:

  • Windows .NET 8 build PASS, 0 errors
  • xUnit 94/94 PASS (including new SV quality, ARStack mirror, multi-ASDU, PTP UDP v4/v6 boundary, fixed-size PTP rates, two-step correlation, bounded stream/catalog/event memory, and exact-sample M3 repaint coalescing)
  • Repeated Runtime Stability PASS
  • Dependency Security Review PASS
  • CodeQL was still in progress when this comment was posted; confirm its final state separately.

Software engineering work is in this PR. Physical canonical VLAN/multicast and concurrent SV/PTP hardware soak, profile/IED acceptance and calibrated timing are not implied by these results. PR remains draft until owner review and remaining gates/bench acceptance decisions.

Copy link
Copy Markdown
Owner Author

Final same-HEAD software gate confirmation for 350146294dfdd63e002e76f6daf2b5dcb4548c6e: CI PASS (0 build errors, 94/94 tests); repeated Runtime Stability PASS; Dependency Security Review PASS; CodeQL PASS. Release package is intentionally skipped for this draft PR. No software-gate failure remains on this HEAD. Physical canonical SMV/PTP bench interoperability and measured resource/soak acceptance are explicitly not claimed. Keep main protected and PR draft pending those release decisions.

@masarray masarray changed the title M1/M2 + M3: IEC 61850 SV/PTP truth, bounded runtime and quiet operator UI M1–M3 software closeout + M4 ARStack SV/PTP interop screening and quiet Validation UI Oct 17, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

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 ✅ Completed 2026-10-17T02:49:23.731154Z 35445df Draft marked ready
ℹ️ 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.

@masarray
masarray merged commit b8e5a4e into main Oct 17, 2026
7 checks passed
@masarray
masarray deleted the feat/m1-m2-sv-ptp-runtime-hardening-20261017 branch October 17, 2026 02:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35445df2de

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1227 to +1231
_knownFourI4VMapping = mappingProfile is null ||
(mappingProfile.Elements.Count >= 3 && mappingProfile.Elements.All(e =>
e.ElementIndex >= 0 && e.ElementIndex < 16 && e.ElementIndex % 2 == 0 &&
(e.SignalReference.Contains("instMag", StringComparison.OrdinalIgnoreCase) ||
e.TypeText.Contains("instMag", StringComparison.OrdinalIgnoreCase))));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require positive layout evidence before decoding quality

When no SCL mapping is resolved, mappingProfile is null marks every 64-byte payload as a known 4I+4V instMag/quality layout. An unrelated 16-word DataSet can therefore have its odd words interpreted as quality flags, causing valid measurements to be cleared as Untrusted or mislabeled as quality-good. Keep the payload as unmapped raw evidence unless the exact interleaved quality layout is established.

AGENTS.md reference: src/AGENTS.md:L32-L35

Useful? React with 👍 / 👎.

Comment on lines +73 to +76
.OrderByDescending(x => x.LastAnnounceUtc.HasValue &&
IsFresh(nowUtc, x.LastAnnounceUtc.Value, AnnounceFreshness))
.ThenByDescending(x => x.LastAnnounceUtc)
.ThenByDescending(x => x.LastMessageUtc)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fall back to the currently active PTP source

When one source has an expired Announce and another source has recent Sync traffic but no Announce, both fail the fresh-Announce sort key, after which the non-null stale LastAnnounceUtc wins over the active source. The resulting snapshot reports the old domain/source as timed out and hides the current Sync rate; after prioritizing fresh Announce sources, the fallback should select by recent message activity rather than stale Announce presence.

Useful? React with 👍 / 👎.

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