GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — tak/tak.usage.kdl at main · jdx/tak Expand file tree/ Copy pathtak.usage.kdlMore file actions 281 lines (276 loc) · 24.9 KB / Copy pathtak.usage.kdlFile metadata and controls281 lines (276 loc) · 24.9 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 name tak bin tak about "CLI performance, tracked" unknown_flags error subcommand_required #true flag --env-deny help="Remove a variable from the environment of measured commands. Repeatable. Replaces the default list rather than adding to it." global=#true var=#true { arg <VAR> } flag --env-allow help="Keep a variable that --env-deny would remove. Repeatable." global=#true var=#true { arg <VAR> } flag --gate-pct help="Percentage an instruction count may rise before `compare` fails." global=#true { arg <PCT> } flag --gate-min-delta help="Instructions a count may rise by before `compare` fails, whatever the percentage." global=#true { arg <N> } flag --allow-empty help="Pass, with a warning, when nothing was compared, instead of failing. For `compare`, `detect` and `run --baseline --gate`. A regression still fails." global=#true flag no-credit: help="Leave the line naming tak off the end of generated reports." global=#true negate=--no-credit default="true" flag --runner help="Machine class to record under. Overrides the derived name." global=#true { arg <CLASS> } flag "-h --help" help="Print help" action=help builtin=#true flag "-V --version" help="Print version" action=version builtin=#true cmd completion help="Generate a self-contained shell completion script" { flag "-h --help" help="Print help" action=help builtin=#true arg <SHELL> help="Shell to generate completions for" { choices bash elvish zsh fish nu nushell powershell pwsh } } cmd run help="Benchmark a command, or everything declared in tak.toml." { flag --bench help="Name to record this measurement under. With no command, selects a single benchmark from tak.toml instead of running all of them." { arg <BENCH> } flag --runs help="Timed runs, or `auto` to size each subject from how long its samples take. Overrides tak.toml when both are given." { arg <N|auto> } flag --warmup help="Untimed warmup runs. Overrides tak.toml when both are given." { arg <WARMUP> } flag --no-counters help="Skip instruction counting even where valgrind is available." flag --allocations help="Also count heap allocations under valgrind's DHAT, for every subject measured. Recorded and reported, never gated." flag --record help="Append the result to refs/notes/tak for the current commit." flag --no-progress help="Do not report progress on stderr." flag --group help="Run only the benchmarks that name this `[group.NAME]` in tak.toml. Repeatable. Cannot be combined with --bench." var=#true { arg <NAME> } flag --subject help="Measure only this subject of each multi-subject benchmark. Repeatable. Benchmarks with none of the named subjects are skipped." var=#true { arg <NAME> } flag --seed help="Seed for the order subjects are sampled in. Every multi-subject run prints the seed it used, so an order can be repeated." { arg <N> } flag --config help="Read this file instead of searching for tak.toml." { arg <PATH> } flag --dry-run help="Print what would run — every subject's command, setup, prepare, check, directory, environment and run count, templates rendered — without running any of it." flag --export-json help="Write every sample and summary to PATH as hyperfine-compatible JSON." { arg <PATH> } flag --profile-dir help="Keep the cachegrind profile behind each instruction count, as `DIR/<bench>/<subject>.cachegrind.out`, for `tak explain`." { arg <DIR> } flag --save-baseline help="Save the results as a named local baseline, kept in the git directory rather than in refs/notes/tak. Replaces what NAME held for the benchmarks measured and keeps the rest." { arg <NAME> } flag --baseline help="Compare the results against a saved local baseline and print the report `tak compare` prints. Reports only; add --gate to fail on a regression." { arg <NAME> } flag --gate help="With --baseline, fail when an instruction count rose beyond its gate — the one `tak compare` would apply — or when a gated benchmark could not be compared. `allow_empty` (`--allow-empty`) passes, with a warning, a run where nothing was compared at all." flag "-h --help" help="Print help" action=help builtin=#true arg "[CMD]..." help="Command to benchmark, after `--`. Omit to run what tak.toml declares." double_dash=required } cmd history help="Show recorded history for a commit." { flag --remote help="Remote to refresh notes from." default=origin { arg <REMOTE> } flag "-h --help" help="Print help" action=help builtin=#true arg "[REV]" help="Revision to read. Defaults to HEAD." default=HEAD } cmd log help="Show each benchmark's measurements over first-parent history." { long_help #""" Show each benchmark's measurements over first-parent history. One table per benchmark and runner class, newest commit first, with the change in instruction count from the previous measurement. Commits with nothing recorded are skipped. `--html` writes the same history as a self-contained page of charts instead. """# flag "-n --limit" help="Most recent recorded commits to show." default="30" { arg <LIMIT> } flag --bench help="Show only this benchmark. Repeatable." var=#true { arg <NAME> } flag --html help="Write a self-contained HTML report to PATH instead of printing." { arg <PATH> } flag --remote help="Remote to refresh notes from." default=origin { arg <REMOTE> } flag "-h --help" help="Print help" action=help builtin=#true arg "[REV]" help="Revision to walk back from. Defaults to HEAD." default=HEAD } cmd push help="Push recorded measurements to the remote." { flag --remote help="Remote to use for git-notes synchronization." default=origin { arg <REMOTE> } flag "-h --help" help="Print help" action=help builtin=#true } cmd artifact help="Move measurements between a read-only job and a trusted publisher." subcommand_required=#true { flag "-h --help" help="Print help" action=help builtin=#true cmd export help="Export locally recorded measurements as one portable file." { flag --output help="Artifact file to write." required=#true { arg <PATH> } flag --rev help="Revision whose local measurements should be exported." default=HEAD { arg <REV> } flag "-h --help" help="Print help" action=help builtin=#true } cmd publish help="Validate, import, and publish a measurement artifact." { flag --expect help="Trusted revision the artifact must target." required=#true { arg <REV> } flag --remote help="Remote to synchronize with." default=origin { arg <REMOTE> } flag "-h --help" help="Print help" action=help builtin=#true arg <PATH> help="Artifact file produced by `tak artifact export`." } } cmd init help="Teach plain `git fetch` about the notes ref." { flag --remote help="Remote to use for git-notes synchronization." default=origin { arg <REMOTE> } flag "-h --help" help="Print help" action=help builtin=#true } cmd backfill help="Benchmark published release binaries, or build and benchmark past commits, to bootstrap history." { long_help #""" Benchmark published release binaries, or build and benchmark past commits, to bootstrap history. By default, downloads the release binaries a project already published and measures one command against each. With `--commits`, checks out each first-parent commit in a range, runs tak.toml's `[build]` there, and measures the benchmarks tak.toml declares. """# flag --commits help="Build and measure the first-parent commits in RANGE, such as `main~20..main`, instead of downloading releases." { arg <RANGE> } flag --force help="With --commits, measure every subject again even where this runner class already has a record, and retry commits whose build or measurement failed in an earlier run." flag --repo help="Repository to pull releases from, as \"owner/name\". Defaults to the `origin` remote of the current repository." { arg <REPO> } flag --bin help="Executable name to look for inside each release archive. Defaults to the repository name." { arg <BIN> } flag --bench help="Name to record release measurements under; `release` if omitted. With --commits, the one benchmark from tak.toml to measure." { arg <BENCH> } flag --limit help="Most recent releases to measure. With --commits, most commits to build, newest first, among those not already recorded." default="20" { arg <LIMIT> } flag --runs help="Timed runs per release; 10 if omitted. With --commits, overrides tak.toml's `runs` for every benchmark." { arg <RUNS> } flag --dry-run help="Measure releases but do not write to refs/notes/tak. With --commits, list what would be built, and build nothing." flag "-h --help" help="Print help" action=help builtin=#true arg "[ARGS]..." help="Arguments passed to the downloaded binary, after `--`. Defaults to `--version`, which every CLI answers cheaply." double_dash=required } cmd compare help="Compare this commit's measurements against another's." { long_help #""" Compare this commit's measurements against another's. Fails when an instruction count has risen by more than `gate_pct` and `gate_min_delta`, or by more than a benchmark's own `gate`, or when no series was measured on both sides, unless `allow_empty` (`--allow-empty`) is on, which passes that case with a warning. The gate comes from BASE's tak.toml, not the working tree's, so a change cannot loosen its own; flags and environment variables still override it. Wall clock is reported and never gated. A regression in a benchmark named by `--accept` is reported as accepted and does not fail. So is one named by a `Tak-Accept:` trailer on a commit in BASE..REV, but only when the `accept_trailers` setting is on. """# flag --rev help="Revision to compare. Defaults to HEAD." default=HEAD { arg <REV> } flag --remote help="Remote to refresh notes from." default=origin { arg <REMOTE> } flag --no-gate help="Report without failing, whatever the numbers say. Takes precedence over `allow_empty`: an empty comparison passes too. Errors, such as an invalid `tak.toml`, still fail." flag --accept help="Accept a regression in this benchmark: report it, but do not fail on it. Repeatable; each value is one exact benchmark name. Honoured whatever `accept_trailers` says." var=#true { arg <BENCH> } flag "-h --help" help="Print help" action=help builtin=#true arg "[BASE]" help="Revision to compare against." default="origin/main" } cmd explain help="Show which functions an instruction-count change came from." { long_help #""" Show which functions an instruction-count change came from. Reads two sets of profiles written by `tak run --profile-dir`, pairs them by benchmark and subject, and prints the functions whose counts changed most as markdown. Reports only; it never fails on the numbers. """# flag --top help="Functions to list for each benchmark." default="10" { arg <N> } flag "-h --help" help="Print help" action=help builtin=#true arg <BASE> help="Base profiles: a directory written by `tak run --profile-dir`, or one profile file." arg <HEAD> help="Head profiles, in the same form as the base." } cmd detect help="Find instruction-count steps that already landed on a branch." { long_help #""" Find instruction-count steps that already landed on a branch. Meant for the main-branch workflow, after recording. Walks REV's first-parent history and compares each series' consecutive recorded points. Fails when the step onto REV itself is beyond that series' gate (the same per-benchmark gates as `compare`), so a regression fails the run for the commit that introduced it rather than every run after, and when nothing could be compared: REV has no instruction counts, or none of its series has an earlier point in the window. `allow_empty` (`--allow-empty`) passes that case with a warning, for a first recording or the first on a new runner class. Older steps and slow drift are reported without failing. Wall clock is shown and never gated. A step in a benchmark named by `--accept` is reported as accepted and does not fail. So is one named by a `Tak-Accept:` trailer on a first-parent commit in the step's range, but only when the `accept_trailers` setting is on. """# flag --window help="Recorded commits to examine, counting REV when it is recorded." default="20" { arg <N> } flag --remote help="Remote to refresh notes from." default=origin { arg <REMOTE> } flag --no-gate help="Report without failing on the result: neither a step nor an empty comparison fails the command. Errors, such as an invalid `tak.toml`, still fail." flag --accept help="Accept a step onto REV in this benchmark: report it, but do not fail on it. Repeatable; each value is one exact benchmark name. Honoured whatever `accept_trailers` says." var=#true { arg <BENCH> } flag "-h --help" help="Print help" action=help builtin=#true arg "[REV]" help="Newest commit to examine. Defaults to HEAD." default=HEAD } cmd doctor help="Diagnose the git-notes plumbing." { flag "-h --help" help="Print help" action=help builtin=#true } cmd settings help="Show every setting, its resolved value, and where that value came from." { flag --docs help="Include the full description of each setting." flag "-h --help" help="Print help" action=help builtin=#true } cmd usage help="Generate the CLI specification used to build the documentation." hide=#true { flag "-h --help" help="Print help" action=help builtin=#true } config { prop "env_deny" type="list<string>" parse="list_by_comma" since="0.0.3" help="Environment variables removed from every command tak measures." long_help="Environment variables removed from every command tak measures.\n\nTwo reasons this defaults to a non-empty list rather than to nothing.\n\n**Determinism.** A CLI that finds a forge token in its environment often does more with it than without — authenticating, fetching, checking rate limits. A measurement that moves depending on whether CI happened to export a token is not a measurement of the code under test. It lands in the series as an unexplained step change on the day someone edits an unrelated workflow.\n\n**This is not a credential sandbox.** The listed variables are absent from the child's direct environment, but a hostile binary can still inspect accessible same-user processes and files. In particular, `tak backfill` downloads and executes release binaries; run it on an isolated credential-free machine when those assets are not fully trusted.\n\nSetting this replaces the default list rather than adding to it. To keep the defaults and remove more, list them alongside. To keep the defaults and remove fewer, use `env_allow` — it is subtracted from this list, so the two compose without either having to restate the other.\n\nNames are matched exactly. There is no globbing: a benchmark whose behaviour depends on which variables happen to match a pattern is the problem this setting exists to avoid.\n\ntak's own network calls are unaffected. `backfill` authenticates with `curl` directly rather than through the measurement path." { default "GITHUB_TOKEN" "GH_TOKEN" env "TAK_ENV_DENY" cli "--env-deny" example "tak run --env-deny AWS_PROFILE --env-deny AWS_REGION" example "TAK_ENV_DENY=GITHUB_TOKEN,GH_TOKEN,NPM_TOKEN tak run" source "config" "env.deny" } prop "env_allow" type="list<string>" parse="list_by_comma" since="0.0.3" help="Environment variables kept even though `env_deny` lists them." long_help="Environment variables kept even though `env_deny` lists them.\n\nSubtracted from `env_deny`, so a project can opt one variable back in without restating the whole default list. A CLI whose measured path genuinely requires a token — a client that cannot start unauthenticated, say — needs this.\n\nDoing so makes the measurement depend on something outside the repository. That is a real cost, not a formality: the numbers become conditional on the environment the run happened to have, and a token expiring will read as a performance change.\n\nListing a variable here that `env_deny` does not mention has no effect. This setting removes entries from the deny list; it does not add anything to the environment." { default env "TAK_ENV_ALLOW" cli "--env-allow" example "tak run --env-deny GITHUB_TOKEN --env-allow GITHUB_TOKEN" source "config" "env.allow" } prop "gate_pct" type="float" default=1.0 since="0.0.4" help="How much an instruction count may rise before `tak compare` or `tak detect` fails." long_help="How much an instruction count may rise before `tak compare` or `tak detect` fails.\n\nA percentage of the base measurement. Only instruction counts are gated. Wall clock is reported and never gated: on the same hardware it moves 4-20% run to run, so a threshold tight enough to catch a real regression would fire constantly, and one loose enough to stay quiet would catch nothing.\n\nThe default of 1% is about fifty times the ~0.02% instruction counting reproduces to, leaving room for the small differences a compiler or dependency bump can produce without turning the gate into noise.\n\nRaise it to report without effectively failing. Setting it to zero fails on any increase at all, which sounds appealing and is not: one extra instruction on a startup path is not worth blocking a pull request over.\n\nThis is the gate for every series without its own. A benchmark or subject can set one with `gate = { pct = N }` in `tak.toml`, and that wins over this setting from any source, `--gate-pct` included: the flag moves the default, not the benchmarks a project has singled out." { env "TAK_GATE_PCT" cli "--gate-pct" example "tak compare origin/main --gate-pct 0.5" example "TAK_GATE_PCT=5 tak compare origin/main" source "config" "gate.pct" } prop "accept_trailers" type="bool" default=#false since="0.0.14" help="Whether `tak compare` and `tak detect` honour `Tak-Accept:` trailers on the commits they compare." long_help="Whether `tak compare` and `tak detect` honour `Tak-Accept:` trailers on the commits they compare.\n\nOff by default, because of who writes those trailers. A trailer is part of a commit message, and the commits `tak compare` reads are the change being gated — on a pull request, the author's own. Honouring them by default would let any change waive its own gate by adding one line, which makes the gate advisory for exactly the changes it exists to stop. The acceptance would be visible in the report, but visible is not the same as approved.\n\nWith this off, trailers are ignored entirely; if the compared range carries any, the report says so in one line, so an author is not left wondering why theirs did nothing. `tak compare --accept BENCH` works either way, and is the recommended route in CI: pass it from a workflow step driven by something only maintainers can do, such as applying a pull-request label.\n\nTurn it on where every commit in the compared range has already been reviewed by the time the result matters, or where everyone who can push is trusted to waive the gate — a solo project, or comparisons along an already-reviewed main branch.\n\n`tak compare` reads this key, like the rest of its gate, from the base revision's `tak.toml` rather than the checkout being measured, so a pull request cannot turn trailers on for itself; turning them on takes effect once that change is merged. `tak detect` reads the working tree's, which on a main-branch run is merged history. The environment takes precedence over either file." { env "TAK_ACCEPT_TRAILERS" example "TAK_ACCEPT_TRAILERS=1 tak compare origin/main" source "config" "gate.accept_trailers" } prop "gate_min_delta" type="uint" default=0 since="0.0.14" help="How many instructions a count may rise by before `tak compare` or `tak detect` fails, whatever the percentage." long_help="How many instructions a count may rise by before `tak compare` or `tak detect` fails, whatever the percentage.\n\nA regression has to exceed both this and `gate_pct`. A percentage alone serves small benchmarks badly: on a 450k-instruction startup check, 1% is 4,500 instructions, which one new dependency's relocations in the dynamic loader can account for before `main` runs. A floor lets such a benchmark keep a tight percentage without failing on a handful of instructions.\n\nThe default of 0 means no floor: any rise beyond `gate_pct` fails. A benchmark or subject can set its own with `gate = { min_delta = N }` in `tak.toml`." { env "TAK_GATE_MIN_DELTA" cli "--gate-min-delta" example "tak compare origin/main --gate-min-delta 20000" source "config" "gate.min_delta" } prop "allow_empty" type="bool" default=#false since="0.0.14" help="Whether a comparison that compared nothing passes, with a warning, instead of failing." long_help="Whether a comparison that compared nothing passes, with a warning, instead of failing.\n\nApplies to `tak compare`, `tak detect` and `tak run --baseline --gate`: the case where no series was measured on both sides, so the gate had nothing to check. Off by default, because a gate that passed without running reads exactly like one that ran clean, and the causes nobody notices — a base never recorded, notes never fetched, a recording that stopped producing instruction counts — are the ones a green check hides.\n\nTurn it on where comparing nothing is routine rather than a symptom: a runner class that encodes an image or toolchain version, so every update starts a new series and the first comparison after it has no base; or a project still adopting, whose pull requests branch from commits measured before tak was. With it on, those runs exit successfully, the report says `allow_empty` let them through, and a warning goes to stderr — as a `::warning::` annotation under GitHub Actions.\n\nThe cost is that the broken causes above warn as well instead of failing. Only the empty case is waived: a regression still fails, and so do a failed check and a failed instruction count against a baseline.\n\n`--allow-empty` turns it on for one run, and `TAK_ALLOW_EMPTY=0` off. Like the rest of its gate, `tak compare` reads it from the base revision's `tak.toml`, so a pull request cannot waive its own empty comparison; turning it on takes effect once the change is merged. `tak detect` and `tak run --baseline` read the working tree's." { env "TAK_ALLOW_EMPTY" cli "--allow-empty" example "tak compare origin/main --allow-empty" example "TAK_ALLOW_EMPTY=0 tak detect" source "config" "gate.allow_empty" } prop "credit" type="bool" default=#true since="0.0.4" help="Whether generated reports end with a line naming tak." long_help="Whether generated reports end with a line naming tak.\n\nOn by default. A report that appears in someone's pull request should say what put it there — a reader who has never heard of tak needs a way to find out, and a maintainer evaluating the comment needs to know what to turn off.\n\nTurn it off with `--no-credit`, `TAK_CREDIT=0`, or `credit = false` under `[report]`. Nothing else about the report changes." { env "TAK_CREDIT" cli "--no-credit" example "tak compare origin/main --no-credit" example "TAK_CREDIT=0 tak compare origin/main" source "config" "report.credit" } prop "runner_class" type="string" default="" default_note="derived from the machine" since="0.0.6" help="The machine class a measurement is recorded under, and compared within." long_help="The machine class a measurement is recorded under, and compared within.\n\nEmpty means derive it: `gha-<os>-<arch>` under GitHub Actions, `local-<os>-<arch>` otherwise. That is right until something about the machine changes without the name changing.\n\nSeries are partitioned on this, and must be. Absolute instruction counts shift between machine types by more than a real regression does, so tak will not compare across classes — it reports the old series as removed and the new one as added rather than inventing a step change.\n\nSet it when the *environment* changes in a way the derived name cannot see. The common case is a toolchain bump: a hosted runner image or a compiler upgrade between the base measurement and this one is attributed to the code otherwise, and on a one-percent gate that is a false failure. Encoding the compiler version into the class starts a fresh series at the bump, which is honest — the numbers either side genuinely are not comparable.\n\ntak cannot detect this for you. It measures programs, not build systems, and has no way to know what produced the binary it is timing." { env "TAK_RUNNER" cli "--runner" example "TAK_RUNNER=gha-linux-x64-rust1.85 tak run --record" example "tak run --runner gha-linux-x64-glibc2.39" source "config" "runner.class" } } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |