From a22417cc75839edb29848d45a7df33cfdcf08ce6 Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Mon, 28 Jul 2025 02:52:06 +0800 Subject: [PATCH] viz: fix bug with wrong program links (#11396) --- tinygrad/viz/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/viz/js/index.js b/tinygrad/viz/js/index.js index ff5aeb2da2..e389b525ae 100644 --- a/tinygrad/viz/js/index.js +++ b/tinygrad/viz/js/index.js @@ -162,7 +162,7 @@ async function renderProfiler() { else if (ref != null) { const start = ref.step>0 ? ref.step+1 : 0; const stepIdx = ctxs[ref.ctx+1].steps.findIndex((s, i) => i >= start && s.name == e.name); - if (stepIdx !== -1) ref = {ctx:ref.ctx, step:stepIdx}; + ref = stepIdx === -1 ? null : {ctx:ref.ctx, step:stepIdx}; } const arg = { tooltipText:formatTime(e.dur), ...ref }; // offset y by depth