From 8d29ba6ce0cebbef97dac7a3e1050dd647447e7c Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:15:59 +0000 Subject: [PATCH 1/2] DOC: explain the two target forms in bx compare (closes #161) --- docs/benchx.md | 9 +++++++++ src/benchx/cli.py | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/benchx.md b/docs/benchx.md index 7fecf21..cc9ea30 100644 --- a/docs/benchx.md +++ b/docs/benchx.md @@ -161,6 +161,15 @@ Each target is `BUILD_DIR[:SOURCE_DIR]` or `@CONFIG[=SOURCE_REF]`. Two targets ( `--profile variants`) select measure mode, where `--run-key` names the new run; with no targets, `--run-key` names the run to read: read mode. +- `BUILD_DIR[:SOURCE_DIR]` is a directory you prepared yourself: a working tree for pyperf, a + build directory for Google Benchmark. Comparing two revisions this way means two directories + (for example two `git worktree`s), and `--suite` is looked up in each, so each side runs its + own revision's benchmarks. `SOURCE_DIR` is the checkout that identifies the revision, needed + only when the build directory does not lead back to it (CMake's cache usually does). +- `@CONFIG[=SOURCE_REF]` asks the project's target provider (below) to build configuration + `CONFIG` at the revision `SOURCE_REF`, the working tree when it is left out. With a provider, + two revisions of one checkout are `bx compare @release=main @release=HEAD …`. + `@CONFIG` asks the project's **target provider**, the command named by `provider.command` in `benchx.conf.json` (it runs with the project root as its working directory). The provider speaks the contract of `system-decomposition.md` §3.4: a JSON request on stdin, a target description diff --git a/src/benchx/cli.py b/src/benchx/cli.py index f26d5c4..6e641d7 100644 --- a/src/benchx/cli.py +++ b/src/benchx/cli.py @@ -1548,8 +1548,14 @@ def main(argv=None): description="Read mode compares results already measured: --run-key KEY --baseline VALUE. " "Measure mode runs two prepared targets, alternating them over " "--rounds rounds, delivers the results to the local store, then compares: " - "BASELINE CONTENDER --suite NAME --rounds R, each target BUILD_DIR[:SOURCE_DIR] " - "or @CONFIG[=SOURCE_REF] (the project's target provider). " + "BASELINE CONTENDER --suite NAME --rounds R. A target is one of two forms. " + "BUILD_DIR[:SOURCE_DIR] is a directory you built or checked out yourself " + "(pyperf: a working tree; google-benchmark: a build directory, SOURCE_DIR its " + "checkout when CMake does not record it), so two revisions are two directories, " + "e.g. ../main ../feature; --suite is found in each. @CONFIG[=SOURCE_REF] asks the " + "project's target provider (provider.command in benchx.conf.json) to build " + "configuration CONFIG at a revision (default: the working tree), so two revisions " + "can be @release=main @release=HEAD. " "The variants profile takes one target: its sides are two values of one " "benchmark parameter (--vary), as in TARGET --profile variants --suite NAME " "--rounds R.", From 97bfb5e88b347630f64ada19509954ea8ded8da5 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:47:40 +0000 Subject: [PATCH 2/2] DOC: shorten the target description --- docs/benchx.md | 13 +++++-------- src/benchx/cli.py | 12 ++++-------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/docs/benchx.md b/docs/benchx.md index cc9ea30..98cc982 100644 --- a/docs/benchx.md +++ b/docs/benchx.md @@ -161,14 +161,11 @@ Each target is `BUILD_DIR[:SOURCE_DIR]` or `@CONFIG[=SOURCE_REF]`. Two targets ( `--profile variants`) select measure mode, where `--run-key` names the new run; with no targets, `--run-key` names the run to read: read mode. -- `BUILD_DIR[:SOURCE_DIR]` is a directory you prepared yourself: a working tree for pyperf, a - build directory for Google Benchmark. Comparing two revisions this way means two directories - (for example two `git worktree`s), and `--suite` is looked up in each, so each side runs its - own revision's benchmarks. `SOURCE_DIR` is the checkout that identifies the revision, needed - only when the build directory does not lead back to it (CMake's cache usually does). -- `@CONFIG[=SOURCE_REF]` asks the project's target provider (below) to build configuration - `CONFIG` at the revision `SOURCE_REF`, the working tree when it is left out. With a provider, - two revisions of one checkout are `bx compare @release=main @release=HEAD …`. +- `BUILD_DIR[:SOURCE_DIR]` is a directory you prepared: a working tree (pyperf, asv) or a build + directory (Google Benchmark). Two revisions are two directories, such as two `git worktree`s, + and `--suite` is looked up in each. `SOURCE_DIR` names the checkout when CMake's cache does not. +- `@CONFIG[=SOURCE_REF]` asks the target provider (below) to build `CONFIG` at revision + `SOURCE_REF` (default: the working tree), as in `bx compare @release=main @release=HEAD …`. `@CONFIG` asks the project's **target provider**, the command named by `provider.command` in `benchx.conf.json` (it runs with the project root as its working directory). The provider speaks the contract of diff --git a/src/benchx/cli.py b/src/benchx/cli.py index 6e641d7..84b4dd9 100644 --- a/src/benchx/cli.py +++ b/src/benchx/cli.py @@ -1548,14 +1548,10 @@ def main(argv=None): description="Read mode compares results already measured: --run-key KEY --baseline VALUE. " "Measure mode runs two prepared targets, alternating them over " "--rounds rounds, delivers the results to the local store, then compares: " - "BASELINE CONTENDER --suite NAME --rounds R. A target is one of two forms. " - "BUILD_DIR[:SOURCE_DIR] is a directory you built or checked out yourself " - "(pyperf: a working tree; google-benchmark: a build directory, SOURCE_DIR its " - "checkout when CMake does not record it), so two revisions are two directories, " - "e.g. ../main ../feature; --suite is found in each. @CONFIG[=SOURCE_REF] asks the " - "project's target provider (provider.command in benchx.conf.json) to build " - "configuration CONFIG at a revision (default: the working tree), so two revisions " - "can be @release=main @release=HEAD. " + "BASELINE CONTENDER --suite NAME --rounds R. A target is a directory you prepared, " + "BUILD_DIR[:SOURCE_DIR] (two revisions are two directories, e.g. ../main ../feature; " + "--suite is found in each), or @CONFIG[=SOURCE_REF], which asks the project's target " + "provider to build CONFIG at a revision (e.g. @release=main @release=HEAD). " "The variants profile takes one target: its sides are two values of one " "benchmark parameter (--vary), as in TARGET --profile variants --suite NAME " "--rounds R.",