| --- |
| 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 } |
| } |
| ``` |
|
|