davish007 commited on
Commit
ecfc589
·
verified ·
1 Parent(s): 9e5de70

Update dataset card to match the HF-schema parquet release

Browse files
Files changed (1) hide show
  1. README.md +179 -30
README.md CHANGED
@@ -1,46 +1,195 @@
1
  ---
2
- license: cc-by-4.0
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  configs:
4
  - config_name: default
5
  data_files:
6
- - split: test_real
7
- path: "test_real-*.parquet"
8
- - split: test_synth
9
- path: "test_synth-*.parquet"
10
- - split: train_not_compilable
11
- path: "train_not_compilable-*.parquet"
12
  - split: train_real_compilable
13
- path: "train_real_compilable-*.parquet"
 
 
14
  - split: train_real_simple_io
15
- path: "train_real_simple_io-*.parquet"
16
- - split: train_synth_compilable
17
- path: "train_synth_compilable-*.parquet"
18
  - split: train_synth_rich_io
19
- path: "train_synth_rich_io-*.parquet"
20
- - split: train_synth_simple_io
21
- path: "train_synth_simple_io-*.parquet"
22
- - split: valid_real
23
- path: "valid_real-*.parquet"
24
  - split: valid_synth
25
- path: "valid_synth-*.parquet"
 
 
 
 
 
 
26
  ---
27
 
28
  # ExeBenchPlus
29
 
30
- | split | shards |
31
- |---|---|
32
- | test_real | 1 |
33
- | test_synth | 1 |
34
- | train_not_compilable | 57 |
35
- | train_real_compilable | 52 |
36
- | train_real_simple_io | 1 |
37
- | train_synth_compilable | 291 |
38
- | train_synth_rich_io | 9 |
39
- | train_synth_simple_io | 49 |
40
- | valid_real | 1 |
41
- | valid_synth | 1 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  ```python
44
  from datasets import load_dataset
45
- ds = load_dataset("davish007/ExeBenchPlus", split="test_real")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  ```
 
1
  ---
2
+ license: mit
3
+ pretty_name: ExeBenchPlus
4
+ language:
5
+ - code
6
+ task_categories:
7
+ - text-generation
8
+ tags:
9
+ - decompilation
10
+ - binary-analysis
11
+ - reverse-engineering
12
+ - assembly
13
+ - c
14
+ size_categories:
15
+ - 1M<n<10M
16
  configs:
17
  - config_name: default
18
  data_files:
19
+ - split: train_synth_compilable
20
+ path: train_synth_compilable-*.parquet
 
 
 
 
21
  - split: train_real_compilable
22
+ path: train_real_compilable-*.parquet
23
+ - split: train_synth_simple_io
24
+ path: train_synth_simple_io-*.parquet
25
  - split: train_real_simple_io
26
+ path: train_real_simple_io-*.parquet
 
 
27
  - split: train_synth_rich_io
28
+ path: train_synth_rich_io-*.parquet
29
+ - split: train_not_compilable
30
+ path: train_not_compilable-*.parquet
 
 
31
  - split: valid_synth
32
+ path: valid_synth-*.parquet
33
+ - split: valid_real
34
+ path: valid_real-*.parquet
35
+ - split: test_synth
36
+ path: test_synth-*.parquet
37
+ - split: test_real
38
+ path: test_real-*.parquet
39
  ---
40
 
41
  # ExeBenchPlus
42
 
