feat: enable splitting SesameWindowed buffers into 2 or 3#1260
Conversation
Dependency ReviewThe following issues were found:
Snapshot WarningsConsider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issuesexternal/segger_rtt/CMakeLists.txt
lwip/lwip/CMakeLists.txt
external/crypto/micro-ecc/CMakeLists.txt
external/crypto/tiny-aes128/CMakeLists.txt
osal/threadx/CMakeLists.txt
external/protobuf/CMakeLists.txt
infra/syntax/CMakeLists.txt
external/crypto/mbedtls/CMakeLists.txt
cmake/emil_test_helpers.cmake
osal/freertos/CMakeLists.txt
external/args/CMakeLists.txt
OpenSSF ScorecardScorecard details
Scanned Files
|
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 11 | 0 | 0 | 0.28s | |
| ✅ ACTION | zizmor | 11 | 0 | 0 | 0 | 2.74s |
| ✅ CPP | clang-format | 1098 | 8 | 0 | 0 | 9.84s |
| ✅ DOCKERFILE | hadolint | 2 | 0 | 0 | 0.09s | |
| ✅ JSON | jsonlint | 7 | 0 | 0 | 0.38s | |
| ✅ JSON | prettier | 7 | 0 | 0 | 0 | 0.58s |
| markdownlint | 8 | 0 | 5 | 0 | 1.21s | |
| ✅ MARKDOWN | markdown-table-formatter | 8 | 0 | 0 | 0 | 0.29s |
| ✅ REPOSITORY | checkov | yes | no | no | 33.5s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.09s | |
| ✅ REPOSITORY | grype | yes | no | no | 55.7s | |
| ✅ REPOSITORY | ls-lint | yes | no | no | 0.01s | |
| osv-scanner | yes | 1 | no | 0.77s | ||
| ✅ REPOSITORY | secretlint | yes | no | no | 17.67s | |
| ✅ REPOSITORY | syft | yes | no | no | 1.8s | |
| ✅ REPOSITORY | trivy | yes | no | no | 19.32s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.29s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 12.13s | |
| lychee | 140 | 1 | 0 | 109.11s | ||
| prettier | 21 | 1 | 1 | 0 | 0.74s | |
| ✅ YAML | v8r | 21 | 0 | 0 | 10.25s | |
| ✅ YAML | yamllint | 21 | 0 | 0 | 0.87s |
Detailed Issues
⚠️ SPELL / lychee - 1 error
📝 Summary
---------------------
🔍 Total..........697
🔗 Unique.........661
✅ Successful.....691
⏳ Timeouts.........0
🔀 Redirected.....309
👻 Excluded.........5
❓ Unknown..........0
🚫 Errors...........1
⛔ Unsupported......1
Errors in external/protoc/CMakeLists.txt
[404] https://github.com/protocolbuffers/protobuf/releases/download/v$%7Bprotobuf_tag%7D/protoc-$%7Bprotobuf_version%7D-$%7Bos_postfix%7D.zip (at 18:13) | Rejected status code: 404 Not Found
Hint: Followed 309 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
⚠️ MARKDOWN / markdownlint - 5 errors
.github/instructions/microtest.instructions.md:7 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "## Google Test Suite Coding Ru..."]
external/crypto/tiny-aes128/README.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "### Tiny AES128 in C"]
external/crypto/tiny-aes128/README.md:29 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
external/crypto/tiny-aes128/README.md:39 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
external/crypto/tiny-aes128/README.md:49 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
⚠️ REPOSITORY / osv-scanner - 1 error
Scanning dir .
Starting filesystem walk for root: /
Scanned external/segger_rtt file and found 0 packages
Scanned external/args file and found 0 packages
Scanned external/protobuf file and found 0 packages
Scanned external/protoc file and found 0 packages
Scanned external/crypto file and found 0 packages
End status: 155 dirs visited, 1618 inodes visited, 5 Extract calls, 549.503713ms elapsed, 549.503943ms wall time
No package sources found, --help for usage information.
⚠️ YAML / prettier - 1 error
[error] Explicitly specified pattern "documents/modules/ROOT/examples/clangformat.yaml" is a symbolic link.
.clusterfuzzlite/project.yaml 29ms (unchanged)
.github/dependabot.yml 14ms (unchanged)
.github/workflows/ci.yml 67ms (unchanged)
.github/workflows/dependency-scanner.yml 10ms (unchanged)
.github/workflows/documentation.yml 11ms (unchanged)
.github/workflows/fuzzing-batch.yml 5ms (unchanged)
.github/workflows/fuzzing-cron.yml 11ms (unchanged)
.github/workflows/fuzzing-pr.yml 8ms (unchanged)
.github/workflows/linting-formatting.yml 11ms (unchanged)
.github/workflows/release-please.yml 16ms (unchanged)
.github/workflows/security.yml 6ms (unchanged)
.github/workflows/static-analysis.yml 10ms (unchanged)
.github/workflows/validate-pr.yml 15ms (unchanged)
.ls-lint.yml 2ms
.mega-linter.yml 3ms (unchanged)
antora-playbook-branch.yml 5ms (unchanged)
antora-playbook-site.yml 4ms (unchanged)
documents/antora.yml 3ms (unchanged)
documents/supplemental-ui/ui.yml 1ms (unchanged)
mull.yml 2ms (unchanged)
Notices
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.5.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,ACTION_ZIZMOR,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

