File size: 3,455 Bytes
0a90876
ece42b3
0a90876
 
 
 
 
 
 
 
 
 
 
 
 
f843c4c
0a90876
 
 
 
 
 
 
ece42b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8665cf3
 
 
 
 
 
 
ece42b3
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
license: gpl-2.0
task_categories:
- text-generation
language:
- en
- asm
tags:
- assembly
- linux-kernel
- compiler
- bfc-bic
- objdump
- decompilation
- bug-fix
- text2text-generation
pretty_name: Linux Kernel BFC/BIC Assembly→Explanation Pairs
size_categories:
- 100K<n<1M
---

# Linux Kernel Assembly → Explanation Dataset

A dataset of disassembled Linux kernel functions paired with structured natural-language explanations, built from the [Linux Commits Dataset (Zenodo 10654193)](https://zenodo.org/records/10654193).

Each row corresponds to a single compiled function extracted from a `.c` or `.h` file touched by a **Bug-Fix Commit (BFC)** or **Bug-Introducing Commit (BIC)** in the Linux kernel git history. Source files are compiled with `gcc -O2 -g -fno-inline -fno-omit-frame-pointer` and disassembled with `objdump -d -S` (AT&T syntax, source-interleaved).

Intended for training or evaluating models on **assembly code understanding**, specifically, generating natural language explanations from disassembled Linux kernel functions.

---

## Schema

| Column | Type | Description |
|---|---|---|
| `bfc_hash` | `string` | Hash of the bug-fix commit in the pair |
| `bic_hash` | `string` | Hash of the bug-introducing commit in the pair |
| `commit_hash` | `string` | The specific commit this function was extracted from |
| `commit_type` | `string` | `"bfc"` (bug-fix commit) or `"bic"` (bug-introducing commit) |
| `filename` | `string` | Source file path within the kernel tree (e.g. `kernel/sched/core.c`) |
| `func_name` | `string` | Name of the disassembled function |
| `asm` | `string` | `objdump -d -S` output for one function (AT&T syntax, source lines interleaved) |
| `explanation` | `string` | Structured description: commit type, function name, author, date, commit message, and role |
| `commit_message` | `string` | First 512 characters of the commit message |

---

## Usage

```python
from datasets import load_dataset

ds = load_dataset("theelderemo/linux-asm-pairs", split="train")
print(ds["asm"])
print(ds["explanation"])
```

Filter to only bug-fix commits:
```python
bfc_only = ds.filter(lambda x: x["commit_type"] == "bfc")
```

---

## Data Pipeline

1. BFC/BIC pairs sourced from `bfc_bic.csv` in [Zenodo record 10654193](https://zenodo.org/records/10654193)
2. Full diffs fetched from a local bare clone of the Linux kernel git repo (snapshot: 2023-11-12)
3. Changed `.c` / `.h` files compiled with `gcc -O2 -g -fno-inline -fno-omit-frame-pointer`
4. Functions extracted via `objdump -d -S --no-show-raw-insn`
5. Explanations constructed from Perceval-parsed commit metadata

---

## License

Source assembly is derived from the Linux kernel, which is licensed under **GPL-2.0**. This dataset inherits that license. See [kernel.org/doc/html/latest/process/license-rules.html](https://www.kernel.org/doc/html/latest/process/license-rules.html) for details.

---

## Citation

If you use this dataset, please also cite the upstream source:

```bibtex
@dataset{linux_commits_2023,
  title   = {Linux Commits Dataset},
  year    = {2023},
  url     = {https://zenodo.org/records/10654193}
}

@dataset{christopher_dickinson_2026,
	author       = { Christopher Dickinson },
	title        = { linux-asm-pairs (Revision 9ea25c3) },
	year         = 2026,
	url          = { https://huggingface.co/datasets/theelderemo/linux-asm-pairs },
	doi          = { 10.57967/hf/8453 },
	publisher    = { Hugging Face }
}
```