Skip to content

feat: fit the message cap, the pools, the ring and the stacks to this device - #18

Merged
DavidCozens merged 1 commit into
mainfrom
stage-18-right-size
Aug 16, 2026
Merged

feat: fit the message cap, the pools, the ring and the stacks to this device#18
DavidCozens merged 1 commit into
mainfrom
stage-18-right-size

Conversation

@DavidCozens

Copy link
Copy Markdown
Contributor

Fit the compile-time sizes to what this device uses, now that every collaborator is in place.

The message cap comes first, because the ring, the store's record buffer and the formatter frame on
both task stacks all follow it.

/* app/config/solid_syslog_tunables.h */
#define SOLIDSYSLOG_MAX_MESSAGE_SIZE 400U

#define SOLIDSYSLOG_ADDRESS_POOL_SIZE 1U
#define SOLIDSYSLOG_TCP_STREAM_POOL_SIZE 1U
#define SOLIDSYSLOG_STREAM_SENDER_POOL_SIZE 1U

The worst case measured here is 345 octets: the four SD-ELEMENTs with both counters at full 32-bit
width and both addresses at fifteen characters, plus a short message. 400 allows for longer messages
on this device. Anything longer is truncated rather than dropped.

The pool defaults suit a device running several transports at once. This one runs a single sender
over a single stream to a single destination.

The overrides reach the library through SOLIDSYSLOG_USER_TUNABLES_FILE, an absolute path quoted
for the preprocessor and given to every group that includes a SolidSyslog header: Core, the platform
sources and this application. They change struct sizes, and a build where only some translation
units saw them would disagree about how big those structs are.

The ring drops from eight records to four. The store holds a backlog, so the ring only has to absorb
what can be logged while the service task is sending.

The task stacks go last, at twice their measured high-water marks rounded up to a whole
configMINIMAL_STACK_SIZE.

When you need it. Once the pipeline is complete. Sizing earlier means sizing against a device
that is still missing collaborators.

@DavidCozens

Copy link
Copy Markdown
Contributor Author

@coderabbitai pause

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews paused.

… device

Every collaborator is in place, so the compile-time sizes come down to what the
device uses.

  Flash      +13,788 B  (unchanged)
  RAM        +36,048 B    (-3,488)
  Log stack     +600 B       (-80)
  Service     +3,688 B       (-80)

The message cap comes first: the ring, the store's record buffer and the
formatter frame on both task stacks all follow it. The worst case measured here
is 345 octets — four SD-ELEMENTs with both counters at full 32-bit width and both
addresses at fifteen characters, plus a short message — and the cap is set to 400
to allow for longer messages on this device.

The ring then drops from eight records to four, the store holding the backlog.
Three pool tunables come down to one, the library's defaults being sized for a
device running several transports at once. The stacks go last, at twice their
measured high-water marks rounded up to a whole configMINIMAL_STACK_SIZE.

The overrides arrive through SOLIDSYSLOG_USER_TUNABLES_FILE, as an absolute path
quoted for the preprocessor, and every group that includes a SolidSyslog header
is given it: Core, the platform sources and this application. They change struct
sizes, and a build where only some translation units saw them would disagree
about how big those structs are.

Nothing here changes what the device does or what protection it is under.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DavidCozens
DavidCozens changed the base branch from stage-17-aes-gcm to main August 16, 2026 21:52
@DavidCozens
DavidCozens merged commit 63ca862 into main Aug 16, 2026
1 check was pending
@DavidCozens
DavidCozens deleted the stage-18-right-size branch August 16, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant