Skip to content

Add flatbuffers component#2720

Open
OliverHeilwagen wants to merge 5 commits intoeclipse-score:mainfrom
etas-contrib:add_flatbuffers_component
Open

Add flatbuffers component#2720
OliverHeilwagen wants to merge 5 commits intoeclipse-score:mainfrom
etas-contrib:add_flatbuffers_component

Conversation

@OliverHeilwagen
Copy link
Copy Markdown
Contributor

resolves issue #1935

  • Add component request
  • Add feature requirement
  • Add initial set of component requirements

@github-actions
Copy link
Copy Markdown

⚠️ Docs-as-Code version mismatch detected
Please check the CI build logs for details and align the documentation version with the Bazel dependency.

@OliverHeilwagen OliverHeilwagen force-pushed the add_flatbuffers_component branch from f727465 to b95dda6 Compare March 26, 2026 08:59
@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

Verification only validates the buffer structure (e.g. offsets, vtables, field boundaries),
not the correctness or integrity of the payload data.

.. comp_req:: Load FlatBuffers Binary File
Copy link
Copy Markdown
Contributor Author

@OliverHeilwagen OliverHeilwagen Mar 26, 2026

Choose a reason for hiding this comment

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

I guess this should be removed and is a duplicate of comp_req__filesystem__file_io

@OliverHeilwagen OliverHeilwagen force-pushed the add_flatbuffers_component branch from b95dda6 to 2087bf4 Compare March 26, 2026 09:08
Copy link
Copy Markdown

@paulquiring paulquiring left a comment

Choose a reason for hiding this comment

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

Only some minor findings.

Copy link
Copy Markdown
Contributor

@aschemmel-tech aschemmel-tech left a comment

Choose a reason for hiding this comment

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

Generally the component request is well documented. Also the related issue is correctly using the change request template, Several findings documented in inline comments to resolve still.

@@ -0,0 +1,198 @@
..
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
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.

I think new files should have "2026"

and the potential for configuration-related runtime errors.


Basic Functionality
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 the template this is called "Specification" - why rename?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Forgot about the template, headings are now aligned again.

Basic Functionality
===================

The ``flatc`` compiler shall generate code for serializing, accessing, and verifying
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.

isn't this rather code for deserializing? I mean from the binary data back?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That is the benefit of FlatBuffers it doesn't require deserialization, it basically just does some pointer hops and access the data.


The FlatBuffers-Library shall provide services for serialization, zero-copy access of
FlatBuffers binary data, and structural verification of buffers. The library shall also support
loading FlatBuffers binary files and optionally provide common buffer identification and version
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.

what means optionally? does it provide it or not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wording should be changed to opt-in buffer identification.
On default FlatBuffers only provide a 4 character buffer identification (identifier).

The intention is to provide a small default schema for a common schema version. If this is placed at the front of the buffer (1st element), a common reader is possible that doesn't need to know the module specific details.

However the module schema need to actively select it or omit it.

FlatBuffers binary data. Code generation shall be provided for C++ and Rust at ASIL-B level
and other languages as needed at QM level (e.g. Python).

The FlatBuffers-Library shall provide services for serialization, zero-copy access of
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.

this sounds very much like the feature requirement, you could also just refer to this here?


.. note::
Python code generation is nice-to-have for benchmark testing (scale configurations).
It is not intended for safety certification (meta model check requires safety level ASIL-B).
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.

now I understand: this is because you qualified the feature requirement as ASIL_B. Try it with setting the flatbuffers feature requirement to QM and linking to feat_req__baselibs__safety for the ASIL_B component /tool requirements.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah nice, i was not aware of this yet. I will change it accordingly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated accordingly, all ASIL-B requirements now link additionally to feat_req__baselibs__safety

:implemented: NO

The FlatBuffers-Library tooling shall support creation of FlatBuffers binary files from
JSON-encoded files conforming to the corresponding FlatBuffers schema.
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.

let's say "provided" instead "corresponding" - because how would the tool judge?

:implemented: NO

The FlatBuffers-Library tooling shall support creation of FlatBuffers binary files from
JSON-encoded files conforming to the corresponding FlatBuffers schema.
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.

What happens if the JSON-encoded files do not conform to the FlatBuffers schema.

Copy link
Copy Markdown
Contributor Author

@OliverHeilwagen OliverHeilwagen Apr 2, 2026

Choose a reason for hiding this comment

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

Serialisation of the binary from the JSON fails.
The baselibs PR has a manual demo for it:
https://github.com/eclipse-score/baselibs/pull/131/changes#diff-65ac3f00480b8aaa2ad3de2e8be4860118fe1ca9f6ab1ad23fbcf9a665f115d5R69

Later it is intended to be covered by schema support checks (good cases: boundaries, equivalence; bad cases). We need to see how much we demand modules to redo such tests. Minimum what i see is e2e integration test for module specific schema (boundaries, equivalence)

:status: invalid
:implemented: NO

The FlatBuffers-Library tooling shall provide a mechanism to validate FlatBuffers data against
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.

It is not clear what the inputs (config.bin, config.fbs) are and what is the output (result: valid/invalid).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will mention them in the requirement so the expected behaviour is known.

:status: invalid
:implemented: NO

The FlatBuffers-Library tooling shall provide a mechanism to check whether a new version of a
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.

What is this needed for. For every SW release the config binary and genarated code is produced again. Backward compatibility would be an issue if we have the config.bin in NVM (use for read/write) and not replace it. But why should we do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For the configuration use case i also don't see it necessary, but we should support typical use cases e.g. transport of size limited FlatBuffers via mw::com or other transport mediums.
For such extended use cases the evolution check will be helpful. However we can also omit it for now and introduce it, once it is requested.

:security: YES
:realizes: wp__requirements_comp

FlatBuffers Tooling Requirements
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Add @flatbuffers//:flatc to the development tool list: docs/score_tools/tools_build_development/bazel.rst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants