Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ff2c2ad
bench: simfps takes a device set, a common start time and writes per-…
0xdaniell Nov 16, 2026
853f488
bench: simfps stamps start with the screen as it stands
0xdaniell Nov 16, 2026
ac533f9
bench: the suite's pure parts (statistics, frame strip, PNG and tear …
0xdaniell Nov 16, 2026
8af434f
bench: the guest helper (own device set, simctl always with --set, pe…
0xdaniell Nov 16, 2026
d4e44ff
bench: the scaling sweep, idle, lifecycle, soak, build, panel plug, g…
0xdaniell Nov 16, 2026
67dc4fc
bench: README (every command and metric defined), baselines format, m…
0xdaniell Nov 16, 2026
ab0aaf5
bench: --slim for the pool's Slim configuration; ANV from QEMU's own …
0xdaniell Nov 16, 2026
8764106
bench: guest memory counts cache, observer out of the simulators' tre…
0xdaniell Nov 16, 2026
26fa951
bench: run-wide gates for every scenario, a sweep without a step fail…
0xdaniell Nov 16, 2026
ce068da
bench: README: guard, settle, observer, run gates
0xdaniell Nov 16, 2026
f852dc7
bench: observer CPU counts reaped helpers, census dir checked on the …
0xdaniell Nov 16, 2026
7b8e407
bench: one persistent device set, run lock and leftover refusal, a ve…
0xdaniell Nov 17, 2026
4df10aa
bench: bench simulators are production simulators: clones of a settle…
0xdaniell Nov 17, 2026
fcc6b3a
bench: fail closed: a settle at its cap fails the run, the booted cou…
0xdaniell Nov 17, 2026
94ea330
bench: guards: host disk floors 18/14/11, swap-outs and compressor, t…
0xdaniell Nov 17, 2026
759a6be
bench: README for production simulators, the guards and the new comma…
0xdaniell Nov 17, 2026
64c4233
macbox: bench usage lists seed and cleanup
0xdaniell Nov 17, 2026
3ae296d
bench: review fixes - incomplete seeds are cleaned, foreign count ign…
0xdaniell Nov 17, 2026
5884b87
bench: judge crash reports of the bench and the graphics path only
0xdaniell Nov 17, 2026
faefd56
bench: one lock per surface in simfps; the observer check's window re…
0xdaniell Nov 17, 2026
dcbf36f
bench: a notification as the input probe, no openurl; the tear band b…
0xdaniell Nov 17, 2026
d36210b
bench: a second look at a still surface; leaks judged on RSS + swap, …
0xdaniell Nov 17, 2026
32f96d6
bench: the second look only on still screens; what differs from a lease
0xdaniell Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.bak*
__pycache__/
/shots/
/bench-results/
12 changes: 12 additions & 0 deletions macbox
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,15 @@ cmd_coherent() { # Coherent's crash guard (docs/performance.md)
esac
}

cmd_bench() { # the scaling, regression and A/B suite (src/bench/README.md)
case "${1:-}" in
compare|chart|report|tools|check|"") ;;
*) [ "${DRY:-0}" = 1 ] || { vm_running || die "the VM is not running: macbox up first (DRY=1 runs the suite against stubs)"; ssh_ok || die "ssh $MACBOX_SSH_HOST doesn't answer"; } ;;
esac
BENCH_QEMU_PID="$(qemu_pid)" BENCH_BUILD_ID="$(build_id)" BENCH_RUN="$RUN" BENCH_QEMU_LOG="$VMDIR/logs/qemu.log" \
BENCH_SSH="$MACBOX_SSH_HOST" BENCH_HOME="$MACBOX_HOME" exec "$REPO/src/bench/run" "$@"
}

cmd_backup() {
local name=${1:?usage: macbox backup <name>} b="$MACBOX_HOME/backups/$1" disk
vm_running && die "the VM is running: macbox down first"
Expand Down Expand Up @@ -707,6 +716,8 @@ Day to day:
macbox coherent [status|reset] Coherent's crash guard (MACBOX_COHERENT=auto|on|off)
macbox video-kexts reims-util's video kexts into OpenCore (for MACBOX_VIDEO=on)
macbox backup <name>
macbox bench scale|idle|lifecycle|soak|build|panel|ab|golden|seed|cleanup|compare|chart|report|tools|check
the scaling, regression and A/B suite (src/bench/README.md)
EOF
}

