performance report #
perf.yml measures albedo's memory and wire bytes.
perf.yml(push to main, pull requests to main, manual) is the gate.ci.pyruns the report tests, builds the CLI and a snapshot daemon, replays the recorded bonsai scenarios once (five fresh-home samples each), publishes the run, and exits with the gate status after publication. It never repeats a measurement. The replay result is printed as JSON in the pipeline log, so fork PRs without secrets still show it. A replay that crashed leaves a partial result with no gated numbers;ci.pypublishes nothing then.
Replay is the only mode; the recordings it replays are made on valefar with test/perf/record_container.py (robot-docs/perf.md).
Pipeline secret, under repository Settings -> Pipelines -> Secrets:
WISP_APP_PASSWORD: an app password forokami.mom, used to write records and deploy sites.
isolation #
The daemon, CLI and kernels run model output, so ci.py runs run.py as the perf-agent user through sudo -n -u perf-agent env -i, passing only the variables in isolation.py, with writable directories under a 0700 directory perf-agent creates in /tmp. Before anything runs, Sandbox.open checks that the sudo rule exists, that perf-agent can read the checkout, and that perf-agent cannot read the CI processes' /proc/<pid>/environ or mem; any failure stops the job. All perf-agent processes are killed before a site is deployed, because wispctl takes its password in argv. The spindle guest gets the user and the sudo rule from ark ec75712.
where results live #
Records are the store. Each run writes atproto records in okami.mom's repo; records hold only strings and integers, because the atproto data model has no floats, so numbers travel as JSON text.
- A replay run is a
pet.nekomimi.albedo.perf.runrecord, rkey = the commit sha (<sha>-2and so on when a commit runs again).summaryholds the gated numbers and per-scenario memory and wire values; the full results.json is theresultblob;committedAtorders main's history;urlis the run's page. CI logs it asperf report: https://sites.wisp.place/okami.mom/albedo-perf/<sha7>/(with the rkey's-Nsuffix for a rerun).
publish.py replay uploads the blob and claims the record (createRecord with an explicit rkey fails if it exists, so two runs never share a record), then updates the site. It refuses a replay result without gated numbers.
One site, albedo-perf, serves every run. It is a static app deployed with wispctl --spa, so every path answers index.html and the page reads the route itself; nothing per run is deployed, so runs never race a deploy, the site's manifest does not grow and nothing needs pruning. publish.py builds it, hashes everything it serves into version.json, reads the served version.json back and deploys only when the hashes differ and the run is a push or a manual run on main, so another branch never rolls the app back and a pull request never deploys. After a deploy it waits until the site serves the new version. publish.py site --event push --ref refs/heads/main does only that step.
Before this, every run deployed its own albedo-perf-<sha7> site with its results in data/run.json. Those sites still exist; their records are drawn by the new site, so the old sites can be deleted with wispctl site delete okami.mom --site albedo-perf-<sha7> --yes.
The gate's baseline is chosen per gated number among main-push run records whose commit is an ancestor of the commit under test (git merge-base --is-ancestor, after unshallowing the clone): the newest record that passed that number (pass or improved), or that test/perf/accepted.toml names for it with the value it measured. A regressed number therefore stays red on later pushes until someone accepts it in the repo. ci.py composes the chosen numbers from the records' summaries, logs where each came from, and passes them to run.py --baseline; each compared number carries its base_commit. With no such record, only budgets apply. For each regressed number the result carries accept, the accepted.toml line that would accept it; the CI log prints those lines at the end and the run page shows them under its header.
the site #
/ lists runs newest first (main pushes tagged, failures red), each linked to its page and to its record on pdsls.dev, 40 at a time. /<sha7>/ (or any longer prefix of the sha, plus -N for a rerun) is a run's page, /main/ the latest main push by commit time. A short sha that names two commits lists both; a record without gated numbers (a replay that crashed) has no page and is left out of the index.
Every route reads okami.mom's PDS at view time: com.atproto.repo.listRecords for the run records (100 a page; rkeys are shas, not times, so the index needs every page to sort, and stops after 20 pages) and com.atproto.sync.getBlob for the run's own result blob only; the compared run needs only the summary in its record. The PDS (the reference PDS, 0.5.38, behind Cloudflare) sends Access-Control-Allow-Origin: * on both, checked from a page on sites.wisp.place, and sends no rate-limit headers; the reference PDS's own limit, when enabled, is 3000 requests per five minutes per IP. Its fetches bypass the browser's HTTP cache: the PDS sends CORS headers only to requests that carry an Origin (with Vary: Origin), and Chrome reused a copy cached for another origin and failed the fetch. The page keeps answers in its own Cache API store instead: records for a minute, blobs (content-addressed, about 1 MB each) until twelve newer ones push them out. A cold run page makes three requests (plc.directory, one listRecords page, the blob), a warm one none. Records of the retired live runs stay in the repo under their own collection; the site no longer reads them.
the run page #
Each run's page answers whether the commit made albedo heavier and where. A header bar holds the gate chip, a one-sentence verdict, the commit and a picker for the run to compare with (default: its baseline main run). Tiles show the headline numbers (six, plus kernel at rest, kernel memory per cell and the kernel pool when the result carries them; the per-turn tile is the BEAM leak gate with process memory as a secondary line) in decimal units with their change against the compared run, a budget bar, and a sparkline once main has three runs; exact bytes and noise are in tooltips. A number measured once is labelled as such and only counts as moved at 5% or more. Arrows are red only when the gate failed that metric. "What moved" lists changes larger than three times the noise. Each scenario card charts the private memory kept after each step with each turn's peak, and bytes per model request; its raw numbers are behind a disclosure. The history chart covers every main push, with metric tabs, a ±3×MAD noise band and the budget when it is near the data.
The page draws the run from its result blob and compares it with the summaries in the other records, so an old run compares against runs made after it. Charts use Apache ECharts 6.1.0 from jsDelivr, pinned with an SRI hash of dist/echarts.min.js taken from the npm tarball (verified against the registry's sha512), with the canvas renderer and the built-in default and dark themes switched at runtime with prefers-color-scheme. Without JavaScript the page says it needs it.
local use #
With wispctl on PATH and WISP_APP_PASSWORD in the environment:
python3 test/perf/report/publish.py replay /path/to/replay-results.json
python3 test/perf/report/render.py SITE_DIRECTORY --serve 8765 builds the site and serves it at http://127.0.0.1:8765/ with the same SPA fallback, reading the real records. --did and --pds point it at another repo, for example a local mock PDS.