Analyse des rapports de performance CI

VérifiéSûr

Analyse les rapports de comparaison de performance CI pour une PR ClickHouse. Recoupe l'historique master pour distinguer les vraies régressions des tests instables.

Spar Skills Guide Bot
TestingIntermédiaire
29/08/2026
Claude Code
#performance-regression#clickhouse#ci-analysis#flaky-tests#benchmark

Recommandé pour

Synthèse automatique

Analyse les rapports de comparaison de performances CI d'une pull request ClickHouse, énumère toutes les régressions et améliorations dépassant le seuil, puis les recoupe avec l'historique master pour distinguer les vrais changements des tests instables.

Points forts

  • Produit la liste complète et non filtrée des changements pour les architectures amd et arm, avec interdiction explicite de masquer ou de résumer des entrées.
  • Impose un recoupement avec la table default.checks de play.clickhouse.com et fait remonter le nombre d'apparitions sur master (par ex. « 8/685 runs »).
  • Documente le mapping des colonnes TSV et fournit les requêtes SQL prêtes à l'emploi, y compris l'hôte, l'utilisateur explorer et les suffixes ::new/::old.
  • Énonce des règles de classification claires : instable sur master, nouveau dans la PR, cas rare, ou correction d'une régression antérieure.

Limites

  • Étroitement lié au dépôt ClickHouse, au format de ses rapports CI et au script fetch_perf_report.py du dossier .claude/tools.
  • Exige un client clickhouse installé et un accès réseau à play.clickhouse.com pour l'étape de recoupement, présentée comme obligatoire.
  • La fenêtre de 30 jours, le seuil de 1,10x et le critère de plus de 50 exécutions sont des heuristiques figées ; la classification finale reste indicative.
Quand l'utiliser

À utiliser lors de la revue d'une PR ClickHouse dont les tests de performance montrent des écarts, pour déterminer s'ils sont réellement introduits par la PR ou dus à des tests instables.

Quand l'éviter

Inutile pour les benchmarks d'autres projets, ou lorsque ni le rapport CI ni la base play.clickhouse.com ne sont accessibles.

Analyse de sécurité

Sûr
Score qualité92/100

The skill only performs read-only analysis: it fetches public CI performance data, queries a public ClickHouse database with a read-only 'explorer' user, and downloads CI artifacts for log inspection. It uses Bash, curl, and tar, but only on trusted GitHub/ClickHouse endpoints and with no destructive, exfiltrating, or obfuscated actions. Quoted variables reduce shell injection risk. No secrets are handled.

Aucun point d'attention détecté

Comment cette analyse est faite

Exemples

Full PR analysis
Analyze the performance report for PR 99474: list every regression and improvement above 1.10x for amd and arm in separate tables, then cross-reference all of them with the last 30 days of master history and classify each one.
Direct CI report URL
Here is the CI report URL: https://github.com/ClickHouse/ClickHouse/pull/98123 — go through the complete list of changed queries on both architectures and tell me which ones the PR really caused versus which are flaky on master.
Flakiness verdict only
For PR 96500, which of the slower queries are genuinely introduced by the PR rather than already flaky on master? Show the master slower/total counts per architecture before giving the verdict.

name: perf-report description: Analyze CI performance comparison reports for a ClickHouse PR. Lists all regressions and improvements, cross-references with master history to distinguish real changes from flaky tests. argument-hint: "<PR-number or CI-report-URL>" disable-model-invocation: false allowed-tools: Bash, Read, Grep, Glob, WebFetch

Performance Report Analysis Skill

Arguments

  • $0 (required): PR number (e.g. 99474) or a CI report URL

Steps

1. Fetch performance data

Use the fetch_perf_report.py tool to get TSV data for both architectures:

python3 .claude/tools/fetch_perf_report.py "https://github.com/ClickHouse/ClickHouse/pull/$PR" --arch amd --tsv
python3 .claude/tools/fetch_perf_report.py "https://github.com/ClickHouse/ClickHouse/pull/$PR" --arch arm --tsv

If a direct CI report URL is given instead of a PR number, use it directly.

Extract all changed queries (column 10 == 1 means the change exceeds the threshold):

  • Column 1: test name
  • Column 2: query index
  • Column 4: batch
  • Column 5: old time
  • Column 6: new time
  • Column 8: ratio (e.g. 1.5 = 1.5x)
  • Column 10: 1 if changed, 0 if within threshold
  • Column 12: "slower" or "faster"
  • Column 13: query text

2. List ALL changes

Present the complete, unfiltered list of all changes above 1.10x, sorted by magnitude, for both architectures separately. Use tables with columns: Magnitude, Direction, Test, Query#, Batch.

Do NOT summarize, collapse, or hide entries. Do NOT dismiss anything as "noise" or "not actionable" without evidence. Every entry must be visible.

