#7233 · Runtime glyph animation and main-thread rendering
Trusted origin/main base: e61446e15a0bb3e6df551e45c3aba5c5187ffad3
Verdict: PARTIALLY REPRODUCED · Root-cause confidence: medium · Reproduction label: partial-repro
1. TL;DR
The runtime status glyph really does apply its spinning transform to the SVG itself. Rendering three actual ThreadStatusGlyph components from trusted main produced repeated main-thread style, prepaint, and layerization work; pausing their animations removed nearly all of that work. A second clean checkout produced the same result. However, this automation browser has GPU compositing disabled, and rotating an HTML container did not eliminate that work either. This supports the animation-work portion of the report, but cannot establish the SVG-specific hardware-compositor limitation, the reported high-refresh CPU costs, or the proposed fix.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| Runtime animation targets the SVG | Verified | Actual DOM: three svg elements with data-icon=Loading and computed animation 1s linear infinite spin; matches trusted source. |
| Running animations create repeated main-thread rendering work | Verified in this environment | 20 UpdateLayoutTree, PrePaint, and Layerize events in each four-second running sample; paused baseline had 0–1 style events and no PrePaint or Layerize. |
| Moving rotation to HTML makes it compositor-only | Unverified | HTML control still produced 20 rendering events. CDP reports gpu_compositing: disabled_software, so this is not a valid hardware-compositor comparison. |
| Large renderer CPU costs on a high-refresh physical display | Unverified | No matching physical display, browser version, or hybrid-GPU configuration. Measured renderer main-thread TaskDuration was about 20–23 ms per four seconds, not the reported process CPU measurement. |
| Reduced-motion behavior is separate | Partially checked | The probe used reduced-motion=false, and source already includes motion-reduce:animate-none. This investigation did not re-test reduced-motion or offscreen behavior. |
3. Environment and isolation
- Two fresh detached worktrees of the same trusted base, referred to as
$WORK/base-oneand$WORK/base-two. Neither tracked production source tree was modified. - Build environment: Linux x86-64, kernel 4.19.0-gvisor; Node 22.19.0; pnpm 9.15.0.
- Browser Automation plugin: isolated local headless Chrome 149.0.0.0 on Linux x86-64 with a fresh plugin-owned profile. Reduced motion was false.
- Browser GPU: ANGLE / SwiftShader; GPU compositing and rasterization disabled_software. LayerTree returned no composited layers.
- Each checkout generated its own self-contained local HTML file, transferred explicitly to the browser machine. No application server, host daemon, provider, account, user database, or real thread was used. No product data directory was needed. An initial Vite server used port 47331, but the browser could not reach the container loopback; all measurements instead used isolated local file URLs, with no network service port.
- The plugin's live preview remained attached for all variants. About five rendering updates per second were observed, not physical-display vsync. Do not extrapolate these timings to a normal visible desktop browser.
4. Minimal reproduction
This is an author-written probe of the real source component, not a script copied from the issue. Save the three source files below under apps/app. Save inline-probe.mjs and measure.js outside the checkout. The two control modes alter the rendered DOM only: one pauses the real animations; the other transfers their computed animation to the existing HTML containers and leaves the SVGs static.
BASE=e61446e15a0bb3e6df551e45c3aba5c5187ffad3 WORK=$(mktemp -d) git fetch origin main git worktree add --detach "$WORK/base-one" "$BASE" cd "$WORK/base-one" pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@get-bb/plugin-sdk pnpm exec turbo run build --filter=@bb/app # Save the three source files below, then: cd apps/app pnpm exec vite build --config 7233-probe.config.ts node /tmp/inline-probe.mjs "$PWD/7233-probe-dist" > /tmp/issue-7233-one.html
The final Vite command deliberately builds only the investigative page, after the normal Turbo dependency builds. It is not a proposed repository build change.
With Browser Automation installed, select the explicit browser host from bb machine list --json, set BROWSER_HOST to that ID, and open an isolated session. The browser may be on a different execution host, so transfer both files:
SESSION=$(bb browser-automation open --backend local --headless --machine "$BROWSER_HOST" --json | jq -r .id)
bb file write /tmp/issue-7233-one.html --host "$BROWSER_HOST" --stdin < /tmp/issue-7233-one.html
bb file write /tmp/issue-7233-measure.js --host "$BROWSER_HOST" --stdin < /tmp/measure.js
bb browser-automation run "$SESSION" --script 'const page = await browser.getPage("main"); await page.goto("file:///tmp/issue-7233-one.html?mode=paused"); await page.waitForSelector("html[data-ready=true]");' --json
bb browser-automation run "$SESSION" --script-file /tmp/issue-7233-measure.js --script-host "$BROWSER_HOST" --timeout 90s --json
Expected for the proposed optimization on a GPU-composited browser: the HTML control removes per-frame main-thread rendering while keeping rotation. Actual here: both moving variants produce rendering updates, whereas the paused baseline does not. That mismatch is why the verdict is partial, not confirmed.
apps/app/7233-probe.html
<!doctype html> <html lang="en"> <head><meta charset="UTF-8"><title>Runtime glyph rendering probe</title></head> <body><div id="root"></div><script type="module" src="/7233-probe.tsx"></script></body> </html>
apps/app/7233-probe.tsx
import { createRoot } from "react-dom/client";
import { ThreadStatusGlyph } from "./src/components/thread/ThreadStatusGlyph";
import "./src/app.css";
const mode = new URLSearchParams(location.search).get("mode") ?? "original";
document.body.style.cssText = "padding:40px;font:16px system-ui;background:white;color:black";
createRoot(document.getElementById("root")!).render(
<main>
<h1>Runtime glyph rendering probe</h1>
<p>Mode: {mode}. Three real ThreadStatusGlyph components, no agent or server.</p>
<div id="glyphs" style={{ display: "flex", gap: 20 }}>
{[0, 1, 2].map((index) => (
<span key={index} className="inline-flex size-4 items-center justify-center">
<ThreadStatusGlyph indicator="runtime" />
</span>
))}
</div>
</main>,
);
requestAnimationFrame(() => {
requestAnimationFrame(() => {
const animations = document.getAnimations();
if (mode === "paused") {
for (const animation of animations) animation.pause();
}
if (mode === "html-control") {
for (const animation of animations) {
if (!(animation.effect instanceof KeyframeEffect)) continue;
const target = animation.effect.target;
if (!(target instanceof SVGElement)) continue;
const parent = target.parentElement;
if (!parent) throw new Error("Missing glyph container");
const style = getComputedStyle(target);
parent.style.animation = style.animation;
target.style.animation = "none";
}
}
document.documentElement.dataset.ready = "true";
});
});
apps/app/7233-probe.config.ts
import { resolve } from "node:path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { sharedUiEnvSeam } from "./vite-shared-ui-seam";
import { pluginZodRuntime } from "./vite-plugin-zod-runtime";
export default defineConfig({
plugins: [pluginZodRuntime(), sharedUiEnvSeam(), react(), tailwindcss()],
resolve: {
conditions: ["source"],
alias: { "@": resolve(import.meta.dirname, "src") },
},
build: {
outDir: "7233-probe-dist",
rollupOptions: { input: "7233-probe.html" },
},
});
inline-probe.mjs
import fs from "node:fs";
import path from "node:path";
const directory = process.argv[2];
let html = fs.readFileSync(path.join(directory, "7233-probe.html"), "utf8");
html = html.replace(/<script[^>]*src="([^"]+)"[^>]*><\/script>/g, (_, source) => {
const script = fs.readFileSync(path.join(directory, source), "utf8");
return '<script type="module">' + script.replaceAll("</script", "<\/script") + "</script>";
});
html = html.replace(/<link[^>]*href="([^"]+\.css)"[^>]*>/g, (_, source) => {
return "<style>" + fs.readFileSync(path.join(directory, source), "utf8") + "</style>";
});
process.stdout.write(html);
measure.js
const page = await browser.getPage("main");
const protocol = await page.createCDPSession();
const fixture = page.url().split("?")[0];
await protocol.send("Performance.enable");
const results = [];
for (const mode of ["paused", "original", "html-control", "original"]) {
await page.goto(fixture + "?mode=" + mode);
await page.waitForSelector("html[data-ready=true]");
await new Promise(resolve => setTimeout(resolve, 1000));
const before = (await protocol.send("Performance.getMetrics")).metrics;
await page.tracing.start({ categories: ["devtools.timeline", "disabled-by-default-devtools.timeline", "blink.animations"] });
await new Promise(resolve => setTimeout(resolve, 4000));
const trace = JSON.parse(Buffer.from(await page.tracing.stop()).toString("utf8"));
const after = (await protocol.send("Performance.getMetrics")).metrics;
const events = {};
for (const event of trace.traceEvents) {
if (!["UpdateLayoutTree", "PrePaint", "Layerize", "Paint", "Commit", "Layout"].includes(event.name)) continue;
const entry = events[event.name] ??= { count: 0, milliseconds: 0 };
entry.count += 1;
entry.milliseconds += (event.dur ?? 0) / 1000;
}
const metrics = {};
for (const name of ["TaskDuration", "RecalcStyleCount", "RecalcStyleDuration", "LayoutCount"]) {
metrics[name] = after.find(metric => metric.name === name).value - before.find(metric => metric.name === name).value;
}
results.push({ mode, seconds: 4, events, metrics });
}
await protocol.detach();
console.log(JSON.stringify(results));
5. Measurements
All windows are four seconds. TaskDuration is a CDP renderer-main-thread metric, not total renderer process CPU. Event counts are extracted from devtools.timeline traces. A fourth sample restores the original mode to detect drift.
| Checkout | Sample and mode | UpdateLayoutTree | PrePaint | Layerize | TaskDuration delta |
|---|---|---|---|---|---|
| 1 | 1: paused | 0 | 0 | 0 | 1.541 ms |
| 1 | 2: original | 20 | 20 | 20 | 20.939 ms |
| 1 | 3: html-control | 20 | 20 | 20 | 21.402 ms |
| 1 | 4: original | 20 | 20 | 20 | 19.900 ms |
| 2 | 1: paused | 1 | 0 | 0 | 1.962 ms |
| 2 | 2: original | 20 | 20 | 20 | 23.127 ms |
| 2 | 3: html-control | 20 | 20 | 20 | 20.856 ms |
| 2 | 4: original | 20 | 20 | 20 | 20.314 ms |
Verbatim structured measurements, checkout one
[
{
"mode": "paused",
"seconds": 4,
"events": {
"Commit": {
"count": 1,
"milliseconds": 0.04
}
},
"metrics": {
"TaskDuration": 0.0015410000000000007,
"RecalcStyleCount": 1,
"RecalcStyleDuration": 0.00001299999999999999,
"LayoutCount": 0
}
},
{
"mode": "original",
"seconds": 4,
"events": {
"UpdateLayoutTree": {
"count": 20,
"milliseconds": 3.398
},
"PrePaint": {
"count": 20,
"milliseconds": 1.857
},
"Layerize": {
"count": 20,
"milliseconds": 0.086
},
"Commit": {
"count": 21,
"milliseconds": 1.4099999999999997
}
},
"metrics": {
"TaskDuration": 0.020939,
"RecalcStyleCount": 21,
"RecalcStyleDuration": 0.0035389999999999996,
"LayoutCount": 0
}
},
{
"mode": "html-control",
"seconds": 4,
"events": {
"UpdateLayoutTree": {
"count": 20,
"milliseconds": 3.245
},
"PrePaint": {
"count": 20,
"milliseconds": 1.2539999999999998
},
"Layerize": {
"count": 20,
"milliseconds": 0.10000000000000002
},
"Commit": {
"count": 21,
"milliseconds": 1.4860000000000004
}
},
"metrics": {
"TaskDuration": 0.021402000000000004,
"RecalcStyleCount": 23,
"RecalcStyleDuration": 0.0035740000000000004,
"LayoutCount": 0
}
},
{
"mode": "original",
"seconds": 4,
"events": {
"UpdateLayoutTree": {
"count": 20,
"milliseconds": 3.2260000000000004
},
"PrePaint": {
"count": 20,
"milliseconds": 1.7090000000000003
},
"Layerize": {
"count": 20,
"milliseconds": 0.14300000000000002
},
"Commit": {
"count": 21,
"milliseconds": 1.3950000000000002
}
},
"metrics": {
"TaskDuration": 0.0199,
"RecalcStyleCount": 22,
"RecalcStyleDuration": 0.0034,
"LayoutCount": 0
}
}
]
Verbatim structured measurements, checkout two
[
{
"mode": "paused",
"seconds": 4,
"events": {
"Commit": {
"count": 1,
"milliseconds": 0.176
},
"UpdateLayoutTree": {
"count": 1,
"milliseconds": 0.038
}
},
"metrics": {
"TaskDuration": 0.0019619999999999985,
"RecalcStyleCount": 1,
"RecalcStyleDuration": 0.000027000000000000114,
"LayoutCount": 0
}
},
{
"mode": "original",
"seconds": 4,
"events": {
"UpdateLayoutTree": {
"count": 20,
"milliseconds": 3.015
},
"PrePaint": {
"count": 20,
"milliseconds": 1.809
},
"Layerize": {
"count": 20,
"milliseconds": 0.16000000000000006
},
"Commit": {
"count": 21,
"milliseconds": 1.3330000000000002
}
},
"metrics": {
"TaskDuration": 0.023126999999999995,
"RecalcStyleCount": 23,
"RecalcStyleDuration": 0.003271,
"LayoutCount": 0
}
},
{
"mode": "html-control",
"seconds": 4,
"events": {
"UpdateLayoutTree": {
"count": 20,
"milliseconds": 2.7439999999999993
},
"PrePaint": {
"count": 20,
"milliseconds": 1.257
},
"Layerize": {
"count": 20,
"milliseconds": 0.08000000000000002
},
"Commit": {
"count": 21,
"milliseconds": 1.3150000000000004
}
},
"metrics": {
"TaskDuration": 0.020856,
"RecalcStyleCount": 22,
"RecalcStyleDuration": 0.0028439999999999997,
"LayoutCount": 0
}
},
{
"mode": "original",
"seconds": 4,
"events": {
"UpdateLayoutTree": {
"count": 20,
"milliseconds": 3.14
},
"PrePaint": {
"count": 20,
"milliseconds": 1.7640000000000002
},
"Layerize": {
"count": 20,
"milliseconds": 0.10500000000000002
},
"Commit": {
"count": 21,
"milliseconds": 1.4240000000000004
}
},
"metrics": {
"TaskDuration": 0.020314000000000002,
"RecalcStyleCount": 22,
"RecalcStyleDuration": 0.0033010000000000005,
"LayoutCount": 0
}
}
]
LayerTree and SystemInfo checks used these additional Browser Automation statements after creating the page:
const protocol = await page.createCDPSession();
await protocol.send("LayerTree.enable");
protocol.on("LayerTree.layerTreeDidChange", event => console.log(event.layers));
const system = await page.browser().target().createCDPSession();
const info = await system.send("SystemInfo.getInfo");
console.log(info.gpu.featureStatus);
await system.detach();
await protocol.detach();
Relevant actual SystemInfo result: gpu_compositing: disabled_software rasterization: disabled_software LayerTree layers observed: []
6. Root cause and source evidence
ThreadStatusGlyph.tsx:167–178 selects the core Loading icon and puts animate-spin motion-reduce:animate-none on that icon. icon.tsx:385–403 passes that className directly to HugeiconsIcon. The resulting real browser DOM confirms that the animation target is SVG, not an HTML rotation container.
case "runtime":
return (
<Icon
name="Loading"
className={cn(
"animate-spin motion-reduce:animate-none",
SIDEBAR_WORKING_STATUS_COLOR_CLASS,
iconSizeClass,
)}
aria-label={threadIndicatorLabel(indicator) ?? undefined}
/>
);
The direct observation is that keeping this transform animation active drives repeated style/prepaint/layerization work in the tested software-rendering configuration. Pausing changes neither source markup nor application state and removes that work. This establishes animation causality in the probe, not an SVG-specific compositor failure. Because even the HTML control cannot use GPU compositing here, the deeper browser limitation remains unverified; claiming otherwise would overstate the evidence.
7. Verification in the second clean checkout
The same agent repeated the reproduction; this is not an independent-agent check. A second fresh detached worktree was created at the recorded full base commit. Frozen install and both scoped Turbo builds succeeded again. The same three author-written probe files were copied into that checkout, rebuilt there, and inlined into a separate HTML file; both generated files had identical SHA-256 digests. Tracked git diff --exit-code remained clean. The second page used its own local HTML path and no shared product data or port.
The exact build and measurement commands above were repeated for base-two and issue-7233-two.html. Running the same measurement script produced the second table and structured output. Both original samples again had 20 style/prepaint/layerization events; the paused control had no prepaint/layerization; the HTML control again had 20. The final report therefore retains the partial verdict and explicitly excludes a validated wrapper fix.
8. Proposed next experiment and safe-fix decision
Repeat this A/B experiment on a GPU-composited, visible browser and record SystemInfo/LayerTree alongside the trace. If only the SVG variant has recurring main-thread rendering, move rotation to a properly sized HTML container in the runtime glyph, keeping the SVG static, its accessible label, and the reduced-motion override. Then add a focused regression at the rendering boundary that fails before and passes after the change and run the existing glyph tests.
No pull request is opened. No open pull request linked to #7233 was found in the issue timeline or the open-PR number search. The proposed optimization does not improve the measured rendering-event regression in this GPU-disabled environment, so a focused pre-fix-fail/post-fix-pass proof is unavailable. A DOM-class assertion alone would not prove compositor behavior. The simple-fix gate therefore fails before any production patch, branch, commit, or push.
9. Existing checks and limitations
pnpm exec turbo run test --filter=@bb/app -- src/components/thread/ThreadStatusGlyph.test.tsx Test Files 1 passed (1) Tests 21 passed (21) Both clean checkouts: pnpm exec turbo run build --filter=@get-bb/plugin-sdk pnpm exec turbo run build --filter=@bb/app Tasks: 5 successful, 5 total (app and dependency build)
The existing test verifies the animation and reduced-motion classes, not compositor scheduling. No test was changed, and no regression test is claimed to fail before or pass after a fix. An initial broad build in the original clean checkout failed because the GitHub plugin's SDK host/process dist outputs were missing; explicitly building the SDK first allowed the relevant app builds in both clean worktrees to pass. No unrelated build code was changed.
No 144 Hz measurement, physical-GPU A/B result, process-level CPU reproduction, desktop-app result, macOS result, Windows result, or complete sidebar/thread user journey is claimed. No screenshot is included because this is a rendering-performance investigation, not a visible-pixel defect.
10. Related issues and trust boundary
#3921 concerns reduced-motion/offscreen behavior; #4515 concerns residual animation activity. They were inspected through GitHub metadata for classification context, not treated as evidence of this root cause. Their code and scripts were not run.
Issue content and comments were treated as untrusted claims. No issue-provided script, linked branch, patch, or external evidence URL was fetched or executed. Every executed product source file came from trusted origin/main; the only additions were the probe and build harness authored for this investigation. The report repository is public, and only this sanitized HTML and its summary metadata are published; raw evidence remains outside that repository.