Improve StmtToHtml output
We currently generate pretty bad HTML output:
- It's huge. I'm looking at a 10MB html file right now. The stmt file for the same pipeline is a few hundred KB.
- It brings chrome to its knees. Expanding/collapsing a node is slow and clunky.
I think there are ways to generate similar syntax highlighted and collapsible/expandable HTML that is far less bloated and easier for the browser to handle, but I only know enough HTML to be dangerous.
Is the HTML output regularly used? (Honest question; I never use it but I guess you must do so otherwise you wouldn't have noticed)
I tend to not use it because it's not very good, I think due in large part to these issues. I just tried using it because I really needed it to understand a large piece of IR, and that's when I filed this issue.
I use it for grokking large pipelines too, and it's really annoying how large and slow it is. I think a talented js person could make it substantially better.
Tagging as a good candidate for a contributor project
I used it a lot when I was learning how Halide compilation works. Indeed it is less useful for larger pipelines.
https://github.com/halide/Halide/wiki/%5BGSoC-2021%5D-A-(Better)-Interactive-Viewer-for-Halide-Pseudocode
I just had an idea: maybe we could tweak the stmt syntax to make it more C-like (e.g. emit produce/consume as comments, make allocate a function call/return value, etc.), and then one could just tell a text editor to treat .stmt as .c.
Maybe just those things would make it close enough. Things like lets would be a problem but maybe not enough to break syntax highlighting so much it isn't useful.
iirc, Fredo's class also recommends using it to understand Halide a bit, and students complained about it.
Also might be worth it to make a syntax highlighter that works on different IDEs for .stmt files?
Also might be worth it to make a syntax highlighter that works on different IDEs for .stmt files?
This is very easy and a good idea.
I just switched to latest Halide, and the HTML output has gotten these new features with the assembly, and this weird middle column. While the idea looks interesting with the three panes, this is EXTREMELY slow. Loading the page takes longer than compiling the pipeline.
Is the HTML output regularly used? (Honest question; I never use it but I guess you must do so otherwise you wouldn't have noticed)
I use the HTML statement file all the time. Can we produce the old simple version of the HMTL statement file?