Logo vun Chrome Trace

Chrome Trace

Organisatioun
layoutit
chrome-trace

Capture and analyze Chrome/Chromium performance traces with Playwright around a concrete browser interaction. Use when Codex needs to answer where frame time is spent during an update, drag, rotation, scroll, animation, camera movement, light movement, DOM/CSS render change, or other performance-sensitive UI action; especially when the right answer requires per-frame Chrome trace evidence instead of FPS-only guesses.

Iwwersiicht

Editeurlayoutit
Repositorypolycss
Skill-Nummchrome-trace
Stären
768
Forks
22
Matgeliwwert Fichieren
5
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum layoutit op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Chrome Trace an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/layoutit/polycss/tree/main/.agents/skills/chrome-trace
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/layoutit/polycss.git /tmp/polycss
mkdir -p .claude/skills
cp -r /tmp/polycss/.agents/skills/chrome-trace .claude/skills/chrome-trace
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Chrome Trace an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Chrome Trace automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Chrome Trace net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Chrome Trace

Core Workflow

Use Playwright with Chromium and the Chrome DevTools Protocol Tracing domain to capture the exact interaction under investigation.

  1. Start from a reproducible page and action.
  2. Warm up the page until app-specific readiness is true.
  3. Start Chrome tracing and a requestAnimationFrame sampler immediately before the action.
  4. Mark the action window with performance.mark() and console.timeStamp().
  5. Perform the action with real Playwright input when the user is asking about input-driven behavior.
  6. Stop tracing after a short settle window.
  7. Align trace event timestamps to performance.now() using the start/end marks.
  8. Report where time went: Scripting, Style, Layout, PrePaint, Paint, compositor main-thread work, compositor impl-thread work, raster, GPU/viz events, and the slowest frame windows.

Do not draw conclusions from FPS alone. Use FPS/frame-time summaries only as the symptom; use trace groups and top events as the explanation.

PolyCSS Trace Runners

Use scripts/trace.mjs as the front door:

bash
pnpm bench:build
node .agents/skills/chrome-trace/scripts/trace.mjs motion --page nonvoxel --mesh glb:Elephant.glb --variant baseline --dom-samples --label elephant-baseline
node .agents/skills/chrome-trace/scripts/trace.mjs motion --page nonvoxel --mesh teapot --variant baseline --dom-samples --frame-details --layer-details --gpu-details --trace-out bench/results/teapot.trace.json --label teapot-enriched --report
node .agents/skills/chrome-trace/scripts/trace.mjs motion --page nonvoxel --mesh teapot --variant baseline --gpu-details full --trace-out bench/results/teapot-full-gpu.trace.json --label teapot-full-gpu
node .agents/skills/chrome-trace/scripts/trace.mjs drag --mesh teapot --mode baked --frame-details --label teapot-drag
node .agents/skills/chrome-trace/scripts/trace.mjs motion --mesh garden --report --markdown-out bench/results/garden-trace.md
node .agents/skills/chrome-trace/scripts/trace.mjs compare bench/results/before.json bench/results/after.json --markdown-out bench/results/trace-compare.md

Use trace.mjs motion for steady bench motion across perf and nonvoxel pages, cadence buckets, DOM samples, render stats, and tag counts.

Add --frame-details to motion traces when you need slowest/fastest frame attribution instead of only bucket averages. On nonvoxel pages this also enables page-work samples for camera.update, scene.applyCamera, and input/control callbacks when available. Add --layer-details when compositor/layer shape is part of the question; it records LayerTree counts, layer aggregates by DOM tag/class (leaf:b, leaf:u, polycss-camera, etc.), largest layers, and compositing reasons. Add --trace-out when the raw Chrome trace should be preserved for DevTools.

Add --gpu-details when render pass timing is the current question and the trace still needs to stay reasonably sized. Light mode keeps the normal GPU/viz timeline categories and adds only disabled-by-default-viz.gpu_composite_time; render-pass attribution still comes from base events such as DirectRenderer::DrawFrame and DirectRenderer::DrawRenderPass. It intentionally avoids per-quad, Skia command, and GPU service spam.

Use --deep-gpu or --gpu-details full only for rare forensic runs that truly need per-quad/Skia/overdraw detail. Full mode also enables disabled-by-default-viz.quads, disabled-by-default-viz.triangles, disabled-by-default-viz.overdraw, disabled-by-default-gpu.debug, and disabled-by-default-skia.gpu; raw traces can become hundreds of MB and timing can be heavily perturbed.

Use trace.mjs drag for real PolyOrbitControls pointer-drag traces on nonvoxel-vanilla.html. This runner knows the non-voxel readiness hooks, camera state, interaction stats, and per-frame page-work samples.

