Akirayasha commited on
Commit
fd9aabd
·
verified ·
1 Parent(s): 5ba73b9

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +36 -63
README.md CHANGED
@@ -1,82 +1,52 @@
1
  ---
2
  language:
3
- - en
4
  license: mit
5
  task_categories:
6
- - text2text-generation
7
  tags:
8
- - assembly
9
- - transpilation
10
- - x86-to-arm
11
- - security
12
- - compiler-bugs
13
- - CISB
 
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: x86 → ARM Assembly Transpilation Benchmark
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 is designed for evaluating
49
- **x86-64 → AArch64 assembly transpilation** models, with a particular focus on
50
- **security-preserving transpilation**.
51
 
52
  ## Dataset Structure
53
 
54
- Each record contains:
55
-
56
  | Column | Description |
57
  |--------|-------------|
58
- | `variant_name` | Base variant identifier (e.g., `b-4-var-0`) |
59
- | `bug_id` | Bug category ID (e.g., `b-4`, `l-30`) |
60
- | `flag` | `"safe"` or `"unsafe"` — whether the input x86 assembly is from the safe or unsafe variant |
61
- | `input_x86_assembly` | x86-64 assembly code (`code.s` from `.build_x86/`) |
62
- | `output_arm_assembly` | AArch64 assembly code — **always the safe version** from `.build_arm_linux/` |
63
- | `test_harness` | C test harness (`test.c`) used to verify correctness |
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
- - **Unique variants**: 36
79
- - **Unique bug categories**: 6
 
 
 
 
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 safe/unsafe inputs
97
- safe_inputs = ds.filter(lambda x: x["flag"] == "safe")
98
- unsafe_inputs = ds.filter(lambda x: x["flag"] == "unsafe")
99
 
100
- # Access a record
101
  record = ds[0]
102
- print(record["input_x86_assembly"]) # x86 input
103
- print(record["output_arm_assembly"]) # ARM ground truth (always safe)
104
- print(record["flag"]) # "safe" or "unsafe"
 
 
 
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