Skip to content

feat(M4-P0A): compile 3 SCD Merging Unit SV profiles with bounded common 4kHz roster - #334

Merged
masarray merged 6 commits into
mainfrom
feat/m4-three-sv-scl-roster
Oct 25, 2026
Merged

masarray merged 6 commits into
mainfrom
feat/m4-three-sv-scl-roster

Conversation

@masarray

Copy link
Copy Markdown
Owner

M4-P0A — Three SCD-derived SV profiles on one common PTP sample grid (host foundation)

Implements the FIRST shippable coding slice of M4 ARD / #333.

This PR actually implements

  • A reusable M4ThreeSvRosterCompiler in C++20; reuses the existing SCL model/compiler/device-profile binary compiler and keeps exactly three independently identified 4I+4V SV streams in one bounded host roster.
  • Fail-all (atomic) compile: rejects absent family choice, unvalidated modulus, wrong stream count/rate/layout, unsupported device profile, duplicate full wire identity; allows APPID 0x4000 repeated on different multicast MACs as the owner's supplied SCD does.
  • m4-three-9-2le-reference.scd with 3 IEDs, exact MAC/APPID/svID identity mapping, SCL 4000/s, 16 leaves per MU and explicit SmvOpts.
  • New CTest verifies 3 compiled/roundtripped V1 binary stream records, unique MACs/svIDs and total 12,000 SV fps plus negative/error paths.
  • No changes to M3.H.3 shipping firmware / release assets. This code is a host compiler, NOT live 3-stream firmware yet.

Follow-up PRs before user-visible M4

M4-P0B: V2 aggregate record/CRC and transactional 3-slot firmware staging. M4-P0C: single GPTimer/PTP-grid -> three preallocated TX contexts. M4-P0D: per-stream setpoints/readback. M4-P0E: one Studio with 3 synchronized Table/Waveform/Phasor pages. M4-P0F: paired firmware/Studio builds and bench testing.

Test gate

C++ CI: ariec61850_m4_three_sv_roster_tests and existing ariec61850_scl_tests. Merge only when C++ CI is green.

@masarray
masarray marked this pull request as ready for review October 25, 2026 10:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T10:23:29.208148Z d05e15a 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.

@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: d05e15ab6c

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

}
}
}
if (result.errors.empty()) result.roster = std::move(candidate);

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 Reject duplicate IED conflicts before accepting the roster

When the SCD contains duplicate IED@name declarations with different control-block names, this compiler returns a successful roster despite the parser reporting an IED conflict. Reproduced by renaming the fixture's second IED to MU01_4I_4V_1 and its control/binding to MSVCB02: document.conflicts reports the duplicate IED, but compile().ok() is true. The pairwise control-reference check does not catch this, allowing profiles compiled from ambiguous IED/DataSet namespaces through the validation boundary. Preserve the deliberate repeated-APPID exception, but reject duplicate-IED conflicts before publishing the roster.

AGENTS.md reference: AGENTS.md:L152-L152

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