From 337c684047bbbc15c8798bd9b4737187d6bbee8f Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Thu, 19 Mar 2026 11:41:29 +0200 Subject: [PATCH] viz: cycle time relative to kernel start in sidebar (#15352) --- tinygrad/viz/js/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tinygrad/viz/js/index.js b/tinygrad/viz/js/index.js index 986da2c991..7977ca64ba 100644 --- a/tinygrad/viz/js/index.js +++ b/tinygrad/viz/js/index.js @@ -300,7 +300,12 @@ function setFocus(key) { if (eventType === EventTypes.EXEC) { const [n, _, ...rest] = e.arg.tooltipText.split("\n"); const tableData = [["Name", colored(e.arg.label)], ["Duration", formatTime(e.width)]]; - data.instSt != null ? tableData.push(["Start Cycle", formatTime(e.x)], ["Timestamp", timeAtCycle(e.x)]) : tableData.push(["Start Time", formatTime(e.x)]); + if (data.instSt != null) { + const p = d3.create("p"); + p.append("span").text(timeAtCycle(e.x)); + p.append("span").style("margin-left", "8px").style("color", "#f0f0f566").text(formatTime(e.x)); + tableData.push(["Cycle", formatTime(e.x-data.instSt)], ["Time", p.node()]); + } else tableData.push(["Start Time", formatTime(e.x)]); html.append(() => tabulate(tableData)); let group = html.append("div").classed("args", true); for (const r of rest) group.append("p").text(r);