Skip to content

IED simulator: IEC 61850 full-discovery golden parity - #102

Merged
masarray merged 44 commits into
fix/iedsim-control-command-golden-parityfrom
fix/iedsim-iedscout-full-discovery-parity
Sep 19, 2026
Merged

masarray merged 44 commits into
fix/iedsim-control-command-golden-parityfrom
fix/iedsim-iedscout-full-discovery-parity

Conversation

@masarray

@masarray masarray commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Scope

Stacked on fix/iedsim-control-command-golden-parity; keep this PR Draft until real external vendor external IEC 61850 client discovery acceptance passes.

Root cause from supplied golden/failed captures

  • Golden external IEC 61850 client completes the large reference IEC 61850 model-style discovery and returns GVAA for AA1E1F06R4ESQZ1/CSWI1.
  • ARStack receives the same CSWI1 GVAA request but stalls while synthesizing the large LN root.
  • Object inventory is not missing; the ESQZ1 inventory matches. The defects are synthesis complexity and wire/declaration ordering.
  • Golden control metadata exposes ctlModel as MMS INTEGER; ARStack had overridden it to UNSIGNED.

Changes

  • Bound synthetic LN-root type/data assembly to one collected child set per subtree instead of repeated full-object-table scans.
  • Preserve SCL/external IEC 61850 client declaration order in indexed GetNameList and synthetic hierarchy.
  • Give runtime CO aliases explicit declaration order.
  • Expose control ctlModel as MMS INTEGER to match external IEC 61850 client.
  • Add interop_parity_full_discovery_large_model, a ~4.9k object / 32 LD regression targeting AA1E1F06R4ESQZ1/CSWI1.
  • Reuse the official main/assets icon set for Qt app/product mark, Windows executable/NSIS installer, favicon/PWA/brand surfaces.

Must remain green

  • DPC control golden parity: SBOw → Operate → positive CommandTermination → process feedback.
  • Static Reporting 36/36 digital + 22/22 analog = 58/58.
  • URCB/BRCB retained paths.
  • Windows/GCC/Clang external IEC 61850 client parity matrix.

No merge until external external vendor external IEC 61850 client full discovery and ARSAS control/reporting acceptance.

@masarray masarray closed this Sep 18, 2026
@masarray masarray reopened this Sep 18, 2026

masarray commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner Author

Exact-head validation update for 4c4db36d0250c0e8d8d267425728ae17f879ecb8:

  • external IEC 61850 client Parity Server CI run 35336670066: PASS on Linux GCC, Linux Clang, and Windows.
  • New interop_parity_full_discovery_large_model regression: PASS (Linux observed 0.81 s), exercising ~4.9k objects / 32 LDs and target AA1E1F06R4ESQZ1/CSWI1.
  • interop_parity_dpc_control: PASS (Linux observed 0.79 s), so SBOw/Operate/termination control parity remains intact.
  • IED Simulator Qt run 1049: PASS.
  • SCL-Assisted Connect run 292: PASS.
  • SCL-Assisted Workbench run 299: PASS.
  • Release Hardening Linux soak: PASS.
  • Windows release packaging is still running; artifact is not yet ready.

PR remains Draft and unmerged pending real external vendor external IEC 61850 client full-discovery acceptance plus ARSAS control/reporting acceptance.

masarray commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner Author

Windows RC artifact is now available for exact head 4c4db36d0250c0e8d8d267425728ae17f879ecb8.

Release Hardening run: 35336670058
Artifact: arstack-iec61850-workbench-windows-rc
Artifact ID: 10543826457
Size: 61,450,931 bytes
Digest: sha256:cc336501a60a403739cb3eadb95c6afc6bd5e90a9f5f943abd822ef93b388090
Expires: 2026-10-02T11:06:07Z

Windows build, staging, NSIS packaging with official ARStack icon, and staged+installed release verification all PASS.

