File size: 10,500 Bytes
5a67d67
 
 
 
 
 
 
 
05fb4fc
 
 
 
 
 
5a67d67
b9c2fa3
 
 
 
 
 
 
 
 
ac769c2
b9c2fa3
 
 
 
 
 
 
 
 
 
 
 
 
ac769c2
b9c2fa3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a67d67
 
 
b9c2fa3
 
 
 
5a67d67
b9c2fa3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a67d67
b9c2fa3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a67d67
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
---
license: mit
language:
- en
tags:
- Benchmark
- Inserloft
pretty_name: Rockman

configs:
- config_name: benchmark
  data_files:
  - split: rockman
    path: benchmark.csv
---
# Rockman Benchmark v0.2

> **A comprehensive, contamination-resistant benchmark for evaluating LLMs on code generation, debugging, optimization, and software engineering tasks.**

[![Benchmark Version](https://img.shields.io/badge/version-v0.2-blue)](https://github.com/InserLoft/Rockman)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Hugging Face Dataset](https://img.shields.io/badge/πŸ€—%20Hugging%20Face-Rockman-yellow)](https://huggingface.co/datasets/Inserloft/Rockman)
[![Python](https://img.shields.io/badge/python-3.8+-blue)](https://python.org)

---

## 🎯 Overview

Rockman is a **production-ready benchmark** designed to rigorously evaluate Large Language Models on realistic software engineering tasks. Unlike simple code generation benchmarks, Rockman covers the full spectrum of developer workflows:

| Task Type | Description | Examples |
|-----------|-------------|----------|
| **Generation** | Implement function from signature + docstring | "Implement Dijkstra's algorithm" |
| **Debugging** | Fix bugs in provided code | Off-by-one, edge cases, infinite loops |
| **Optimization** | Meet specific complexity targets | O(n log n), O(1) space |
| **Stateful** | Classes with persistent state | LRU cache, banking ledger, event processor |
| **Multi-step** | Parse β†’ Build β†’ Solve pipelines | Parse graph β†’ build adjacency β†’ find path |

---

## πŸ“Š Benchmark Composition (v0.2)

| Split | Tasks | Hidden Tests | Purpose |
|-------|-------|--------------|---------|
| **Public** | 154 | ❌ | Development, debugging |
| **Private** | 44 | βœ… (encrypted) | Official evaluation |
| **Hidden** | 22 | βœ… (never published) | Final leaderboard integrity |

| Category | Tasks | Difficulty Range |
|----------|-------|------------------|
| Fundamentals | 60 | 1–3 |
| Data Structures | 50 | 2–4 |
| Algorithms | 50 | 2–5 |
| Graphs | 60 | 3–6 |
| Trees | 40 | 3–5 |
| Math | 40 | 2–5 |
| **Debugging** | 50 | 2–4 |
| **Complexity** | 30 | 3–5 |
| **Software Engineering** | 40 | 3–5 |
| **Stateful Systems** | 30 | 4–6 |
| **Multi-step** | 30 | 4–6 |
| **Total** | **520** | **1–7** |

**Difficulty Levels:** 1=Introductory β†’ 7=Research

---

## πŸ” Contamination Prevention

Rockman implements **six layers** of contamination protection:

| Layer | Mechanism |
|-------|-----------|
| **1. Canary Strings** | Unique `ROCKMAN_CANARY_<hash>` per task |
| **2. Content Hashing** | SHA256 of prompt + tests for integrity |
| **3. Split Isolation** | Public/Private/Hidden with zero overlap |
| **4. Encrypted Hidden Tests** | AES-256-GCM, keys held by evaluator only |
| **5. Source Attribution** | `source_type`, `source_url`, `derived_from` metadata |
| **6. Temporal Controls** | Creation/publication dates, embargo periods |

**Verification:** Run `rockman verify --dataset rockman_v0.2.jsonl` to audit integrity.

---

## πŸš€ Quick Start

### Installation

```bash
git clone https://github.com/InserLoft/Rockman
cd Rockman
pip install -e .
pip install matplotlib  # for PNG reports
```

### Run Baseline Evaluation

```bash
# Phase 1: Reference baselines (always works offline)
python phase1_evaluate_baselines.py

# Phase 2: Model evaluation via OpenRouter
python phase2_evaluate_openrouter.py
```

### Programmatic Usage

```python
from rockman import (
    Evaluator, Problem, load_problems_from_jsonl,
    RockmanResultsReporter, generate_benchmark_dataset
)

# Load dataset
problems = load_problems_from_jsonl("rockman_v0.2_private.jsonl")

# Evaluate model
evaluator = Evaluator(benchmark_version="v0.2")
completions = {p.task_id: [your_model(p.prompt)] for p in problems}
results = evaluator.evaluate_dataset(problems, completions, k=1)

# Generate reports
reporter = RockmanResultsReporter("results")
reporter.generate_full_report(leaderboard, detailed_results)
```

---

## πŸ“ˆ Evaluation Protocol

| Parameter | Value | Description |
|-----------|-------|-------------|
| **Temperature** | 0.0 | Deterministic generation |
| **Top-p** | 1.0 | No nucleus sampling |
| **Max Tokens** | 4096 | Sufficient for complex tasks |
| **k (Pass@k)** | 1 | Single sample per task |
| **Timeout** | 2.0s | Per-task execution limit |
| **Memory** | 256 MB | Per-task memory limit |
| **Sandbox** | Containerized | Docker (or local fallback) |

### Required Metadata per Evaluation

```json
{
  "model_name": "user/model",
  "model_version": "model-version",
  "provider": "provider",
  "temperature": 0.0,
  "top_p": 1.0,
  "max_tokens": 4096,
  "k": 1,
  "hardware": "example-cloud",
  "date": "2024-09-20T01:48:31Z",
  "evaluator_version": "0.2.0",
  "benchmark_version": "v0.2"
}
```

### API Error Handling

**Critical:** Network/API errors are **not** counted as code failures.

| Error Type | Recorded As | Counted as Failure |
|------------|-------------|-------------------|
| Code assertion failure | `FAIL` | βœ… Yes |
| Runtime error | `FAIL` | βœ… Yes |
| Timeout | `TIMEOUT` | βœ… Yes |
| **API 429 (rate limit)** | `RATE_LIMITED` | ❌ No |
| **API 402/400 (payment)** | `API_ERROR` | ❌ No |
| **API 404/500** | `API_ERROR` | ❌ No |

---

## πŸ“Š Official Reports

Every evaluation automatically generates:

| Format | Description |
|--------|-------------|
| **`results/*.csv`** | Complete breakdown: overall, difficulty, category, task type, language, per-problem |
| **`results/*.png`** | Professional charts (black bg, white primary): leaderboard, difficulty bars, category bars, task type donut |

### Sample Leaderboard Output

```
ROCKMAN BENCHMARK v0.2
Private Evaluation β€” 44 Tasks

Model                    Pass@1    Solved
------------------------------------------------
Template                 13.64%     6/44
Heuristic                 0.00%     0/44
Random                    0.00%     0/44
```

---

## πŸ—οΈ Architecture

```
rockman/
β”œβ”€β”€ benchmark/           # Core evaluation engine
β”‚   β”œβ”€β”€ schema.py        # Problem, Score, Result dataclasses
β”‚   β”œβ”€β”€ evaluator.py     # Unified evaluator (all task types)
β”‚   β”œβ”€β”€ metrics.py       # Pass@k, Wilson CI, statistical tests
β”‚   β”œβ”€β”€ runners/         # Language runners (Py, C++, Java, JS, TS, Rust, Go)
β”‚   β”œβ”€β”€ sandbox.py       # Docker sandbox + local fallback
β”‚   β”œβ”€β”€ encryption.py    # AES-256-GCM hidden test encryption
β”‚   β”œβ”€β”€ versioning.py    # Immutable version registry
β”‚   └── determinism.py   # Reproducibility tracking
β”œβ”€β”€ dataset/             # Dataset generation & management
β”‚   β”œβ”€β”€ generator.py     # Template-based task generation
β”‚   β”œβ”€β”€ categories.py    # 12 categories, 50+ subcategories
β”‚   β”œβ”€β”€ validators.py    # 13 validation checks (incl. negative testing)
β”‚   └── splits.py        # Public/Private/Hidden splits + canaries
β”œβ”€β”€ tasks/               # Specialized task types
β”‚   β”œβ”€β”€ debugging.py     # Bug injection (8 bug types)
β”‚   β”œβ”€β”€ complexity.py    # Performance test generation
β”‚   β”œβ”€β”€ stateful.py      # LRU, banking, event processor, etc.
β”‚   └── multi_step.py    # Parseβ†’Buildβ†’Solve pipelines
β”œβ”€β”€ baselines/           # Reference baselines
β”‚   β”œβ”€β”€ calibration.py   # Difficulty calibration
β”‚   β”œβ”€β”€ human_baseline.py # Human evaluation framework
β”‚   └── reference_models.py # Random, Heuristic, Template
β”œβ”€β”€ reports/             # Report generation
β”‚   └── generate.py      # Markdown/HTML/JSON reports
β”œβ”€β”€ visualization/       # CSV + PNG report generation
β”‚   └── results_reporter.py # Black-theme professional charts
β”œβ”€β”€ cli/                 # CLI commands (generate, eval, leaderboard, publish)
β”œβ”€β”€ docs/                # Methodology, scoring, security, contamination
β”‚   β”œβ”€β”€ methodology.md
β”‚   β”œβ”€β”€ scoring.md
β”‚   β”œβ”€β”€ security.md
β”‚   └── contamination.md
β”œβ”€β”€ phase1_evaluate_baselines.py
β”œβ”€β”€ phase2_evaluate_openrouter.py
β”œβ”€β”€ freeze_v0.2.py
β”œβ”€β”€ rockman_benchmark.py   # Backward-compatible facade
β”œβ”€β”€ rockman_cli.py
└── rockman_v0.2_manifest.json
```

---

## πŸ”§ CLI Commands

```bash
# Generate dataset
rockman generate --count 500 --encrypt-hidden --output rockman_v0.2.jsonl

# Evaluate model
rockman evaluate --dataset rockman_v0.2_private.jsonl --completions-file model_outputs.json --k 1

# Generate leaderboard
rockman leaderboard --results-file eval_results.json

# Publish dataset
rockman publish --dataset rockman_v0.2.jsonl --public-output public.jsonl --private-output private.jsonl

# Validate dataset
rockman validate --dataset rockman_v0.2.jsonl --solutions-file refs.json
```

---

## πŸ“¦ Dataset Access

| Platform | Link | Access |
|----------|------|--------|
| **Hugging Face** | [Inserloft/Rockman](https://huggingface.co/datasets/Inserloft/Rockman) | `datasets.load_dataset("Inserloft/Rockman")` |
| **GitHub** | [InserLoft/Rockman](https://github.com/InserLoft/Rockman) | `git clone` + releases |

```python
from datasets import load_dataset
ds = load_dataset("Inserloft/Rockman", split="private")
# Note: Private split requires authentication + master secret for hidden tests
```

---

## πŸ“œ License

MIT License β€” see [LICENSE](LICENSE) for details.

Dataset splits:
- **Public**: CC-BY-4.0
- **Private/Hidden**: Restricted (evaluation only)

---

## 🏷️ Citation

```bibtex
@misc{rockman2024,
  title={Rockman: A Comprehensive Benchmark for Code Generation and Software Engineering},
  author={Inserloft},
  year={2026},
  version={v0.2},
  url={https://github.com/InserLoft/Rockman}
}
```

---

## 🀝 Contributing

1. Fork the repository
2. Create a feature branch
3. Add tasks via `rockman generate` or PR new task templates
4. Ensure all 13 validation checks pass
5. Submit PR with validation report

---

## πŸ“ž Contact

| Platform | Link |
|----------|------|
| **Website** | [Inserloft.com](https://Inserloft.com) |
| **Benchmarks** | [Inserloft.com/benchmarks/RockMan](https://Inserloft.com/benchmarks/RockMan) |
| **GitHub** | [InserLoft/Rockman](https://github.com/InserLoft/Rockman) |
| **Hugging Face** | [Inserloft/Rockman](https://huggingface.co/datasets/Inserloft/Rockman) |
---

**[Inserloft](https://Inserloft.com)** β€” Advancing the science of code intelligence evaluation.