Repository navigation
Give the terms argument a test surface, and read a suite once - #260
Conversation
Speed against
|
The terms argument was the only one of the five with no test over what it reads. Nothing called its settings reader but the one line in the usage test, no test named it a suite file, and the refusal table every measuring tool leans on named the other four. It gains three tests. The suite is the bench's own unless the line names a file, and a named file is checked against tactics.epd rather than the bench's own, so a reader that ignored the name could not pass. A file that is no suite is named rather than walked, on three readings: it will not open, it holds a position no board will take, and it holds no position at all. The last is written to the temp directory for the test, since nothing checked in is one. And a word the argument does not know is refused, which is the refusal only this one can make: it runs no search, so a number where the depth would be is a word rather than a depth. The table in tests/uci_session.rs gains a terms row, so its own comment about asking this of each command that takes settings is now true. Checked by mutation. Dropping the claim from term_settings leaves every test passing before this commit and fails the third of these after it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The residual sampler, the reduction ledger and the term extraction each take a suite, and each read it with the same five lines written out again. The reading is two decisions rather than one: the path is kept because the report's header states it, and the positions are read while the settings are so that a file which is no suite is refused before the minutes are spent. Two decisions written three times can come apart on one of the three without the other two saying anything. `suite` is that reading, once, beside the `read_epd` it calls. The cutoffs argument is left out because it takes no suite, which is a difference the declaration already states and this does not hide. Checked by mutation. A `suite` that swallows the refusal fails the no-suite test on all three arguments, which is what the one copy has to keep true. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The residuals and reductions arguments each have a test that the suite a line names is the suite the settings hold. Both named arche-core/bench.epd and then asserted the positions equalled bench::positions(), which is the same file. A reader that opened the named file, checked it, and handed back the bench's own positions passed both. With the suite now read in one place that reader would be wrong for all three arguments at once. Both now name tactics.epd and hold the positions against that file, and against the bench's as well, so the two cannot be mistaken for each other. Each also gains the third way a file can fail to be a suite. A file that opens and holds no position was refused by read_epd and tested by nothing. Nothing checked in is one, so the test writes it to the temp directory and removes it when done. Checked by mutation. Returning the bench's positions after checking the named file, and dropping the empty check from read_epd, each left both of these tests passing before this commit and fail them after it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2c92f14 to
94e03c8
Compare
|
Review round 1, folded as 5ebfb37, 9c69dac and 94e03c8 (previously 46307a5 and 2c92f14). Seventeen mutations to
Q was the finding. Every test that a named suite is read named E, F and O are left. Each reorders the settings a reader checks, which changes which refusal a line with two bad words reports. The fold did not reorder anything: fifteen such lines give byte-identical refusals on master and on this branch. Pinning an order nobody has asked to keep is a separate decision, with one exception worth naming. O moves the bench's claim ahead of its depth, and that order is one the code states a reason for (claim last, so a word read as the depth is refused under the better name). It is observable: One gap stays out of reach: |
Three changes to the command line side of the instruments. None touches a
searched tree, so no bench moves and there is no
Bench:trailer.Pin what a terms argument takes and how it refuses.
termswas the onlyone of the five instruments with no test over what it reads. Its settings
reader was called by nothing but the one-line smoke assertion in the usage
test, no test ever named it a suite file, and the refusal table in
tests/uci_session.rscovered the other four while its own comment said itasked this of each command that takes settings.
It now has three settings tests, and the table has a
termsrow so thecomment is true.
Check: dropping
TERMS.claim(params)?fromterm_settingsleaves every testpassing before this commit and fails
an_unreadable_terms_setting_is_named_rather_than_runafter it.
Read an instrument's suite in one place. The residual sampler, the
reduction ledger and the term extraction each took a suite and each read it
with the same five lines written out again.
suiteis that reading once,beside the
read_epdit calls. The cutoffs argument is left out because ittakes no suite. The refusal each argument gives for a line with more than one
bad word was compared on fifteen lines against master and is identical.
Check: a
suitethat swallows the refusal fails the no-suite test on allthree arguments.
Name a suite the bench does not use when checking one is read. The
residuals and reductions tests of a named suite named
bench.epdand thencompared against
bench::positions(), which is the same file. A reader thatchecked the named file and handed back the bench's own positions passed both.
They now name
tactics.epd. Each also gains a file that opens and holds noposition, which
read_epdrefused and nothing tested.Check: both of those mutations fail these tests after the commit and did not
before it.
Verified with
cargo test --workspace --releaseandcargo test --workspaceat the tip, the release suite at each commit on its own,
cargo fmt --all -- --check, and clippy (the only warning is the pre-existing const-evaluationone from the magic tables).
🤖 Generated with Claude Code