Skip AdvantageKit mirror of Property values from NetworkTables (-459 entries for 2026 code in sim)#675
Open
aschokking wants to merge 1 commit into
Open
Skip AdvantageKit mirror of Property values from NetworkTables (-459 entries for 2026 code in sim)#675aschokking wants to merge 1 commit into
aschokking wants to merge 1 commit into
Conversation
Properties currently cost two NT entries each: one at /Preferences/<prefix>/<suffix> (WPILib Preferences, the editable/savable dashboard surface) and a redundant mirror at /AdvantageKit/<prefix>/<suffix> that comes from Logger.processInputs() recording the property value for replay correctness. Route Property processInputs() calls through a dedicated PropertyMirror/ subtable in the AKit log, then wrap NT4Publisher to drop that subtable on the way to NT. The on-disk WPILOG receiver still captures everything, so replay sees the property value the robot used. The /Preferences/... surface is unchanged. Net effect: roughly halves the AdvantageKit slice of NT traffic with no loss of dashboard editability or replay fidelity. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
This PR was written by Claude Opus 4.8 with my direction and manual verification of changes.
Why are we doing this?
Each Property currently costs two NetworkTables entries:
/Preferences/<prefix>/<suffix>— the WPILibPreferences-backed editable/savable dashboard surface./AdvantageKit/<prefix>/<suffix>— a mirror created byLogger.processInputs(...)inProperty.refreshDataFrame(), which records the value as aLoggableInputsso replay sees what the robot used.The AKit mirror has to exist for replay correctness, but it doesn't need to be published over NetworkTables — dashboards already see the value via
/Preferences/.... With well over a thousand Properties on the bot, the redundant mirrors are a meaningful chunk of the NT load that's been stressing the rio.This PR drops the AKit mirror's path to NT, keeps it on disk for replay, and leaves
/Preferences/...untouched.Whats changing?
New:
xbot.common.advantage.PropertySkippingNT4Publisher— aLogDataReceiverthat wrapsNT4Publisher. On eachputTable, it builds a filtered copy of the incomingLogTablethat omits any entry under thePropertyMirror/namespace, then forwards to the realNT4Publisher. TheWPILOGWriterdata receiver is untouched — disk capture (and therefore replay) is unaffected.Property base class — added
public static final String AKIT_LOG_NAMESPACE = "PropertyMirror/"and aprotected akitLogPrefix()helper that returnsPropertyMirror/<prefix>. Subclasses use it when callingLogger.processInputs(...).Property subclasses —
DoubleProperty,BooleanProperty,StringProperty,MeasurePropertyall changeLogger.processInputs(prefix, inputs)→Logger.processInputs(akitLogPrefix(), inputs). One-line each.BaseRobot.robotInit()—new NT4Publisher()→new PropertySkippingNT4Publisher().Measured impact
Counted live against the TeamXbot2026 sim using a small
ntcore-based Python script (connect as an NT4 client, subscribe""with the topics-only flag, wait for announcements, group by path).Top-level NT tables
/AdvantageKit/Preferences/SmartDashboard/photonvision/CameraPublisher/.schema/FMSInfo/PathPlanner/Shuffleboard/LiveWindowDrop is exactly the number of
/Preferences/...entries — every WPILib Preference that had an AKit mirror has lost the mirror. Nothing else moved.Per-subsystem matching: AKit mirror is decoupled, Preferences is intact
/Preferences/<X>before → after/AdvantageKit/<X>before → afterThe
/Preferences/<X>column is unchanged everywhere (dashboards still see and edit the values). The/AdvantageKit/<X>column drops to 0 wherever everything under that subtable was a property mirror, and drops by exactly the Preferences count where the subsystem also has real telemetry going throughaKitLog.record(...)(e.g.DriveSubsystemkeeps 52 telemetry keys,AprilTagVisionSubsystemExtendedkeeps 20).Questions/notes for reviewers
PropertyMirror/(rather thanProperties/) deliberately so the deny prefix in the wrapper reads less ambiguously next to WPILib'sPreferencestable. They sit close together conceptually and the original name kept tripping me up when re-reading the code.How this was tested
PropertySkippingNT4PublisherTest; full suite: 294 tests, 0 failures, 10 skipped)🤖 Generated with Claude Code