Skip to content

feat: raise the message cap to fit the grown record - #40

Merged
DavidCozens merged 1 commit into
mainfrom
stage/cap-rise
Jul 30, 2026
Merged

feat: raise the message cap to fit the grown record#40
DavidCozens merged 1 commit into
mainfrom
stage/cap-rise

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Pull request

What this stage adds

Three SD-ELEMENTs put the record at 245 bytes, but sequenceId and sysUpTime are
both 32-bit counters: at full width the same record is 261 bytes, past the 256-byte
cap and into truncation. The cap doubles to 512.

Flash +11,980 B (+8 on the previous stage)
RAM +9,440 B (+2,304)
Log stack +704 B (+256)
Service +992 B (+256)

The cap is the largest single demand the formatter makes of whichever task calls
it, so both stacks rise by exactly the difference — 568 to 824 on the log task, 788
to 1,044 on the service task. Both seams were sized at 2 KiB when the send moved,
so they absorb it and no RAM moves with them.

The RAM that does move accounts for itself exactly. The ring is eight records at
the cap plus a two-byte length prefix each, so it grows 2,048. The store keeps one
record buffer of cap plus integrity trailer plus framing, so it grows 256. That is
the whole 2,304.

The store is otherwise unaffected. SOLIDSYSLOG_FILE_DEFAULT_BLOCK_SIZE must hold
one worst-case record — cap plus integrity trailer plus five framing bytes, 549
here — and at 8192 it has room to spare.

Files

 README.md                          | 15 +++++++++------
 app/config/solid_syslog_tunables.h | 10 ++++------
 measurements/cap-rise.csv          | 13 +++++++++++++
 measurements/stages.tsv            |  1 +
 run-report.md                      | 38 +++++++++++++++++++-------------------
 5 files changed, 46 insertions(+), 31 deletions(-)

Checklist

  • The diff is application-only — no change to board bring-up, config headers, or build infra.
  • measurements/cap-rise.csv committed.
  • Row added to measurements/stages.tsv.
  • README regenerated: python3 scripts/gen-cost-table.py.
  • ./run.sh green (build + QEMU + baseline self-check) — run-report.md committed.

Context for review: 13 of 21 sequential single-commit PRs replaying the integration on top of the Baseline root. Each lands green and reviewed before the next is built on it, because a change to an early commit would force every commit above it to be re-run and re-measured.

Summary by CodeRabbit

  • New Features

    • Increased the maximum syslog message size from 256 to 512 bytes, allowing longer records (with over-length messages truncated rather than dropped).
  • Documentation

    • Updated README stage guidance to describe the larger message-cap behavior and refreshed related cost comparisons.
    • Refreshed run-report measurements and self-check assertions to match the cap-rise build results.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 98ab90ad-4493-4ade-bf18-49ee42d961c9

📥 Commits

Reviewing files that changed from the base of the PR and between bb51efb and 3746c59.

⛔ Files ignored due to path filters (2)
  • measurements/cap-rise.csv is excluded by !**/*.csv
  • measurements/stages.tsv is excluded by !**/*.tsv
📒 Files selected for processing (3)
  • README.md
  • app/config/solid_syslog_tunables.h
  • run-report.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • README.md
  • run-report.md

📝 Walkthrough

Walkthrough

The compile-time SolidSyslog message cap increases from 256U to 512U. README stage and cost-table entries, along with cap-rise measurements, baseline checks, and self-check output, are updated to match.

Changes

Syslog message cap update

Layer / File(s) Summary
Update message cap
app/config/solid_syslog_tunables.h
The SOLIDSYSLOG_MAX_MESSAGE_SIZE override changes from 256U to 512U.
Update cap-rise documentation and measurements
README.md, run-report.md
Stage descriptions, cost figures, run measurements, baseline checks, BOOT output, and self-check assertions are updated for the cap-rise run.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: increasing the message cap.
Description check ✅ Passed The description matches the template and covers the required summary, checklist, and implementation details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stage/cap-rise

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/config/solid_syslog_tunables.h`:
- Around line 7-10: Update the comment above SOLIDSYSLOG_MAX_MESSAGE_SIZE to
avoid claiming RFC 5424 interoperability for 512 bytes; explicitly describe the
cap as applying to the bundled collector, or change the constant to the minimum
standards-supported receiver size if it is intended as a general
interoperability limit.

In `@README.md`:
- Around line 19-24: Update the “Larger cap” cost description in the README to
say the cost is primarily RAM, reflecting the reported Flash increase as well as
the RAM increase. Leave the generated cost table and its markers unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fb6fd628-adac-4972-8f74-cd105d593980

📥 Commits

Reviewing files that changed from the base of the PR and between 57262b5 and bb51efb.

⛔ Files ignored due to path filters (2)
  • measurements/cap-rise.csv is excluded by !**/*.csv
  • measurements/stages.tsv is excluded by !**/*.tsv
📒 Files selected for processing (3)
  • README.md
  • app/config/solid_syslog_tunables.h
  • run-report.md

Comment thread app/config/solid_syslog_tunables.h
Comment thread README.md Outdated
Three SD-ELEMENTs put the record at 245 bytes, but sequenceId and sysUpTime are
both 32-bit counters: at full width the same record is 261 bytes, past the 256-byte
cap and into truncation. The cap doubles to 512.

  Flash      +11,980 B      (+8 on the previous stage)
  RAM         +9,440 B       (+2,304)
  Log stack     +704 B         (+256)
  Service       +992 B         (+256)

The cap is the largest single demand the formatter makes of whichever task calls
it, so both stacks rise by exactly the difference — 568 to 824 on the log task, 788
to 1,044 on the service task. Both seams were sized at 2 KiB when the send moved,
so they absorb it and no RAM moves with them.

The RAM that does move accounts for itself exactly. The ring is eight records at
the cap plus a two-byte length prefix each, so it grows 2,048. The store keeps one
record buffer of cap plus integrity trailer plus framing, so it grows 256. That is
the whole 2,304.

The store is otherwise unaffected. SOLIDSYSLOG_FILE_DEFAULT_BLOCK_SIZE must hold
one worst-case record — cap plus integrity trailer plus five framing bytes, 549
here — and at 8192 it has room to spare.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DavidCozens
DavidCozens merged commit 9fb81d6 into main Jul 30, 2026
2 checks passed
@DavidCozens
DavidCozens deleted the stage/cap-rise branch July 30, 2026 06:08
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