This is an experiment with adding "sequence point" instrumentation directives to Tracy. The use case here is asynchronous compute chains/graphs, especially those driven by callbacks chains.
You'd use TracySeqCreate() to request a unique sequence identifier, and pass that id along to TarcySeqResume(id) and TracySeqSuspend(id) at each "continuation" scope. At the end of the processing, you'd TracySeqRetire(id) it. Later, in the profiler GUI, hovering over a sequenced zone would show arrows pointing to the previous and next sequence point zones.
In addition, if you right-click on a zone that belongs to a sequence point, there's the option to "flatten" it to a "virtual thread" in order to visualize it in isolation in the timeline.
Context: over the years, I managed to workaround just by using TRACY_FIBERS as a way to define "virtual threads", and then assigning each async compute chain to one such virtual thread.
Curious to know other people's opinion. There's a (vibe-coded) examples/seq to demonstrate the feature.
https://github.com/user-attachments/assets/9346e54d-6bd1-4a72-a2b5-bcd83c3e58e5
Activity
4Grouping makes a lot of sense. A very common use case for me (in fact, it's what inspired this experiment) is defining a number of "channels" to organize this sort of parallel continuations in virtual threads/timelines.
Concretely, there's a set number of "fiber names", and you'd instrument all sequence points of a given async task with the same fiber name. So, when an async task is created, it claims a fiber name, uses it through. Doing so ensures no two zones ever "intersect" in any given fiber timeline.
If we have support for grouping, you'd then be able to flatten all TracySeq'd zones that belong to the same group, and basically recreate the "TracyFiber"-equivalent behavior "on demand" from the UI. We could think about going one step further and consider adding more explicit directives to define and use "virtual threads" (fibers and sequence-points would just be specialized cases that build upon the virtual thread functionality).
This pull request is a draft
Merging is unavailable until it is marked ready for review.
Depending on the intended usage I had the following ideas and scope, and they all have their limitations. The main issue is: what granularity do we want