Repository navigation
[v2.16]fix(driver): accept UINT64 write values for numeric tags - #2961
Conversation
Sparkplug B encodes UInt64 metrics as an unsigned 64-bit value, which cannot be represented by an INT64 write value. Accept NEU_TYPE_UINT64 writes for numeric tags, evaluate the range with the unsigned value, and extend cal_decimal and float conversion accordingly. INT64 write values keep their signed semantics.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2.16 #2961 +/- ##
==========================================
- Coverage 69.00% 68.88% -0.12%
==========================================
Files 137 137
Lines 34860 34870 +10
==========================================
- Hits 24055 24021 -34
- Misses 10805 10849 +44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26a4f828b7
ℹ️ 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 (write_type == NEU_TYPE_INT64) { | ||
| result = (long double) value; | ||
| } else if (write_type == NEU_TYPE_UINT64) { | ||
| result = (long double) (uint64_t) value; |
There was a problem hiding this comment.
Preserve fractional checks for wide UINT64 transforms
On the x86_64 target configured in .github/workflows/ci.yml, long double has only 64 mantissa bits, so for newly accepted unsigned values above INT64_MAX the subsequent bias or division can round away every fractional bit before the integer check. For example, writing UINT64_MAX to a UINT64 tag with bias 0.5 turns result into UINT64_MAX - 1, passes the integrality check, and makes cal_decimal write that different value, whereas the exact transformed value is a half-integer that should be rejected; preserve the fractional remainder or use wider/exact arithmetic in both validation and conversion.
Useful? React with 👍 / 👎.
Sparkplug B encodes UInt64 metrics as an unsigned 64-bit value, which cannot be represented by an INT64 write value. Accept NEU_TYPE_UINT64 writes for numeric tags, evaluate the range with the unsigned value, and extend cal_decimal and float conversion accordingly. INT64 write values keep their signed semantics.