diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 5413931..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 }} @@ -64,8 +66,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=