Skip to content

feat: halve the record buffer now the store holds the backlog - #41

Merged
DavidCozens merged 1 commit into
mainfrom
stage/buffer-halve
Jul 30, 2026
Merged

feat: halve the record buffer now the store holds the backlog#41
DavidCozens merged 1 commit into
mainfrom
stage/buffer-halve

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Pull request

What this stage adds

The ring is sized in records, so doubling the message cap doubled its cost. Four
records is enough to absorb a burst logged while the service task is sending; the
store, not the ring, is what holds a backlog.

Flash +11,980 B (unchanged)
RAM +7,384 B (-2,056)
Log stack +704 B (unchanged)
Service +992 B (unchanged)

Static RAM is the only figure that moves, and it is exactly four records at the cap
plus a two-byte length prefix each. Nothing else is affected: the ring bounds how
many records can be in flight, not how large one may be.

Taken with the cap rise, the pair costs 248 bytes. The ring ends up 8 bytes smaller
than it was before the cap moved — four records at 512 is less than eight at 256 —
so what is actually being paid for is the store's single record buffer, which
follows the cap and cannot be halved.

Files

 README.md                     | 15 ++++++++-------
 app/syslog/Syslog.c           |  7 ++++---
 measurements/buffer-halve.csv | 13 +++++++++++++
 measurements/stages.tsv       |  1 +
 run-report.md                 | 26 +++++++++++++-------------
 5 files changed, 39 insertions(+), 23 deletions(-)

Checklist

  • The diff is application-only — no change to board bring-up, config headers, or build infra.
  • measurements/buffer-halve.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: 14 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

  • Improvements

    • Reduced the system log buffer size from eight records to four, lowering static memory usage while retaining capacity for short bursts when log delivery is busy.
    • Updated resource-usage measurements to reflect the smaller buffer configuration.
  • Documentation

    • Updated configuration guidance, cost figures, and performance tables to describe the smaller ring setting.
    • Refreshed validation and measurement reports with results from the updated configuration.

The ring is sized in records, so doubling the message cap doubled its cost. Four
records is enough to absorb a burst logged while the service task is sending; the
store, not the ring, is what holds a backlog.

  Flash      +11,980 B  (unchanged)
  RAM         +7,384 B     (-2,056)
  Log stack     +704 B  (unchanged)
  Service       +992 B  (unchanged)

Static RAM is the only figure that moves, and it is exactly four records at the cap
plus a two-byte length prefix each. Nothing else is affected: the ring bounds how
many records can be in flight, not how large one may be.

Taken with the cap rise, the pair costs 248 bytes. The ring ends up 8 bytes smaller
than it was before the cap moved — four records at 512 is less than eight at 256 —
so what is actually being paid for is the store's single record buffer, which
follows the cap and cannot be halved.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@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: a4071a0f-c469-4a2f-bb80-6f490c8c7d46

📥 Commits

Reviewing files that changed from the base of the PR and between 9fb81d6 and b610b5e.

⛔ Files ignored due to path filters (2)
  • measurements/buffer-halve.csv is excluded by !**/*.csv
  • measurements/stages.tsv is excluded by !**/*.tsv
📒 Files selected for processing (3)
  • README.md
  • app/syslog/Syslog.c
  • run-report.md

📝 Walkthrough

Walkthrough

The syslog circular buffer is reduced from eight records to four. README stage costs, aggregate resource deltas, and the generated run report are updated for the smaller-ring configuration.

Changes

Smaller ring stage

Layer / File(s) Summary
Reduce syslog ring capacity
app/syslog/Syslog.c
Changes SYSLOG_BUFFER_RECORDS from eight to four and documents the ring’s burst-buffering role.
Update measurements and documentation
README.md, run-report.md
Replaces the larger-cap stage with the smaller-ring stage and updates cost figures, run measurements, size totals, captured logs, and self-check assertions.

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 clearly summarizes the main change: reducing the syslog record buffer because the store now holds backlog.
Description check ✅ Passed The description matches the template and includes the required stage summary and checklist items with all checks filled.
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/buffer-halve

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

@DavidCozens
DavidCozens merged commit cc775f5 into main Jul 30, 2026
2 checks passed
@DavidCozens
DavidCozens deleted the stage/buffer-halve branch July 30, 2026 06:52
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