feat: limit retained points in live line and scatter plots #2170
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 312 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.344
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #2170"
general
weight: 0.35
ArnavBallinCode
Description
Line and scatter plots can retain the newest N samples per trace with
opts={"max_points": N}. Later appends reuse the limit. The default keeps full history.Closes #2171.
Motivation and Context
A long training run can keep extending the same trace in server memory, in connected browsers, and in the saved environment. A rolling window lets users choose how much history their dashboard needs.
How Has This Been Tested?
Sent 100,000 samples through the Python client to a running server. With a limit of 1,000, the retained coordinates matched the newest 1,000 exactly. A separate save-and-restart test preserved the expected samples. Chromium verified live appends and reloads over WebSocket and polling. The Python suite passed with 4,308 tests and three platform skips.
Types of changes
Checklist:
Summary by Sourcery
Add rolling point retention for live plots so users can bound per-trace history while preserving consistent rendering and persistence.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Scatter and line plots can limit each trace to the newest N samples with
max_points. As data arrives, older samples are discarded from the plot and saved environment, and the limit persists after reloading.The limit must be a positive integer and defaults to unlimited. When samples are trimmed, associated point values remain aligned.
Documentation
* Added README guidance on
max_points, including its accepted values and default.<!-- end of auto-generated comment: release notes by coderabbit.ai -->