43
+ ExeBenchPlus is an audited and extended version of
44
+ [ExeBench](https://huggingface.co/datasets/jordiae/exebench), a dataset of
45
+ executable C functions used to train and evaluate neural decompilers. Auditing
46
+ all 6.56M functions in ExeBench's ten splits turned up nine data-quality
47
+ problems. In three of them, the function's C code cannot be recovered from its
48
+ assembly alone:
49
+
50
+ - P1, parameter order: x86-64, ARM32 and ARM64 pass integer/pointer and
51
+ floating-point parameters in separate registers, so the callee's assembly
52
+ does not show how mixed parameters are ordered.
53
+ - P2, unused parameters: from `-O1` up, an unused parameter leaves no trace in
54
+ the callee's assembly.
55
+ - P3, data sections: constants live in `.rodata`, `.data` or `.bss`, and the
56
+ function's code only refers to them by address.
57
+
58
+ ExeBenchPlus keeps the 16 columns that `load_dataset("jordiae/exebench")`
59
+ returns, with the same names, types and values, and adds 16: the assembly
60
+ of a call to the function (`func_call`, P1), wrappers that test a
61
+ reduced-arity decompilation (`opt_*_exe_wrapper`, P2), data-section contents
62
+ (`data_section`, P3), disassembly of the linked binary on four architectures
63
+ at five optimization levels (`objdump_asm`), and five warning flags.
64
+ Problematic records are flagged rather than removed, so ExeBenchPlus works as a
65
+ drop-in replacement for ExeBench: code written against `jordiae/exebench`
66
+ runs unchanged, and users choose what to filter.
67
+
68
+ ## Splits
69
+
70
+ | Split | Rows |
71
+ |---|---:|
72
+ | `train_synth_compilable` | 4,159,373 |
73
+ | `train_real_compilable` | 885,074 |
74
+ | `train_not_compilable` | 715,700 |
75
+ | `train_synth_simple_io` | 640,116 |
76
+ | `train_synth_rich_io` | 107,250 |
77
+ | `train_real_simple_io` | 42,769 |
78
+ | `valid_synth` | 5,000 |
79
+ | `valid_real` | 2,133 |
80
+ | `test_synth` | 5,000 |
81
+ | `test_real` | 2,134 |
82
+ | **Total** | **6,564,549** |
83
+
84
+ The splits and their rows are ExeBench's own; ExeBenchPlus only adds columns.
85
+
86
+ ## Loading
87
 
88
  ```python
89
  from datasets import load_dataset
90
+
91
+ # Pass data_files so only that split's shards are downloaded
92
+ # (split= alone downloads every split before selecting one).
93
+ test = load_dataset("davish007/ExeBenchPlus", data_files="test_real-*.parquet", split="train")
94
+ # The training splits are large - stream them rather than downloading:
95
+ train = load_dataset("davish007/ExeBenchPlus", split="train_real_compilable", streaming=True)
96
+ ```
97
+
98
+ All columns are typed Arrow columns; no decoding is needed for the
99
+ ExeBenchPlus fields:
100
+
101
+ ```python
102
+ row = test[0]
103
+ row["objdump_asm"]["x86-64"]["O2"] # disassembly of the function, x86-64, -O2
104
+ row["data_section"]["ARM64"]["O2"] # data the function reads, ARM64, -O2
105
+ row["func_call"]["ARM32"]["O3"] # call site of the function, ARM32, -O3
106
+ ```
107
+
108
+ As in ExeBench, `real_iospec` / `synth_iospec` and each I/O-pair `value` are
109
+ JSON strings (`json.loads` them).
110
+
111
+ The warning flags are plain booleans. For example, the rows with none of the four
112
+ data-quality flags set (63.85% of the corpus):
113
+
114
+ ```python
115
+ clean = test.filter(lambda r: not (r["dummy_udt"] or r["truncated_funcs"]
116
+ or r["no_return"] or r["trivial_function"]))
117
+ ```
118
+
119
+ ## Fields
120
+
121
+ Architectures are `x86`, `x86-64`, `ARM32`, `ARM64`; optimization levels are
122
+ `O0`, `O1`, `O2`, `O3`, `Os`. Per-architecture fields are structs
123
+ `{arch: {level: str}}` with all 20 entries present; an entry is `null`
124
+ when it does not apply or could not be produced, and the companion `*_errors`
125
+ field explains why. `func_call` and `func_call_errors` are `null` as a whole
126
+ when no call site was generated (see `func_call_skip_reason`).
127
+
128
+ ### Added by ExeBenchPlus (16)
129
+
130
+ | Field | Type | Description |
131
+ |---|---|---|
132
+ | `objdump_asm` | `{arch: {level: str}}` | objdump disassembly of the function from the linked binary (`static`/`inline` stripped before compiling, so optimized builds are not empty). |
133
+ | `objdump_asm_errors` | `{arch: {level: str}}` | Why an `objdump_asm` entry is empty; `null` = no error. |
134
+ | `func_call` | `{arch: {level: str}}` | Assembly of the call site in a driver `main` that calls the function (renamed `func0`) with arguments derived from `argc`/`argv`, so the compiler cannot fold them away. Shows how each argument is passed (P1). |
135
+ | `func_call_errors` | `{arch: {level: str}}` | Why a `func_call` entry is empty; `null` = no error. |
136
+ | `func_call_skip_reason` | str \| null | Why no call site was generated: e.g. `unsupported_param_type:<category>` (struct/union by value, SIMD, `_Complex`), `fname_is_main`, `all_architectures_failed`. `null` = attempted. |
137
+ | `data_section` | `{arch: {level: str}}` | Contents of the data sections (`.rodata`, `.data`, `.bss`, …) the function references, from the same binary as `objdump_asm` (P3). Empty when the function reads no such data. |
138
+ | `data_section_errors` | `{arch: {level: str}}` | Why a `data_section` entry could not be produced; `null` = no error. |
139
+ | `unused_param` | bool | The function has a parameter it never uses, which optimized assembly drops (P2). |
140
+ | `opt_real_exe_wrapper` | str \| null | `real_exe_wrapper` rewritten to call the function without its unused parameters, so a reduced-arity decompilation can be executed and tested. Set when `unused_param` is true. |
141
+ | `opt_real_exe_wrapper_error` | str \| null | Why the wrapper could not be adapted. |
142
+ | `opt_angha_exe_wrapper` | str \| null | Same, for `synth_exe_wrapper` (synthetic I/O). |
143
+ | `opt_angha_exe_wrapper_error` | str \| null | Why the wrapper could not be adapted. |
144
+ | `no_return` | bool | Non-`void` return type, but no `return` statement. |
145
+ | `dummy_udt` | bool | A dependency replaces a real user-defined type with a `{int dummy;}` placeholder. |
146
+ | `trivial_function` | bool | Trivial body: empty, a bare `return`, or at most two non-blank lines. |
147
+ | `truncated_funcs` | bool | `func_def` is truncated upstream: its return type (or part of its name) is missing although `func_head` has it. K&R implicit-`int` definitions are not flagged. |
148
+
149
+ ### ExeBench fields (16, unchanged)
150
+
151
+ These are the columns of `load_dataset("jordiae/exebench")`, in the same order
152
+ and with the same types.
153
+
154
+ | Field | Type | Description |
155
+ |---|---|---|
156
+ | `path` | str | `owner/repo/path/to/file.c` of the function's GitHub source. |
157
+ | `func_def` | str | C definition of the function. |
158
+ | `func_head` | str | Function header as extracted from the source. |
159
+ | `func_head_types` | str | Function header with each parameter's type and name. |
160
+ | `fname` | str | Function name. |
161
+ | `signature` | list[str] | Return type, then the parameter types. |
162
+ | `asm` | list[{`target`, `code`}] | Compiler-generated assembly of the function per target (`{real\|angha}_gcc_{x86\|arm}_{O0\|O3\|Os}`). |
163
+ | `synth_deps` / `real_deps` | str | Dependencies (types, globals, prototypes): synthesized (AnghaBench-style) / from the original repository. |
164
+ | `synth_io_pairs` / `real_io_pairs` | list[{`input`, `output`, `dummy_funcs`, `dummy_funcs_seed`}] | Input/output examples; `input` and `output` are lists of {`var`, `value`} with `value` JSON-encoded. |
165
+ | `synth_exe_wrapper` / `real_exe_wrapper` | str \| null | C++ harness that runs the function on I/O examples. |
166
+ | `ref` | str | Git ref (branch) of that repository, e.g. `master`. |
167
+ | `synth_iospec` / `real_iospec` | str (JSON) | I/O specification used to build the harness. |
168
+
169
+ `real_*` fields use the dependencies from the original repository; `synth_*`
170
+ fields use synthesized ones. (`opt_angha_exe_wrapper*` keeps the raw ExeBench
171
+ `angha` prefix but pairs with `synth_exe_wrapper`.)
172
+
173
+ ## Licensing
174
+
175
+ ExeBenchPlus follows ExeBench's licensing. All C functions keep the original
176
+ license of their GitHub repository (identified by `path` and `ref`). The fields
177
+ ExeBenchPlus adds are released under the MIT license, as are ExeBench's own
178
+ contributions. The code that produces them is released under Apache-2.0.
179
+
180
+ ## Citation
181
+
182
+ ExeBenchPlus is under anonymous review; its citation will be added here.
183
+ Please also cite ExeBench:
184
+
185
+ ```bibtex
186
+ @inproceedings{armengol2022exebench,
187
+ title = {ExeBench: an ML-scale dataset of executable C functions},
188
+ author = {Armengol-Estap{\'e}, Jordi and Woodruff, Jackson and Brauckmann, Alexander and
189
+ de Souza Magalh{\~a}es, Jos{\'e} Wesley and O'Boyle, Michael F. P.},
190
+ booktitle = {Proceedings of the 6th ACM SIGPLAN International Symposium on Machine Programming},
191
+ pages = {50--59},
192
+ year = {2022},
193
+ doi = {10.1145/3520312.3534867}
194
+ }
195
  ```