Merge remote-tracking branch 'origin/main' into item-531
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
# Conflicts: # CHANGELOG.md # README.md # docs/reading-cost.md
This commit is contained in:
+21
-14
@@ -14,13 +14,14 @@ origin's as last fetched, else main or master. Where --base names the head's own
|
||||
No model judges anything: the bench runs programs, and reads Haiku's own stream.
|
||||
|
||||
- Plant. It copies the tree at the base and runs a mutation tool there, over the files that hold the places `larv-review places`
|
||||
prints, the ones the comprehension seats found hardest: Gremlins over the Go files, as `gremlins unleash`, and mutmut 3 over
|
||||
the Python files, as `mutmut run`. It takes the mutants the tests kill in the order --seed sets, 1 by default, until --bugs of
|
||||
prints, the ones the comprehension seats found hardest: Gremlins over the Go files, as `gremlins unleash`, mutmut 3 over
|
||||
the Python files, as `mutmut run`, and cargo-mutants over the Rust files, as `cargo mutants`. No other language is planted
|
||||
in so far. It takes the mutants the tests kill in the order --seed sets, 1 by default, until --bugs of
|
||||
them, 5 by default, have become bugs. A mutant becomes a bug where the lines it changes stand unchanged at the head, and where,
|
||||
planted at each side, a test fails and prints a message that says more than the test's name. The bench reads that message
|
||||
from `go test`'s output for a Go file and from pytest's for a Python file, so --test must run the tests of each language the
|
||||
places name, with that runner: pytest as it prints by default, or with --tb=short. Any other mutant is passed over, so a
|
||||
change to the very lines of a bug is not benched. Go and Python are the languages so far.
|
||||
from `go test`'s output for a Go file, from pytest's for a Python file and from `cargo test`'s for a Rust file, so --test must
|
||||
run the tests of each language the places name, with that runner: pytest as it prints by default, or with --tb=short, and
|
||||
`cargo test` without --nocapture. Any other mutant is passed over, so a change to the very lines of a bug is not benched.
|
||||
- Run. Haiku fixes each bug --runs times at each side, 5 by default, the sides in turn. A fix starts from a copy of that side's
|
||||
tree with the bug in it, committed once, so git doesn't show which line the bug is on. In the copy, in a container, `claude -p
|
||||
--strict-mcp-config --disable-slash-commands --no-session-persistence --model claude-haiku-5-5 --effort low` works with every
|
||||
@@ -28,23 +29,29 @@ No model judges anything: the bench runs programs, and reads Haiku's own stream.
|
||||
Claude home is new and empty, so the project's own CLAUDE.md, or AGENTS.md, in the copy is all the setup that loads. Its network
|
||||
reaches api.anthropic.com and nothing else. A fix ends after 30 minutes.
|
||||
- Check. The test command runs over the planted tree with each file that is no test as Haiku left it; a fix passes where it exits 0.
|
||||
A test Haiku changed, removed or added doesn't count, and neither does a file under a `testdata` folder.
|
||||
A test Haiku changed, removed or added doesn't count, and neither does a file under a `testdata` folder. A Rust test that
|
||||
stands in the file of the code it tests is the exception: the bench takes that file whole, so a change to such a test counts.
|
||||
|
||||
--image is the project's development image, such as golang:1.27.4. The bench adds Claude Code to it, as its installer installs it,
|
||||
so the image needs curl and bash; the result names the version. Haiku works in that image. So does --test: sh runs that text at
|
||||
the copy's top, with no network, so the image must hold what the tests would otherwise download.
|
||||
--prefix is shell text that runs the mutation tool, on the host, as mutate-changes' --prefix does: sh runs `<prefix> "$@"` with
|
||||
the tool's command as "$@", such as `gremlins unleash ...` or `mutmut run ...`. Gremlins runs in the copy of the base, and mutmut
|
||||
in a copy of the folder there that holds its settings; $PWD is the folder the tool runs in. Without --prefix, the bench runs
|
||||
the `gremlins` or the `mutmut` on the host's PATH. For example, for Go and then for Python:
|
||||
the tool's command as "$@", such as `gremlins unleash ...`, `mutmut run ...` or `cargo mutants ...`. Gremlins and
|
||||
cargo-mutants run in the copy of the base, and mutmut in a copy of the folder there that holds its settings; $PWD is the folder
|
||||
the tool runs in. Without --prefix, the bench runs the `gremlins`, the `mutmut` or the `cargo` on the host's PATH. For example,
|
||||
for Go, for Python and then for Rust:
|
||||
|
||||
docker run --rm --memory 16g --memory-swap 16g -v "$PWD:$PWD" -w "$PWD" golang:1.27.4 \
|
||||
sh -c 'shift; exec go run github.com/go-gremlins/gremlins/cmd/gremlins@v0.6.0 "$@"' sh
|
||||
|
||||
uvx --python "$(command -v python3)" --with pytest==9.2.0 --from "mutmut>=3,<4"
|
||||
|
||||
Where the places name files in both languages, the one prefix gets both tools' commands, Gremlins' first, and a tool it
|
||||
cannot run fails the bench. Such a prefix picks the tool by "$1", which is `gremlins` or `mutmut`:
|
||||
docker run --rm --memory 16g --memory-swap 16g --user "$(id -u):$(id -g)" -e CARGO_HOME=/tmp/cargo -v "$PWD:$PWD" -w "$PWD" \
|
||||
rust:1.100.0 sh -c 'cargo install --quiet --locked cargo-mutants@27.1.0 && exec "$@"' sh
|
||||
|
||||
Where the places name files in more than one language, the one prefix gets each tool's command, Gremlins' first and
|
||||
cargo-mutants' last, and a tool it cannot run fails the bench. Such a prefix picks the tool by "$1", which is `gremlins`, `mutmut` or `cargo`, as here for Go
|
||||
and Python:
|
||||
|
||||
sh -c 'case "$1" in
|
||||
gremlins) shift; exec docker run --rm --memory 16g --memory-swap 16g -v "$PWD:$PWD" -w "$PWD" golang:1.27.4 \
|
||||
@@ -140,7 +147,7 @@ not, unless a bench or a gather is using it. So gather a bench before the next o
|
||||
|
||||
Exit 1, saying why, on an unknown or repeated argument, a missing --image or --test, a --seed, --bugs or --runs that is no whole
|
||||
number from 1, a --tasks that is none of bugs, features, data-sources and shipped-features, or no token; and where git, docker or a mutation tool
|
||||
fails, the seats' places don't name any Go or Python file, the tests fail at a side without a bug, or no mutant becomes a bug. With --tasks
|
||||
fails, the seats' places don't name any Go, Python or Rust file, the tests fail at a side without a bug, or no mutant becomes a bug. With --tasks
|
||||
features or data-sources it exits 1 on a --seed, --bugs or --prefix; where no config names the checkout or its config sets no
|
||||
`bench-tasks`, or the folder holds no task of that kind, one that lacks a part, or a `generate-register` that is no executable
|
||||
file, each before docker runs; and where the tests fail at a side without the acceptance tests, or no task counts.
|
||||
@@ -346,11 +353,11 @@ def features_planner(features: Features, checkout: str, trees: dict[Side, str])
|
||||
|
||||
|
||||
def bugs_planner(given: dict[str, str], env: typing.Mapping[str, str], places: str, base: str) -> typing.Callable[[Bench], Planned | Failure] | Failure:
|
||||
"""What plans a bench of bugs: of the mutants the tests kill in the Go and Python files of the tree at base that hold a place
|
||||
"""What plans a bench of bugs: of the mutants the tests kill in the Go, Python and Rust files of the tree at base that hold a place
|
||||
in places, those --seed draws first become bugs, until --bugs of them have."""
|
||||
files = [path for path in place_files(places) if pathlib.Path(base, path).is_file()]
|
||||
if not files:
|
||||
return Failure("The places the seats found hard don't name any Go or Python file that the base holds, so there is nowhere to plant a bug.")
|
||||
return Failure("The places the seats found hard don't name any Go, Python or Rust file that the base holds, so there is nowhere to plant a bug.")
|
||||
run = functools.partial(run_tool, prefix=given.get("--prefix"), env=env, killpg=os.killpg)
|
||||
mutants = killed_mutants(base, files, run, CPUS_PER_SLOT)
|
||||
return mutants if isinstance(mutants, Failure) else functools.partial(planted_tasks, mutants=mutants, seed=int(given["--seed"]), bugs=int(given["--bugs"]))
|
||||
|
||||
Reference in New Issue
Block a user