External acceptance still required before merge:

  1. external vendor external IEC 61850 client full discovery on the supplied reference IEC 61850 model SCL: no LIB0407 timeout at AA1E1F06R4ESQZ1/CSWI1.
  2. ARSAS Close/Open: SBOw → Operate → positive CommandTermination → process feedback.
  3. Static Reporting remains Digital 36/36 + Analog 22/22 = 58/58 with no projection/semantic rejects.
  4. External BRCB/URCB reporting shows no regression.

masarray commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner Author

Real external vendor external IEC 61850 client discovery — FAIL #2 analyzed (2026-09-18)

Tested current full-discovery work against the supplied real capture Arstack_external IEC 61850 client_Discovery_Failed2.pcapng and simulator diagnostics.

Important: the old timeout/stall is fixed

  • ARStack is genuinely running on 192.168.81.103:102.
  • external IEC 61850 client reaches MMS and ARStack answers invokes 1..129.
  • GVAA invoke 128 (AA1E1F06R4ESQZ1/CSWI1) and invoke 129 (AA1E1F06R4ESQZ2/CSWI1) are both answered immediately.
  • external IEC 61850 client closes the association immediately after invoke 129 and reports DAT00032/LIB01002.
  • Therefore this is no longer a performance timeout. It is a semantic interoperability rejection.

Exact golden-vs-ARStack CSWI1 GVAA diff

  • Golden response size: 1471 bytes.
  • ARStack response size: 1450 bytes.
  • Both decode structurally and contain the same 72 leaf paths: missing=0, extra=0.
  • Root order ARStack: ST, CF, DC, EX, OR, CO.
  • Root order golden: ST, CO, CF, DC, EX, OR.
  • CO.Pos ARStack order: SBOw, Oper, Cancel, SBO.
  • CO.Pos golden order: SBO, SBOw, Oper, Cancel.
  • 29 leaf TypeSpecification mismatches remain.

Representative mismatches:

  • ST.Mod/Beh/Health.stVal: INTEGER32 -> golden INTEGER8.
  • CF.Pos.sboTimeout/operTimeout: UTC-Time -> golden UNSIGNED32.
  • ST.Pos/LocSta.origin.orCat: UTC-Time -> golden INTEGER8.
  • ST.Pos/LocSta.origin.orIdent: UTC-Time -> golden variable OCTET STRING(64).
  • CO.LocSta.Oper.Test: UTC-Time -> golden BOOLEAN.
  • CO.Pos.*.origin.orCat: unspecified INTEGER -> golden INTEGER8.
  • CO.Pos.*.origin.orIdent: fixed OCTET STRING(64) -> golden variable OCTET STRING max 64.
  • CO.Pos.*.ctlNum: unspecified UNSIGNED -> golden UNSIGNED8.
  • CO.Pos.SBO: fixed VisibleString(129) -> golden variable VisibleString max 129.
  • DC.NamPlt.* / EX.NamPlt.lnNs: fixed VisibleString(255) -> golden variable VisibleString max 255.

Source-level causes found

  1. display_type() in src/simulation/ied_simulator_profile.cpp uses ascii_ends_with(entry.da_name, "t"). This falsely classifies orCat, orIdent, sboTimeout, operTimeout, Test, etc. as Timestamp. The same pattern exists for q.
  2. MmsSimulatorManifestCodec::type() lets normalized UI/display type (Timestamp, Enumeration) override authoritative raw SCL bType. Wire typing must be raw-SCL-first; display type is UI metadata/fallback only.
  3. Raw Enum / normalized Enumeration is encoded as INTEGER32, while the golden server advertises these IEC 61850 enum fields as INTEGER8.
  4. Generic TypeSpecification encoding treats visible/octet string sizes as positive fixed lengths. Golden external IEC 61850 client uses negative maximum lengths (e.g. VisString255=FF01, VisString129=FF7F, Octet64=FFC0).
  5. Source/declaration ordering is not sufficient for external IEC 61850 client root parity. CSWI1 needs golden FC order with CO before CF, and control service order SBO, SBOw, Oper, Cancel.

