Searchfox call diagram emoji are utterly mysterious
Categories
(Webtools :: Searchfox, defect)
Tracking
(Not tracked)
People
(Reporter: jimb, Unassigned)
Details
I'm looking at a function's "Uses" diagram. It puts the ⚛️ and 🧮 emoji on some functions, and I have no idea what they're supposed to represent. I tried inspecting the DOM but of course they're emoji, not images with suggestive names, so that didn't help. They should have hover text.
Comment 1•11 months ago
|
||
Thank you for your interest in the pre-alpha diagram functionality!
There's some complexity around how graphviz is used to produce SVG because graphviz doesn't like to tunnel meta-information and so a pile of hacks is in use. Initial "clever" attempts to enable tooltips ran into problems where even when graphviz has access to the emoji fonts, its layout logic cannot handle wrapping the emoji in spans without causing serious layout problems, and because the SVG layout model is very different, attempting to fix-up the continuous stream of text is more involved.
I have some tentative plans to improve the situation, but I think we've reached the point where it likely makes sense to move from the pile of hacks to providing upstream enhancements to graphviz; their dev team has indicated they are very open to enhancements in this space and searchfox is already provisioning upstream builds rather than debian builds. (And I've stood up a searchfox index with diagramming support enabled at https://searchfox.org/graphviz/source/ to make this easier for me to do.)
But to set expectations appropriately, almost the entirety of the diagramming functionality (and in general all searchfox development other than the brief contractor engagement at the end of 2023Q4) has been done on my nights/weekends/PTO and so development is primary driven by my personal frustrations/itches/whims. (This is why I'm always asking people to talk to their managers in searchfox update emails; because it would be great to get contractor funding again or even a more permanent allocation of resources since I think there's a case to be made that an important part of platform engineers' jobs is understanding the system and things like the diagram functionality can help with that.) Current priorities for diagram improvements are screen reader accessibility and improved cleverness in terms of automatically collapsing/ending traversal on subsystem boundaries/automatic class aspect subdivisions based on field-access-clusters as the automatic diagrams frequently end up unwieldy.
In general a good resource for alpha features like diagram is the searchfox channel; for example, for very weak values of documented, the emoji are documented there (and can be found by logging into chat.mozilla.org and doing /goto https://matrix.to/#/!vDKxYNxlsZYvjSWGBh:mozilla.org/$d1hQLIqq4oHvKOXkQOORG1M9g5G6tqrrChlA18VmSMk?via=mozilla.org
). The good news is that I was able to extract the contents of the message and it seems to show up okay below:
The emoji all correspond to "labels" that are defined in ontology-mapping.toml and then which get translated into emoji in ontology_mapping.rs. Unfortunately, because of limitations due to having graphviz do the layout and limitations in its fake HTML label syntax and its layout engine, it hasn't been entirely trivial to recontextualize the emoji on the other side so they can have "title" attributes attached to help explain the label on hover.
For pointer strength:
- 💪 is a RefPtr which is technically a strong reference
- ❄️ is a unique pointer because snowflakes are unique
- 📆 is a weak pointer because calendars have weeks in them
- 😱 is a raw pointer because raw pointers bad
- & is a reference
- 🫚 is a gc reference because ginger is a root
- 📦️ is containment and I forgot to add a comment in the source so I had to look that up
for the labels that aren't from pointer strength:
- ⚛️ is for "arc" atomic reference count, also for
Atomic<>
fields. This only goes on classes that directly hold the reference count field. - 🔗 is for "cc" for something that's cycle collected
- ⛓️ is for "ccrc", the thing has a cycle collected reference count, which only goes on classes that directly hold the reference count field.
- 🔗✏️ is for "cc-trace", this is a field that was referenced directly in a cycle collection trace method. If you call helpers in your trace functions you are out of luck
- 🔗🔍️ means that the CycleCollector helper Traverse method directly references the field. If you call helpers in your traverse functions you are out of luck.
- ⛓️💥 means the CycleCollector helper Unlink method directly references the field
- 🧮 is for "rc", this is a reference-counted class
Description
•