Skip to content

Reset per-report state when reusing a Speedscope renderer - #466

Merged
joerick merged 1 commit into
joerick:mainfrom
FanWu-ai:fix-speedscope-renderer-state-20261011
Oct 12, 2026
Merged

joerick merged 1 commit into
joerick:mainfrom
FanWu-ai:fix-speedscope-renderer-state-20261011

Conversation

@FanWu-ai

Copy link
Copy Markdown
Contributor

Reusing a SpeedscopeRenderer carries its event clock and frame-index table into the next report. A second 0.25-second session can emit events from 0.25 to 0.5 while its declared endValue remains 0.25; distinct or empty sessions also retain unrelated frames.

Reset both pieces of per-report state at the start of render. Recursive render_frame calls retain their shared state within that report. Tests compare reused and fresh renderers for identical, different and empty sessions.

Validation on CPython 3.12/Linux:

  • Pristine CI split suite executes all 143 tests: 136 ordinary + 7 IPython.
  • All 3 regressions fail before the fix; final split suite executes all 146 tests: 139 ordinary + 7 IPython. Complementary skips are the configured isolation between these two modes.
  • All 9 pinned hooks pass, including Pyright and the JavaScript bundle rebuild; no generated files changed.
  • Docs, native-extension wheel/sdist builds, strict Twine metadata and whitespace checks pass. Docs retain one existing MyST warning; builds retain the existing setuptools license warning.
  • 768 reused-render comparisons match fresh instances; independent alternating-session controls pass.

Other interpreter/OS combinations and hosted CI have not run locally.

AI assistance: OpenAI Codex was used to investigate, implement and test this fix. No human review is claimed.

AI assistance: OpenAI Codex was used for investigation, implementation, regression tests, and automated validation.
@FanWu-ai
FanWu-ai marked this pull request as ready for review October 11, 2026 17:29

@joerick joerick left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. thank you!

@joerick
joerick merged commit e0d3dba into joerick:main Oct 12, 2026
24 checks passed
@FanWu-ai
FanWu-ai deleted the fix-speedscope-renderer-state-20261011 branch October 13, 2026 04:03
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.

2 participants