Correct P0 strategy

  1. Fix timestamp/quality classification to exact semantic leaf matching (t / .t, q / .q) and trust parser flags.
  2. Make raw SCL bType authoritative in manifest MMS typing; normalized/display type only fallback.
  3. Pin IEC 61850 Enum width to golden INTEGER8 and preserve exact unsigned widths.
  4. Add variable-length TypeSpecification semantics to codec (or an equivalent bounded exact encoding) so visible/octet types match golden signed-size encoding.
  5. Add explicit external IEC 61850 client FC/control ordering for LN-root synthesis; do not rely only on source order.
  6. Replace the current synthetic large-model-only gate with an exact golden CSWI1 TypeSpecification regression: 72 leaf paths, exact order, exact leaf TypeSpecs, then prove invoke 130 can proceed.
  7. Re-run ARSAS control + 58/58 reporting + BRCB/URCB gates unchanged.

PR #102 remains Draft/unmerged. The current RC must not be treated as externally accepted.

masarray commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner Author

P0.1–P0.2 implementation checkpoint

Head: f6b032a4b38dff44ecc5804d589791331f6f272c

Implemented from the real external vendor external IEC 61850 client discovery capture:

  • fixed q/t semantic classification: only terminal DA q / t (or parser flags) are treated as Quality/Timestamp; orCat, orIdent, sboTimeout, operTimeout, Test no longer become UTC-Time.
  • made raw SCL bType authoritative for MMS wire typing; display/normalized type is fallback only.
  • IEC 61850 Enum now advertises INTEGER(8), matching the golden CSWI1 capture.
  • added explicit variable-length TypeSpecification semantics.
  • exact external vendor max-length encodings pinned:
    • VisibleString255 = 8A 02 FF 01
    • VisibleString129 = 8A 02 FF 7F
    • OctetString64 = 89 02 FF C0
  • virtual control service TypeSpecifications now use:
    • origin.orCat INTEGER(8)
    • origin.orIdent variable OCTET STRING max 64
    • ctlNum UNSIGNED(8)
    • SBO variable VisibleString max 129
  • added C++ regression tests for raw-bType precedence and exact q/t classification.

CI is triggered on this exact head. C++ and external IEC 61850 client parity jobs are currently queued.

Next phase (P0.3)

Use the golden capture ordering as authority and correct synthetic LN-root/control ordering. Captured CSWI1 requires:
ST → CO → CF → DC → EX → OR
and CO.Pos: SBO → SBOw → Oper → Cancel.

Then P0.4 will add an exact golden CSWI1 TypeSpecification regression (72/72 paths + exact type/size/order), not only the existing self-discovery test.

masarray commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner Author

P0.3–P0.4 implementation checkpoint

Head: 94c2d3c1ad3a1d20eb2966e13bce53cda674d05b

Completed after the P0.1–P0.2 wire-typing fixes:

  • P0.3 exact ordering from the real external vendor external IEC 61850 client capture:
    • CSWI1 root: ST → CO → CF → DC → EX → OR
    • CO.Pos: SBO → SBOw → Oper → Cancel
    • ordering patch is intentionally narrow; every other FC remains declaration/source ordered.
  • P0.4 added a new read-only GVAA type probe plus an exact capture-derived CSWI1 regression.
  • New golden gate validates:
    • 72/72 scalar leaves
    • exact traversal order
    • exact MMS kind
    • exact width
    • exact variable max-length semantics
    • root/order mismatches = 0
  • The expected tree is derived from the supplied external vendor external IEC 61850 client discovery capture, including:
    • Enum = INTEGER(8)
    • ctlNum = UNSIGNED(8)
    • orIdent = variable OCTET STRING max 64
    • SBO = variable VisibleString max 129
    • NamPlt strings = variable VisibleString max 255

Exact-head CI has been triggered. C++ CI and external IEC 61850 client Parity Server CI are currently queued.

