FWeindel commited on
Commit
6a0f908
·
verified ·
1 Parent(s): 5572e9f

Publish crosscodeeval_v2 filtered by both models pass@16 results

Browse files

Retain 863 of 6710 v1 tasks solved by Qwen3-30B Instruct or Thinking; archive 5847 newly unsolved tasks alongside 1053 prior exclusions. Preserve all task payloads, reuse pinned v1 images, and expose per-model success counts and selection examples.

crosscodeeval_v2/README.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CrossCodeEval v2
2
+
3
+ ## Dataset stats
4
+
5
+ - **6,710 v1 tasks → 863 retained; 5,847 newly archived.** All 863 retain their v1 repairs; v2 changes no task instructions, environments, verifiers or reference solutions.
6
+ - **7,763 original tasks: 863 retained and 6,900 archived**, including 1,053 earlier v1 exclusions.
7
+ - **Images:** the original 3 image definitions were not consolidated. Retained tasks reuse the 3 [v1 cached images](https://huggingface.co/datasets/FWeindel/validated-tasks/tree/main/crosscodeeval_environment-reliable/cached_images), pinned by immutable revision and checksum in the Parquet. No image copies are needed in v2.
8
+
9
+ ## Dataset characteristics
10
+
11
+ Cross-file code completion in C#, Java, Python and TypeScript, with related-file context and executable verifiers.
12
+
13
+ <details><summary>Domains</summary>
14
+
15
+ Software Engineering; Code Completion; Cross-file Repository Understanding.
16
+
17
+ </details>
18
+
19
+ <details><summary>Capabilities</summary>
20
+
21
+ Read related files, resolve identifiers, follow existing code patterns and complete missing statements.
22
+
23
+ </details>
24
+
25
+ **Likely transfer targets:** cross-file code completion and repository understanding.
26
+
27
+ ## Pass@16 filtering
28
+
29
+ Keep a task if either model solved it at least once. Both models completed 16 attempts on every v1 task. Recorded terminal failures count as unsuccessful attempts; unsolved tasks are not necessarily defective.
30
+
31
+ | Model | Tasks evaluated | Attempts | Tasks solved at least once |
32
+ | --- | ---: | ---: | ---: |
33
+ | Qwen3-30B Instruct | 6,710 | 107,360 | 641 |
34
+ | Qwen3-30B Thinking | 6,710 | 107,360 | 627 |
35
+ | Either model | 6,710 | 214,720 | **863** |
36
+
37
+ Successful-attempt distribution **among the 863 retained tasks**. Each model column totals 863; rows with zero tasks for both models are omitted. A task with 0/16 for one model was solved by the other.
38
+
39
+ | Successful attempts | Instruct tasks | Thinking tasks |
40
+ | --- | ---: | ---: |
41
+ | 0/16 | 222 | 236 |
42
+ | 1/16 | 222 | 193 |
43
+ | 2/16 | 70 | 94 |
44
+ | 3/16 | 57 | 64 |
45
+ | 4/16 | 40 | 51 |
46
+ | 5/16 | 38 | 36 |
47
+ | 6/16 | 33 | 22 |
48
+ | 7/16 | 33 | 24 |
49
+ | 8/16 | 20 | 24 |
50
+ | 9/16 | 22 | 21 |
51
+ | 10/16 | 17 | 16 |
52
+ | 11/16 | 21 | 16 |
53
+ | 12/16 | 18 | 19 |
54
+ | 13/16 | 17 | 12 |
55
+ | 14/16 | 13 | 13 |
56
+ | 15/16 | 7 | 7 |
57
+ | 16/16 | 13 | 15 |
58
+
59
+ The retained tasks inherit v1's rule-based repairs, build checks, reference reward 1 and no-op reward 0. Teacher runs used the same task contents without the timeout/anti-cheating sentence; v2 preserves that v1 sentence. [V1 repair details](https://huggingface.co/datasets/FWeindel/validated-tasks/blob/main/crosscodeeval_environment-reliable/README.md) · [Teacher results](https://huggingface.co/datasets/FWeindel/validated-tasks/discussions/6).
60
+
61
+ ## Select tasks by successful-attempt count
62
+
63
+ `tasks.parquet` includes `instruct_successes`, `thinking_successes` and `attempts_per_model` (16). Counts are also available in [selection.json](assets/selection.json). Earlier v1 archives have null teacher counts because they were not evaluated.
64
+
65
+ ```python
66
+ import pyarrow.parquet as pq
67
+
68
+ # Exactly 1 successful attempt out of 16 for Instruct:
69
+ filters = [("instruct_successes", "=", 1)]
70
+
71
+ # Alternatively, at least 3 successes for either model:
72
+ # filters = [[("instruct_successes", ">=", 3)],
73
+ # [("thinking_successes", ">=", 3)]]
74
+
75
+ subset = pq.read_table("tasks.parquet", filters=filters)
76
+ pq.write_table(subset, "selected.parquet")
77
+ ```
78
+
79
+ `patch.py` reproduces the release from the pinned v1 Parquets and recorded counts.
80
+
81
+ ## Runtime
82
+
83
+ - **Versions:** Apptainer **1.5.4**, Python **3.12.14**, Harbor **0.8.1**.
84
+ - **Implementation:** [Marin Harbor `7faf878c14b6`](https://github.com/marin-community/harbor/tree/7faf878c14b6d72737579ec936ebf5f74ba3194d) + [our runtime patches](https://github.com/MLI-lab/OT-next-data/tree/main/harbor_patches).
crosscodeeval_v2/archive.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbfd98d499cb56d9c85c8ab2faf7ec97a30c8ed2699f487350ba4ae27c0b953a
3
+ size 92382213
crosscodeeval_v2/assets/selection.json ADDED
The diff for this file is too large to render. See raw diff
 
crosscodeeval_v2/patch.py ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Reproduce CrossCodeEval v2 from pinned v1 Parquets and the recorded pass@16 results.
2
+
3
+ pip install pyarrow huggingface_hub
4
+ python patch.py --out ./rebuilt
5
+ Use --source-dir PATH to reuse the two original v1 Parquets locally.
6
+ """
7
+ import argparse
8
+ import copy
9
+ import hashlib
10
+ import json
11
+ import io
12
+ import tarfile
13
+ from pathlib import Path
14
+ import pyarrow as pa
15
+ import pyarrow.parquet as pq
16
+
17
+ MODELS = {'instruct_successes': 'qwen3-30b-instruct-2507',
18
+ 'thinking_successes': 'qwen3-30b-thinking'}
19
+
20
+ def rows(path):
21
+ table = pq.ParquetFile(path)
22
+ for i in range(table.num_row_groups):
23
+ yield from table.read_row_group(i).to_pylist()
24
+
25
+ def restrict_images(manifest, names):
26
+ result = copy.deepcopy(manifest)
27
+ result['tasks'] = {k: v for k, v in manifest['tasks'].items() if k in names}
28
+ bundles = {e['bundle'] for t in result['tasks'].values() for e in t['environments']}
29
+ result['bundles'] = {k: v for k, v in manifest['bundles'].items() if k in bundles}
30
+ result['missing'] = []
31
+ return result
32
+
33
+ def build(source_dir, out, selection_path):
34
+ selection = json.loads(selection_path.read_text())
35
+ out.mkdir(parents=True, exist_ok=True)
36
+ if any((out / n).exists() for n in ('tasks.parquet', 'archive.parquet')):
37
+ raise ValueError('Output Parquets already exist; choose an empty output directory')
38
+ sources = {}
39
+ for name in ('tasks.parquet', 'archive.parquet'):
40
+ if source_dir is None:
41
+ from huggingface_hub import hf_hub_download
42
+ path = Path(hf_hub_download(selection['repo_id'], selection['source_folder'] + '/' + name,
43
+ repo_type='dataset', revision=selection['source_revision'], cache_dir=out / '.source-cache'))
44
+ else:
45
+ path = source_dir / name
46
+ with path.open('rb') as handle:
47
+ digest = hashlib.file_digest(handle, 'sha256').hexdigest()
48
+ if digest != selection['source_sha256'][name]:
49
+ raise ValueError('Pinned source hash mismatch: ' + name)
50
+ sources[name] = path
51
+ tasks = selection['tasks']
52
+ kept = {name for name, task in tasks.items() if task['kept']}
53
+ assert len(tasks) == 6710 and len(kept) == 863
54
+ original_schema = pq.read_schema(sources['tasks.parquet'])
55
+ image_manifest = json.loads(original_schema.metadata[b'ot.images.v1'])
56
+ images = restrict_images(image_manifest, kept)
57
+ assert set(images['tasks']) == kept
58
+ release = {k: v for k, v in selection.items() if k != 'tasks'}
59
+ release['selection_file'] = 'assets/selection.json'
60
+ metadata = {b'ot.release.v2': json.dumps(release).encode(), b'ot.images.v1': json.dumps(images).encode()}
61
+ schema = original_schema.remove_metadata().append(pa.field('instruct_successes', pa.int64())).append(
62
+ pa.field('thinking_successes', pa.int64())).append(pa.field('attempts_per_model', pa.int64())).append(pa.field('archive_category', pa.string()))
63
+ seen, audit = set(), {}
64
+ with pq.ParquetWriter(out / 'tasks.parquet', schema.with_metadata(metadata), compression='zstd') as retain, \
65
+ pq.ParquetWriter(out / 'archive.parquet', schema.with_metadata({b'ot.release.v2': json.dumps(release).encode()}), compression='zstd') as archive:
66
+ counts = {'retained': 0, 'newly_archived': 0, 'prior_archived': 0}
67
+ for row in rows(sources['tasks.parquet']):
68
+ name = row['path']
69
+ if name in seen or name not in tasks:
70
+ raise ValueError('Duplicate or unexpected task: ' + name)
71
+ seen.add(name)
72
+ result = tasks[name]
73
+ assert row['content_sha256'] == result['content_sha256']
74
+ for column, model in MODELS.items():
75
+ rewards = result['models'][model]['rewards']
76
+ assert len(rewards) == 16 and result['models'][model]['complete'] and result['models'][model]['missing'] == 0
77
+ row[column] = sum(reward >= 1 for reward in rewards)
78
+ assert row[column] == result['models'][model]['solved_attempts']
79
+ row['attempts_per_model'] = 16
80
+ selected = row['instruct_successes'] > 0 or row['thinking_successes'] > 0
81
+ assert selected == result['kept']
82
+ audit[name] = {'binary_sha256': hashlib.sha256(row['task_binary']).hexdigest(),
83
+ 'content_sha256': row['content_sha256'], 'kept': selected}
84
+ if selected:
85
+ row['stages_passed'] = ','.join(dict.fromkeys(row['stages_passed'].split(',') + ['6']))
86
+ retain.write_table(pa.Table.from_pylist([row], schema=schema.with_metadata(metadata)))
87
+ counts['retained'] += 1
88
+ else:
89
+ row['archive_stage'] = 6
90
+ row['archive_reason'] = 'pass16-unsolved: no successful attempt in 16 Instruct and 16 Thinking trials; this is not a confirmed task defect.'
91
+ row['archive_labels'] = list(row.get('archive_labels') or []) + ['pass16-unsolved']
92
+ archive.write_table(pa.Table.from_pylist([row], schema=schema))
93
+ counts['newly_archived'] += 1
94
+ assert seen == set(tasks)
95
+ for row in rows(sources['archive.parquet']):
96
+ assert row['path'] not in seen
97
+ seen.add(row['path'])
98
+ # V1's original-source archive predates the validation columns.
99
+ # Preserve its category and reason while computing its content hash.
100
+ with tarfile.open(fileobj=io.BytesIO(row['task_binary']), mode='r:*') as archive_tar:
101
+ files = [(str(Path(m.name)), archive_tar.extractfile(m).read())
102
+ for m in archive_tar.getmembers() if m.isfile()]
103
+ digest = hashlib.sha256()
104
+ for name, content in sorted(files):
105
+ encoded = name.encode()
106
+ digest.update(len(encoded).to_bytes(8, 'big')); digest.update(encoded)
107
+ digest.update(len(content).to_bytes(8, 'big')); digest.update(content)
108
+ row['content_sha256'] = digest.hexdigest()
109
+ row['archive_stage'] = 0
110
+ row['stages_passed'] = ''
111
+ for column in MODELS:
112
+ row[column] = None
113
+ row['attempts_per_model'] = None
114
+ audit[row['path']] = {'binary_sha256': hashlib.sha256(row['task_binary']).hexdigest(),
115
+ 'content_sha256': row['content_sha256'], 'kept': False}
116
+ archive.write_table(pa.Table.from_pylist([row], schema=schema))
117
+ counts['prior_archived'] += 1
118
+ assert counts == {'retained': 863, 'newly_archived': 5847, 'prior_archived': 1053}
119
+ checked = set()
120
+ for filename, expected_kept in [('tasks.parquet', True), ('archive.parquet', False)]:
121
+ for row in rows(out / filename):
122
+ prior = audit[row['path']]
123
+ assert row['path'] not in checked and prior['kept'] == expected_kept
124
+ assert hashlib.sha256(row['task_binary']).hexdigest() == prior['binary_sha256']
125
+ assert row['content_sha256'] == prior['content_sha256']
126
+ checked.add(row['path'])
127
+ assert checked == seen
128
+ print(json.dumps(dict(counts, preserved_task_payloads=len(checked), cached_bundles_reused=len(images['bundles']))))
129
+
130
+ if __name__ == '__main__':
131
+ parser = argparse.ArgumentParser(description=__doc__)
132
+ parser.add_argument('--source-dir', type=Path)
133
+ parser.add_argument('--out', type=Path, required=True)
134
+ parser.add_argument('--selection', type=Path, default=Path(__file__).parent / 'assets' / 'selection.json')
135
+ args = parser.parse_args()
136
+ build(args.source_dir, args.out, args.selection)
crosscodeeval_v2/tasks.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21a25eac1b374c251f67f76e7abbb865435eeba329c7598ba210ba274d31f648
3
+ size 11270178