Datasets:
docs: disclose that the ast.unparse rewrite changes the compiled bytecode on 1 of 383 rows (src/00117.py, MBPP task_id 757) — co_code identical on all 383, set remains sound since reference and .pyc come from the same normalised string
1dabd6c verified | license: cc-by-4.0 | |
| task_categories: | |
| - text-generation | |
| language: | |
| - en | |
| tags: | |
| - decompilation | |
| - python | |
| - bytecode | |
| - code | |
| - mbpp | |
| size_categories: | |
| - n<1K | |
| configs: | |
| - config_name: default | |
| data_files: bench.jsonl | |
| # Data card — MBPP held-out decompilation benchmark | |
| 383 MBPP reference solutions compiled to Python 3.12 bytecode and paired with their source, with | |
| the original `task_id` restored on every row. Built 2026-08-04 by `tools/build_mbpp_ood.py`. | |
| **Redistributable** under CC-BY-4.0, provided `NOTICES.md` ships alongside. | |
| --- | |
| ## The set | |
| | | | | |
| |---|---| | |
| | Rows | **383** (400 candidates − 17 contaminated) | | |
| | Source | `google-research-datasets/mbpp`, config `full` | | |
| | Licence | **CC-BY-4.0** | | |
| | `task_id` restored | **383 / 383** (all distinct, range 11–973) | | |
| | Untraceable rows dropped | 0 | | |
| | **Contaminated rows dropped** | **17** (see below) | | |
| | Disassembly length | mean 47.5 lines, median 41, max 187 | | |
| | Python | 3.12, `optimize=0` | | |
| ### In what sense this set is independent of training — stated precisely, not as an adjective | |
| It is a **different corpus** (`google-research-datasets/mbpp`, not | |
| `codeparrot/github-code-clean`) and a **different kind of code**: short, self-contained, | |
| hand-written answers to stated problems, against the training trunk's real project code with its | |
| framework coupling and helper chains. Both differences are verifiable from row provenance. | |
| That matters because the pilot's failure mode was a model learning the *source of the data* | |
| rather than the task, and a test set drawn from the training source cannot detect it. | |
| It is **not** described as out-of-distribution anywhere, and no divergence statistic was computed, | |
| so no distributional-shift claim is made. The defensible claim is exactly three things: | |
| different source, different task style, and the verified non-overlap below. | |
| ### Contamination — the defect that cost 17 rows | |
| **This set was originally decontaminated against the wrong corpus.** `build_ood_mbpp.py` checked | |
| against the v1-era 10k training labels, but the shipping model (v3) trained on 48,196 rows. | |
| Re-checked against the corpus v3 actually trained on: | |
| | gate | result | | |
| |---|---| | |
| | exact canonical match vs v3 corpus | 0 / 400 | | |
| | **identifier-blind fingerprint vs v3 corpus** | **17 / 400 (4.25%)** | | |
| Those 17 are dropped. They are structural collisions rather than copied code — the fingerprint | |
| erases literals, so `re.sub(' +', ' ', t)` and `re.sub('[- ()]', '', s)` collide despite computing | |
| different things. The gate is applied anyway: it is the same gate `build_final.py` and the CSN | |
| builder apply, and arguing with it case by case is precisely how the earlier provenance defects | |
| happened. | |
| After rebuild: **0 / 383** contamination against the v3 corpus, by either gate. | |
| ## Task ids restored | |
| `build_ood_mbpp.py` wrote only `{input, expected}`, so no row could be traced to its task, prompt | |
| or tests. Recovery is exact rather than approximate: `expected == canonicalise(mbpp["code"])`, a | |
| deterministic transform, so rebuilding the map over all 974 MBPP rows (974 rows → 965 distinct | |
| canonical forms) recovers the id by lookup. All 400 rows matched; the builder refuses to emit a | |
| row it cannot trace. | |
| Each row now carries `provenance.task_id`, `mbpp_split`, the task `prompt`, and the `test_list`. | |
| The tests travel with the row, so a behavioural check is possible on this set without going back | |
| to the dataset. | |
| ## Decontamination | |
| Two stages. At original build time, against the 10k training labels of that era, by exact | |
| canonical match and by identifier-blind fingerprint (which caught 15 items exact match missed). | |
| At rebuild, against the **48,196-row corpus the shipping model actually trained on**, removing a | |
| further 17 rows as above. Rows not adjudicable by the differential-execution oracle were excluded | |
| at original build time, so every row here was labelled by running it. | |
| ## Changes made to the original, as CC-BY-4.0 §3(a)(1)(B) requires be indicated | |
| Each reference solution was rewritten through `ast.unparse` — normalising away formatting, | |
| comments and redundant parentheses — then compiled to a `.pyc` at `optimize=0` and paired with a | |
| disassembly of the resulting code object. Task text and tests are unmodified. | |
| **That rewrite changes the compiled bytecode on 1 of the 383 rows.** CPython 3.12 inlines | |
| comprehensions (PEP 709) and emits a cleanup entry in the exception table for the inlined scope; | |
| how the comprehension is *line-wrapped* changes that entry. In `src/00117.py` (MBPP `task_id` | |
| 757) the original solution wraps a nested comprehension across lines, so its bytecode differs | |
| from the normalised form shipped here. The instruction stream `co_code` is identical on all 383 | |
| rows; this row differs only in that exception-table entry. | |
| The row is a valid decompilation task and the benchmark remains sound: for all 383 rows the | |
| reference source and the `.pyc` are compiled from **the same** normalised string, which is the | |
| condition the oracle needs. What the row is not is byte-identical to upstream MBPP — hence this | |
| note. Re-deriving it from the original would put that solution's tab continuations and trailing | |
| whitespace into the reference and make the label an unstable target, so it is documented instead. | |
| Measured with `tools/measure_format_ceiling.py`; the general limit is in | |
| `../../EVAL.md` §6. | |
| ## Harness soundness on this set | |
| `grade.py --self-test-only`: pre-flight **383/383 = 100%**, mutation kill rate **199/199 = 100%**, | |
| 0 survivors. Note what pre-flight does and does not prove — see `../../ORACLE-LIMITS.md`. | |
| ## Read this before quoting any "OOD" figure | |
| The published PyBytecode figures labelled *OOD-MBPP* — 91.04% strict greedy, 97.49% certified@32, | |
| 100% docstring recovery — **were not measured on this set.** They were measured on | |
| the superseded held-out set (n=279), which despite its name contains no MBPP at all: it is | |
| GitHub source from the held-out shards of the training corpus. Matching all 974 canonicalised | |
| MBPP rows against it yields 0 hits, against 400/400 for this set. Evidence in | |
| `../../LICENSING-DETERMINATION.md` §4. | |
| Those numbers remain valid measurements of **held-out generalisation**. They are not | |
| out-of-distribution measurements, and the label should be corrected wherever it appears. | |
| **No scores have been measured on this benchmark.** Doing so requires a generation run (GPU). | |
| ## Limitations | |
| - MBPP solutions are short and stylistically uniform. Success here says little about long or | |
| framework-coupled functions; the CSN set is the harder distribution. | |
| - Rows are the first 400 adjudicable MBPP tasks in split order, minus the 17 contaminated ones. Not a random sample. | |
| - Two MBPP tasks with identical canonical solutions collapse to one row; 974 rows yield 965 | |
| distinct canonical forms, and the first `task_id` wins. | |
| ## Attribution | |
| MBPP (Mostly Basic Python Problems), Austin et al., 2021, Google Research. | |
| <https://huggingface.co/datasets/google-research-datasets/mbpp> — CC-BY-4.0 | |
| (<https://creativecommons.org/licenses/by/4.0/>). | |