You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multi-frame tracing is planned for Cyberbrain 2.0, and I want to start collecting some feedbacks and suggestions for it.
First, what is Multi-frame tracing? Right now Cyberbrain only visualizes the execution of one funtion call. Multi-frame tracing is for Cyberbrain to expand the coverage of tracing beyond a single frame. I haven't decided what the feature should look like, and that's what this thread is for.
There are several open questions.
For tracing
What should Cyberbrain trace? Nested function calls started from the decorated function, or the whole program?
Should we allow multiple @trace decorators?
Should all invocations be traced? Imagine a function that is called a million times.
How to deal with long-running programs? Do we want something like a circular buffer and only keep the latest calls?
Specifically, I want to talk about user interaction to hopefully draw more attention to it. In short, I want to find a way to make this feature very intuitive and easy to use.
As #55 suggested, cb-py will send all invocation information to cb-vsc, then cb-vsc will be aware of all invocations, including their relationships.
Now comes the hard part: how to let users (you) select which call frame to visualize. There are a few options I can think of, but suggestions are always welcomed:
Personally, I think this is the cleanest solution, in that
It does not need extra work to implement a "call graph", nor a GUI to pick frames.
It is scalable, I don't need to worry about whether there's enough space to list all the invocations.
It relies on the standard VS Code API, not the somewhat-discouraged webview.
Downsides:
Maybe can't handle multiple calls of the same function properly. Needs more investigation.
Requires certain-level of familarity with code from users to be able to use it.
Build a custom frame-selection UI
Maybe a call graph, maybe a table, or even a search box. Say we use call graph, users can click on each node (representing a call frame), and Cyberbrain will show the trace graph for that frame.
One more thing...
I have a feature in mind, a feature that inspired me to create Cyberbrain.
I want to be able to generate a graph, that shows the entire "source tree" of a variable. For example, you want to debug why foo has a wrong value, and Cyberbrain will show a tree. The root node is foo, its children would be foo's sources, and the next level nodes are sources of the sources. The tree goes on until we don't have more data (aka reach the starting point of tracing on each path). You see this graph, and it's easy to spot exactly which step caused the error.
This is the ultimate form of Cyberbrian, but it has to be built on top of multi-frame tracing. I put it here to kinda give you an idea of what you can expect from Cyberbrian.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Multi-frame tracing is planned for Cyberbrain 2.0, and I want to start collecting some feedbacks and suggestions for it.
First, what is Multi-frame tracing? Right now Cyberbrain only visualizes the execution of one funtion call. Multi-frame tracing is for Cyberbrain to expand the coverage of tracing beyond a single frame. I haven't decided what the feature should look like, and that's what this thread is for.
There are several open questions.
@trace
decorators?User interaction
Specifically, I want to talk about user interaction to hopefully draw more attention to it. In short, I want to find a way to make this feature very intuitive and easy to use.
As #55 suggested, cb-py will send all invocation information to cb-vsc, then cb-vsc will be aware of all invocations, including their relationships.
Now comes the hard part: how to let users (you) select which call frame to visualize. There are a few options I can think of, but suggestions are always welcomed:
Rely on codelens (#34).
Personally, I think this is the cleanest solution, in that
Downsides:
Build a custom frame-selection UI
Maybe a call graph, maybe a table, or even a search box. Say we use call graph, users can click on each node (representing a call frame), and Cyberbrain will show the trace graph for that frame.
One more thing...
I have a feature in mind, a feature that inspired me to create Cyberbrain.
I want to be able to generate a graph, that shows the entire "source tree" of a variable. For example, you want to debug why
foo
has a wrong value, and Cyberbrain will show a tree. The root node isfoo
, its children would befoo
's sources, and the next level nodes are sources of the sources. The tree goes on until we don't have more data (aka reach the starting point of tracing on each path). You see this graph, and it's easy to spot exactly which step caused the error.This is the ultimate form of Cyberbrian, but it has to be built on top of multi-frame tracing. I put it here to kinda give you an idea of what you can expect from Cyberbrian.
Beta Was this translation helpful? Give feedback.
All reactions