شعار Run Benchmark

Run Benchmark

المجتمع
onevcat
run-benchmark

شغّل طبقات اختبار الأداء في Prowl للفرع الحالي أو لأحد الإصدارات، وقارن النتائج بالخطوط الأساسية المسجّلة، واكتب تقريرًا محليًا دائمًا. استخدم هذه المهارة فقط عندما يطلب المستخدم صراحةً تشغيل run-benchmark أو إجراء اختبارات أداء أو التحقق من أثر الأداء. لا تشغّلها تلقائيًا بعد تنفيذ العمل. حدّد أولًا هدف المستخدم (تغيير في مسار ساخن، أو تحسين جديد، أو فحص شامل على مستوى الإصدار)، ثم أكّده معه، وبعدها شغّل الطبقات المناسبة.

Add to TypingMind

نظرة عامة

الناشرonevcat
المستودعProwl
اسم المهارةrun-benchmark
النجوم
647
التفريعات
66
الملفات المرفقة
تعليمات فقط
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها onevcat على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Run Benchmark في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/onevcat/Prowl/tree/main/.claude/skills/run-benchmark
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/onevcat/Prowl.git /tmp/Prowl
mkdir -p .claude/skills
cp -r /tmp/Prowl/.claude/skills/run-benchmark .claude/skills/run-benchmark
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Run Benchmark في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Run Benchmark تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Run Benchmark بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Run Benchmark

Invocation contract

Run this skill only after an explicit user request. Implementing, fixing, or reviewing performance-adjacent code does not by itself authorize a benchmark run.

All timing in this workflow assumes one dedicated, quiet local machine accumulating a series over time. Numbers from CI runners, other machines, or a loaded host are not comparable and must not enter the baseline series. Never run other builds, tests, or heavy agents concurrently with a timed run.

Background and design decisions live in docs-ai/057-performance-benchmark-suite/; the measurement methodology (why workload context matters, why load kills comparability) in docs-ai/032-performance-hardening/004-agent-detection-steady-state.md.

Step 0 — Preflight

  1. git status --short — an A/B run switches the checkout to the baseline commit, so the tree must be clean and HEAD committed. If dirty, tell the user what is blocked and ask whether to commit/stash or fall back to a branch-only run.
  2. Quiet-host check: compare uptime load1 against sysctl -n hw.ncpu. Above roughly half the cores, warn that starvation inflates numbers unevenly and ask whether to wait or proceed; above one runnable process per core, refuse the timed run and say why.
  3. Note what is available for the live layer: is a Prowl instance running (prowl list --json), and are any agents working (animating titles)?

Step 1 — Classify intent, then always confirm

Gather evidence before guessing:

  • The user's own words in the invocation — these override everything below.
  • git branch --show-current; BASE=$(git merge-base HEAD origin/main); git diff --name-only $BASE and git log --oneline $BASE..HEAD.
  • Map changed files through the table in Reference to see which benchmark suites the branch can plausibly affect.

Classify into one of three modes:

ModeSignalWhat runs
hot-pathBranch touches files mapped to existing suites; user wants to know whether the change regressed themA/B make bench: merge-base baseline vs branch
new-optimizationBranch introduces a performance improvement no suite pins yetAdd a benchmark first (057 pattern), then the hot-path A/B
releasePre-release or "how is performance overall" with no specific change in questionmake test + make bench vs trailing series + live layer

Then confirm with the user before running anything, even when the evidence is clear: present the guessed mode with its one-line evidence and the alternatives (AskUserQuestion with the recommended option first). If the evidence is contradictory or absent, do not guess — ask. Benchmark runs take minutes and switch the checkout; a wrong mode wastes both.

Step 2 — Run the confirmed mode

Every make bench appends records to ~/Library/Logs/Prowl/measurements/bench/bench.jsonl keyed by git rev-parse --short HEAD. Record the exact SHA before each run so the comparison step can find its rows.

hot-path — A/B against the merge-base

  1. Check whether the baseline already exists on this machine: jq -c "select(.gitSHA == \"<base-short-sha>\")" bench.jsonl. Reuse it if present.
  2. If absent: git switch --detach $BASE → make bench → git switch -. The first optimized build after a switch takes minutes; later ones are incremental.
  3. make bench on the branch HEAD.
  4. Compare per Step 3.

new-optimization — pin the claim before measuring it

  1. Check the Reference inventory: does any suite already cover the optimized path?
  2. If not, the primary deliverable is a new benchmark following the 057 pattern, in the same PR as the optimization:
    • dig the replaced implementation out of git history and keep it verbatim as the reference;
    • assert output equivalence before timing;
    • assert a floor ratio 2–4x below the measured Release ratio;
    • gate Swift-vs-Swift ratios on optimized builds (BenchmarkMeasurement.isOptimizedBuild); C-call/filesystem ratios assert everywhere.
  3. Then run the hot-path A/B: the new suite quantifies the win, the existing suites catch collateral damage.
  4. The measured ratio goes into the report as the claim's durable evidence — this is exactly what the #644–#665 wave lacked.