Use trace.mjs generic for arbitrary pages and interactions that are not covered by a polycss bench page.

When interpreting PolyCSS traces, map the result back to the render model:

  • FunctionCall, EventDispatch, FireAnimationFrame: JS/input work. Unexpected sustained per-frame work is suspicious outside imported skeletal animation.
  • UpdateLayoutTree, RecalculateStyles: style recalculation, often CSS variable or selector invalidation cost.
  • Layout: layout; should stay low for transform/CSS-var-driven motion.
  • PrePaint, Paint, PaintArtifactCompositor::Update, Layerize: paint/compositing setup.
  • LayerTreeImpl::UpdateDrawProperties, draw_property_utils::ComputeDrawPropertiesOfVisibleLayers, LayerTreeHostImpl::PrepareToDraw, MainFrame.Draw, SubmitCompositorFrame: compositor-side cost.
  • Graphics.Pipeline, DisplayScheduler::DrawAndSwap, DirectRenderer::DrawFrame, DirectRenderer::DrawRenderPass: GPU/viz drawing pipeline. Treat these as browser output work, and compare them against layer details before changing app JS.
  • gpuVizRenderPass, gpuVizTiles, gpuVizGpuService: opt-in --gpu-details attribution buckets for render pass, coarse tile/raster playback, and GPU service events.
  • gpuVizQuads and gpuVizSkia: usually require --gpu-details full / --deep-gpu; treat them as high-overhead forensic signals.
  • RasterTask, image decode events: raster/bitmap work, usually atlas or tile work.

Trace event durations are inclusive and often nested, especially GPU/viz and scheduler events. Use group ms/frame as attribution evidence and for before/after deltas, not as exclusive slices that must add up to frame time.

Generic Capture

For arbitrary pages, use trace.mjs generic:

bash
node .agents/skills/chrome-trace/scripts/trace.mjs generic \
  --url http://127.0.0.1:3000 \
  --ready-js "window.appReady === true" \
  --action drag \
  --selector "#viewport" \
  --drag "480,0" \
  --duration 1200 \
  --steps 90 \
  --summary-out trace-summary.json \
  --trace-out trace.json

Useful alternatives:

bash
node .agents/skills/chrome-trace/scripts/trace.mjs generic --url http://127.0.0.1:3000 --action wait --sample 3000
node .agents/skills/chrome-trace/scripts/trace.mjs generic --url http://127.0.0.1:3000 --action eval --eval "window.rotateScene?.(Math.PI / 2)"
node .agents/skills/chrome-trace/scripts/trace.mjs generic --url http://127.0.0.1:3000 --action scroll --scroll "0,900"

Comparing Runs

Use --report on a runner to generate a Markdown report after capture, or use trace.mjs report on an existing summary JSON:

bash
node .agents/skills/chrome-trace/scripts/trace.mjs report bench/results/garden.json --markdown-out bench/results/garden.md

Use trace.mjs compare on summary JSON files from any runner:

bash
node .agents/skills/chrome-trace/scripts/trace.mjs compare before.json after.json --markdown-out trace-compare.md

Read positive deltas in frame_time_*_ms and trace group ms/frame as more expensive after the change. Read positive FPS deltas as better. Reports include a Quick Read section that calls out p95 frame time and the dominant trace group.

Reporting

Keep the report evidence-led and compact:

  • State the exact command, page, viewport, action, warmup, and sample/settle windows.
  • Include frame-time p50/p95/p99 and slowest-frame count.
  • Identify the dominant trace groups in the action window.
  • Name the top Chrome events, not only broad categories.
  • For polycss, explicitly say whether the trace supports or violates the "no JS in the render loop" expectation.
  • Mention artifacts written, especially the raw trace JSON that can be opened in Chrome DevTools Performance.

If trace markers are missing, say that alignment is weaker and rerun with marks before making a firm claim.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Chrome Trace?

Capture and analyze Chrome/Chromium performance traces with Playwright around a concrete browser interaction. Use when Codex needs to answer where frame time is spent during an update, drag, rotation, scroll, animation, camera movement, light movement, DOM/CSS render change, or other performance-sensitive UI action; especially when the right answer requires per-frame Chrome trace evidence instead of FPS-only guesses.

Firwat Chrome Trace op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Chrome Trace besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Chrome Trace an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/layoutit/polycss/tree/main/.agents/skills/chrome-trace an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Chrome Trace benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Chrome Trace benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Chrome Trace domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Chrome Trace gratis?

Jo. De Skill gëtt vum layoutit ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