-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathgenerate_full_benchmark.py
More file actions
749 lines (640 loc) · 28.7 KB
/
generate_full_benchmark.py
File metadata and controls
749 lines (640 loc) · 28.7 KB
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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
#!/usr/bin/env python3
"""
Generate Complete 5,000 MRR Benchmark Scenarios
Based on Chronos paper specifications
"""
import json
import random
import hashlib
import os
from pathlib import Path
from datetime import datetime, timedelta
from typing import Dict, List, Any, Tuple
import string
class MRRBenchmarkGenerator:
"""Generate comprehensive MRR benchmark scenarios"""
def __init__(self, output_dir: str = "mrr_full_benchmark"):
self.output_dir = Path(output_dir)
self.output_dir.mkdir(exist_ok=True)
# Distribution from paper
self.category_distribution = {
'syntax_errors': 500,
'logic_errors': 1200,
'api_misuse': 900,
'memory_issues': 600,
'concurrency_issues': 800,
'performance_bugs': 400,
'cross_category': 600
}
# Subcategory distributions
self.subcategories = {
'syntax_errors': [
'missing_semicolon', 'missing_bracket', 'invalid_token',
'typo', 'incorrect_syntax', 'indentation_error',
'unclosed_string', 'invalid_character'
],
'logic_errors': [
'off_by_one', 'incorrect_operator', 'boundary_condition',
'incorrect_logic', 'algorithmic_error', 'wrong_condition',
'infinite_loop', 'incorrect_calculation'
],
'api_misuse': [
'wrong_method', 'incorrect_params', 'missing_validation',
'deprecated_api', 'api_contract_violation', 'wrong_return_type',
'missing_error_handling', 'incorrect_api_sequence'
],
'memory_issues': [
'null_pointer', 'memory_leak', 'buffer_overflow',
'dangling_pointer', 'resource_leak', 'double_free',
'stack_overflow', 'heap_corruption'
],
'concurrency_issues': [
'race_condition', 'deadlock', 'livelock',
'synchronization_bug', 'atomicity_violation',
'thread_safety', 'data_race', 'lock_ordering'
],
'performance_bugs': [
'inefficient_algorithm', 'n_plus_one', 'unnecessary_computation',
'blocking_io', 'cache_misuse', 'memory_bloat',
'excessive_allocation', 'poor_data_structure'
],
'cross_category': [
'multiple_issues', 'complex_interaction', 'system_level',
'architectural', 'mixed_bugs', 'cascading_failures',
'integration_issues', 'deployment_bugs'
]
}
# Language distribution
self.languages = ['python', 'javascript', 'java', 'go', 'cpp']
self.language_weights = [0.35, 0.25, 0.20, 0.10, 0.10]
def generate_all_scenarios(self):
"""Generate all 5,000 scenarios"""
print("Generating 5,000 MRR Benchmark Scenarios...")
total_generated = 0
for category, count in self.category_distribution.items():
print(f"\nGenerating {count} {category} scenarios...")
category_dir = self.output_dir / category
category_dir.mkdir(exist_ok=True)
for i in range(count):
scenario = self.generate_scenario(category, i)
# Save scenario
filename = f"mrr_{category}_{i+1:04d}.json"
filepath = category_dir / filename
with open(filepath, 'w') as f:
json.dump(scenario, f, indent=2)
total_generated += 1
if (i + 1) % 100 == 0:
print(f" Generated {i + 1}/{count} {category} scenarios")
print(f"\n✓ Generated {total_generated} total scenarios")
# Generate metadata
self.generate_metadata()
def generate_scenario(self, category: str, index: int) -> Dict:
"""Generate a single MRR scenario"""
# Select language
language = random.choices(self.languages, self.language_weights)[0]
# Select subcategory
subcategory = random.choice(self.subcategories[category])
# Generate unique bug ID
bug_id = self.generate_bug_id(category, index)
# Generate complexity parameters
complexity = self.generate_complexity_params(category)
# Generate code snippets
buggy_code, fixed_code = self.generate_code_snippets(
category, subcategory, language
)
# Generate scattered context
scattered_context = self.generate_scattered_context(
complexity['spatial_distribution'],
language,
category
)
# Generate temporal info
temporal_info = self.generate_temporal_info(
complexity['temporal_spread_months']
)
# Generate retrieval paths
retrieval_paths = self.generate_retrieval_paths(
scattered_context,
complexity['abstraction_layers']
)
# Generate obfuscation
obfuscation = self.generate_obfuscation(
complexity['obfuscation_level']
)
# Generate ground truth
ground_truth = self.generate_ground_truth(
category, subcategory, scattered_context
)
# Generate test artifacts
test_artifacts = self.generate_test_artifacts(language, category)
# Generate error artifacts
error_artifacts = self.generate_error_artifacts(category, language)
scenario = {
'bug_id': bug_id,
'category': category,
'subcategory': subcategory,
'language': language,
'description': self.generate_description(category, subcategory),
'complexity': complexity,
'code_snippets': {
'buggy_code': buggy_code,
'fixed_code': fixed_code
},
'scattered_context': scattered_context,
'temporal_info': temporal_info,
'retrieval_paths': retrieval_paths,
'obfuscation': obfuscation,
'ground_truth': ground_truth,
'test_artifacts': test_artifacts,
'error_artifacts': error_artifacts,
'symptoms': self.generate_symptoms(category, subcategory),
'error_location': self.generate_error_location(),
'evaluation_criteria': self.generate_evaluation_criteria(scattered_context)
}
return scenario
def generate_bug_id(self, category: str, index: int) -> str:
"""Generate unique bug ID"""
timestamp = datetime.now().strftime('%Y%m')
return f"MRR-{category.upper()}-{timestamp}-{index+1:04d}"
def generate_complexity_params(self, category: str) -> Dict:
"""Generate complexity parameters based on category"""
# Base complexity by category
complexity_ranges = {
'syntax_errors': {
'spatial_distribution': (1, 5),
'temporal_spread_months': (0, 3),
'abstraction_layers': (1, 2),
'obfuscation_level': ['low', 'low', 'medium'],
'cross_module_dependencies': (0, 2)
},
'logic_errors': {
'spatial_distribution': (3, 15),
'temporal_spread_months': (1, 6),
'abstraction_layers': (2, 4),
'obfuscation_level': ['low', 'medium', 'medium'],
'cross_module_dependencies': (1, 5)
},
'api_misuse': {
'spatial_distribution': (5, 20),
'temporal_spread_months': (2, 9),
'abstraction_layers': (2, 4),
'obfuscation_level': ['medium', 'medium', 'high'],
'cross_module_dependencies': (2, 8)
},
'memory_issues': {
'spatial_distribution': (10, 30),
'temporal_spread_months': (3, 12),
'abstraction_layers': (3, 5),
'obfuscation_level': ['medium', 'high', 'high'],
'cross_module_dependencies': (3, 10)
},
'concurrency_issues': {
'spatial_distribution': (15, 40),
'temporal_spread_months': (3, 12),
'abstraction_layers': (3, 5),
'obfuscation_level': ['high', 'high', 'high'],
'cross_module_dependencies': (5, 15)
},
'performance_bugs': {
'spatial_distribution': (10, 25),
'temporal_spread_months': (2, 9),
'abstraction_layers': (2, 4),
'obfuscation_level': ['medium', 'high', 'high'],
'cross_module_dependencies': (2, 8)
},
'cross_category': {
'spatial_distribution': (20, 50),
'temporal_spread_months': (6, 12),
'abstraction_layers': (4, 5),
'obfuscation_level': ['high', 'high', 'high'],
'cross_module_dependencies': (10, 20)
}
}
ranges = complexity_ranges.get(category, complexity_ranges['logic_errors'])
return {
'spatial_distribution': random.randint(*ranges['spatial_distribution']),
'temporal_spread_months': random.randint(*ranges['temporal_spread_months']),
'abstraction_layers': random.randint(*ranges['abstraction_layers']),
'obfuscation_level': random.choice(ranges['obfuscation_level']),
'cross_module_dependencies': random.randint(*ranges['cross_module_dependencies']),
'artifact_types': random.randint(2, 5)
}
def generate_code_snippets(self, category: str, subcategory: str, language: str) -> Tuple[str, str]:
"""Generate buggy and fixed code snippets"""
# Language-specific templates
templates = {
'python': {
'syntax_errors': {
'missing_semicolon': (
"def process_data(items):\n result = []\n for item in items\n result.append(item * 2)\n return result",
"def process_data(items):\n result = []\n for item in items:\n result.append(item * 2)\n return result"
),
'missing_bracket': (
"def calculate(a, b):\n return (a + b * 2",
"def calculate(a, b):\n return (a + b) * 2"
)
},
'logic_errors': {
'off_by_one': (
"def get_last_element(arr):\n return arr[len(arr)]",
"def get_last_element(arr):\n return arr[len(arr) - 1]"
),
'incorrect_operator': (
"def is_even(n):\n return n / 2 == 0",
"def is_even(n):\n return n % 2 == 0"
)
},
'concurrency_issues': {
'race_condition': (
"class Counter:\n def __init__(self):\n self.count = 0\n \n def increment(self):\n self.count += 1",
"import threading\n\nclass Counter:\n def __init__(self):\n self.count = 0\n self.lock = threading.Lock()\n \n def increment(self):\n with self.lock:\n self.count += 1"
)
}
},
'javascript': {
'syntax_errors': {
'missing_semicolon': (
"function processData(items) {\n let result = []\n items.forEach(item => {\n result.push(item * 2)\n })\n return result\n}",
"function processData(items) {\n let result = [];\n items.forEach(item => {\n result.push(item * 2);\n });\n return result;\n}"
)
},
'api_misuse': {
'wrong_method': (
"async function fetchData(url) {\n const response = await fetch(url);\n return response.text();\n}",
"async function fetchData(url) {\n const response = await fetch(url);\n return response.json();\n}"
)
}
}
}
# Get template or generate generic
if language in templates and category in templates[language]:
if subcategory in templates[language][category]:
return templates[language][category][subcategory]
# Generate generic code
return self.generate_generic_code(category, subcategory, language)
def generate_generic_code(self, category: str, subcategory: str, language: str) -> Tuple[str, str]:
"""Generate generic buggy and fixed code"""
if language == 'python':
buggy = f"""def buggy_function_{subcategory}(data):
# Bug: {subcategory}
result = []
for item in data:
# Buggy logic here
if item > 0:
result.append(item)
return result"""
fixed = f"""def fixed_function_{subcategory}(data):
# Fixed: {subcategory}
result = []
for item in data:
# Fixed logic here
if item >= 0:
result.append(item)
return result"""
elif language == 'javascript':
buggy = f"""function buggyFunction_{subcategory}(data) {{
// Bug: {subcategory}
let result = [];
data.forEach(item => {{
// Buggy logic here
if (item > 0) {{
result.push(item);
}}
}});
return result;
}}"""
fixed = f"""function fixedFunction_{subcategory}(data) {{
// Fixed: {subcategory}
let result = [];
data.forEach(item => {{
// Fixed logic here
if (item >= 0) {{
result.push(item);
}}
}});
return result;
}}"""
else:
buggy = f"// Buggy code for {category}/{subcategory} in {language}"
fixed = f"// Fixed code for {category}/{subcategory} in {language}"
return buggy, fixed
def generate_scattered_context(self, num_files: int, language: str, category: str) -> List[Dict]:
"""Generate scattered context across multiple files"""
context = []
# File types based on language
file_extensions = {
'python': '.py',
'javascript': '.js',
'java': '.java',
'go': '.go',
'cpp': '.cpp'
}
ext = file_extensions.get(language, '.txt')
# Generate context files
for i in range(num_files):
relevance = random.choice(['critical', 'high', 'medium', 'low'])
# Generate file path
modules = ['core', 'utils', 'services', 'models', 'controllers', 'helpers']
module = random.choice(modules)
filename = f"{module}/file_{i+1}{ext}"
# Generate content
content = self.generate_context_content(language, category, relevance)
# Generate relationship
relationships = ['imports', 'extends', 'implements', 'calls', 'uses', 'tests']
relationship = random.choice(relationships)
context_item = {
'file_path': filename,
'content': content,
'relevance': relevance,
'relationship': relationship,
'specific_issue': f"Related to {category} issue",
'line_numbers': [random.randint(10, 200) for _ in range(random.randint(1, 5))]
}
context.append(context_item)
return context
def generate_context_content(self, language: str, category: str, relevance: str) -> str:
"""Generate context file content"""
if language == 'python':
if relevance == 'critical':
return f"""class CriticalComponent:
def process(self, data):
# Critical logic related to {category}
if not self.validate(data):
raise ValueError("Invalid data")
return self.transform(data)
def validate(self, data):
# Validation logic
return data is not None"""
elif relevance == 'high':
return f"""def important_function(param):
# Important logic for {category}
result = []
for item in param:
result.append(process_item(item))
return result"""
else:
return f"# Helper code for {category}\ndef helper(): pass"
else:
return f"// Context code for {category} in {language}"
def generate_temporal_info(self, spread_months: int) -> Dict:
"""Generate temporal information"""
base_date = datetime.now() - timedelta(days=spread_months * 30)
commits = []
for i in range(random.randint(3, 10)):
commit_date = base_date + timedelta(days=random.randint(0, spread_months * 30))
commits.append({
'hash': hashlib.md5(f"commit_{i}".encode()).hexdigest()[:8],
'date': commit_date.strftime('%Y-%m-%d'),
'message': f"Refactored module {i}",
'files': [f"file_{j}.py" for j in range(random.randint(1, 5))]
})
return {
'bug_introduced': base_date.strftime('%Y-%m-%d'),
'temporal_spread_days': spread_months * 30,
'refactoring_events': random.randint(0, 5),
'related_commits': commits
}
def generate_retrieval_paths(self, scattered_context: List[Dict], layers: int) -> Dict:
"""Generate retrieval paths between files"""
if not scattered_context:
return {'explicit': [], 'implicit': [], 'compositional': []}
files = [ctx['file_path'] for ctx in scattered_context]
# Explicit paths
explicit = []
for i in range(min(5, len(files) - 1)):
explicit.append({
'from': files[i],
'to': files[i + 1],
'type': random.choice(['imports', 'calls', 'extends'])
})
# Implicit paths
implicit = []
for i in range(min(3, len(files) // 2)):
implicit.append({
'files': random.sample(files, min(3, len(files))),
'pattern': 'shared_dependency'
})
# Compositional paths
compositional = []
for i in range(layers):
path_length = min(i + 2, len(files))
compositional.append({
'path': random.sample(files, path_length),
'depth': i + 1
})
return {
'explicit': explicit,
'implicit': implicit,
'compositional': compositional
}
def generate_obfuscation(self, level: str) -> Dict:
"""Generate obfuscation details"""
renamed_entities = {}
if level == 'low':
# Minor renames
for i in range(random.randint(1, 3)):
old_name = f"variable_{i}"
new_name = f"var_{i}"
renamed_entities[old_name] = new_name
elif level == 'medium':
# Function and class renames
for i in range(random.randint(3, 7)):
old_name = f"function_{i}"
new_name = ''.join(random.choices(string.ascii_lowercase, k=8))
renamed_entities[old_name] = new_name
else: # high
# Major refactoring
for i in range(random.randint(5, 15)):
old_name = f"entity_{i}"
new_name = ''.join(random.choices(string.ascii_letters, k=10))
renamed_entities[old_name] = new_name
return {
'obfuscation_level': level,
'renamed_entities': renamed_entities,
'moved_files': random.randint(0, 5) if level != 'low' else 0,
'refactored_modules': random.randint(0, 3) if level == 'high' else 0
}
def generate_ground_truth(self, category: str, subcategory: str,
scattered_context: List[Dict]) -> Dict:
"""Generate ground truth for evaluation"""
# Determine fix type based on category
fix_types = {
'syntax_errors': 'syntax_correction',
'logic_errors': 'logic_correction',
'api_misuse': 'api_correction',
'memory_issues': 'memory_management',
'concurrency_issues': 'synchronization',
'performance_bugs': 'optimization',
'cross_category': 'multiple_fixes'
}
# Select critical files
critical_files = [ctx['file_path'] for ctx in scattered_context
if ctx['relevance'] in ['critical', 'high']]
# Select should-find files
should_find = [ctx['file_path'] for ctx in scattered_context
if ctx['relevance'] == 'medium']
return {
'root_cause': f"{subcategory} in main processing logic",
'fix_type': fix_types.get(category, 'general_fix'),
'must_find_files': critical_files[:5],
'should_find_files': should_find[:3],
'expected_behavior': {
'should_not_error': True,
'expected_output': 'Correct processing result',
'performance_threshold': random.uniform(0.5, 2.0)
}
}
def generate_test_artifacts(self, language: str, category: str) -> List[Dict]:
"""Generate test artifacts"""
tests = []
for i in range(random.randint(1, 3)):
if language == 'python':
test_code = f"""import unittest
class Test{category.title()}(unittest.TestCase):
def test_scenario_{i+1}(self):
# Test for {category}
result = function_under_test(test_data)
self.assertEqual(result, expected_result)
"""
else:
test_code = f"// Test for {category} in {language}"
tests.append({
'file_name': f"test_{category}_{i+1}.{language}",
'test_code': test_code,
'test_type': random.choice(['unit', 'integration', 'e2e'])
})
return tests
def generate_error_artifacts(self, category: str, language: str) -> List[Dict]:
"""Generate error artifacts"""
errors = []
for i in range(random.randint(1, 2)):
error_messages = {
'syntax_errors': f"SyntaxError: invalid syntax at line {random.randint(10, 100)}",
'logic_errors': f"AssertionError: Expected 5 but got 4",
'api_misuse': f"TypeError: Invalid argument type for API call",
'memory_issues': f"MemoryError: Out of memory",
'concurrency_issues': f"DeadlockError: Thread deadlock detected",
'performance_bugs': f"TimeoutError: Operation timed out after 30s",
'cross_category': f"SystemError: Multiple failures detected"
}
errors.append({
'error_type': category,
'error_message': error_messages.get(category, "Generic error"),
'stack_trace': self.generate_stack_trace(language),
'timestamp': datetime.now().isoformat()
})
return errors
def generate_stack_trace(self, language: str) -> str:
"""Generate realistic stack trace"""
if language == 'python':
return """Traceback (most recent call last):
File "main.py", line 42, in <module>
result = process_data(input_data)
File "processor.py", line 15, in process_data
return transform(validate(data))
File "validator.py", line 8, in validate
raise ValueError("Invalid data")
ValueError: Invalid data"""
else:
return f"Stack trace for {language}"
def generate_symptoms(self, category: str, subcategory: str) -> List[str]:
"""Generate bug symptoms"""
symptoms_map = {
'syntax_errors': [
"Code fails to compile/run",
"Syntax error message displayed",
"IDE highlights error"
],
'logic_errors': [
"Incorrect output produced",
"Test cases failing",
"Unexpected behavior"
],
'concurrency_issues': [
"Intermittent failures",
"Race condition symptoms",
"Deadlock occurs"
]
}
return symptoms_map.get(category, ["Generic symptom"])
def generate_error_location(self) -> Dict:
"""Generate error location information"""
return {
'file': f"main.py",
'line': random.randint(10, 200),
'function': f"process_function",
'module': random.choice(['core', 'utils', 'services'])
}
def generate_evaluation_criteria(self, scattered_context: List[Dict]) -> Dict:
"""Generate evaluation criteria"""
critical_files = [ctx['file_path'] for ctx in scattered_context
if ctx['relevance'] == 'critical']
return {
'must_find_files': critical_files[:3],
'should_find_files': [ctx['file_path'] for ctx in scattered_context
if ctx['relevance'] == 'high'][:2],
'retrieval_threshold': 0.75,
'fix_validation': 'must_pass_tests'
}
def generate_description(self, category: str, subcategory: str) -> str:
"""Generate bug description"""
descriptions = {
'syntax_errors': f"Syntax error: {subcategory} causing compilation failure",
'logic_errors': f"Logic bug: {subcategory} producing incorrect results",
'api_misuse': f"API misuse: {subcategory} violating API contract",
'memory_issues': f"Memory issue: {subcategory} causing memory problems",
'concurrency_issues': f"Concurrency bug: {subcategory} in multi-threaded code",
'performance_bugs': f"Performance issue: {subcategory} causing slowdown",
'cross_category': f"Complex bug: {subcategory} with multiple issues"
}
return descriptions.get(category, f"Bug in {category}: {subcategory}")
def generate_metadata(self):
"""Generate benchmark metadata"""
metadata = {
'benchmark_name': 'Chronos MRR Full Benchmark',
'version': '1.0.0',
'total_scenarios': 5000,
'generation_date': datetime.now().isoformat(),
'category_distribution': self.category_distribution,
'languages': self.languages,
'complexity_levels': {
'low': 'Simple bugs with minimal context',
'medium': 'Moderate complexity with scattered context',
'high': 'Complex bugs requiring extensive retrieval',
'extreme': 'Very complex with heavy obfuscation'
}
}
with open(self.output_dir / 'BENCHMARK_METADATA.json', 'w') as f:
json.dump(metadata, f, indent=2)
print("✓ Generated benchmark metadata")
def main():
print("="*60)
print("CHRONOS MRR BENCHMARK GENERATOR")
print("="*60)
print("\nThis will generate 5,000 comprehensive MRR scenarios")
print("Based on the specifications from the Chronos paper")
print("\nCategories:")
print("- Syntax Errors: 500 scenarios")
print("- Logic Errors: 1,200 scenarios")
print("- API Misuse: 900 scenarios")
print("- Memory Issues: 600 scenarios")
print("- Concurrency Issues: 800 scenarios")
print("- Performance Bugs: 400 scenarios")
print("- Cross-Category: 600 scenarios")
print("\nTotal: 5,000 scenarios")
print("="*60)
# Auto-generate without prompt
print("\nStarting generation...")
generator = MRRBenchmarkGenerator()
generator.generate_all_scenarios()
print("\n" + "="*60)
print("BENCHMARK GENERATION COMPLETE")
print("="*60)
print(f"Location: benchmarks/mrr_full_benchmark/")
print("Files generated: 5,000 JSON scenarios")
print("\nNext steps:")
print("1. Run evaluation: python run_evaluation.py")
print("2. Test specific category: python run_benchmark.py --category logic_errors")
print("3. View scenarios: ls mrr_full_benchmark/")
if __name__ == "__main__":
main()