Show us your support by starring ⭐ the repository
There was a problem hiding this comment.
Pull request overview
This PR extends the SesameWindowed/Cobs instantiation path to support splitting the underlying buffers into 2 or 3 segments (via a new SplitBuffers parameter), and threads that configuration through the various Sesame/Echo instantiation helpers (including secured + tracing variants).
Changes:
- Add
SplitBuffersconfiguration plumbing throughSesameWindowed,main_::Sesamestorage helpers, and Echo/Sesame secured + tracing instantiations. - Generalize
SesameWindowed::bufferSizeForMessageand related max-send sizing logic to useSplitBuffers. - Update/extend tests to match the new
bufferSizeForMessagetemplate signature.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| services/util/test/TestSesameWindowed.cpp | Updates expectations for the new bufferSizeForMessage template parameters. |
| services/util/SesameWindowed.hpp | Introduces SplitBuffers support in the API and generalizes buffer-size computation. |
| services/util/SesameWindowed.cpp | Uses splitBuffers in sizing/state logic when determining max send size and release-window behavior. |
| services/util/SesameInstantiation.hpp | Adds a CobsStorageBase indirection and threads SplitBuffers into storage sizing. |
| services/util/SesameInstantiation.cpp | Updates Sesame construction to use CobsStorageBase and pass windowedReceiveBuffers to SesameWindowed. |
| services/util/SesameInstantiationSecured.hpp | Threads SplitBuffers through SesameSecured instantiation via storage base. |
| services/util/SesameInstantiationSecured.cpp | Updates secured Sesame construction to use CobsStorageBase. |
| services/util/EchoInstantiation.hpp | Threads SplitBuffers into Echo-on-Sesame instantiation templates and forwarding helpers. |
| services/util/EchoInstantiation.cpp | Updates Echo-on-Sesame construction to use CobsStorageBase. |
| services/util/EchoInstantiationSecured.hpp | Threads SplitBuffers into secured Echo-on-Sesame instantiation templates. |
| services/util/EchoInstantiationSecured.cpp | Updates secured Echo-on-Sesame construction to use CobsStorageBase. |
| services/tracer/TracingSesameWindowed.hpp | Updates tracing wrapper constructor signature to pass splitBuffers. |
| services/tracer/TracingSesameWindowed.cpp | Passes splitBuffers through to the SesameWindowed base. |
| services/tracer/TracingEchoInstantiation.hpp | Threads SplitBuffers into tracing Echo-on-Sesame instantiation templates. |
| services/tracer/TracingEchoInstantiation.cpp | Updates tracing Echo-on-Sesame construction to use CobsStorageBase. |
| services/tracer/TracingEchoInstantiationSecured.hpp | Threads SplitBuffers into secured tracing Echo-on-Sesame instantiation templates (incl. mbedTLS crypto helper). |
| services/tracer/TracingEchoInstantiationSecured.cpp | Updates secured tracing Echo-on-Sesame construction to use CobsStorageBase. |
Comments suppressed due to low confidence (1)
services/util/SesameWindowed.cpp:66
splitBuffersis used as a divisor inMaxSendMessageSize()and state transitions, but the constructor does not validate it. Passing 0 (or 1) would cause a divide-by-zero / invalid behavior at runtime.
SesameWindowed::SesameWindowed(infra::BoundedDeque<uint8_t>& receivedMessage, uint8_t splitBuffers, SesameEncoded& delegate, SesameInitializer& sesameInitializer)
: SesameEncodedObserver(delegate)
, receivedMessage(receivedMessage)
, splitBuffers(splitBuffers)
, sesameInitializer(sesameInitializer)
, ownBufferSize(static_cast<uint16_t>(SesameEncodedObserver::Subject().MaxSendMessageSize()))
, releaseWindowSize(static_cast<uint16_t>(SesameEncodedObserver::Subject().WorstCaseEncodedMessageSize(sizeof(PacketReleaseWindow))))
, state(std::in_place_type_t<StateSendingInit>(), *this)
{
…buffers # Conflicts: # services/util/test/CMakeLists.txt
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
services/util/SesameWindowed.cpp:68
- The constructor accepts
splitBuffersat runtime but does not validate it. SincesplitBuffersis later used as a divisor (e.g. inMaxSendMessageSize()andSetNextState()), passing 0 or 1 would cause division-by-zero/incorrect behavior. Adding anassert(orreally_assert) here prevents undefined behavior and documents the precondition.
SesameWindowed::SesameWindowed(infra::BoundedDeque<uint8_t>& receivedMessage, uint8_t splitBuffers, SesameEncoded& delegate, SesameInitializer& sesameInitializer)
: SesameEncodedObserver(delegate)
, receivedMessage(receivedMessage)
, splitBuffers(splitBuffers)
, sesameInitializer(sesameInitializer)
, ownBufferSize(static_cast<uint16_t>(SesameEncodedObserver::Subject().MaxSendMessageSize()))
, releaseWindowSize(static_cast<uint16_t>(SesameEncodedObserver::Subject().WorstCaseEncodedMessageSize(sizeof(PacketReleaseWindow))))
, state(std::in_place_type_t<StateSendingInit>(), *this)
{
state->Request();
}
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
services/util/SesameWindowed.cpp:92
- Reset() clears initialized/sentInitResponse/etc., but it does not reset requestingInitialization. If Reset() is called while an init request is pending, requestingInitialization can remain true and later prevent ReceivedInitialize() from running on an initResponse, leaving the instance stuck uninitialized.
void SesameWindowed::Reset()
{
SesameEncodedObserver::Subject().Reset();
assert(currentReceiveMessageReader == std::nullopt);
assert(!readerAccess.Referenced());
initialized = false;
sentInitResponse = false;
otherAvailableWindow = 0;
maxUsableBufferSize = 0;
releasedWindow = 0;
sendInitResponse = false;
|



This PR extends the SesameWindowed/Cobs instantiation path to support splitting the underlying buffers into 2 or 3 segments (via a new SplitBuffers parameter), and threads that configuration through the various Sesame/Echo instantiation helpers (including secured + tracing variants).