diff --git a/tinygrad/viz/index.html b/tinygrad/viz/index.html index f9a8b313ee..6a8ec2b820 100644 --- a/tinygrad/viz/index.html +++ b/tinygrad/viz/index.html @@ -157,10 +157,6 @@ #insts .left.highlight { background-color: rgba(0, 199, 47, 0.2); } - #insts .n { - color: #787fa1; - min-width: 5ch; - } #insts .wave { color: #7aa2f7; min-width: 2ch; diff --git a/tinygrad/viz/js/index.js b/tinygrad/viz/js/index.js index 40db9050b2..14c58cfd19 100644 --- a/tinygrad/viz/js/index.js +++ b/tinygrad/viz/js/index.js @@ -323,10 +323,11 @@ function setFocus(key) { let instList = document.getElementById("insts"); if (data.pcToShape.size == 0) return d3.select(instList?.parentElement).html(""); if (instList == null) { - let contents = "", i = 0; + let contents = ""; for (const [k, v] of data.pcToShape) { - contents += `
${i++}${v.wave} - ${"0x"+v.pc.toString(16).padStart(12, "0")}${data.pcMap[v.pc]}
`; + const pcHex = v.pc.toString(16); + contents += `
${v.wave} + ${"0x"+pcHex.padStart(Math.max(4, Math.ceil(pcHex.length/4)*4), 0)}${data.pcMap[v.pc]}
`; } instList = d3.create("pre").append("code").classed("hljs", true).style("margin-top", "20px").attr("id", "insts").html(contents) .on("click", e => { const line = e.target.closest(".line"); line && setFocus(line.dataset.k); }).node();