perf_ab
Compares two environment setups by recording the same program in A B B A order and reports per metric whether B is better, worse, or the same, with all values.
Instructions
Records the same program with two environments in the order A B B A (repeated rounds times, so drift hits both
sides equally) and says per metric whether B is better, worse or the same as A, with every value behind it.
env_a and env_b are NAME=VALUE pairs separated by spaces; empty means none. Runs are named name-a1, name-b1, ...
Each recording takes its seconds plus about a minute to read back. skip_s leaves out the first seconds of every
recording (the start-up) when the verdicts are drawn, as perf_compare does; the recordings are whole.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api | No | with workload: mtl (native Metal), mtl-x64 (Metal built for x86_64, run under Rosetta like Wine), vk (Vulkan through MoltenVK: set METAL_TRACE_MOLTENVK), d3d11 or d3d12 (under wine) | |
| dim | No | with workload drawstress: side of the cube grid, dim^3 draws per frame | |
| args | No | program arguments as in a shell, quotes included | |
| name | Yes | name for the runs: letters, digits, '.', '_', '-' | |
| size | No | with a workload that has size_variables (drawstress): the window size, WIDTHxHEIGHT such as 1920x1080 | |
| wine | No | Wine directory holding bin/wine, or native | |
| env_a | Yes | NAME=VALUE pairs for side A, the reference (empty: none) | |
| env_b | Yes | NAME=VALUE pairs for side B, the change under test (empty: none) | |
| memory | No | default true; false skips the Metal memory table, the slowest to read (about 40 % faster summary): no metal_mib_peak | |
| prefix | No | Wine prefix, default WINEPREFIX or ~/.wine; ignored with native | |
| rounds | No | A B B A rounds, default 1 (4 recordings), at most 5 | |
| skip_s | No | seconds to leave out at the start of each recording, where shaders compile and resources load; 0 (default) keeps all. The GPU numbers, hitches and Metal memory are recomputed without them | |
| example | No | with a workload that lists examples in workload_list: the one to run | |
| program | No | path of the .exe, or of the macOS binary with wine=native | |
| seconds | No | recording length, default 20; use 30 under Wine, whose start-up takes part of it; the export afterwards takes several minutes under Wine | |
| workdir | No | directory the program starts in, default the program's own | |
| counters | No | default false; true also records Metal GPU Counters (gpu_counters in the summary); not under Windows; adds about 40 s of read-back per recorded second | |
| workload | No | a test program from workload_list, fetched with workload_fetch, instead of program | |
| background | No | macOS only, default false; true runs the program under taskpolicy -b, which throttles it hard and unevenly (drawstress: 18 to 280 times slower): repeat the run | |
| memory_free_pct | No | macOS only, 20 to 60: holds the whole Mac at this percentage of RAM free while recording (memory_pressure), to see how the program behaves short of memory; lower can freeze the Mac |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||