Skip to content

Commit c4e2202

Browse files
committed
ci: skip first-run onboarding too, A/B main window against PR 3104 patches
1 parent c9d1af9 commit c4e2202

3 files changed

Lines changed: 42 additions & 19 deletions

File tree

‎.github/workflows/idle-win-busy-ab.yml‎

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,61 @@ jobs:
4949
env:
5050
RUST_TARGET_TRIPLE: x86_64-pc-windows-msvc
5151

52-
- name: Build
52+
- name: Build base
5353
shell: bash
5454
run: |
5555
set -euxo pipefail
5656
node scripts/sync-desktop-versions.mjs
5757
./scripts/prepare-gpui-dependency.sh
5858
git -C ../zed-cap apply "$GITHUB_WORKSPACE/scripts/probe/frame-trace.patch"
5959
cargo +1.95.0 build --manifest-path apps/desktop-gpui/Cargo.toml --locked --target x86_64-pc-windows-msvc --bin cap-gpui
60+
mkdir -p "$RUNNER_TEMP/base"
61+
cp apps/desktop-gpui/target/x86_64-pc-windows-msvc/debug/cap-gpui.exe apps/desktop-gpui/target/x86_64-pc-windows-msvc/debug/cap_gpui.pdb "$RUNNER_TEMP/base/"
6062
61-
- name: Fetch samply
62-
shell: pwsh
63-
continue-on-error: true
63+
- name: Build head (PR 3104 patches)
64+
shell: bash
6465
run: |
65-
Invoke-WebRequest https://github.com/mstange/samply/releases/download/samply-v0.13.1/samply-x86_64-pc-windows-msvc.zip -OutFile $env:RUNNER_TEMP\samply.zip
66-
Expand-Archive $env:RUNNER_TEMP\samply.zip -DestinationPath $env:RUNNER_TEMP\samply
67-
Get-ChildItem -Recurse $env:RUNNER_TEMP\samply | Select-Object FullName
66+
set -euxo pipefail
67+
git fetch --no-tags --depth 1 origin perf/idle-vblank-win-x11
68+
mkdir -p "$RUNNER_TEMP/head-patches"
69+
for p in zed-gpui zed-windows zed-linux zed-idle-frames zed-streaming-image; do
70+
git show "FETCH_HEAD:apps/desktop-gpui/patches/$p.patch" > "$RUNNER_TEMP/head-patches/$p.patch"
71+
done
72+
git -C ../zed-cap reset -q --hard
73+
git -C ../zed-cap clean -fdq
74+
for p in zed-gpui zed-windows zed-linux zed-idle-frames zed-streaming-image; do
75+
git -C ../zed-cap apply --unidiff-zero "$RUNNER_TEMP/head-patches/$p.patch"
76+
done
77+
git -C ../zed-cap apply "$GITHUB_WORKSPACE/scripts/probe/frame-trace.patch" || echo "trace patch did not apply on head"
78+
cargo +1.95.0 build --manifest-path apps/desktop-gpui/Cargo.toml --locked --target x86_64-pc-windows-msvc --bin cap-gpui
79+
mkdir -p "$RUNNER_TEMP/head"
80+
cp apps/desktop-gpui/target/x86_64-pc-windows-msvc/debug/cap-gpui.exe apps/desktop-gpui/target/x86_64-pc-windows-msvc/debug/cap_gpui.pdb "$RUNNER_TEMP/head/"
6881
6982
- name: Profile
7083
shell: bash
7184
run: |
7285
set -uo pipefail
7386
export PATH="$(cygpath "$GITHUB_WORKSPACE/target/debug"):$PATH"
74-
app="apps/desktop-gpui/target/x86_64-pc-windows-msvc/debug/cap-gpui.exe"
7587
out="$RUNNER_TEMP/out"
76-
samply="$(find "$RUNNER_TEMP/samply" -name samply.exe | head -1)"
77-
python scripts/probe/thread_profile.py --label main-trace --out "$out" ${samply:+--samply "$samply"} \
78-
--env CAP_PERF_SKIP_ONBOARDING=1 --env CAP_FRAME_TRACE=1 --env RUST_LOG=info "$app"
79-
python scripts/probe/thread_profile.py --label main-clean --out "$out" \
80-
--env CAP_PERF_SKIP_ONBOARDING=1 "$app"
81-
python scripts/probe/thread_profile.py --label onboarding-trace --out "$out" \
82-
--env CAP_FRAME_TRACE=1 --env RUST_LOG=info "$app"
83-
for f in "$out"/*-app.log; do
88+
prof() { python scripts/probe/thread_profile.py --out "$out" "$@" || echo "profile failed: $*"; }
89+
skip="--env CAP_PERF_SKIP_ONBOARDING=1"
90+
prof --label main-base-trace $skip --env CAP_FRAME_TRACE=1 --env RUST_LOG=info "$RUNNER_TEMP/base/cap-gpui.exe"
91+
prof --label main-head-trace $skip --env CAP_FRAME_TRACE=1 --env RUST_LOG=info "$RUNNER_TEMP/head/cap-gpui.exe"
92+
for round in 1 2 3; do
93+
if (( round % 2 )); then order="base head"; else order="head base"; fi
94+
for v in $order; do
95+
prof --label "main-$v-r$round" $skip "$RUNNER_TEMP/$v/cap-gpui.exe"
96+
done
97+
done
98+
for round in 1 2 3; do
99+
prof --label "onboarding-base-r$round" "$RUNNER_TEMP/base/cap-gpui.exe"
100+
done
101+
prof --label onboarding-base-trace --env CAP_FRAME_TRACE=1 --env RUST_LOG=info "$RUNNER_TEMP/base/cap-gpui.exe"
102+
for f in "$out"/*trace-app.log; do
84103
echo "=== $f"
85-
grep -v FRAMETRACE "$f" | tail -60
104+
grep -v FRAMETRACE "$f" | tail -40
86105
echo "--- last FRAMETRACE blocks"
87-
grep FRAMETRACE "$f" | tail -50
106+
grep FRAMETRACE "$f" | tail -30
88107
done
89108
true
90109

‎apps/desktop-gpui/src/main.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ fn main() {
348348
// starts hidden instead of flashing up before onboarding replaces it.
349349
// Linux keeps the gate: its main window tracks retained visibility.
350350
let first_run = cfg!(not(target_os = "linux"))
351+
&& std::env::var("CAP_PERF_SKIP_ONBOARDING").is_err()
351352
&& (!crate::store::has_completed_startup()
352353
|| !crate::store::has_completed_onboarding());
353354
let window_handle = cx

‎scripts/probe/thread_profile.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ def main():
213213
})
214214
rows.sort(key=lambda r: -r["mcycles_per_s"])
215215
total = (s1["cycles"] - s0["cycles"]) / wall / 1e6
216-
print(f"## {a.label}: process {total:.1f} Mcycles/s, {len(rows)} threads", flush=True)
216+
main_row = next(r for r in rows if r["main"])
217+
all_sw = sum(r["switches_per_s"] for r in rows)
218+
print(f"## {a.label}: process {total:.1f} Mcycles/s, main {main_row['mcycles_per_s']:.1f} Mcycles/s, main wakeups {main_row['switches_per_s']:.2f}/s, process wakeups {all_sw:.1f}/s, {len(rows)} threads", flush=True)
219+
print("RESULT " + json.dumps({"label": a.label, "process_mcycles_per_s": total, "main_mcycles_per_s": main_row["mcycles_per_s"], "main_wakeups_per_s": main_row["switches_per_s"], "process_wakeups_per_s": all_sw}), flush=True)
217220
for r in rows:
218221
print(f" tid={r['tid']:>6} main={int(r['main'])} {r['mcycles_per_s']:9.1f} Mc/s {r['switches_per_s']:8.1f} sw/s name={r['name']!r} start={r['start']}", flush=True)
219222
top = [r["tid"] for r in rows[:10]]

0 commit comments

Comments
 (0)