Expand Down Expand Up @@ -761,6 +772,7 @@ case "$sub" in
coherent) cmd_coherent "$@" ;;
video-kexts) cmd_video_kexts "$@" ;;
backup) cmd_backup "$@" ;;
bench) cmd_bench "$@" ;;
help|-h|--help) cmd_help ;;
*) cmd_help >&2; exit 2 ;;
esac
53 changes: 50 additions & 3 deletions src/bench/GlassBench/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
// A table of cards scrolls by itself at a fixed speed (time-based, so a dropped
// frame skips content rather than slowing the scroll) under a glass navigation bar,
// a glass tab bar and a floating glass toolbar with a glass button that keeps pulsing.
// Launch arguments: -noglass (no floating glass, opaque bars), -speed <pt/s>, -nostrip.
// Launch arguments: -noglass (no floating glass, opaque bars), -speed <pt/s>, -nostrip,
// -static (nothing animates: a fixed picture for pixel-exact checks and for a simulator that sits idle),
// -probe (an input marker, see below).
//
// The input marker (-probe): a 30 pt square at (21, 160) pt that flips between white and black on every
// tap, on the Darwin notification dev.macbox.glassbench.toggle (`simctl spawn <udid> notifyutil -p ...`) and
// on every glassbench://toggle URL (`simctl openurl`). The bench times from the injection to the
// first surface whose marker flipped (bench/README.md, "input proxy").
//
// The frame strip: every display-link tick draws a 16-bit counter as blocks at the top left, so a
// frame can be told apart from the one before it all the way to a viewer (simfps --strip at the
Expand All @@ -14,6 +21,34 @@ import UIKit
let launchArgs = ProcessInfo.processInfo.arguments
let noGlass = launchArgs.contains("-noglass")
let showStrip = !launchArgs.contains("-nostrip")
let isStatic = launchArgs.contains("-static")
let showProbe = launchArgs.contains("-probe")

/// The input marker: white until toggled, then black, then white again. It follows the system appearance
/// until the first toggle, so `simctl ui appearance` flips it too (the bench's fallback injection).
final class ProbeMarker: UIView {
private var dark = false
init() {
super.init(frame: CGRect(x: 21, y: 160, width: 30, height: 30))
backgroundColor = .systemBackground
layer.borderWidth = 1; layer.borderColor = UIColor.gray.cgColor
isUserInteractionEnabled = false
}
required init?(coder: NSCoder) { fatalError() }
func toggle() {
dark.toggle()
overrideUserInterfaceStyle = dark ? .dark : .light
}
}
var probeMarker: ProbeMarker?

/// Any touch on the window flips the marker (the bench's tap injection).
final class BenchWindow: UIWindow {
override func sendEvent(_ event: UIEvent) {
if event.type == .touches, event.allTouches?.contains(where: { $0.phase == .began }) == true { probeMarker?.toggle() }
super.sendEvent(event)
}
}

final class FrameStrip: UIView {
static let origin = CGPoint(x: 21, y: 120), block: CGFloat = 20
Expand Down Expand Up @@ -155,7 +190,7 @@ final class BenchViewController: UITableViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if !noGlass, let host = navigationController?.view, pulse.superview == nil { addFloatingGlass(to: host) }
guard link == nil else { return } // viewDidAppear runs again on every return to the app
guard link == nil, !isStatic else { return } // viewDidAppear runs again on every return to the app
link = CADisplayLink(target: self, selector: #selector(step))
link?.preferredFrameRateRange = CAFrameRateRange(minimum: 60, maximum: 60, preferred: 60)
startTime = CACurrentMediaTime()
Expand Down Expand Up @@ -243,8 +278,20 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
other.tabBarItem = UITabBarItem(title: "Other", image: UIImage(systemName: "square.grid.2x2"), tag: 1)
let tabs = UITabBarController(); tabs.viewControllers = [nav, other]
if noGlass { tabs.tabBar.isHidden = true }
let w = UIWindow(windowScene: ws); w.rootViewController = tabs; w.makeKeyAndVisible()
let w = BenchWindow(windowScene: ws); w.rootViewController = tabs; w.makeKeyAndVisible()
if showStrip { let f = FrameStrip(); w.addSubview(f); frameStrip = f }
if showProbe {
let m = ProbeMarker(); w.addSubview(m); probeMarker = m
// `simctl spawn <udid> notifyutil -p dev.macbox.glassbench.toggle`: an event from outside that puts
// nothing on the screen but the marker's flip (an openurl raises an alert, an appearance switch redraws all).
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), nil, { _, _, _, _, _ in
DispatchQueue.main.async { probeMarker?.toggle() }
}, "dev.macbox.glassbench.toggle" as CFString, nil, .deliverImmediately)
}
window = w
}

func scene(_ scene: UIScene, openURLContexts contexts: Set<UIOpenURLContext>) {
if contexts.contains(where: { $0.url.scheme == "glassbench" }) { probeMarker?.toggle() }
}
}
Loading
Loading