Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,82 +1,52 @@
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
-
- en
|
| 4 |
license: mit
|
| 5 |
task_categories:
|
| 6 |
-
-
|
| 7 |
tags:
|
| 8 |
-
- assembly
|
| 9 |
-
- transpilation
|
| 10 |
-
- x86-to-arm
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
-
|
|
|
|
| 14 |
size_categories:
|
| 15 |
-
- n<1K
|
| 16 |
-
dataset_info:
|
| 17 |
-
features:
|
| 18 |
-
- name: task_name
|
| 19 |
-
dtype: string
|
| 20 |
-
- name: flag
|
| 21 |
-
dtype: string
|
| 22 |
-
- name: source_code
|
| 23 |
-
dtype: string
|
| 24 |
-
- name: x86_64
|
| 25 |
-
dtype: string
|
| 26 |
-
- name: aarch64_linux
|
| 27 |
-
dtype: string
|
| 28 |
-
- name: test_harness
|
| 29 |
-
dtype: string
|
| 30 |
-
splits:
|
| 31 |
-
- name: test
|
| 32 |
-
num_bytes: 509607
|
| 33 |
-
num_examples: 72
|
| 34 |
-
download_size: 77385
|
| 35 |
-
dataset_size: 509607
|
| 36 |
-
configs:
|
| 37 |
-
- config_name: default
|
| 38 |
-
data_files:
|
| 39 |
-
- split: test
|
| 40 |
-
path: data/test-*
|
| 41 |
---
|
| 42 |
|
| 43 |
-
# CISB-Bench LLVM-O2:
|
| 44 |
|
| 45 |
## Overview
|
| 46 |
|
| 47 |
This dataset is derived from the **Compiler-Introduced Security Bugs (CISB)** benchmark,
|
| 48 |
-
compiled with LLVM/Clang-17 at **-O2** optimization level. It
|
| 49 |
-
**x86-64
|
| 50 |
-
|
| 51 |
|
| 52 |
## Dataset Structure
|
| 53 |
|
| 54 |
-
Each record contains:
|
| 55 |
-
|
| 56 |
| Column | Description |
|
| 57 |
|--------|-------------|
|
| 58 |
-
| `
|
| 59 |
-
| `
|
| 60 |
-
| `
|
| 61 |
-
| `
|
| 62 |
-
| `
|
| 63 |
-
| `test_harness` | C test harness (`test.c`)
|
| 64 |
-
|
| 65 |
-
## Key Design Decisions
|
| 66 |
-
|
| 67 |
-
- **Input**: 72 x86 assembly files (36 safe + 36 unsafe variants)
|
| 68 |
-
- **Output/Ground truth**: Always the **safe** ARM assembly version
|
| 69 |
-
- **Flag**: Indicates whether the input is from the safe or unsafe variant
|
| 70 |
-
- For **safe** inputs: the task is straightforward CISC→RISC transpilation
|
| 71 |
-
- For **unsafe** inputs: the task requires the model to transpile AND repair the security bug
|
| 72 |
|
| 73 |
## Statistics
|
| 74 |
|
| 75 |
- **Total records**: 72
|
| 76 |
- **Safe records**: 36
|
| 77 |
- **Unsafe records**: 36
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
## Security Oracle
|
| 82 |
|
|
@@ -93,15 +63,18 @@ from datasets import load_dataset
|
|
| 93 |
|
| 94 |
ds = load_dataset("Akirayasha/cisb-bench-llvm-O2", split="test")
|
| 95 |
|
| 96 |
-
# Filter
|
| 97 |
-
|
| 98 |
-
|
| 99 |
|
| 100 |
-
#
|
| 101 |
record = ds[0]
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
| 105 |
```
|
| 106 |
|
| 107 |
## Citation
|
|
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
+
- en
|
| 4 |
license: mit
|
| 5 |
task_categories:
|
| 6 |
+
- text-generation
|
| 7 |
tags:
|
| 8 |
+
- assembly
|
| 9 |
+
- transpilation
|
| 10 |
+
- x86-to-arm
|
| 11 |
+
- arm-to-x86
|
| 12 |
+
- security
|
| 13 |
+
- compiler-bugs
|
| 14 |
+
- CISB
|
| 15 |
size_categories:
|
| 16 |
+
- n<1K
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# CISB-Bench LLVM-O2: Assembly Transpilation Benchmark
|
| 20 |
|
| 21 |
## Overview
|
| 22 |
|
| 23 |
This dataset is derived from the **Compiler-Introduced Security Bugs (CISB)** benchmark,
|
| 24 |
+
compiled with LLVM/Clang-17 at **-O2** optimization level. It supports **bidirectional
|
| 25 |
+
assembly transpilation** (x86-64 ↔ AArch64) and is designed for evaluating transpilation
|
| 26 |
+
models on security-critical code.
|
| 27 |
|
| 28 |
## Dataset Structure
|
| 29 |
|
|
|
|
|
|
|
| 30 |
| Column | Description |
|
| 31 |
|--------|-------------|
|
| 32 |
+
| `task_name` | Full task identifier including flag (e.g., `b-4-var-0-safe`, `b-4-var-0-unsafe`) |
|
| 33 |
+
| `flag` | `"safe"` or `"unsafe"` — whether the assembly preserves the security check |
|
| 34 |
+
| `source_code` | Original C source from `cisb-bench/<variant>/code.c` (shared by safe/unsafe pairs) |
|
| 35 |
+
| `x86_64` | x86-64 assembly (`code.s` from `.build_x86/`) |
|
| 36 |
+
| `aarch64_linux` | AArch64 assembly (`code.s` from `.build_arm_linux/`) |
|
| 37 |
+
| `test_harness` | C test harness (`test.c`) for correctness verification |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Statistics
|
| 40 |
|
| 41 |
- **Total records**: 72
|
| 42 |
- **Safe records**: 36
|
| 43 |
- **Unsafe records**: 36
|
| 44 |
+
|
| 45 |
+
## Transpilation Directions
|
| 46 |
+
|
| 47 |
+
This dataset supports both directions:
|
| 48 |
+
- **x86 → ARM**: Use `x86_64` as input, `aarch64_linux` as target
|
| 49 |
+
- **ARM → x86**: Use `aarch64_linux` as input, `x86_64` as target
|
| 50 |
|
| 51 |
## Security Oracle
|
| 52 |
|
|
|
|
| 63 |
|
| 64 |
ds = load_dataset("Akirayasha/cisb-bench-llvm-O2", split="test")
|
| 65 |
|
| 66 |
+
# Filter by flag
|
| 67 |
+
safe = ds.filter(lambda x: x["flag"] == "safe")
|
| 68 |
+
unsafe = ds.filter(lambda x: x["flag"] == "unsafe")
|
| 69 |
|
| 70 |
+
# x86 -> ARM transpilation
|
| 71 |
record = ds[0]
|
| 72 |
+
x86_input = record["x86_64"]
|
| 73 |
+
arm_target = record["aarch64_linux"]
|
| 74 |
+
|
| 75 |
+
# ARM -> x86 transpilation
|
| 76 |
+
arm_input = record["aarch64_linux"]
|
| 77 |
+
x86_target = record["x86_64"]
|
| 78 |
```
|
| 79 |
|
| 80 |
## Citation
|