Repository navigation
Refresh config values at 1 Hz, only the axis state at 10 Hz - #18
Merged
Merged
Conversation
Every axis panel refreshed all its mirrors on the USB worker every 0.1 s: the axis state, but also every bound config value (gains, limits, bandwidths, input-mode parameters, trap_traj limits), about 22 reads per axis and tick. Every write and command queues behind those reads, and each open tab adds its own. With two axes that was ~480 reads per second. Only the axis state must feel live. Config values change only when someone edits them, and an edit made here shows at once, so their mirrors now refresh at 1 Hz: ~105 reads per second. An edit from another client or odrivetool shows up within a second instead of 0.1 s. Closes #17 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FUjP7mHeiHytZSgfnFC3W2
evnchn
approved these changes
Oct 28, 2026
evnchn
left a comment
Contributor
There was a problem hiding this comment.
Looks good. The new test fails on main (483 reads per second) and passes here, and the full suite passes (21). An edit in the panel still shows at once, and a change from odrivetool taking up to a second is fine for config values.
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.
Closes #17.
Since #16, every axis panel refreshed all its mirrors on the USB worker every 0.1 s: the axis state, but also every bound config value (gains, limits, bandwidths, input-mode parameters, trap_traj limits). Every write and command (Idle, Stop,
current_lim) queues behind those reads, and each open tab adds its own. Measured with the mock (two calibrated axes, one tab, plots off), that was 483 worker reads per second.Now only the axis state mirror refreshes at 10 Hz. The four config mirrors have their own 1 Hz timer. With the same setup that gives 105 reads per second. An edit made in this panel still shows and is written at once. An edit from another client or odrivetool now shows up within about a second instead of 0.1 s.
Tests:
test_config_values_are_not_polled_at_10_hz(new) caps the worker at 150 reads per second with two axes. Before this change it would have counted ~480.test_gain_edits_reach_the_device_and_device_changes_reach_the_uinow waits 2 s instead of 1.2 s for a device-side change to reach the UI.※