Experimental Avro/Protobuf/Arrow reference encoders + PubSub adapters#7
Open
marcschier wants to merge 2 commits into
Open
Experimental Avro/Protobuf/Arrow reference encoders + PubSub adapters#7marcschier wants to merge 2 commits into
marcschier wants to merge 2 commits into
Conversation
…ters Adds two net8.0+ experimental libraries implementing the draft OPC UA DataEncoding extensions (opcua-drafts) as hand-rolled reference codecs plus PubSub NetworkMessage adapters, with NUnit round-trip tests. Libraries/Opc.Ua.Core.Experimental (IEncoder/IDecoder): - Avro: streaming Avro binary (zig-zag varint, LE floats, nullable unions, NodeId-by-parts); Variant/Action/Discovery support. SchemaId = CRC-64-AVRO Rabin fingerprint + single-object prefix. - Protobuf: hand-rolled protobuf wire; scoped to gRPC service messages. - Arrow: genuinely typed Apache Arrow (Apache.Arrow 18.1.0) - typed arrays, StructArray, ListArray, dense UnionArray; no JSON/blob carrier. Libraries/Opc.Ua.PubSub.Experimental: - Avro adapter drives the real AvroEncoder per field (Avro-in-Avro bytes). - Arrow adapter emits a real columnar RecordBatch (rows = DataSetMessages, typed per-field + header columns) per the Part 14 Arrow batch mapping. Build/scope notes: - net8.0;net9.0;net10.0 only (Apache.Arrow + net5+ BCL); RestrictForLegacyTfm no-ops the legacy CI CustomTestTarget matrix entries. - Round-trip-only conformance for this first reference; unsupported/out-of-scope decode paths fail loud (NotSupportedException), never corrupt. Includes fixes from code review: Avro present-empty-array terminator (fixed + regression test), Arrow dense-union declared type-ids made conformant, Arrow XmlElement decode implemented. Known limitation: Protobuf optional-presence reconstruction is unreliable for structures with 2+ optionals where an earlier one is absent (documented; not exercised by in-scope gRPC messages).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two experimental class libraries to the stack that implement the draft OPC UA DataEncoding extensions (Avro binary, Protobuf, Apache Arrow) as hand-rolled reference encoder/decoders, plus PubSub NetworkMessage adapters, with NUnit round-trip tests. These are the C# reference implementation of the spec drafts in the
marcschier/opcua-draftsrepo.New projects
Libraries/Opc.Ua.Core.Experimental—IEncoder/IDecoderimplementations:SchemaId= CRC-64-AVRO (Rabin) fingerprint with Avro single-object prefix.StructArray,ListArray, denseUnionArray,FixedSizeBinaryArray. No JSON/base64/blob carrier (asserted by tests).Libraries/Opc.Ua.PubSub.Experimental—INetworkMessageEncoder/Decoder:AvroEncoderper field (self-describing Avro-in-Avrobytes).RecordBatch(rows = DataSetMessages, typed per-field + leading header columns; NetworkMessage headers in schema metadata) per the Part 14 Arrow batch mapping (ADBC/historian oriented).Apache.Arrow 18.1.0added to central package management, four projects added toUA.slnx.Target frameworks / CI
BitConverter.SingleToUInt32Bits,Convert.ToHexString,Stream.ReadExactly). They opt intoRestrictForLegacyTfmso the per-TFM CI matrix entries pinned to legacy TFMs (net472/net48/netstandard2.x) no-op them (verified locally).Opc.Ua.Core.Experimental.Tests17/17 andOpc.Ua.PubSub.Experimental.Tests3/3 pass on net8.0 and net10.0; legacy CustomTestTarget builds no-op cleanly.Conformance / scope
NotSupportedException) rather than corrupt.Code-review fixes included
Null. Fixed inAvroEncoder.WriteArray+ a dedicated multi-field regression test.XmlElementnow round-trips instead of being silently dropped.Known limitation
ProtobufDecoder).Companion to the encoding spec drafts in
marcschier/opcua-drafts(PR #4).