From bf7e473224938777dddc41b009e1205615a3b170 Mon Sep 17 00:00:00 2001 From: "Memoria (Noblistic)" Date: Sat, 31 Oct 2026 22:38:09 +0000 Subject: [PATCH] dashboard: a card-count change replaces the device rows, it does not stack them The memory panel rebuilds its per-card rows when the card count changes, but the rebuild only appended: the previous set stayed in #mem. Every card-count change -- a TP flip, a card swap, a lane re-pin -- therefore grew the panel by the old count, permanently, until the page was reloaded. On a box that flips TP2 and TP4 by hand the section becomes unusable within a day: eighteen rows of identical cards after three flips, and the panel's own header (KV cache, prefix hits) scrolls away. Remove the old rows before rebuilding, the same shape the request rows already use above. Per-row removal rather than the sibling guards' container-clear because #mem is shared with the KV and prefix meters, which are built once and must survive. Verified: the embedded page parses (node --check on the extracted script), the translation unit compiles, dashboard_test passes. The behavior itself -- rows gone after a count change -- needs a live card-count change to prove; not tested here. Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (xhigh) via Open WebUI --- core/server/dashboard.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/server/dashboard.cpp b/core/server/dashboard.cpp index 3510e60a..07c08f23 100644 --- a/core/server/dashboard.cpp +++ b/core/server/dashboard.cpp @@ -2434,8 +2434,15 @@ function update(s, dt) { /* ---- devices, in the same panel as the cache meter: they are one question. */ const cards = s.cards || []; - if (devs.length !== cards.length) + if (devs.length !== cards.length) { + /* Rebuild means REPLACE. The old rows must leave the panel: a card-count change -- a + * TP flip, a card swap -- otherwise stacks a fresh set on the stale one, and the panel + * grows by the old count every time until the page is reloaded. Per-row removal rather + * than the sibling guards' container-clear: #mem is shared with the KV and prefix + * meters, which are built once and must survive. Same shape as the request rows above. */ + devs.forEach((d) => d.wrap.remove()); devs = cards.map((c) => meter($("mem"), "dev", c.name, c.index)); + } cards.forEach((c, i) => { setBar(devs[i].i, c.vram_total ? c.vram_used / c.vram_total : 0, false); devs[i].v.textContent = hbOf(c.vram_used, c.vram_total, " / ");