Files
marqdo-cli/.woodpecker/performance.yml
T
cflmy 9b21486c7d
ci/woodpecker/push/main Pipeline failed
ci/woodpecker/pr/main Pipeline failed
candidate: prepare 3.0.0-rc.5 metadata and fix the migrated perf print workload
Version/metadata candidate only — this commit does not create a tag or release:
- workspace version 3.0.0-rc.4 -> 3.0.0-rc.5 (Cargo.toml/Cargo.lock) and an
  explicit unreleased-candidate CHANGELOG section; current release docs still
  describe rc.4 until a frozen release SHA and maintainer approval exist.
- The external-Bundle migration removed the in-repo stdlib tree, so the G4
  stdlib-print-demo workload no longer had a source. Move it to a self-contained
  tools/perf/fixtures/print-demo.mq.md, rename to print-demo, record its expected
  digest, and make performance.yml copy the same tools/perf into the baseline
  worktree so a paired run measures identical workloads.
- Evidence records the candidate measurement (MEASURED/correctness VERIFIED on
  the shared node) but explicitly does not claim G4 PASS: the beta baseline
  predates the external-Bundle harness and no approved paired node exists yet.

Refs cflmy/marqdo-cli issues #11, cflmy/marqdo#2
2026-11-27 10:08:22 +08:00

79 lines
3.9 KiB
YAML

# Manual performance comparison on the shared Woodpecker runner.
# Shared-node measurements may support an explicitly approved RC WARN.
when:
event: [manual]
branch: [master, "release/*"]
steps:
measure:
image: rust:1.100-bookworm
commands:
- apt-get update
- apt-get install -y --no-install-recommends python3 util-linux ca-certificates git openssl build-essential
- python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib
- python3 tools/stdlib/bundle.py --stdlib-dir target/ecosystem-stdlib
- cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker
- |
set -eu
baseline_sha=2c7c4f31e7a388d3fcfa717a77067e696ed13854
git fetch --no-tags origin refs/tags/v3.0.0-beta.1
test "$(git rev-parse 'FETCH_HEAD^{commit}')" = "$baseline_sha"
perf_dir="$(mktemp -d)"
git worktree add --detach "$perf_dir/beta" "$baseline_sha"
trap 'git worktree remove --force "$perf_dir/beta"; rm -rf "$perf_dir"' EXIT
(cd "$perf_dir/beta" && cargo build --release --locked -p marqdo-cli)
# The external-Bundle migration moved the print workload fixture out of
# the removed in-repo stdlib tree; both binaries must measure the same
# workload sources/expected digests, so copy the perf definition into
# the baseline worktree.
rm -rf "$perf_dir/beta/tools/perf"
cp -a tools/perf "$perf_dir/beta/tools/perf"
version="$(target/release/marqdo --version | cut -d ' ' -f 2)"
python3 tools/release/package.py --version "$version" --source-sha "$CI_COMMIT_SHA" \
--stdlib-dir target/ecosystem-stdlib --bundle-pin tools/stdlib/bundle-pin.json --out-dir "$perf_dir"
archive="$perf_dir/marqdo-$version-x86_64-unknown-linux-gnu.tar.gz"
(cd "$perf_dir" && sha256sum -c "$(basename "$archive.sha256")")
tar -xzf "$archive" -C "$perf_dir"
candidate="$perf_dir/marqdo-$version-x86_64-unknown-linux-gnu"
test "$(cat "$candidate/SOURCE_SHA")" = "$CI_COMMIT_SHA"
allowed="$(awk '/^Cpus_allowed_list:/ {print $2}' /proc/self/status)"
cpu_list="${MARQDO_PERF_CPU_LIST:-$(printf '%s' "$allowed" | cut -d, -f1 | cut -d- -f1)}"
echo "G4_NODE host=$(uname -n) kernel=$(uname -r) arch=$(uname -m) allowed_cpus=$allowed pin=$cpu_list"
echo "G4_CPU $(awk -F: '/model name/ {print $2; exit}' /proc/cpuinfo | xargs)"
echo "G4_GOVERNOR $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo unavailable)"
(cd "$perf_dir/beta" && python3 tools/perf/runner.py --no-build \
--warmups 5 --samples 20 --platform-id woodpecker-agent-1 \
--cpu-list "$cpu_list" --out "$perf_dir/beta.json" > /dev/null)
python3 tools/perf/runner.py --no-build --binary "$candidate/marqdo" \
--stdlib-dir "$candidate/stdlib" --warmups 5 --samples 20 \
--platform-id woodpecker-agent-1 --cpu-list "$cpu_list" \
--baseline "$perf_dir/beta.json" --out perf.json > /dev/null
python3 - <<'PY'
import json
with open("perf.json", encoding="utf-8") as handle:
report = json.load(handle)
print(
"G4_STATUS "
f"{report['status']} correctness={report['correctness']} "
f"platform={report['platform_id']} "
f"binary={report['binary']['sha256']}"
)
for workload in report["workloads"]:
print(
"G4_WORKLOAD "
f"{workload['name']} {workload['status']} "
f"p50={workload.get('median_ms')} "
f"p95={workload.get('p95_ms')} "
f"rss={workload.get('max_rss_kb_median')}"
)
PY
echo "G4_BASELINE_REPORT_BEGIN"
cat "$perf_dir/beta.json"
echo "G4_BASELINE_REPORT_END"
echo "G4_REPORT_BEGIN"
cat perf.json
echo "G4_REPORT_END"