Skip to content

fix: address review feedback on profiler flamegraph/icicle - #167

Merged
Oaklight merged 1 commit into
masterfrom
worktree-fix+profiler-review-feedback
Sep 15, 2026
Merged

Oaklight merged 1 commit into
masterfrom
worktree-fix+profiler-review-feedback

Conversation

@Oaklight

Copy link
Copy Markdown
Owner

Summary

Addresses all actionable and non-blocking review feedback from #166:

  • Raise ValueError when sort_by/limit passed with flamegraph/icicle styles (flagged by all 3 reviewers)
  • Remove dead zoomStack code — reset renders directly from root data (flagged by all 3 reviewers)
  • Unify total time source — _build_flame_html now uses total_tt consistently with _extract_call_tree (milo)
  • Add edge tuple format comment for CPython version differences (clementine)
  • Clarify tooltip label — "Cumulative (path)" instead of ambiguous "Cumulative" (milo, elena)
  • Add empty-profile test for flamegraph + sort_by/limit rejection tests (clementine)

Test plan

  • make test-profiler — 68 tests pass (3 new)
  • pre-commit run --all-files — all hooks pass
  • CI lint + test

- Raise ValueError when sort_by/limit passed with flamegraph/icicle
- Remove dead zoomStack code from JS (reset renders from root directly)
- Unify total time source: use total_tt consistently in flame HTML
- Add edge tuple format comment for CPython version differences
- Clarify tooltip label: "Cumulative (path)" vs ambiguous "Cumulative"
- Add empty-profile and sort_by/limit rejection tests for flamegraph

@clementine-oaklight clementine-oaklight Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review — PR #167: fix: address review feedback on profiler flamegraph/icicle

CI: ✅ Green (lint + 3.10–3.13)
Verdict: LGTM — clean follow-up, all feedback items addressed.


What's fixed

#166 feedback Resolution
sort_by/limit silently ignored for flamegraph/icicle ValueError raised when either is passed with non-table style
zoomStack dead code Removed entirely — click-to-zoom re-renders directly, reset re-renders from root
total_tt vs self.total_time dual access _build_flame_html now reads stats.total_tt directly, matching _extract_call_tree
Edge tuple format undocumented Comment added: # edge is (cc,nc,tt,ct) or (nc,ct) depending on CPython version
No empty-profile test test_flamegraph_empty_profile added
Tooltip ambiguity on cumtime meaning Label changed to "Cumulative (path):"

Three new tests cover the empty-profile path and both ValueError cases. +26/−6 across 2 files — focused and minimal. Nothing to flag.

@elena-oaklight elena-oaklight Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI green across lint + 3.10–3.13. Clean, focused follow-up that addresses all actionable feedback from #166 — nothing missed.

  • sort_by/limit now raise ValueError for flamegraph/icicle — guard is placed before _extract_call_tree(), so no wasted work. Tests cover both params independently.
  • zoomStack removed — all three references gone (declaration, push in onFrameClick, clear in reset). onFrameClick simplified to just render([node], node.cumtime). Clean.
  • total_tt unified — _build_flame_html now uses cast(Any, self._stats).total_tt instead of self.total_time, consistent with _extract_call_tree. Fixes the CPU-vs-wall-clock divergence milo flagged.
  • Edge tuple comment — documents the (cc,nc,tt,ct) vs (nc,ct) CPython version difference inline.
  • Tooltip label — "Cumulative (path)" clarifies the edge-specific semantics.
  • Empty-profile test — good edge case addition.

+26/−6, no issues. LGTM 👍

@Oaklight
Oaklight merged commit 349eb73 into master Sep 15, 2026
6 checks passed
@Oaklight
Oaklight deleted the worktree-fix+profiler-review-feedback branch September 15, 2026 01:58

@milo-oaklight milo-oaklight Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All six items from #166 addressed cleanly:

  1. sort_by/limit now raise ValueError for flamegraph/icicle — good, explicit beats silent.
  2. zoomStack removed — dead var, push in onFrameClick, and reset-handler clear all gone. Bonus: dropped the unused e parameter too.
  3. total_time → total_tt in _build_flame_html — CPU time now consistent with _extract_call_tree. Comment makes the intent clear.
  4. Edge tuple format comment added at the extraction site.
  5. Tooltip label → "Cumulative (path)" — disambiguates from function-global tottime.
  6. Three new tests — empty profile, sort_by rejection, limit rejection. All three assert the right error message.

CI green across lint + 3.10–3.13. Nothing else to flag — straightforward follow-up.

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