@@ -278,6 +278,72 @@ are saved every 15 seconds in a sibling `console.progress.log` (or
278278only print start and finish summaries. These are status updates, not an estimated
279279completion percentage.
280280
281+ # # Publishing benchmark results to a PR
282+
283+ A suite can post one results comment after its final comparison report. Add an
284+ explicit target (the repository is always on github.com) :
285+
286+ ` ` ` yaml
287+ inputs:
288+ pr:
289+ type: integer
290+ required: true
291+ minimum: 1
292+ publish:
293+ github:
294+ repository: ActivitySim/activitysim
295+ pr: ${pr}
296+ baseline: main
297+ ` ` `
298+
299+ ` baseline` names a run in `runs` and defaults to the first run. The posting target
300+ is independent of source selection : use `pr: ${pr}` in an ActivitySim source
301+ mapping to benchmark that PR's pinned head as well. See
302+ [`examples/sandag-pr.yaml`](examples/sandag-pr.yaml) for a complete example with a
303+ pinned baseline; adjust its model/data paths and baseline commit for your model.
304+
305+ ` ` ` bash
306+ abench examples/sandag-pr.yaml --set pr=1110
307+ # Run benchmarks, but only generate the local comment and charts:
308+ abench examples/sandag-pr.yaml --set pr=1110 --publish-dry-run
309+ # Inspect or publish retained results without rerunning benchmarks:
310+ abench publish /path/to/suite-output --dry-run
311+ abench publish /path/to/suite-output
312+ ` ` `
313+
314+ Publication requires GitHub CLI 2.99 or newer with `gh pr comment --attach`, an
315+ authenticated account, and repository write access for image uploads. Use
316+ ` gh auth login --hostname github.com` (OAuth), or a classic personal access token
317+ through `GH_TOKEN`. Other token types and GitHub Enterprise Server image uploads
318+ are not supported by this first release. `gh` remains optional for ordinary runs
319+ and publication dry runs. Authentication and PR access are checked before asset
320+ preparation or benchmark execution when publication is enabled; validation and
321+ prepare-only commands do not publish. Tokens are never written to experiment
322+ metadata or passed into benchmark containers.
323+
324+ The comment contains elapsed time and peak memory, percentage changes against the
325+ baseline for valid runs with matching comparison settings, run settings, source
326+ commits, memory traces, and component-runtime charts. Invalid runs have no change
327+ claims and are excluded from the runtime chart; unstarted runs are identified.
328+ PR head/base commits are recorded at startup, and a head change during execution
329+ is noted when posting. These are observations, not statistical significance tests.
330+
331+ The `publication/` directory retains `comment.md`, `memory.svg`, `runtimes.svg`,
332+ and `state.json` with the comment ID/URL and publication status. The exact upload
333+ body is retained as `upload.md`. A retry searches for the suite's unique comment
334+ marker before posting; a recorded successful publication is a no-op. Independent
335+ suite executions get separate comments. Simultaneous publication of the same
336+ output directory is blocked. Partial uploads can leave unused GitHub attachments,
337+ but the local reports are retained and a retry can complete the comment.
338+
339+ A posting error fails the command and prints the retry command. If the benchmark
340+ also failed, its failure remains primary and the publication error is printed
341+ separately. The full HTML/JSON comparison remains local; this release uploads only
342+ the summary and SVG figures, not raw logs, model data, or the interactive HTML.
343+ Images must fit GitHub's 10 MB attachment limit, and summaries are limited to
344+ 60,000 characters. Publication transport tests simulate GitHub; a live attachment
345+ smoke test should use a designated test PR, never a production PR by default.
346+
281347# # Run controls
282348
283349- ` --single-process` (default), or `--multiprocess --processes N`. The count applies
0 commit comments