Repository navigation
feat(playground): the stack-and-heap lens draws traces in 2D and 3D - #206
Merged
Merged
Conversation
The Playground now runs tracer v2 and draws its traces with the shared stack-and-heap views in the dark palette (ADR 0004). - the sandbox runs tracer v2 and reports a trace; the old tracer, its types and the timeline pieces are removed (useTrace, StepControls) - the stack-and-heap lens places the whole trace once, pins the heap floor, marks unreachable objects and never shows a sweep - limits: 5 frame boxes, 9 heap objects, then a "too large to draw" message - the Event Loop, Data Structures and Streams lenses are removed, and with them the @xyflow/react dependency - Python keeps stepping with values only - the 3D view lists a frame's slots one per line when it holds more than two - the view toggle, the 3D fallback and the view choice are shared with the Stack and Heap story - the lens pane is the widest by default, and the step panel hides its variable list while a lens draws the step Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 7 of the ADR 0004 build plan. The Playground runs tracer v2 and draws its traces with the shared stack-and-heap views, in 2D and 3D, in the dark palette.
Changes
services/instrumentCode.ts,instrumentation/JsInstrumenter.ts,StateSnapshot.tsand the old types.useTimelineis nowuseTrace,TimelinePlayeris nowStepControls.lenses/StackHeapLens.tsx,stackHeapLensModel.ts): places the whole trace once, pins the heap floor so nothing jumps, takes focus from the step, marks unreachable objects and never shows a garbage-collection phase. 2D is the default; 3D is lazy and falls back to 2D.@xyflow/reactis removed with its 19 transitive lockfile entries, its CSS import and itsmanualChunksrule.ViewToggle,View3DBoundaryanduseViewChoiceare extracted from the Stack ↔ Heap story section and used by both;Viewer3DToolbarand the 3D hint take an optional theme. The 3D view lists a frame's slots one per line when it holds more than two (the story's largest frame), capped at 6 lines.Evidence
npm auditpass; three.js is not in the entry graph./playground, 1440×900, dark, with code that aliases an array, keeps a closure and drops an object: 2D and 3D both draw the shared array once, the closure's scope with its counter, and the dropped object as unreachable. A recursion 8 deep shows the placeholder frame; a step with 15 objects shows the too-large message.Known limits
🤖 Generated with Claude Code