Next phase (P0.5)

  1. Let exact-head CI compile/run the new 72-leaf golden test on GCC/Clang/Windows.
  2. Fix any build/test mismatch without weakening the golden.
  3. Re-run DPC control and reporting/BRCB/URCB regression gates.
  4. Produce a new Windows RC artifact.
  5. External external vendor external IEC 61850 client full discovery on the real reference IEC 61850 model CID. Only after that passes do we consider PR IED simulator: IEC 61850 full-discovery golden parity #102 for merge.

masarray commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner Author

P0 internal completion — exact-head green, ready for real external IEC 61850 client discovery

P0 code-side validation is complete on exact head:

202c872316957e78a9bf6c8d4eecd8f81ccd464f

Exact-head CI

All 14 workflows associated with this head completed SUCCESS, including:

external IEC 61850 client parity matrix

Windows, Linux GCC, and Linux Clang all pass 8/8.

The new P0 gates execute and pass on the matrix:

  • interop_parity_full_discovery_large_model
  • interop_parity_cswi1_type_golden
  • interop_parity_dpc_control

This locks the capture-derived CSWI1 TypeSpecification contract and preserves DPC control behavior.

Reporting / RCB regression

Qt production-path gates remain green:

  • URCB GI PASS
  • BRCB event PASS
  • indexed RCB inventory PASS
  • synthetic golden discovery PASS
  • no omitted URCB/BRCB instances in the golden fixture

Windows RC

Release Hardening #389 passed:
WINDOWS_RELEASE_PACKAGE_PASS staged_smoke=pass installed_smoke=pass qt_runtime=pass helper_server=pass npcap_guidance=pass installer=nsis portable=zip reconnect_cycles=24

Artifact:

  • name: arstack-iec61850-workbench-windows-rc
  • artifact id: 10549061713
  • SHA-256: 3db1bf6dc830b568318aa58cc33dd3a8922a5da41740f28c09f82d813aab0672
  • exact head: 202c872316957e78a9bf6c8d4eecd8f81ccd464f
  • expires: 2026-10-02

Real external vendor external IEC 61850 client discovery against the reference IEC 61850 model CID remains the external acceptance step. Keep this PR Draft until that real-client discovery is confirmed.

masarray commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner Author

external IEC 61850 client real-control compatibility fix — implementation checkpoint

Head: f1e2d523ff27314e12a62ba437a08caf409e1b18

Implemented from the real external vendor command capture:

  • server-side incoming ctlNum=0 is now accepted; ARStack client-side auto-allocation (1..255) remains unchanged.
  • SBO-enhanced selection correlation no longer requires SBOw.T == Oper.T; external vendor emits a fresh Oper timestamp.
  • immutable selected identity remains strict across:
    • ctlVal
    • origin.orCat
    • origin.orIdent
    • ctlNum
    • Test
    • Check
    • association ownership / selection timeout
  • accepted Oper remains the authoritative command stored for positive CommandTermination, including its fresh T and ctlNum=0.

New regression coverage:

  • unit test interop_sbo_enhanced_accepts_ctl_num_zero_and_fresh_oper_timestamp
  • read/write integration probe tools/interop_control_wire_probe.cpp
  • server integration test interop_parity_real_control_wire

The integration test reproduces:
SBOw ctlNum=0 T1 Check=C0 -> Oper ctlNum=0 T2 Check=C0 -> positive CommandTermination -> process feedback

Negative invariants remain locked for mismatched ctlVal/origin/ctlNum/Check.

Exact-head CI is running now (external IEC 61850 client parity, Control Interop, C++ matrix, Qt/reporting/RCB, Release Hardening). PR remains Draft/unmerged until real external vendor command acceptance.

masarray commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner Author

external IEC 61850 client command-fix validation complete — ready for real external vendor retest

Exact head:
f1e2d523ff27314e12a62ba437a08caf409e1b18

All 14 exact-head workflows completed SUCCESS.

Real external IEC 61850 client control-wire gate

interop_parity_real_control_wire PASS on:

  • Linux GCC: 0.49 s
  • Linux Clang: 0.49 s
  • Windows: 0.55 s