release — full sweep plus series

  1. make test — the behavioral + ratio layer (Debug).
  2. make bench — compare against the trailing series (last ~5 records per case across recent SHAs), not a single baseline.
  3. Live layer, best-effort, report each as run/inconclusive/skipped:
    • make measure-titles — needs a running app with at least one animating agent tab; exit 3 means nothing was animating (inconclusive, not a pass).
    • make measure-cpu — needs a running Prowl Debug instance; set PROWL_PID when several run. Records agent mix and load next to the attribution, so quote them together.
  4. make capture-spike is a standing watch for long-running instances, not a step here; mention it if the user is chasing an intermittent spike.

Step 3 — Compare and judge

Extract both sides:

bash
jq -r 'select(.gitSHA == "SHA") | [.suite, .name, .referenceMilliseconds, .shippedMilliseconds, .ratio] | @tsv' \
  ~/Library/Logs/Prowl/measurements/bench/bench.jsonl

Judgment rubric (single machine, warm cache, medians of 15):

  • A ratio below its asserted floor already failed the test — confirmed regression, no further interpretation needed.
  • shippedMilliseconds against baseline: within ±20% is noise; 1.2–1.5x growth is a watch — rerun make bench once to confirm before claiming anything; above 1.5x sustained is a regression; above 2x is major. Name suspect commits via the file→suite map.
  • Use referenceMilliseconds as the built-in host canary: the reference workload never changes, so if it moved by a similar factor the host moved, not the code; if shipped moved alone, the code moved.
  • Never average across load regimes. If load was elevated during a run, discard the run and redo it — do not "correct" the numbers.

Step 4 — Persistent report

Write a markdown report to ~/Library/Logs/Prowl/measurements/reports/$(date +%Y%m%d-%H%M)-<branch-or-tag>.md (mkdir -p the directory; it lives with the rest of the measurement home, survives reboots, and is never cleaned by the system). Reports are append-only history — never overwrite or delete earlier ones.

Required sections:

  • Intent — the mode the user confirmed, in one line.
  • Context — date, branch, baseline and branch SHAs, load average and core count at run time, app/agent state if the live layer ran.
  • Results — one table per layer: case, baseline shipped ms, branch shipped ms, delta, ratio vs floor.
  • Verdict — no-regression / watch / regression / major, with suspect commits for anything above noise, and the host-canary observation.
  • Not run — layers skipped or inconclusive, and why.
  • Raw refs — the bench.jsonl SHAs and any script run directories.

Reply to the user with the verdict and the report path. The report, not the chat, is the durable record.

Reference

Benchmark inventory (all under App/Tests/, suite root PerformanceBenchmarks):

Suite / checkPinsFloorAsserts in
LineCountScanBenchmarks sparse#644/#652 memchr scan vs Data.reduce3xall builds
LineCountScanBenchmarks all-newline#652 hybrid dense fallback2xoptimized only
FingerprintNormalizeBenchmarks#650/#657 escape-absence guard1.3xoptimized only
WorktreeDirectoryIndexBenchmarks#648/#655 index vs per-row scan2xall builds
SessionScoringBenchmarks#650/#657 warm fragment cache3xall builds
make measure-titles (live)#649/#656 title coalescing ≤ ~1/s1.25/srunning app

File → suite map for intent classification and suspect naming:

Changed pathAffected check
App/Sources/Clients/Git/GitClient.swift, UntrackedLineCountCache.swiftLineCountScan
App/Sources/Infrastructure/AgentDetection/AgentSessionResolver.swiftFingerprintNormalize, SessionScoring
App/Sources/Domain/WorktreeDirectoryIndex.swift, App/Sources/Support/PathPolicy.swiftWorktreeDirectoryIndex
App/Sources/Features/Terminal/Models/TerminalTabManager.swift, WorktreeTerminalState+AgentDetection.swiftmeasure-titles, coalescing/dedup unit tests
Sidebar / Active Agents views and reducerscounting tests only (no timing suite)

Caveats:

  • referenceMilliseconds values measured inside the Release test bundle are not comparable to standalone -O binaries (~10x apart for Data.reduce); ratios are unaffected. Compare bench.jsonl rows only with other bench.jsonl rows.
  • The suite is .serialized and make bench disables parallel testing and pins the destination arch deliberately — do not "speed it up" by removing either.
  • bench.jsonl is append-only; the same SHA can have several rows (reruns). Prefer the newest row per (suite, name, SHA) and note reruns in the report.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Run Benchmark؟

شغّل طبقات اختبار الأداء في Prowl للفرع الحالي أو لأحد الإصدارات، وقارن النتائج بالخطوط الأساسية المسجّلة، واكتب تقريرًا محليًا دائمًا. استخدم هذه المهارة فقط عندما يطلب المستخدم صراحةً تشغيل run-benchmark أو إجراء اختبارات أداء أو التحقق من أثر الأداء. لا تشغّلها تلقائيًا بعد تنفيذ العمل. حدّد أولًا هدف المستخدم (تغيير في مسار ساخن، أو تحسين جديد، أو فحص شامل على مستوى الإصدار)، ثم أكّده معه، وبعدها شغّل الطبقات المناسبة.

لماذا تستخدم Run Benchmark على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Run Benchmark عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Run Benchmark في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/onevcat/Prowl/tree/main/.claude/skills/run-benchmark. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Run Benchmark؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Run Benchmark؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Run Benchmark معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Run Benchmark مجانية؟

نشرها onevcat على GitHub. راجع المستودع للاطلاع على شروط الترخيص. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