Skip to content

Add CMDP extension types wire format for DQM metrics - #21

Open
VanitasCodes wants to merge 7 commits into
constellation-daq:mainfrom
VanitasCodes:dqm-metrics-ext
Open

VanitasCodes wants to merge 7 commits into
constellation-daq:mainfrom
VanitasCodes:dqm-metrics-ext

Conversation

@VanitasCodes

Copy link
Copy Markdown

This adds a wire format specification to the CMDP protocol documentation for structured data quality monitoring (DQM) metrics. The specification defines three MsgPack extension types that allow CMDP to carry dense 2D matrices and histograms alongside the existing scalar metric values.

The extension types are:

Type Code Purpose
Matrix 1 Dense 2D array of typed numeric values (uint32, uint64, float32, float64)
Histogram1D 2 1D histogram with uniform binning and float64 bin counts
Histogram2D 3 2D histogram with uniform x/y binning, embedding a Matrix

All numeric fields within ext payloads use little-endian byte order for zero-copy compatibility with x86 and NumPy. The existing CMDP metric payload format is unchanged. Deserializers that do not understand the new extension types encounter an unknown MsgPack ext object in the value position and can skip it gracefully.

This is the specification groundwork for the C++ and Python implementations that will follow in subsequent commits.

Copilot AI lite review requested due to automatic review settings September 23, 2026 20:02

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The wire format has unresolved interoperability and validation gaps.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds CMDP MsgPack extension wire-format documentation for DQM matrices and histograms.

Changes:

  • Defines Matrix, Histogram1D, and Histogram2D extension types.
  • Documents payload layouts, dtype tags, and byte ordering.
  • Describes metric integration and compatibility behavior.
File Reviewed changes and findings
docs/​framework_reference/​protocols.md Adds structured metric extension specifications. Findings: Critical (3 votes): zero-bin histograms are undefined at lines 315 and 361. Moderate (2 votes): Histogram2D bin-count dtype is unspecified. Moderate (1 vote): unknown Matrix dtype tags lack decoding rules. Nit (2 votes): the normative CMDP protocol location is not updated or linked.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved

@stephanlachnit stephanlachnit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In general I think the technical aspects are fine. However - I urge to read through our other protocols (https://gitlab.desy.de/constellation/constellation/-/tree/main/docs/protocols?ref_type=heads) - try to copy the structure and write it in RFC style (see also RFC 2119.

This should be less of an explanation of what you did but a documented targeted for people trying to implement - Motivation should briefly come once in the beginning and then the rest should be technical details with motivation only when absolutely necessary.

Think about it like this: when implementing this protocol I don't care about why they choose their design pattern - I just want to get the job done. In that case, the shorter and more precise, the better.

Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved
Comment thread docs/framework_reference/protocols.md Resolved

@stephanlachnit stephanlachnit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Already much better wording!

The spellcheck in the GitLab MR is still failing and needs to be addressed (see https://gitlab.desy.de/constellation/constellation/-/merge_requests/1221).

Comment thread docs/protocols/cmdp_ext.md Resolved
Comment thread docs/protocols/cmdp_ext.md Resolved
@VanitasCodes
VanitasCodes requested a balanced review from Copilot September 27, 2026 19:35

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread cxx/constellation/core/meson.build Resolved
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.

3 participants