Svc::TlmPacketizer: shrink per-channel packetOffset storage from FwSignedSizeType to I16 - #3
Open
Mikefly123 wants to merge 1 commit into
Open
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…gnedSizeType to I16 TlmEntry stores FwSignedSizeType packetOffset[MAX_PACKETIZER_PACKETS] per channel. The value is a byte offset into a ComBuffer-sized packet (bounded by FW_COM_BUFFER_MAX_SIZE, typically a few hundred bytes) or the -1 'not in this packet' sentinel -- a 64-bit signed type per slot is 4-8x oversized. Shrink to I16 (keeps the -1 sentinel; supports packet offsets to 32 KB) with a config-time FW_ASSERT range guard at the single assignment site in setPacketList. Validated on a real CubeSat deployment (MAX_PACKETIZER_CHANNELS=202, MAX_PACKETIZER_PACKETS=22, RP2350/Zephyr, v5e flight board): - -27,472 B BSS (60,480 -> 33,008 B, -45%) in CdhCore::tlmSend - Svc/TlmPacketizer UTs: 12/12 passed (1 pre-existing skip) - HWIL-verified: clean boot, NO_OP round-trip, packetized telemetry decodes bit-correct, SEND_PKT works; live heap walk matches nm prediction exactly (free-at-boot 11,504 -> 38,976 B) Tracked by Open-Source-Space-Foundation/proves-core-reference#469.
Mikefly123
force-pushed
the
fix/tlmpacketizer-i16-offset
branch
from
July 31, 2026 03:00
6a26dce to
a80c4f6
Compare
Mikefly123
changed the base branch from
pcr-usp-base
to
fix/sched-tick-drop-annotations
July 31, 2026 03:00
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TlmPacketizer::TlmEntrystoresFwSignedSizeType packetOffset[MAX_PACKETIZER_PACKETS]per channel. The value is a byte offset into a ComBuffer-sized packet (bounded by
FW_COM_BUFFER_MAX_SIZE, typically a few hundred bytes) or the-1"not in thispacket" sentinel -- a 64-bit signed type per slot is 4-8x oversized. Shrinks the array
to
I16(keeps the-1sentinel; supports packet offsets to 32 KB) with aconfig-time
FW_ASSERTrange guard retightened at the single assignment site insetPacketList. No other changes needed: the sentinel comparisons and buffer-indexuses compile cleanly with
I16via integer promotion.Why
On small targets this field dominates the component's footprint. Diff is 3 lines +
2 comment lines.
Validation
Measured on a real CubeSat deployment (
MAX_PACKETIZER_CHANNELS=202,MAX_PACKETIZER_PACKETS=22, RP2350/Zephyr, PROVES v5e flight board):CdhCore::tlmSend(60,480 -> 33,008 B, -45%)bit-correct (49 distinct channels, sane values); NO_OP round-trip PASS; SEND_PKT
PASS for Beacon and Health packets; live heap walk (
sys_heap) matches thenm-predicted BSS delta exactly -- free-at-boot grew 11,504 -> 38,976 B (+239%),reclaimed BSS moved 1:1 into the malloc arena.
Base branch note
This PR targets
pcr-usp-base, a branch pinned at8a62e455a90b6d4f498c332d45d65a2a819988d8(the v4.2.2-era commit that
lib/fprimeis pinned to inproves-core-reference#439),
not
devel, which has diverged significantly from that pinned commit.Provenance
This change was not carried as a reusable branch on
Mikefly123/fprime; it wasprototyped directly against
8a62e455and applied here from the source patch(
fprime-tlmpacketizer-i16-offset.patch, seeproves-core-referencebench-diag logs) ontopcr-usp-base. Byte-equivalent byconstruction (the patch applied cleanly with no fuzz).
Related