Repository navigation
benchmarking/swebench: fix the review findings from #94-#96 (dataset builder rejects all rows, delete-park leak, cluster script), and a flaky test - #102
Open
Tomer Glottmann (tomergee) wants to merge 5 commits into
Conversation
…pts, records the resolved dataset commit - The eval-script check rejected each row of SWE-bench/SWE-bench_Verified with each swebench 5.x release (5.0.0 to 5.0.2), thus the script exited 2 at the first row and wrote no manifest. make_test_spec adds two lines around the End marker (SWEBENCH_TEST_EXIT_CODE=$? and the "Test Exit Code" echo), so the row's script is never a substring of the harness script. The check now compares the two line for line without the shell header and those two lines: 500 of 500 rows match (0 before), and a changed test command, a dropped line or an added line still fails it. - Without --revision the meta file recorded "revision": null. The dataset is now resolved to a commit first (huggingface_hub, a datasets dependency; the sha256 of a local file), loaded at that commit, and the commit is recorded as resolved_revision. - test_make_dataset.py covers both offline; CI runs it.
- While waiting for the loader's exit code, any kubectl error read as a lost pod (`|| echo gone`): the script exited and its trap deleted the running Job, results included. Only NotFound now means gone; other errors are retried, MAX_API_ERRORS (30) times in a row. - The loader's exit code is printed before the copy; when the loader exited before writing its events file, the script says so and exits with the loader's code. - When no pod is created, the Job's events are printed. - A script killed before its trap runs no longer leaves the Job for good: activeDeadlineSeconds 48 h, ttlSecondsAfterFinished 1 h. The header says that Ctrl-C deletes the Job. - A shellcheck directive for the trap-only cleanup function.
…longest environment name - A delete park that failed kept e.sb but left the environment in the run; the next step created "<base>-s<step>" and overwrote the only handle, and the old environment leaked. The environment now leaves the run and keeps its handle for the final cleanup (TestStepsFailedDeleteParkDoesNotLeak). - The 20-character run-id cap did not keep names within 63 characters: run id, a 36-character instance part, a two-digit replay index and "-s10" make 64. validate now builds the longest name the run will use (largest replay index of each instance, plus the delete-park suffix) and refuses the config when it is longer than 63 (TestValidateChecksTheLongestName). - isNotFound no longer sits between isTransient and its doc comment; the Event.Env doc says that a delete park renames environments from step 2.
… a stray End marker, live 0 kept - LoadDataset refused an http URL but followed an https URL's redirect to http. CheckRedirect now refuses each non-https hop. - The grader took the first End marker in the log, also one before Start, and voided a valid run; it now looks for End after Start, as the harness slices. The two remaining differences from the harness are stricter and documented. - The grader's docstring describes the success / failure / neither split. - report.go: "live": 0 is kept in the JSON when the whole fleet failed.
TestConcurrencyLimiter, TestLogCapping and TestDefaultTimeoutKills used
DefaultConfig(""), thus the shared $TMPDIR/ate-jobs, and the test helper's
cleanup removes LogDir. Another test binary using that directory at the
same time (internal/apiservice's wake tests) then failed with "creating
stdout log: ... no such file or directory". Each test now uses t.TempDir().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the findings from my reviews of #94, #95 and #96 that are on
mainafter those merged, plus a flaky test.The defects
benchmarking/swebench/make-dataset.pySWE-bench/SWE-bench_Verifiedwith each swebench 5.x release. The script exits 2 at the first row and writes no manifest. swebench 5'smake_test_specadds two lines around the End marker (SWEBENCH_TEST_EXIT_CODE=$?and theTest Exit Codeecho), so the row's script is never a substring of the harness script.--revision, the meta file records"revision": null.resolved_revision.benchmarking/swebench/run-in-cluster.sh|| echo gone). The script exits, and its trap deletes the running Job and its results.MAX_API_ERRORS(30) times in a row.kubectl cpfail without the loader's exit code. With no pod there is no diagnostic. A killed script leaves the Job for good.activeDeadlineSeconds(48 h) andttlSecondsAfterFinished(1 h).internal/benchmarking/swebench/run.go-10and-s10make 64.validatebuilds the longest name the run uses and refuses a config whose names are longer than 63.internal/benchmarking/swebench/dataset.goCheckRedirectrefuses each non-https hop.trajectories/swebench-grade.pyreport.go,events.go,run.go, grader docstringlive: 0is dropped from the JSON.Event.Envdoes not say that names change from step 2.isNotFoundsits betweenisTransientand its doc. The grader docstring predates the success/failure/neither split.guest/process/service_test.go$TMPDIR/ate-jobs, and the helper's cleanup removes it.internal/apiservice's wake tests then fail intermittently with "creating stdout log: … no such file or directory".t.TempDir().Why the earlier full runs worked
The full-shape runs on the cluster (posted on #94–#96 on 2026-10-16 at 02:39Z) predate items 1 and 2.
The eval-script check came in d00f349 at 19:48Z, in reply to a review, so those runs never executed it.
They parked with suspend, not delete, so item 5 never came up. SWE-bench ids have 32 characters or
less, so item 6 never came up. Item 3 needs a transient API error during the wait.
The check, per release, over all 500 rows of
SWE-bench/SWE-bench_Verified(commit78f471bf):mainswebench>=5)astropy__astropy-7336On 4.x,
make_test_specbuilds the script from its own tables, and 20 rows differ from the dataset.Both checks rightly refuse them. So the change fixes 5.x and keeps the 4.x behavior row for row.
Verification
crane,make-dataset.py --limit 5writes 5 instances and recordsresolved_revision(78f471bf…).astropy__astropy-12907.test_make_dataset.pycovers the check and the file hash offline, and CI now runs it.kubectl,koandgo:MAX_API_ERRORS=3exit 1.go build,go vet,go test -race ./...and staticcheck on the benchmarking packages pass.make verify-gofmt verify-boilerplateand zizmor onci.yamlare clean.guest,internal/apiserviceandclients/gopassed three runs in a row. Before the fix, the full suite failed inTestGuestCallWaitsForWakewith the error above.