From 6771885c1619be68d4494d8c1dd354420b093fcc Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 29 Nov 2026 14:21:22 +0100 Subject: [PATCH 1/2] ci: run benchstat as a tool of the bench module wfaudit v0.196.0 (go-run-version) flags the A/B workflow's `go run golang.org/x/perf/cmd/benchstat@latest`: a versioned go run loads the deprecation status of the module's newest release from sum.golang.org, the failure #135 removed from the coverage step. It also floated with every x/perf commit. Declare benchstat with a `tool` directive in bench/go.mod, pinned by go.sum, and run it with `go tool` from bench. The ci.yml comment from #135 is reworded: wfaudit read its literal example as a command (reported to the fleettools owner). `wfaudit --fail .` now reports 0 MEDIUM. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/bench.yml | 5 ++++- .github/workflows/ci.yml | 2 +- bench/go.mod | 9 +++++++-- bench/go.sum | 8 ++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 5413931..c72efa1 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -64,8 +64,11 @@ jobs: done - name: Compare run: | + # benchstat is a `tool` of the bench module, pinned by its go.sum + # (wfaudit go-run-version: a versioned go run asks sum.golang.org + # about the module's newest release). + (cd bench && go tool benchstat "$RUNNER_TEMP/base.txt" "$RUNNER_TEMP/head.txt") > "$RUNNER_TEMP/benchstat.txt" cd "$RUNNER_TEMP" - go run golang.org/x/perf/cmd/benchstat@latest base.txt head.txt > benchstat.txt { echo "### ${{ matrix.runner }}: ${{ inputs.base }} vs ${{ github.ref_name }}" echo '```' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faea984..52da346 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: # Count the uncovered blocks: `go tool cover -func` rounds to one # decimal, and a gate on its total passed at 99.98% with two # statements never run. - # covblocks is a `tool` of the bench module: `go run pkg@version` + # covblocks is a `tool` of the bench module: a versioned `go run` # asks the proxy and sum.golang.org about the module's LATEST # release (deprecation check), so every new fleettools tag broke # this step until the checksum database caught up. diff --git a/bench/go.mod b/bench/go.mod index 22ee04b..3df1801 100644 --- a/bench/go.mod +++ b/bench/go.mod @@ -8,6 +8,7 @@ require ( ) require ( + github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794 // indirect github.com/go-blas/blas v0.2.1 // indirect github.com/go-fft/fft v0.29.0 // indirect github.com/go-fleettools/fleettools v0.81.0 // indirect @@ -16,10 +17,14 @@ require ( github.com/spf13/cobra v1.10.2 // indirect github.com/spf13/pflag v1.0.10 // indirect golang.org/x/mod v0.42.0 // indirect - golang.org/x/sys v0.49.0 // indirect + golang.org/x/perf v0.0.0-20261117185222-4febdb082b2c // indirect + golang.org/x/sys v0.50.0 // indirect golang.org/x/tools v0.52.0 // indirect ) replace github.com/go-ndarray/ndarray => ../ -tool github.com/go-fleettools/fleettools/cmd/covblocks +tool ( + github.com/go-fleettools/fleettools/cmd/covblocks + golang.org/x/perf/cmd/benchstat +) diff --git a/bench/go.sum b/bench/go.sum index 83f4c18..e7cd198 100644 --- a/bench/go.sum +++ b/bench/go.sum @@ -1,3 +1,5 @@ +github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794 h1:xlwdaKcTNVW4PtpQb8aKA4Pjy0CdJHEqvFbAnvR5m2g= +github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794/go.mod h1:7e+I0LQFUI9AXWxOfsQROs9xPhoJtbsyWcjJqDd4KPY= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/go-blas/blas v0.2.1 h1:5uZfmvXVZn9CjE+I3DalALqWHdKz+rbBs8VffH3dAZo= github.com/go-blas/blas v0.2.1/go.mod h1:WjhlqzQ+RA8tS473f18QtcJl5Q0GonPs3RJIxT5G7Bk= @@ -20,8 +22,10 @@ github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3A go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= -golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= -golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/perf v0.0.0-20261117185222-4febdb082b2c h1:eIwwPvTmcIzTN2qXPzVy5oOvSX7f6C8S4JG9nSRf+pI= +golang.org/x/perf v0.0.0-20261117185222-4febdb082b2c/go.mod h1:+CnJEPFCSJYTYqIj/+xh7uw90z/h4zNIhETOka2bLAk= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 7271e7ab936119ece16fc4fca9699a918cc1fa43 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 29 Nov 2026 14:38:07 +0100 Subject: [PATCH 2/2] ci(bench): install Go from bench/go.mod The first dispatch of the A/B workflow (run 46267040621) failed in Compare: "go: go.mod requires go >= 1.27.3 (running go 1.27.2; GOTOOLCHAIN=local)". setup-go read the root go.mod (1.27.2), while benchstat now runs as a tool of the bench module, whose go line is 1.27.3. Read the version from bench/go.mod; it also builds the root module. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/bench.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index c72efa1..a1a8936 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -43,7 +43,9 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v7 with: - go-version-file: go.mod + # bench/go.mod, not go.mod: the bench module's `go` line is the + # newer one, and benchstat runs as its tool. + go-version-file: bench/go.mod - name: Build both sides env: BASE: ${{ inputs.base }}