Each external IEC 61850 client parity matrix completed 9/9 with zero failures.

The gate reproduces the real external vendor sequence:
SBOw ctlNum=0 T1 Check=C0 -> Oper ctlNum=0 T2 Check=C0 -> positive CommandTermination -> process feedback.

Control regression matrix

Control Interop Harness PASS:

  • GCC
  • Clang
  • MSVC

Discovery/reporting/RCB regressions also remain green:

  • IED Simulator Qt
  • BRCB Hard Profile
  • Dynamic RCB Trial
  • MMS R1-R2
  • C++ CI
  • Security / Embedded / SCL-assisted workflows

Windows RC

Release Hardening run: 35413303493

Artifact:

  • arstack-iec61850-workbench-windows-rc
  • artifact ID: 10575446832
  • size: 61,452,489 bytes
  • SHA-256: 5cef166ab2e8248305b0aabe6f0a5342a5396f03491427a14ec1ba8d05e52d0d
  • expires: 2026-10-03T01:55:19Z
  • exact head: f1e2d523ff27314e12a62ba437a08caf409e1b18

Release verification:
WINDOWS_RELEASE_PACKAGE_PASS staged_smoke=pass installed_smoke=pass qt_runtime=pass helper_server=pass npcap_guidance=pass installer=nsis portable=zip reconnect_cycles=24

PR remains Draft/unmerged until real external vendor external IEC 61850 client command acceptance is confirmed.

masarray commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner Author

P0 EXTERNAL ACCEPTANCE — LOCKED BEFORE MERGE

Exact accepted head:
f1e2d523ff27314e12a62ba437a08caf409e1b18

Real external vendor external IEC 61850 client acceptance on 2026-09-19 against reference IEC 61850 model_084F06BCU_AA1E1F06R4.cid:

  • Full discovery: PASS — external IEC 61850 client completes model discovery with no discovery error.
  • RCB interoperability: PASS — URCB and BRCB enable/report paths operate successfully.
  • SBO Enhanced command: PASS — OFF and ON commands complete with no external IEC 61850 client error.
  • Real command lifecycle observed:
    SBOw -> Oper -> positive CommandTermination -> process feedback -> BRCB report.
  • External ctlNum=0 accepted.
  • Fresh Oper.T relative to SBOw.T accepted.
  • Process state feedback observed for both off and on.
  • Control-triggered buffered reports observed after both state changes.

Regression lock already in this PR:

  • exact external IEC 61850 client CSWI1 TypeSpecification golden gate
  • large-model full-discovery gate
  • real external IEC 61850 client control-wire gate (ctlNum=0, fresh Oper T)
  • DPC control lifecycle gate
  • URCB/BRCB/reporting production-path gates
  • GCC / Clang / MSVC / Windows parity coverage

Exact-head CI: all 14 workflows SUCCESS.

This is the P0 interoperability baseline. P1 work must preserve Discovery + RCB Reporting + Control behavior and must not weaken these golden tests.

@masarray
masarray marked this pull request as ready for review September 19, 2026 03:21
@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.

@masarray
masarray merged commit 7c1645d into fix/iedsim-control-command-golden-parity Sep 19, 2026
30 checks passed

masarray commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner Author

P0 baseline ref created

Locked baseline branch: baseline/interop-p0-accepted-20260919
Baseline commit: 7c1645da43dfc041cb7d6e5f959ab276a1dbbfe6

P1 work should branch/compare from this accepted P0 baseline and must keep the existing discovery, CSWI1 type, RCB/reporting, real external IEC 61850 client control-wire, and lifecycle golden tests green.

@masarray masarray changed the title IED simulator: IEDScout full-discovery golden parity IED simulator: external IEC 61850 client full-discovery golden parity Sep 19, 2026
@masarray masarray changed the title IED simulator: external IEC 61850 client full-discovery golden parity IED simulator: IEC 61850 full-discovery golden parity Sep 19, 2026
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