Skip to content

checkRoot refuses a bench module nested two levels below the root (bench/perf) #18

Closed

Description

@tannevaled

checkRoot (rbtest/rbtest.go:124, v0.4.0) accepts the bench module only when it is the root module itself or its direct child:

if self != root && path.Dir(self) != root {

A repository whose bench module sits two levels down is refused, although the root is its ancestor. go-simd/floats has its perf module at bench/perf. Run from bench/perf after bumping refbench v0.1.2 → v0.4.0, go test -run TestPerf -count=1 -cpu 1 . -args -perf.run … fails immediately with:

refusing to write docs: this binary's module is "github.com/go-simd/floats/bench/perf", but ../../go.mod declares module "github.com/go-simd/floats", which is not its parent (a binary of one repository was run from another's bench directory?)

v0.1.2 has no such check, so go-simd cannot take the retries and -perf.resume from #10, which are what it needs on a loaded machine. Its last full v0.1.2 run came back valid: false, with the load peaking at 13.4.

Proposed fix: require the bench module to be a descendant of the root module (strings.HasPrefix(self, root+"/"), or the same module). That still refuses the cross-repository case the message describes. Add a test case with a two-level bench module next to the existing one-level case.

🤖 Generated with Claude Code

Prior art: priorart "checkRoot nested bench module parent" at 2026-11-15 18:50 CET reported prior art; checked: read the 11 entries priorart listed (#4, #6, #9, #10, #12, #13, #14, #17): none concerns checkRoot or the depth of the bench module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions