Skip to content

M2E: bounded RCB report member projection and truthful truncation UI - #167

Merged
masarray merged 2 commits into
mainfrom
perf/workbench-bounded-rcb-projection-m2e
Oct 14, 2026
Merged

masarray merged 2 commits into
mainfrom
perf/workbench-bounded-rcb-projection-m2e

Conversation

@masarray

Copy link
Copy Markdown
Owner

Baseline

Follow-up to merged typed RCB q/t PR #165 (main af3ced5). Native Qt Workbench only.

Bottleneck

The Browser showed only first 256 report rows but buildSubscriptionUi formatted every decoded DataSet value in each retained report frame before QML sliced the list. A large IED could allocate large strings many times during UI refresh. This optimized change bounds formatting, not MMS decoding or report subscription.

Implementation

  • Extract a single read-only BrowserReportMemberProjection.hpp from existing report value/typed-evidence projection; no shadow semantic state or new reporting path.
  • Retain at most 256 GUI member rows and at most 1024 text characters per member preview, with explicit row/text-truncation flags. valueCount still records the actual source frame count; the original runtime report stays untouched.
  • Reuse M2D Quality/TimeQuality decoder, maintain per-snapshot 96-evidence budget and exact displayed member ordinal alignment; no extra reads, subscriptions, timer or cyclic polling.
  • QML reports real truncation rather than testing the length of a list already capped; drops redundant .slice(0,256).
  • Native 300-member QA includes q/t mixed with failed and wrong-kind values, 1-item evidence budget, text truncation, capped rows and a small requested window.
  • Browser source contract rejects a return to full-frame per-member string conversion.

Acceptance

Only scoped IED Simulator Qt CI should run. Native build, QML smoke, Browser convergence, 60k model QA, live MMS data-plane checks pass on exact head. Keep Draft and do not merge on failure. Windows visual/device testing remains a separate acceptance gate; no claim of pixel parity.

CI efficiency

One atomic commit, no protocol/firmware edits and no Windows packaging job for this C++/QML-only iteration.

Extract one pure typed report-member projection that retains at most 256 visible member strings, 1024 characters per preview, and 96 typed q/t evidence items across the snapshot. Keep original report count and authoritative decoded MMS frames untouched; expose explicit row/text truncation in Browser Reports. Eliminate O(full DataSet size) Qt string conversion per retained report frame; add 300-member native QA with failed value, wrong type, budget exhaustion and small-window cases. No extra MMS reads or polling.
Update Browser convergence source contract after M2E moved q/t decoding out of MmsReportController to BrowserReportMemberProjection. Require decoder call in the bounded helper and reject accidental duplicate inline decoding in the controller. Preflight validated all UI/source contract required tokens on exact branch.
@masarray
masarray marked this pull request as ready for review October 14, 2026 21:46
@masarray
masarray merged commit 35eda54 into main Oct 14, 2026
1 check passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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-14T21:48:06.424976Z 935146a 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: 935146a038

ℹ️ 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 +58 to +59
if (member.value)
displayValue = QString::fromStdString(mms::MmsDataCodec::to_display_string(*member.value));

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 Bound formatting before materializing the full value

When a retained member contains a large string, byte sequence, array, or structure, to_display_string first materializes the complete recursively formatted std::string, and fromStdString then copies all of it into a QString; the 1,024-character limit is applied only afterward. Because buildSubscriptionUi repeats this for up to 128 retained reports on every 100-ms poll, a history of large valid values can still cause substantial allocation churn and delay report refreshes despite the advertised bound. Use a length-aware formatter that stops appending at the preview limit rather than truncating after full conversion.

AGENTS.md reference: AGENTS.md:L133-L140

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