File size: 9,970 Bytes
0d6f0c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
---
license: other
license_name: mixed-permissive
license_link: https://huggingface.co/datasets/changliu8541/assemblage-rust/blob/main/LICENSES.csv
pretty_name: Assemblage-Rust
language:
  - en
tags:
  - binary-analysis
  - reverse-engineering
  - rust
  - compilers
  - debug-information
  - decompilation
size_categories:
  - 10K<n<100K
configs:
  - config_name: index_members
    data_files: index_members.parquet
  - config_name: commits
    data_files: provenance/commits.parquet
  - config_name: line_labels
    data_files: provenance/line_labels.parquet
  - config_name: binaries
    data_files: provenance/binaries.parquet
  - config_name: functions
    data_files: provenance/functions.parquet
---

# Assemblage-Rust

Consider using your coding agent to test, download and process the data, repository size
is 1.5T and it is highly likely you only want a portion of it, but do remember to
check the agent outputs.

Produced by [Assemblage](https://arxiv.org/abs/2405.03991), a distributed
binary-corpus generator, a cite would be greatly appreciated!

Teh dataset contains**127,165 compiled Rust binaries** from **77,004 builds** 
of **10,766 permissively
licensed GitHub repositories**, each paired with DWARF-derived function and line
metadata, the source tree it was compiled from, and for a subset of it comes with
compiler IRs.

**Unprocessed.** Raw build outputs, filtered only by license, not cleaned,
deduplicated or processed into normal Assemblage database+binary format.

## Layout

One uncompressed tar per repository (~150 MB average). Everything inside is
already compressed — `zstd` for binaries and metadata, `gzip` for IR — so the tar
is pure container and you can stream one repository without fetching the rest.

```
repos/{owner}__{project}.tar        builds: binaries, metadata, IR
repos2/{owner}__{project}.tar       ... overflow, see note below
sources/{owner}__{project}.tar.gz   the source tree each was built from
sources2/{owner}__{project}.tar.gz  ... overflow
sources/manifest.json               source file -> repo URL, commit, license, tar
index.jsonl        one line per build: dir, tar, repo_url, commit, license, sizes
LICENSES.csv       build directory -> repo URL, commit, license
index_members.parquet  byte offset of every file inside every tar
provenance/        experimental: LLM authorship labels, see below
```

> **Why `repos2/`** The Hub caps a directory at 10,000 files and this
> corpus has 10,766 repositories, so the remainder lives in `repos2/` /
> `sources2/`. Treat each pair as **one logical namespace**. The `tar` field in
> `index.jsonl` and the `file`/`tar` fields in `sources/manifest.json` are always
> the authoritative paths — resolve through those rather than assuming `repos/`.

`repos*/X.tar` pairs with `sources*/X.tar.gz` — same slug, so a repository's two
archives share a filename even when they sit in different directories.
Each tar expands to one directory per build:

```
{owner}_{project}_{sha12}-{flag}-{backend}-{mode}/
├── binaries/<name>.zst                ELF binaries, zstd -12
├── metadata/assemblage_meta.json.zst  DWARF functions, RVAs, line mappings
├── ir/<stage>.tar.gz                  LLVM-IR / MIR / HIR / THIR / ASM (subset)
└── export.json                        provenance, license, byte counts
```

Build mode is in the directory name because `Debug`, `RelWithDebInfo` and
`Release` of the same commit are distinct binaries.

`sources/` ships the builder's own `git clone --recursive` snapshot, captured
**before** the build ran — no `target/`, and `.git` included, so history and the
exact tree hash are recoverable. Source correspondence is a property of the
release, not of an upstream that may be deleted or force-pushed later.

## Quickstart

Always pass a token (`huggingface-cli login`, or `HF_TOKEN`): unauthenticated
requests get a lower rate limit, and it is the most common cause of throttling.

```bash
# resolve a repository's paths from index.jsonl (they may be in repos/ or repos2/)
jq -r 'select(.repo_url=="https://github.com/tokio-rs/tokio") | .tar' index.jsonl | head -1
# -> repos/tokio-rs__tokio.tar

# one repository's builds + its source tree
huggingface-cli download changliu8541/assemblage-rust \
    repos/tokio-rs__tokio.tar sources/tokio-rs__tokio.tar.gz \
    --repo-type dataset --local-dir .
tar xf repos/tokio-rs__tokio.tar
mkdir -p src && tar xzf sources/tokio-rs__tokio.tar.gz -C src

zstd -d */binaries/mytool.zst -o mytool
zstd -dc */metadata/assemblage_meta.json.zst | jq .

# find builds without downloading anything
jq -r 'select(.license=="MIT License" and .has_ir) | .tar' index.jsonl | sort -u
```

## Build matrix

| dimension | values |
|---|---|
| codegen backend | `llvm` (50,765) · `gcc` (16,064) · `cranelift` (10,175) |
| build mode | `RelWithDebInfo` (43,862) · `Release` (25,716) · `Debug` (7,426) |
| optimization | `O2` (20,143) · `O0` (14,825) · `Os` (12,474) · `O3` (11,512) · `Oz` (9,677) · `O1` (8,373) |

Toolchain: `nightly-2026-06-15`, symbol mangling `v0`, `x86_64-unknown-linux-gnu`.
**17,174 builds carry IR dumps** (`llvm-ir`, `mir`, `hir`, `thir`, `asm`), emitted
only for the LLVM `RelWithDebInfo` tiers and scoped to repository crates.

`assemblage_meta.json` records, per binary, every function recovered from DWARF:
`function_name` (mangled), `demangled_name`, `source_file`, `function_info`
(RVA ranges), `lines` (line -> RVA), and `origin` ∈ `in_repo | dependency |
stdlib | other`.

## Known limitations

Please read these — they are properties of the data, not bugs to work around.

1. **~26% of builds with binaries have empty or partial function metadata.** DWARF
   extraction runs under a wall-clock budget; over budget, the binary still ships
   but its `Binary_info_list` entry is dropped. Check its length first.
2. **Lib-only crates produce metadata but no binaries** — 17,891 builds (23%) are
   metadata-only.
3. **`Release` binaries carry little repository DWARF by design.** Repo symbols
   survive in `.symtab`; most DWARF present belongs to the precompiled stdlib.
   Filter on `origin`.
4. **The `gcc` (cg_gcc) backend is a name/address corpus.** Mangling and symbol
   tables are sound, but repo-level `source_file` and line info is largely absent
   and stdlib paths are recorded relative.
5. IR builds were compiled with `--emit`
6. Binaries over 1 GiB uncompressed are excluded

## LLM authorship provenance (experimental)

**Experimental update, October 20th, 2026.** The labels are inferred from commit
metadata, and the method, the labels and the file layout may still change. No
existing data file changed: the update only adds `provenance/` and
`index_members.parquet`.

`provenance/` records which code in each build a coding agent (Claude Code,
Copilot, Cursor, Codex, ...) wrote, at the level of source lines, source
functions, binary functions, binaries and IR functions. The approach:

1. **Commits.** Each repository's history (the `.git` shipped in `sources/`) is
   searched for agent traces. Co-author trailers, bot authors and the tools'
   commit footers are strong traces (`agent:<tool>`); merges of agent branches and
   co-author lines from code review bots are weak ones (`agent?:<tool>`).
2. **Lines.** Each line at the built commit takes the label of the commit that
   last touched it (`git blame -w -M`). A line without a trace is "unattributed",
   which does not mean a person wrote it: several tools never sign their commits.
3. **Binaries.** The line labels are carried into each binary byte by byte through
   its DWARF line table, or by symbol name when the binary has no repository DWARF
   (mostly Release builds), and into the IR dumps.

The labels take ~0.55 GB. `provenance/full/` (~9.8 GB, optional) adds exact
address ranges, line-table rows, source text and IR labels. Tables, joins and
caveats are in `provenance/README.md`.

```bash
huggingface-cli download changliu8541/assemblage-rust --repo-type dataset \
    --include "provenance/*.parquet" --exclude "provenance/full/*" --local-dir .
```

`index_members.parquet` gives the byte offset of every file inside every tar, so a
single binary can be fetched with one HTTP range request instead of the whole tar.
The offsets hold for the tar whose sha256 is in `tar_sha256`.

## Licensing and attribution

Every repository carries an OSI-recognized permissive license, verified by
database join against the scraper's license records. Copyleft
(GPL/AGPL/LGPL/MPL/EPL/EUPL) and unidentified-license repositories are
**excluded**.

| license | builds |
|---|---|
| MIT | 55,324 |
| Apache-2.0 | 18,548 |
| Unlicense | 926 |
| BSD-3-Clause | 902 |
| BSD-2-Clause | 348 |
| CC0-1.0 | 302 |
| ISC | 190 |
| 0BSD | 186 |
| WTFPL | 133 |
| Blue Oak 1.0.0 | 62 |
| BSL-1.0 | 45 |
| MIT-0 | 28 |
| Zlib | 6 |
| Artistic-2.0 | 4 |

`LICENSES.csv` maps every build directory to its upstream URL, commit and license;
the same fields appear in each `export.json` and in `sources/manifest.json`. MIT,
BSD and Apache-2.0 require that copyright and license notices accompany
redistribution — because `sources/` ships each tree verbatim, those notices travel
**with** the data rather than only being pointed at. Shipped trees include `.git`,
so they also carry commit history and its author names and emails, as published by
those repositories on GitHub.

If you are an author of an included repository and want it removed, open a
discussion on this dataset and it will be taken out.

## Changlog

- Aug 25th, 2027 Full dataset upload, 127k binaries.
- Aug 27th, 2027 If you are using the dataset version between Aug 25, 2026 to Aug 26th, 2026, the citation bib entry is **wrong**, **hallucinated** by my agent uploading the new dataset (Claude Opus 5), we sincerely apologize for this mistake.
- Oct 20th, 2026 Experimental update: added `provenance/` (LLM authorship labels) and `index_members.parquet` (tar member offsets). No existing data file changed.