3. Cross-reference with master history

This step is MANDATORY. For every test that shows as slower or faster above 1.10x, check the public CI database to determine if this is a known flaky test or a genuine change introduced by the PR. Do NOT skip this step or use alternative approaches (like manually fetching perf reports from other PRs).

Query the default.checks table on play.clickhouse.com with user=explorer:

clickhouse client --format PrettyCompactNoEscapes --host play.clickhouse.com --user explorer --secure --query "
SELECT
    replaceRegexpOne(test_name, '::(new|old)$', '') AS test,
    countIf(test_status = 'slower') AS slower_count,
    countIf(test_status = 'faster') AS faster_count,
    countIf(test_status = 'unstable') AS unstable_count,
    count() AS total_runs
FROM default.checks
WHERE pull_request_number = 0
  AND check_name LIKE '%Performance%amd%'
  AND check_start_time >= now() - INTERVAL 30 DAY
  AND test_name IN (
    'norm_distance #2::new',
    'array_sort #0::new'
  )
GROUP BY test
ORDER BY slower_count DESC, test
"

Run one query per architecture — use '%Performance%amd%' for x86 and '%Performance%arm%' for ARM.

Critical details:

  • Host: play.clickhouse.com, user: explorer (NOT play)
  • Table: default.checks (NOT perftest or other tables)
  • pull_request_number = 0 filters to master-only commits (no PR noise)
  • Test names in the DB have ::new and ::old suffixes — always query with ::new
  • Include ALL changed tests in a single IN clause to minimize round-trips

4. Classify each change

For each test, classify based on the master history:

  • Flaky on master: appears as slower in >1% of master runs, or has many unstable entries. Note the count (e.g. "8/685 runs").
  • New in this PR: 0 slower (or faster) appearances on master in the last 30 days with a meaningful number of total runs (>50). This change was first observed in this PR.
  • Rarely on master: 1-2 appearances out of hundreds. Treat as borderline — note it but don't dismiss.
  • For "faster" results: check if the test was previously slower on master (meaning this PR fixes it).

5. Present the verdict

Present the final classification in a table per architecture:

| Magnitude | Test | Master slower/total (30d) | Verdict | |---|---|---|---|

Classify as:

  • Flaky — frequently appears on master, dismiss
  • Unstable — high unstable count on master, dismiss
  • New in this PR — investigate — regression not seen on master before
  • New in this PR — improvement — speedup not seen on master before, or fixes a previously-slower test
  • Rarely on master — borderline, note it

6. Summary

After the tables, provide a brief summary:

  • Count of genuine regressions (never on master) per architecture
  • Count of genuine improvements per architecture
  • Count of flaky/dismissed entries
  • Call out any extreme outliers (>2x) explicitly regardless of flaky status

7. Deep-dive: accessing CI logs (when asked)

When the user asks to investigate a specific regression further, download and analyze the CI artifacts.

Get artifact links using the fetch_ci_report.js tool with --links:

node .claude/tools/fetch_ci_report.js "<CI-report-URL-for-specific-batch>" --links

This will show logs.tar.zst, job.log.zst, all-query-metrics.tsv, report.html, etc.

Download and extract server logs:

curl -sS "<logs.tar.zst-URL>" -o tmp/perf_logs.tar.zst
tar -I zstd -tf tmp/perf_logs.tar.zst  # list contents
tar -I zstd -xf tmp/perf_logs.tar.zst -C tmp/ ./right/server.log  # PR binary
tar -I zstd -xf tmp/perf_logs.tar.zst -C tmp/ ./left/server.log   # master binary
  • right/server.log = PR binary (the "new" version)
  • left/server.log = master binary (the "old" version)

Analyze the query execution by finding the query ID in the server log:

# Find the query and its timing
grep "math.query2" tmp/right/server.log | grep -E "Aggregated|Read.*rows.*sec"

The perf framework uses query IDs like {test_name.query{N}.run{M}} (e.g. math.query2.run0). Look at:

  • Aggregated ... in X sec — actual compute time
  • executeQuery: Read N rows ... in X sec — total query time
  • TCPHandler: Processed in X sec — wall clock including network

Compare both servers during the same time window to see if the machine was under load or if only the PR binary was slow. Check for:

  • Background activity (merges, flushes, system log writes)
  • Errors or warnings
  • Whether the slowdown is in UserTime (CPU-bound) or wall clock (I/O/contention)

Check the git hash of the binary that actually ran:

grep "Starting ClickHouse" tmp/right/server.log | head -1

This shows the exact revision, build ID, and PID. Compare with what you expect — the CI perf test may use a different binary than the latest commit if the build was cached.

8. Deep-dive: trace log profiling (flamegraphs)

The perf job writes right-trace-log.tsv and left-trace-log.tsv, exports of system.trace_log from each server, containing CPU and real-time stack samples for every query.

