Skip to content

web: tracer drawer — opt-level selector, tailcall render, right-column panels#222

Merged
gnidan merged 5 commits into
transform-contextfrom
ui-tracer-drawer
Jul 2, 2026
Merged

web: tracer drawer — opt-level selector, tailcall render, right-column panels#222
gnidan merged 5 commits into
transform-contextfrom
ui-tracer-drawer

Conversation

@gnidan

@gnidan gnidan commented Jul 2, 2026

Copy link
Copy Markdown
Member

Package-level (docs TraceDrawer widget + programs-react test coverage). No spec/schema changes. Coordinated pass on TraceDrawer.tsx covering tasks #3/#6/#9/#11.

Changes

Verify

Selector labels are "O0"/"O2" (writer #219 mirroring); open to "Level 0/2" if preferred.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-02 04:47 UTC

gnidan added 5 commits July 2, 2026 00:27
The trace panels live in a flex:1 grid whose implicit row was auto-
sized to content, so dragging the drawer taller left dead space below
the panels instead of growing them. Give the grid an explicit 1fr row
and min-height:0 (on the grid and its items) so both panels absorb the
added vertical space and scroll internally.
The drawer hardcoded optimizer level 0. Add an O0/O2 toggle in the
drawer header that recompiles + retraces at the chosen level, so
readers can flip to level 2 and watch optimizer transforms (e.g. the
tailcall annotation on TCO back-edges) appear. compileAndTrace now
takes the level explicitly; a ref mirrors the state so the example-
load effect reads the current level without re-running on toggle.
bugc #217 emits the TCO back-edge as a single flat context object
(return + invoke + transform keys together), but the existing tests
only exercised the gather shape. Add flat-shape variants for transform
extraction, the isTailCall flag, and frame replacement, plus a guard
that stripping the marker (the #10 failure mode) drops tail-call
handling.
- Reuse the shared, tailcall-aware buildCallStack / extractCallInfo /
  extractTransform from @ethdebug/programs-react via a thin adapter
  (bugc .debug.context -> ethdebug format shape); drop the drawer's
  inline call-stack builder and local extractCallInfo.
- Render the tail-call chip on the reused call-stack frame and a
  tail-call variant on the call-info banner.
- Right column (gnidan's picks 1/2/4): resolved variable values
  (name: value via pointer resolution), gas remaining + per-step delta,
  and a transform annotations panel with per-tag glosses. Sections are
  now collapsible.
gnidan's call: expose all four bugc optimizer levels (each distinct —
L1 fold/prop/DCE, L2 +CSE/TCO/jump-opt, L3 +merging) rather than a
two-state O0/O2 toggle, future-proofing for other transforms. The
recompile+retrace already took the level; just widen the control from
two buttons to four (mapped over OPT_LEVELS, per-level tooltips). The
tailcall demo still lands on O2.
@gnidan gnidan force-pushed the ui-tracer-drawer branch from b9063bc to d38c38f Compare July 2, 2026 04:30
@gnidan gnidan merged commit 9bb47f8 into transform-context Jul 2, 2026
4 checks passed
@gnidan gnidan deleted the ui-tracer-drawer branch July 2, 2026 04:43
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