Skip to content

Improve dashboard context telemetry and PNG export speed - #3

Merged
Alek99 merged 3 commits into
mainfrom
codex/dashboard-context-telemetry
Jul 9, 2026
Merged

Improve dashboard context telemetry and PNG export speed#3
Alek99 merged 3 commits into
mainfrom
codex/dashboard-context-telemetry

Conversation

@Alek99

@Alek99 Alek99 commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

  • make the 10/20/50-chart dashboard benchmark retain startup, heap, redraw, and scroll metrics when Chrome evicts contexts
  • record per-chart webglcontextlost / webglcontextrestored events, phases, initial/scrolled nonblank IDs, active chart count, and a stable loss-free ceiling
  • fix the interaction benchmark warm-up by synchronously completing GPU work before samples
  • lower native PNG zlib compression from level 9 to level 6, with regression coverage for indexed and truecolor output

Why

Chrome accepts contexts beyond its per-page quota by evicting older contexts. The previous dashboard probe inferred the cap from blank pixels, threw on the first partial dashboard, and discarded the scaling metrics needed to design shared-context rendering. It also could not distinguish LRU eviction from allocation failure.

The interaction probe issued a warm draw without a readback, so its first timed wheel gesture could pay deferred shader/GPU work. Native PNG export also spent most of its time in level-9 deflate for a very small size win.

Measured impact

  • software GL: 20 charts retain metrics with 4 loss events and 16 active charts; 50 charts retain metrics with 34 losses and 16 active charts
  • hardware reproduces the same context cap while rendering 10/20/50 charts in roughly 86/138/285 ms
  • 1M-line native PNG median improves from about 298 ms to about 64 ms; output grows about 2.65%
  • the 12-repetition software interaction stress probe passes all six chart families after the warm-up fix

Validation

  • cargo build --release
  • .venv/bin/python -m pytest -q (880 passed)
  • .venv/bin/ruff check .
  • .venv/bin/ruff format --check on all changed Python files
  • .venv/bin/python scripts/verify_local.py --only benchmark_harness
  • software-GL dashboard 10/20/50 report plus verify_benchmark_report.py --kind dashboard-browser
  • scripts/interaction_stress_smoke.py with 12 repetitions
  • standard workflow benchmark with 1M-line native PNG export

Repository-wide ruff format --check . currently flags upstream examples/demo.ipynb, which this branch does not modify.

Alek99 added 3 commits July 9, 2026 13:27
webglcontextlost dispatches as a task, so evictions triggered by the
creation loop only fire on the next yield. The probe flipped phase to
"initial" before yielding, so every creation eviction was mislabeled
"initial" and the "create" phase could never appear in real reports.
Yield first, then advance the phase; guard the ordering in the telemetry
marker test. Also add the missing Unreleased changelog entries for the
dashboard telemetry rework and the PNG compression-level change.
@Alek99
Alek99 marked this pull request as ready for review July 9, 2026 20:46
@Alek99
Alek99 merged commit ea589ac into main Jul 9, 2026
4 of 7 checks passed
FarhanAliRaza added a commit that referenced this pull request Jul 15, 2026
- Legend now (re)freezes options and swatch scaling via _attach() when
  added to an axes, so a legend constructed against one axes but
  attached to another picks up the host's dpi/rcParams (review #1).
- Legend.__init__ warns on handles/labels length mismatch and on
  handles without a legend entry instead of dropping them silently
  (review #4).
- JS tracks every legend box (not just the primary) so _resize
  refreshes max-height on extra legends too (review #2).
- JS line swatch uses ?? so an explicit lw=0 draws nothing instead of
  falling back to 1.5px (review #3).
- Drop unreachable return in _best_legend_loc (review #5).
FarhanAliRaza added a commit that referenced this pull request Jul 15, 2026
* Improve pyplot legend and dash parity

* Fix extra legend rendering regressions

* Address review: legend attach recompute, resize tracking, lw=0 swatch

- Legend now (re)freezes options and swatch scaling via _attach() when
  added to an axes, so a legend constructed against one axes but
  attached to another picks up the host's dpi/rcParams (review #1).
- Legend.__init__ warns on handles/labels length mismatch and on
  handles without a legend entry instead of dropping them silently
  (review #4).
- JS tracks every legend box (not just the primary) so _resize
  refreshes max-height on extra legends too (review #2).
- JS line swatch uses ?? so an explicit lw=0 draws nothing instead of
  falling back to 1.5px (review #3).
- Drop unreachable return in _best_legend_loc (review #5).

---------

Co-authored-by: Alek <alek@reflex.dev>
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