Two limits to know before reaching for these files. They are NOT shipped in logs.tar.zst (the archive excludes *-trace-log.tsv), and the dump holds only the four columns the report reads: query_id, trace, trace_type, size. There is no symbols column; addresses are symbolized separately through *-addresses.tsv.

Use the report's collapsed stacks instead. report/stacks.$version.tsv already carries symbolized, collapsed stacks per query, and it is what the report's own flamegraphs are built from. It has no header; its first three columns are test, query_index and trace_type, so select a query by those three fields (the math.queryN spelling is a query id and never appears in this file). Keep the trace types apart: CPU and Real count samples while MemorySample and JemallocSample sum bytes, so folding them together mixes units.

tar -I zstd -xf tmp/perf_logs.tar.zst -C tmp/ ./report/stacks.right.tsv
awk -F'\t' '$1 == "math" && $2 == 2 && $3 == "CPU"' tmp/report/stacks.right.tsv \
  | cut -f 5- | sed 's/\t/ /g' > tmp/math2_right.collapsed

The resulting .collapsed file can be processed with flamegraph.pl. Compare left (master) vs right (PR) to see what changed. Not with analyze-assembly.py --perf-map: that flag reads JSONL records keyed by instruction address, so every folded symbol;...;symbol count line is rejected as a JSON parse error and the weighting silently comes out empty.

This is the fastest way to identify the root cause of a regression. Example: for a 31x exp10 regression, the trace log immediately showed modf consuming 577/1200 CPU samples on the PR binary vs 28/60 on master — pinpointing the exact function responsible without needing to reproduce locally.

The archive also contains pre-built SVG flamegraphs for queries the framework selected for detailed analysis:

tar -I zstd -tf tmp/perf_logs.tar.zst | grep "\.svg"

These come in .left.svg (master), .right.svg (PR), and .diff.svg (differential) variants, for both CPU and Real time. Not all queries get flamegraphs — only those the framework considers interesting.

9. Deep-dive: profile events from raw TSV

The archive contains per-query raw metric data in analyze/tmp/{test}_{queryN}.tsv. Each row is one run, with an array of all ProfileEvents (counters like UserTimeMicroseconds, OSCPUVirtualTimeMicroseconds, RealTimeMicroseconds, etc.).

tar -I zstd -xf tmp/perf_logs.tar.zst -C tmp/ ./analyze/tmp/math_2.tsv

The all-query-metrics.tsv file (linked from --links output) contains the processed comparison data with old/new values, ratios, and thresholds for every metric of every query. The fetch_perf_report.py tool already parses this, but the raw file has all metrics, not just client_time.

Important: use unique download paths

When analyzing multiple batches or PRs, use unique directory names to avoid overwriting:

mkdir -p tmp/batch1_amd tmp/batch5_amd
curl -sS "<batch1-logs-url>" -o tmp/batch1_amd/logs.tar.zst
curl -sS "<batch5-logs-url>" -o tmp/batch5_amd/logs.tar.zst
tar -I zstd -xf tmp/batch1_amd/logs.tar.zst -C tmp/batch1_amd/

Rules

  • Never dismiss a regression without checking master history first. Do not call anything "noise" or "not actionable" based on intuition alone.
  • Show all data. The user wants the full picture, not a filtered summary.
  • Both architectures matter. AMD runs on Intel Sapphire Rapids (m7i.4xlarge), ARM runs on Graviton 4 (m8g.4xlarge). Regressions on one but not the other are still real.
  • A test appearing in multiple CI runs of the same PR is a strong signal even if it also occasionally appears on master.
  • Do not look at the PR code or run local benchmarks unless explicitly asked. This skill is purely about CI report analysis.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/analyze-ci-performance-reports-mte1lfyd/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/analyze-ci-performance-reports-mte1lfyd' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/analyze-ci-performance-reports-mte1lfyd/download' --output '.skill-downloads/analyze-ci-performance-reports-mte1lfyd/SKILL.md.part' && mv '.skill-downloads/analyze-ci-performance-reports-mte1lfyd/SKILL.md.part' '.skill-downloads/analyze-ci-performance-reports-mte1lfyd/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Outils déclarés par l’auteur (à vérifier dans votre agent) : Bash, Read, Grep, Glob, WebFetch

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/analyze-ci-performance-reports-mte1lfyd/SKILL.md' && test -s '.skill-downloads/analyze-ci-performance-reports-mte1lfyd/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/perf-report' && cp -R '.skill-downloads/analyze-ci-performance-reports-mte1lfyd' '.claude/skills/perf-report'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/analyze-ci-performance-reports-mte1lfyd'

openskills read 'analyze-ci-performance-reports-mte1lfyd'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/analyze-ci-performance-reports-mte1lfyd/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires