Skip to content

rbtest: a bench module nested below bench/ belongs to the repository too - #19

Merged
tannevaled merged 1 commit into
mainfrom
checkroot-nested-bench
Nov 15, 2026
Merged

tannevaled merged 1 commit into
mainfrom
checkroot-nested-bench

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Fixes #18.

checkRoot accepted the root module or its direct child only, so a perf module at bench/perf was refused as if it belonged to another repository. go-simd/floats keeps its perf module there, so it could not move from refbench v0.1.2 to v0.4.0 for the per-row retries and -perf.resume, which it needs on a loaded machine.

  • ownsModule(root, self): the same module, or any module below root + "/". A sibling that only shares a prefix (github.com/o/rx) is still refused, and so is a module of another owner.
  • TestOwnsModule covers both directions in eight cases, and TestRootGuard adds example.com/lib/bench/perf (allowed) and example.com/libx/bench (refused).
  • Mutation: restoring the direct-parent rule makes both tests fail.

🤖 Generated with Claude Code

checkRoot accepted the root module or its direct child only
(path.Dir(self) == root), so go-simd/floats, whose perf module is
bench/perf, was refused as if it were another repository's binary. The
rule is now ownsModule: the same module or any module below it, which
still refuses a sibling that merely shares a prefix (github.com/o/rx).

Tested both ways in TestOwnsModule and TestRootGuard (bench/perf allowed,
a prefix sibling refused); restoring the direct-parent rule turns both red.

Fixes #18

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit d568567 into main Nov 15, 2026
5 checks passed
@tannevaled
tannevaled deleted the checkroot-nested-bench branch November 15, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant