Live AggregateFilter PercentGood/DurationGood count Uncertain as Good, disagreeing with Part 13 and HistoryRead #809

Closed
opened 2026-11-10 21:38:06 -05:00 by dohertj2 · 4 comments
Owner

Found while fixing #796.

The OPC UA SDK 2.0.1 upgrade (#782 / PR #802) copied the 1.5.378.182 aggregate calculators into src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Compatibility/Aggregates/, and OtOpcUaSdkServer.CreateAggregateManagerAsync registers them for live AggregateFilter monitored items. In that version StatusAggregateCalculator.ComputeDurationGoodBad counts Uncertain regions as Good when TreatUncertainAsBad=false (1.5.378.106 and SDK 2.0.1 itself count Good only).

Effect: live PercentGood / DurationGood include Uncertain time, while HistoryRead (SqlServer + QuestDB evaluators, Part 13 §5.4.3.31/§5.4.3.33, Mantis 0006166) excludes it. This contradicts ServerAggregateConfiguration's note that live subscriptions agree with history reads. Gateway does not serve PercentGood.

Blocked on an owner decision: the README next to the copied calculators records a 2026-11-10 (#782) decision to keep 1.5.378.182 live results exactly, and says any semantic change needs its own consumer-impact decision. ScadaBridge src uses neither AggregateFilter nor PercentGood/DurationGood, so exposure looks small.

If approved: override only the PercentGood/DurationGood calculators in app code (copied files stay untouched), exempt those cases from the 6,144-case golden test with a pinning test, and add a live-vs-history parity test with Uncertain samples.

Found while fixing #796. The OPC UA SDK 2.0.1 upgrade (#782 / PR #802) copied the 1.5.378.182 aggregate calculators into src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Compatibility/Aggregates/, and OtOpcUaSdkServer.CreateAggregateManagerAsync registers them for live AggregateFilter monitored items. In that version StatusAggregateCalculator.ComputeDurationGoodBad counts Uncertain regions as **Good** when TreatUncertainAsBad=false (1.5.378.106 and SDK 2.0.1 itself count Good only). Effect: live PercentGood / DurationGood include Uncertain time, while HistoryRead (SqlServer + QuestDB evaluators, Part 13 §5.4.3.31/§5.4.3.33, Mantis 0006166) excludes it. This contradicts ServerAggregateConfiguration's note that live subscriptions agree with history reads. Gateway does not serve PercentGood. **Blocked on an owner decision:** the README next to the copied calculators records a 2026-11-10 (#782) decision to keep 1.5.378.182 live results exactly, and says any semantic change needs its own consumer-impact decision. ScadaBridge src uses neither AggregateFilter nor PercentGood/DurationGood, so exposure looks small. If approved: override only the PercentGood/DurationGood calculators in app code (copied files stay untouched), exempt those cases from the 6,144-case golden test with a pinning test, and add a live-vs-history parity test with Uncertain samples.
dohertj2 changed title from zz-probe-delete-me to Live AggregateFilter PercentGood/DurationGood count Uncertain as Good, disagreeing with Part 13 and HistoryRead 2026-11-10 21:38:27 -05:00
dohertj2 added the blockedpriority:p2type:followup labels 2026-11-10 21:39:21 -05:00
Author
Owner

Related, found by #810: the SDK TimeAverage/Total also diverge from Part 13 when an interval starts late with an Uncertain first sample — see #821. Worth deciding together with this one.

Related, found by #810: the SDK TimeAverage/Total also diverge from Part 13 when an interval starts late with an Uncertain first sample — see #821. Worth deciding together with this one.
Author
Owner

Findings from #821 (2026-11-11), same QP data over [0,20) (Uncertain 10 @+5, Good 11 @+12, Uncertain 12 @+25):

Aggregate Live (frozen 1.5.378.182) SDK 2.0.1 stock Part 13 / our HistoryRead
Total 188.96 188.96 163.96
TimeAverage 9.448 (÷20 s) 9.448 10.93 (÷15 s)
DurationGood 15000 ms 8000 ms 8000 ms
PercentGood 75 40 40

The Total/TimeAverage divergence is triggered by the Uncertain FIRST sample (Good-first data agrees everywhere) and an SDK upgrade would not change it. Pinned by LiveAggregateLateStartFactsTests and SdkAggregateParityTests; a decision here should cover both.

Findings from #821 (2026-11-11), same QP data over [0,20) (Uncertain 10 @+5, Good 11 @+12, Uncertain 12 @+25): | Aggregate | Live (frozen 1.5.378.182) | SDK 2.0.1 stock | Part 13 / our HistoryRead | |---|---|---|---| | Total | 188.96 | 188.96 | 163.96 | | TimeAverage | 9.448 (÷20 s) | 9.448 | 10.93 (÷15 s) | | DurationGood | 15000 ms | 8000 ms | 8000 ms | | PercentGood | 75 | 40 | 40 | The Total/TimeAverage divergence is triggered by the Uncertain FIRST sample (Good-first data agrees everywhere) and an SDK upgrade would not change it. Pinned by `LiveAggregateLateStartFactsTests` and `SdkAggregateParityTests`; a decision here should cover both.
Author
Owner

Owner decision 2026-11-11: fix to match Part 13. Override only the live PercentGood/DurationGood calculators in app code (the copied files stay untouched). Exempt them from the 6,144-case golden test with a pinning test, and add a live-vs-history parity test with Uncertain samples. Unblocked.

Owner decision 2026-11-11: **fix to match Part 13.** Override only the live PercentGood/DurationGood calculators in app code (the copied files stay untouched). Exempt them from the 6,144-case golden test with a pinning test, and add a live-vs-history parity test with Uncertain samples. Unblocked.
Author
Owner

Done. Live PercentGood/DurationGood count Good time only (Part 13), matching HistoryRead. An app-owned calculator replaces those two aggregates; the copied SDK files are untouched. 64 of the 6,144 golden cases changed, each pinned to the old SDK's own Good-only result. A live-vs-history parity test is added. Pushed to master in e857135e..7a27ef1f; full suite green (20 projects, 0 failures, 0 warnings).

Done. Live PercentGood/DurationGood count Good time only (Part 13), matching HistoryRead. An app-owned calculator replaces those two aggregates; the copied SDK files are untouched. 64 of the 6,144 golden cases changed, each pinned to the old SDK's own Good-only result. A live-vs-history parity test is added. Pushed to master in `e857135e..7a27ef1f`; full suite green (20 projects, 0 failures, 0 warnings).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#809