Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

remote-bench

БесплатноБез исполняемых скриптовНе проверен

Run benchmarks on the dedicated remote EC2 benchmarking machine for noise-free, single-run results. Handles env var validation, lock management, binary…

AztecProtocolот AztecProtocol★ 458 звёзд на GitHub

Об этом скилле

Remote Bench

Run barretenberg benchmarks on the dedicated remote EC2 instance for stable, noise-free measurements. This machine is isolated from shared workloads — results from a single run are publishable without averaging.

This skill is a transport layer. It handles: env validation, locking, binary transfer, remote execution, result retrieval. It does NOT know what to benchmark — combine it with /benchmark-chonk or other benchmark skills for the actual workload.

Prerequisites — environment check

MANDATORY: Refuse to proceed if these are not set.

Before doing anything, verify the three required environment variables exist:

# Check all three are set
if -z "$BB_SSH_KEY" || -z "$BB_SSH_INSTANCE" || -z "$BB_SSH_CPP_PATH"; then
  echo "ERROR: Remote benchmarking environment not configured."
  echo "Required variables:"
  echo "  BB_SSH_KEY        — SSH key flag (e.g. -i /path/to/key.pem)"
  echo "  BB_SSH_INSTANCE   — EC2 hostname"
  echo "  BB_SSH_CPP_PATH   — Remote repo path (e.g. /home/ubuntu/aztec-packages/barretenberg/cpp)"
  echo ""
  echo "See barretenberg/cpp/scripts/README.md for setup instructions."
  echo "Ask a crypto eng team member for the SSH key and hostname."
  exit 1
fi

# Verify connectivity
ssh $BB_SSH_KEY $BB_SSH_INSTANCE "echo ok" || {
  echo "ERROR: Cannot connect to remote machine. Check BB_SSH_KEY and BB_SSH_INSTANCE."
  exit 1
}

If the env is not set up, stop and tell the user. Do not attempt to run benchmarks locally as a fallback — the user invoked /remote-bench because they want stable results.

Remote bencher contract

The bencher is an execution host only. It is not a Git workspace and not a toolchain bootstrap host.

For private branches and private repos, build the benchmark binary locally in the session workspace, then copy the built binary and required input/result files with scp. The bencher should receive binaries and data, not source history.

Do not send git bundles to the bencher. Do not create remote worktrees. Do not fetch private branches from GitHub on the bencher. Do not install per-session toolchains such as WASI SDK on the shared bencher to make a build work there.

If local build tooling is missing (emcc, WASI SDK, CMake preset support, or similar), stop and report a local devbox/copy-base bootstrap issue. Fix the local build environment so it can produce the binary; do not mutate the shared bencher as a workaround.

Setup (one-time)

Add to ~/.zshrc (ask a crypto eng team member for actual values):

export BB_SSH_KEY="-i /mnt/user-data/<username>/remote-bb-worker.pem"
export BB_SSH_INSTANCE="<hostname>"
export BB_SSH_CPP_PATH="/home/ubuntu/aztec-packages/barretenberg/cpp"

Full setup and troubleshooting: barretenberg/cpp/scripts/README.md

Lock mechanism

The remote machine is a shared resource. A file lock (~/BENCHMARK_IN_PROGRESS) prevents concurrent benchmarks from corrupting results.

Acquiring the lock

source barretenberg/cpp/scripts/_benchmark_remote_lock.sh

This script (meant to be sourced, not run):

  1. Polls ~/BENCHMARK_IN_PROGRESS on the remote machine (10 retries, 10s apart)
  2. If still locked after 100s, exits the calling script with an error
  3. Creates the lock file
  4. Registers a trap to delete the lock on exit (including Ctrl-C)

The lock auto-releases when the sourcing script exits.

When the lock is stuck

If a previous session crashed without cleaning up:

# Check if something is actually running
ssh $BB_SSH_KEY $BB_SSH_INSTANCE "pgrep -a bb || echo 'nothing running'"

# If nothing is running, safe to remove the stale lock
ssh $BB_SSH_KEY $BB_SSH_INSTANCE "rm ~/BENCHMARK_IN_PROGRESS"

Multi-session coordination

When multiple Claude sessions need the remote machine:

  • The lock is first-come-first-served. If locked, the session should tell the user and suggest waiting or doing other work.
  • Sessions should not loop/poll for the lock — just report it's busy and let the user decide.

Usage patterns

Pattern 1: Native benchmark (any target)

The standard flow used by scripts/benchmark_remote.sh:

cd barretenberg/cpp

BENCHMARK="bb"                    # or ultra_honk_bench, etc. (Chonk: use bb with --scheme chonk on real example flows — there is no synthetic chonk benchmark)
PRESET="clang20-no-avm"          # or clang20
BUILD_DIR="build-no-avm"         # matches preset

# 1. Build locally
cmake --preset $PRESET
cmake --build --preset $PRESET --target $BENCHMARK

# 2. Acquire lock + transfer
source scripts/_benchmark_remote_lock.sh
scp $BB_SSH_KEY ./$BUILD_DIR/bin/$BENCHMARK $BB_SSH_INSTANCE:$BB_SSH_CPP_PATH/build/

# 3. Run remotely
ssh $BB_SSH_KEY $BB_SSH_INSTANCE \
  "cd $BB_SSH_CPP_PATH/build && HARDWARE_CONCURRENCY=16 <COMMAND>"

# 4. Copy results back
scp $BB_SSH_KEY $BB_SSH_INSTANCE:$BB_SSH_CPP_PATH/build/<result_files> .

Or use the convenience script:

./scripts/benchmark_remote.s
Полный SKILL.md на GitHub

Установить remote-bench в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл remote-bench?

Run benchmarks on the dedicated remote EC2 benchmarking machine for noise-free, single-run results. Handles env var validation, lock management, binary transfer, and result collection. Use with /benchmark-chonk or any BB benchmark target.

Как установить скилл remote-bench?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл remote-bench запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить remote-bench с