[2.0] Reject unknown benchmark.type at load; delete dead BenchmarkType enum - #393
Closed
ishandhanani wants to merge 1 commit into
Closed
ishandhanani wants to merge 1 commit into
ishandhanani wants to merge 1 commit into
Conversation
This was referenced Sep 6, 2026
Closed
ishandhanani
marked this pull request as ready for review
September 7, 2026 19:16
ishandhanani
requested review from
alec-flowers,
csahithi and
nlevin-ui
as code owners
September 7, 2026 19:16
…pe enum An unknown benchmark.type (a typo like `gsm8k-bench`, or a removed type) loaded fine and only failed deep in the benchmark stage after a full allocation. SrtConfig.__post_init__ now checks benchmark.type against the runner registry plus the special `manual` type, so a bad type fails at load / dry-run instead. The registry import is lazy and guarded, so an import hiccup never blocks a load. The BenchmarkType enum listed 10 of the 13 registered types and had zero references anywhere; it is removed. The registry (register_benchmark / list_benchmarks) is the single source of truth for valid types. This is the safe half of the benchmark step: it validates the type. The per-type field split (rejecting stray fields like use_chat_template on a custom benchmark) is deferred to the discriminated-union follow-up. Part of the 2.0 plan: #385
ishandhanani
force-pushed
the
idhanani/srt2-08-benchmark-validation
branch
from
September 8, 2026 03:54
ad08d18 to
2c263c1
Compare
Collaborator
Author
|
Consolidated into #407, which carries these same commits as one PR against main (this description is reproduced there as one of its parts). Closing to keep review in one place; the branch stays for per-step reference via stack #398. |
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.
Summary
Eighth PR of the 2.0 stack (plan: #385, Track 2 step 4, safe half). Stacked on #392.
An unknown
benchmark.type(a typo likegsm8k-bench, or a removed type) loaded fine and only failed deep in the benchmark stage after a full allocation.SrtConfig.__post_init__now validatesbenchmark.typeagainst the runner registry plus the specialmanualtype, so a bad type fails at load / dry-run. The import is lazy and guarded, so a registry import hiccup never blocks a load.The
BenchmarkTypeenum listed 10 of the 13 registered types and had zero references; it is removed. The registry (register_benchmark/list_benchmarks) is the single source of truth.Scope note: this is the safe half of the benchmark step. It validates the type. The per-type field split (rejecting stray fields such as
use_chat_templateon acustombenchmark, via a discriminated union) is deferred to a follow-up, because a wrong per-type allowlist would hard-error a valid recipe and needs the golden corpus to land safely.Validation
ruffclean; full suite: 1766 passedtests/test_configs.py::TestBenchmarkTypeValidation: registered + manual types load,gsm8k-benchrejected at load, enum is goneStack
8 of the stack; see #386-#392 for the earlier PRs.