Datasets:
acceptance_tests stringlengths 3.5k 39.4k | category stringclasses 12
values | entrypoint stringclasses 1
value | family stringlengths 7 20 | language stringclasses 1
value | num_assertions int64 46 241 | num_scenarios int64 5 20 | prompt stringlengths 2.2k 8.38k | protocol_version stringclasses 1
value | public_tests stringlengths 178 400 | subset stringclasses 4
values | target_model_parameters stringclasses 4
values | task_id stringlengths 19 41 | timeout_seconds int64 10 10 | title stringlengths 21 44 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":[{"count":1,"word":"9"},{"count":1,"word":"b"},{"count":1,"word":"b00a9ab"},{"count":1,"word":"ba"}]},{"ok":true,"result":[{"count":1,"word":"0"}]},{"ok":true,"result":[{"count":1,"word":"00"}]},{"ok":true,"result":[{"count":2,"word":"a9"},{"count... | text | main.py | word_frequency | python | 47 | 5 | # Word Frequency — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
R... | 1.0 | [{"request":{"input":{"text":"Red blue RED! 42"},"op":"solve"},"response":{"ok":true,"result":[{"count":2,"word":"red"},{"count":1,"word":"42"},{"count":1,"word":"blue"}]}},{"request":{"input":{"text":""},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-001-word-frequency | 10 | Word Frequency — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":["b-ba-b-a-b-a-bbaa","a-b-a-b-aa-aa-a-a-a-a-b-a","a-b-b-aaabb-b-a-a-a-a","b-a-a-a","a-ba-abaa-ab-b-aa-a-b-b-aa-ab-aa-b","a-a-a-aa-a","ab","a-a-a-a-a-a-a-a-ab-ab","bb-bb-a-ab-aa","a-a-a-b-b-aba-a-a-b-b-bbabaab-ba","aa-a-a-aa-a-a-a-a-a"]},{"ok":true... | text | main.py | slug_registry | python | 47 | 5 | # Slug Registry — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Re... | 1.0 | [{"request":{"input":{"titles":["Hello World","hello world","hello-world-2",""]},"op":"solve"},"response":{"ok":true,"result":["hello-world","hello-world-2","hello-world-2-2","item"]}},{"request":{"input":{"titles":[]},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-002-slug-registry | 10 | Slug Registry — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":[["0",1],[" ",1],["9",1],["_",1],["A",1],["0",1],["a",1],["é",1],[" ",1],["b",1],["0",1],[" ",2],["_",1],["-",1],["0",1],["a",2],["B",1],["0",1],["b",1],[" ",1]]},{"ok":true,"result":[["B",1],["_",1],["B",1],["a",1],["é",1],["0",1],[" ",1],["\n",1... | text | main.py | run_length | python | 47 | 5 | # Run Length — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Read ... | 1.0 | [{"request":{"input":{"text":"aaabbcaa"},"op":"solve"},"response":{"ok":true,"result":[["a",3],["b",2],["c",1],["a",2]]}},{"request":{"input":{"text":""},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-003-run-length | 10 | Run Length — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":{"balanced":false,"position":1}},{"ok":true,"result":{"balanced":false,"position":3}},{"ok":true,"result":{"balanced":false,"position":3}},{"ok":true,"result":{"balanced":false,"position":8}},{"ok":true,"result":{"balanced":false,"position":2}},{"... | text | main.py | bracket_audit | python | 48 | 5 | # Bracket Audit — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Re... | 1.0 | [{"request":{"input":{"text":"a([)]"},"op":"solve"},"response":{"ok":true,"result":{"balanced":false,"position":3}}},{"request":{"input":{"text":""},"op":"solve"},"response":{"ok":true,"result":{"balanced":true,"position":null}}}] | easy | 2–8B | kcb-easy-004-bracket-audit | 10 | Bracket Audit — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":["Aa","_a-9bA-","BBé","0_ab"]},{"ok":true,"result":["9 0a","-9é-0Aéé9aéb","_é B0","b0aéaB0AB","00-","b-0_A9ABA99"]},{"ok":true,"result":["AbbABébb99"]},{"ok":true,"result":["--A _abé-b"]},{"ok":true,"result":["0aAB0B_a9 éa","Ba0_ A 9b9--","9Bé0bAb... | text | main.py | text_wrap | python | 48 | 5 | # Text Wrap — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Read o... | 1.0 | [{"request":{"input":{"text":"one two three four","width":7},"op":"solve"},"response":{"ok":true,"result":["one two","three","four"]}},{"request":{"input":{"text":"","width":1},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-005-text-wrap | 10 | Text Wrap — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":[{"positions":[0],"tokens":["c","a","é","a/b"]}]},{"ok":true,"result":[{"positions":[2],"tokens":["","a","b","a"]},{"positions":[3],"tokens":["a","b","a","b"]},{"positions":[4],"tokens":["b","a","b","é"]},{"positions":[1],"tokens":["c","","a","b"]... | text | main.py | ngram_index | python | 48 | 5 | # Ngram Index — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Read... | 1.0 | [{"request":{"input":{"n":2,"tokens":["a","b","a","b"]},"op":"solve"},"response":{"ok":true,"result":[{"positions":[0,2],"tokens":["a","b"]},{"positions":[1],"tokens":["b","a"]}]}},{"request":{"input":{"n":1,"tokens":[]},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-006-ngram-index | 10 | Ngram Index — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":["c"]},{"ok":true,"result":[]},{"ok":true,"result":[]},{"ok":true,"result":["a","b","c"]},{"ok":true,"result":["é"]},{"ok":true,"result":["a","b","c"]},{"ok":true,"result":["é"]},{"ok":true,"result":["c"]},{"ok":true,"result":["a","c","é"]},{"ok":... | text | main.py | glob_filter | python | 48 | 5 | # Glob Filter — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Read... | 1.0 | [{"request":{"input":{"paths":["a.py","B.py","a.txt","a.py","x/a.py"],"pattern":"*.py"},"op":"solve"},"response":{"ok":true,"result":["B.py","a.py","x/a.py"]}},{"request":{"input":{"paths":[],"pattern":"*"},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-007-glob-filter | 10 | Glob Filter — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":27},{"ok":true,"result":19},{"ok":true,"result":39},{"ok":true,"result":13},{"ok":true,"result":41},{"ok":true,"result":44},{"ok":true,"result":48},{"ok":true,"result":24},{"ok":true,"result":24},{"ok":true,"result":28},{"ok":true,"result":22},{"o... | text | main.py | edit_distance | python | 48 | 5 | # Edit Distance — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Re... | 1.0 | [{"request":{"input":{"a":"kitten","b":"sitting"},"op":"solve"},"response":{"ok":true,"result":3}},{"request":{"input":{"a":"","b":""},"op":"solve"},"response":{"ok":true,"result":0}}] | easy | 2–8B | kcb-easy-008-edit-distance | 10 | Edit Distance — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":"CXCVIII"},{"ok":true,"result":"MMMCCCXCVII"},{"ok":true,"result":"MDCCLXI"},{"ok":true,"result":"MDLII"},{"ok":true,"result":"MCXIX"},{"ok":true,"result":"MMCDXXIV"},{"ok":true,"result":"MMCMLXXIX"},{"ok":true,"result":"MCCV"},{"ok":true,"result"... | text | main.py | roman_codec | python | 48 | 5 | # Roman Codec — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Read... | 1.0 | [{"request":{"input":{"number":1994},"op":"solve"},"response":{"ok":true,"result":"MCMXCIV"}},{"request":{"input":{"number":1},"op":"solve"},"response":{"ok":true,"result":"I"}}] | easy | 2–8B | kcb-easy-009-roman-codec | 10 | Roman Codec — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":"c0C\n\n_99\nD_ D\nd\n 9CD"},{"ok":true,"result":"0yxy éé y_Xxy- 9\nXYX 009 9é_9é_ --\n--0XX_0xy9Xéé"},{"ok":true,"result":"II-_j0iéI-i9é éji0iJ jjIé 9 ii\nIijII9-Iii 9J"},{"ok":true,"result":""},{"ok":true,"result":"0k\n"},{"ok":true,"result":"... | text | main.py | caesar_cipher | python | 48 | 5 | # Caesar Cipher — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Re... | 1.0 | [{"request":{"input":{"shift":1,"text":"Az-z! 9"},"op":"solve"},"response":{"ok":true,"result":"Ba-a! 9"}},{"request":{"input":{"shift":0,"text":""},"op":"solve"},"response":{"ok":true,"result":""}}] | easy | 2–8B | kcb-easy-010-caesar-cipher | 10 | Caesar Cipher — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":[{"a":"\na\n,bbé\néé,é, ba\n,\"é,b\n b\"\"bé\"a,\",b, ,é éb a\" \n","b":"00éa 0é\nA9é_aB A99_Bbb_B--9 __-Ba9_-aé__BaB9bAAa\n0BBAbé"},{"a":",ba\"a\"a,","b":"Béé baa9éB9 -9A--A"},{"a":"a\n ","b":"00Aéé-a-_\n-A-"},{"a":" \n, b ,é,b\né,\"\n é\né... | data | main.py | csv_records | python | 47 | 5 | # Csv Records — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Read... | 1.0 | [{"request":{"input":{"csv":"name,n\na,1\nb,2\n"},"op":"solve"},"response":{"ok":true,"result":[{"n":"1","name":"a"},{"n":"2","name":"b"}]}},{"request":{"input":{"csv":""},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-011-csv-records | 10 | Csv Records — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":[{"b":null,"c":null},{"b":1,"c":null},{"b":null,"c":null}]},{"ok":true,"result":[{"b":"x","c":null}]},{"ok":true,"result":[{"b":null,"c":null},{"b":null,"c":null}]},{"ok":true,"result":[{"b":2,"c":null},{"b":null,"c":null},{"b":null,"c":null},{"b"... | data | main.py | record_query | python | 48 | 5 | # Record Query — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Rea... | 1.0 | [{"request":{"input":{"rows":[{"a":1,"b":"x"},{"a":2},{"a":1}],"select":["b"],"where":{"a":1}},"op":"solve"},"response":{"ok":true,"result":[{"b":"x"},{"b":null}]}},{"request":{"input":{"rows":[],"select":[],"where":{}},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-012-record-query | 10 | Record Query — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":[{"left":{"k":0},"right":{"k":0}},{"left":{"k":0},"right":{"k":0}}]},{"ok":true,"result":[{"left":{"k":3},"right":{"k":3}}]},{"ok":true,"result":[{"left":{"k":0},"right":{"k":0}}]},{"ok":true,"result":[{"left":{"k":2},"right":{"k":2}},{"left":{"k"... | data | main.py | inner_join | python | 48 | 5 | # Inner Join — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Read ... | 1.0 | [{"request":{"input":{"key":"id","left":[{"id":1},{"id":2}],"right":[{"id":2},{"id":2,"x":3}]},"op":"solve"},"response":{"ok":true,"result":[{"left":{"id":2},"right":{"id":2}},{"left":{"id":2},"right":{"id":2,"x":3}}]}},{"request":{"input":{"key":"k","left":[],"right":[]},"op":"solve"},"response":{"ok":true,"result":[]... | easy | 2–8B | kcb-easy-013-inner-join | 10 | Inner Join — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":[{"count":6,"key":"","sum":-33},{"count":6,"key":"a","sum":-8},{"count":3,"key":"b","sum":21}]},{"ok":true,"result":[{"count":2,"key":"","sum":11},{"count":3,"key":"a","sum":-8},{"count":7,"key":"b","sum":19}]},{"ok":true,"result":[{"count":2,"key... | data | main.py | group_totals | python | 47 | 5 | # Group Totals — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Rea... | 1.0 | [{"request":{"input":{"group":"g","rows":[{"g":"b","v":2},{"g":"a","v":3},{"g":"b","v":-1}],"value":"v"},"op":"solve"},"response":{"ok":true,"result":[{"count":1,"key":"a","sum":3},{"count":2,"key":"b","sum":1}]}},{"request":{"input":{"group":"g","rows":[],"value":"v"},"op":"solve"},"response":{"ok":true,"result":[]}}] | easy | 2–8B | kcb-easy-014-group-totals | 10 | Group Totals — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":{"/a~1b/0/0":-8,"/a~1b/0/1":2,"/a~1b/0/2":-2,"/a~1b/0/3":8,"/a~1b/0/4":3,"/a~1b/0/5":7,"/a~1b/0/6":4,"/a~1b/0/7":9,"/a~1b/1":{},"/a~1b/2":null,"/x":null,"/~0/":3}},{"ok":true,"result":{"/a~1b/0":[],"/a~1b/1":{},"/a~1b/2":null,"/x":null,"/~0/":4}},... | data | main.py | json_flatten | python | 46 | 5 | # Json Flatten — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Rea... | 1.0 | [{"request":{"input":{"value":{"a":[1,{"x/y":null}],"b":{}}},"op":"solve"},"response":{"ok":true,"result":{"/a/0":1,"/a/1/x~1y":null,"/b":{}}}},{"request":{"input":{"value":[]},"op":"solve"},"response":{"ok":true,"result":{"":[]}}}] | easy | 2–8B | kcb-easy-015-json-flatten | 10 | Json Flatten — CLI project |
[{"name":"generated-domain","sessions":[{"expected":[{"ok":true,"result":{"x":{"v":7},"~":{"":2}}},{"ok":true,"result":{"a/b":[1],"x":{"v":3},"~":{"":4}}},{"ok":true,"result":{"a/b":{"z":2},"x":{"v":5},"~":{"":5}}},{"ok":true,"result":{"a/b":{"z":2},"x":{"v":8},"~":{"":0}}},{"ok":true,"result":{"a/b":{"z":2},"x":{"v":6... | data | main.py | merge_patch | python | 48 | 5 | # Merge Patch — CLI project
Build a complete project from an EMPTY directory, using Python 3.11+ and only the standard library. Create main.py as the entry point; any number of supporting files is allowed. No starter implementation is provided.
Run: python main.py (max-tier invocation adds --state-dir DIRECTORY).
Read... | 1.0 | [{"request":{"input":{"patch":{"a":null,"b":{"c":9}},"target":{"a":1,"b":{"c":2,"d":3}}},"op":"solve"},"response":{"ok":true,"result":{"b":{"c":9,"d":3}}}},{"request":{"input":{"patch":null,"target":{}},"op":"solve"},"response":{"ok":true,"result":null}}] | easy | 2–8B | kcb-easy-016-merge-patch | 10 | Merge Patch — CLI project |
Klein-Code-Bench
Can a model build a working program from scratch? Klein-Code-Bench gives a coding model a specification and an empty directory, and checks whether the finished Python project passes every acceptance test.
- 260 tasks in four tiers of 65
- Pass or fail per project: a task counts only if all of its tests pass
- Runs locally: standard-library Python, no Docker, no cloud model, no extra dependencies
| Tier | Intended model size | What the model builds | Tasks |
|---|---|---|---|
| easy | 2–8B | A JSONL command-line tool with a domain algorithm and error recovery | 65 |
| intermediate | 8–16B | A stateful document service: CRUD, listing, domain evaluation | 65 |
| hard | 16–32B | A service with atomic batches, revision checks and nested transactions | 65 |
| max | 60–200B | A durable service that survives being force-killed, with idempotency, history and pagination | 65 |
The model sizes are design targets. Version 0.1.0 has not been calibrated against real models yet, and there is no leaderboard. Any model can be run on any tier.
How a task works
- The model gets
PROMPT.md: the full specification plus two examples. - It writes
main.pyand any other files into an emptyproject/directory. There's no starter code and no existing repository to fix. - The evaluator runs the project as a subprocess, sends JSONL requests and checks every response and state change. In the max tier, the process is force-killed right after its last acknowledged response, restarted on the same state directory, and must continue correctly.
The 65 tasks per tier come from the same 65 domain families: text processing, CSV/JSON tools, calendars, numerical utilities, graphs, scheduling, ledgers, geometry, parsing, simulation and more. Each tier adds service behavior on top of the one below. Full list: task catalog.
Because the tiers share families, results across tiers are correlated. Report each tier separately, and don't train on one tier and then present another as an uncontaminated evaluation.
Quick start
Requires Python 3.11+ on Linux or macOS.
git clone https://huggingface.co/datasets/klein-ml/klein-code-bench
cd klein-code-bench
python -m pip install -e .
klein-bench list --subset easy
# Create a workspace: PROMPT.md, plus an empty project/ directory for the model
klein-bench prepare kcb-easy-001-word-frequency --output workspaces/first
# Give workspaces/first/PROMPT.md to your model and let it write into workspaces/first/project/, then:
klein-bench evaluate kcb-easy-001-word-frequency \
--solution workspaces/first/project --output results/first.json
klein-bench score results/first.json
python -m klein_code_benchworks the same asklein-bench.- Exit code 1 means a failed submission, 2 an invalid invocation.
--public-onlyruns just the two examples as a smoke test. Those results can't be scored.
Bring your own agent or local API endpoint, or use the banana-harness integration. Record the model's inference settings with your results.
Loading the dataset
from datasets import load_dataset
easy = load_dataset("klein-ml/klein-code-bench", "easy", split="test") # 65 tasks
all_tasks = load_dataset("klein-ml/klein-code-bench", split="test") # 260 tasks
Each tier is its own config with a single test split; the default config contains all four. There is no
training split, and no loading script or trust_remote_code is needed. Pin revision to a commit when you
report results.
| Field | Content |
|---|---|
task_id |
Stable unique ID |
subset, family, category, title |
Tier and task description |
target_model_parameters |
Intended model-size band (not calibrated) |
language, entrypoint, protocol_version |
Python, main.py, protocol version |
prompt |
The full specification the model sees |
public_tests |
Example requests and responses (JSON string) |
acceptance_tests |
Evaluator scenarios: sessions, requests, expected responses (JSON string) |
num_scenarios, num_assertions, timeout_seconds |
Test counts and the per-session time limit |
The test fields are stored as JSON strings so that all tasks share one schema; decode them with json.loads.
Never put acceptance_tests, the reference implementations or the evaluator source into the model's prompt,
context or workspace. They're public for reproducibility, so the benchmark depends on you keeping them away from the
model.
Scoring
The metric is resolve@1: one project per task, and it counts only if every test passes.
- Per tier: resolved tasks / 65. Overall: resolved tasks / 260.
- Missing submissions count as failures. The report also shows the rate among submitted tasks and flags incomplete runs.
- Partial assertion success is reported for diagnosis, but it never counts as resolved.
Each scenario starts from a fresh copy of the submission and an empty state directory; sessions within a max-tier scenario share that directory. JSON comparison keeps array order and tells booleans apart from numbers. Floats use an absolute and relative tolerance of 1e-9; integers are compared exactly. Default limits are 10 seconds per session and 1 MiB of stdout. Details: evaluation protocol.
| Tier | Assertions |
|---|---|
| easy | 3,075 |
| intermediate | 5,415 |
| hard | 9,705 |
| max | 15,490 |
| total | 33,685 |
The tests cover:
- 65 hand-written golden outputs
- 24 generated inputs per family (seed 1729, shared across tiers)
- boundary cases and malformed requests
- failure atomicity, nested rollback and revision conflicts
- retry and restart sequences
All expected outputs are computed before grading, never inside the candidate's process.
Verifying the benchmark itself
python -m unittest discover -s tests -v # unit and property tests for the benchmark and runner
klein-bench build # regenerate data and manifest from source
klein-bench validate --output results/validation.json # every reference must pass, every empty project must fail
The reference implementations exist to maintain the evaluator. Export one for auditing with
klein-bench reference TASK_ID --output DIR. The published validation-summary.json documents the dataset
manifest and validation totals; it is not a model score.
Security
The runner is not a sandbox. It does the following:
- removes inherited credentials from the environment
- runs each submission from a temporary copy
- rejects symlinks
- limits time and output
- kills the whole process group when it's done
Generated code can still reach your filesystem and network. Run it under a separate unprivileged user, on a machine you can afford to lose. Timing depends on the host, so record your hardware with your results.
Provenance and limitations
- Origin: every task was written for this benchmark. None were copied from SWE-bench, LiveCodeBench or other benchmarks. That covers how the tasks were authored; it doesn't guarantee that standard algorithms in the easy tier never appear in a model's training data.
- Scope: Python only. The tests measure behavioral correctness, not code quality, architecture or UI. They don't cover concurrent writers, disk corruption or power loss during a write.
- Coverage: the reference implementations and independent golden checks make the dataset internally consistent, but the tests can't prove that no specification or expected output contains an error.
- License: MIT for prompts, test data and reference implementations.
Contributing
A new task needs:
- a contract (the specification)
- meaningful boundary tests
- an independent check of the expected outputs
- a reference implementation that passes
Changes to a contract or expected behavior require a new dataset version. Task IDs stay the same only for backward-compatible fixes.
- Downloads last month
- -