FWeindel commited on
Commit
cf2d20b
·
verified ·
1 Parent(s): bd50cf6

Restore ScaleSWE historical static repairs and concise release evidence

Browse files
scaleswe_environment-reliable/README.md CHANGED
@@ -1,56 +1,43 @@
1
  # Scale SWE
2
 
3
- The pinned [Prime Scale SWE release](https://huggingface.co/datasets/PrimeIntellect/Scale-SWE-Verified/tree/8935f8e55244fd56080cdb8dcd0819a57e8a003c) contains **17,202 tasks**.
4
 
5
- - **Docker images: 17,202 originally; 16,786 retained.** Each task keeps its original image. The decrease comes from excluding 416 tasks; no images were consolidated.
6
- - **Tasks: 16,786 kept, including 456 patched and 16,330 unchanged; 416 excluded.** Changed-task counts include only environment and verifier repairs; original task instructions are preserved.
7
 
8
- ## Stage 3: Verifying build
9
 
10
- - **0 tasks patched; 0 excluded for build/setup failures.** Existing per-task images and setup are unchanged.
11
 
12
- ## Stage 4: Reference solution reward 1
13
 
14
- **419 tasks patched:**
15
 
16
- - **367:** restored missing test helpers, sample inputs and recorded responses that the verifier deleted when resetting the test directory.
17
- - **26:** prevented command-completion tests from closing a file handle used by pytest and crashing the test run.
18
- - **6:** limited parallel test processes to the CPUs allocated to the task.
19
- - **5:** fixed Python import paths so tests could find the repository's code and helpers.
20
- - **5:** fixed test-name matching so passing parameterized tests were scored correctly.
21
- - **5:** removed a required test that always skips because the image already contains the C++ extension whose absence it tests.
22
- - **4:** made tests close their worker pools so the verifier could finish.
23
- - **1:** closed an uploaded temporary file after testing to prevent a cleanup error.
24
 
25
- **362 tasks excluded:**
26
 
27
- - **149:** selected tests still failed with the reference solution applied.
28
- - **122:** tests depended on unavailable or unreliable external services.
29
- - **60:** missing modules, fixtures or incompatible installed libraries prevented tests from running correctly.
30
- - **18:** saved HTTP responses no longer matched the requests made by the tests.
31
- - **7:** tests required a privileged network port that the container could not open.
32
- - **4:** tests required an empty Python import path, conflicting with the grading runner's configuration.
33
- - **2:** the verifier referenced deleted tests or omitted a required test helper.
34
 
35
- ## Stage 5: No-op reward 0
36
 
37
- **37 tasks patched:**
38
 
39
- - **31:** made tests import the task's checkout instead of an installed package that already contained the fix.
40
- - **5:** moved missing-feature imports into the tests that use them, so unfinished code causes a test failure instead of preventing tests from starting.
41
- - **1:** restored a missing test fixture and isolated tests with time limits so broken worker shutdown could not hang the verifier.
42
 
43
- **54 tasks excluded:**
44
 
45
- - **37:** tests passed without the reference fix.
46
- - **15:** the source pull request changed only tests, leaving no code change for the agent to make.
47
- - **1:** the reference passed, but the no-op verifier repeatedly exceeded its 30-minute limit.
48
- - **1:** timing-sensitive tests sometimes passed without the fix.
49
 
50
- ## Download the images
 
 
 
51
 
52
- The prebuilt Docker images are available on [Docker Hub: aweaiteam/scaleswe](https://hub.docker.com/r/aweaiteam/scaleswe/tags). Each task's `environment/Dockerfile` contains its exact image tag. For example:
53
 
54
- ```bash
55
- docker pull aweaiteam/scaleswe:auth0_auth0-python_pr671
56
- ```
 
 
 
1
  # Scale SWE
2
 
3
+ ## Dataset stats
4
 
5
+ - **[17,202 original tasks](https://huggingface.co/datasets/PrimeIntellect/Scale-SWE-Verified/tree/8935f8e55244fd56080cdb8dcd0819a57e8a003c); 16,786 retained, all changed; 416 archived.**
6
+ - **17,202 original Docker images → 16,786 retained images.** No consolidation; the decrease follows task exclusions. Exact tags remain in each Dockerfile, under [aweaiteam/scaleswe](https://hub.docker.com/r/aweaiteam/scaleswe/tags).
7
 
8
+ - **48 cached Apptainer bundles** accompany this release; the other **16,738** retained tasks use their upstream Docker images.
9
 
10
+ ## Dataset characteristics
11
 
12
+ Real repository pull requests with issue instructions, executable regression tests and reference fixes.
13
 
14
+ <details><summary>Domains</summary>
15
 
16
+ Software Engineering; Debugging; Web & API Tooling; Scientific Computing.
 
 
 
 
 
 
 
17
 
18
+ </details>
19
 
20
+ <details><summary>Capabilities</summary>
 
 
 
 
 
 
21
 
22
+ Exploration; Error Recovery; Specification Adherence; Constraint Satisfaction. Trace repository behavior, modify code and run regression tests.
23
 
24
+ </details>
25
 
26
+ **Likely transfer targets:** SWE-bench Verified; repository debugging in Terminal-Bench 2.0 and TBLite 2.0.
 
 
27
 
28
+ ## Per-stage breakdown
29
 
30
+ Counts below describe retained repairs; repair groups overlap. Results combine historical validation and repair reruns; the later full reproduction failed during startup.
 
 
 
31
 
32
+ - **1, rule-based/static:** 16,786 changed, 0 archived. Restored the timeout/anti-cheating sentence (`check-instruction-suffix.sh`) and 750 recorded instruction-path corrections supported by setup/reference observations. The historical `check-task-absolute-path.sh` treated unresolved relative paths as advisory; these corrections do not imply 750 checker failures.
33
+ - **3, build/setup:** 16,786 passed; 0 dataset repairs, 0 archived. Original per-task images ran through the shared Apptainer/Marin Harbor bridge.
34
+ - **4, reference reward 1:** 16,786 passed; 419 repaired, 362 archived. Repairs: 367 missing test fixtures, 26 pytest file-handle conflicts, 6 worker limits, 5 import paths, 5 parameterized-test matching, 5 always-skipped required tests, 4 worker cleanup and 1 temporary-file cleanup. Archives: 149 failing reference tests, 122 unavailable services, 60 missing/incompatible dependencies, 18 stale HTTP recordings, 7 privileged ports, 4 import-path conflicts and 2 missing test definitions/helpers.
35
+ - **5, no-op reward 0:** 16,786 passed; 37 repaired, 54 archived. Repairs: 31 checkout imports, 5 deferred missing-feature imports, 1 fixture/worker-timeout repair. Archives: 37 passing without a fix, 15 test-only pull requests, 1 timeout and 1 timing-sensitive result.
36
 
37
+ [Historical results and per-task reasons](https://huggingface.co/datasets/FWeindel/validated-tasks/blob/e77e80246668e100171168fa369012fd68f3d53a/runs/2026-10-14-scaleswe-historical-audit.json).
38
 
39
+ ## Resources and timing
40
+
41
+ Cached image builds: **4 CPUs, 8,192 MiB each**. Historical validation: Helma, x86_64, Apptainer, host networking through the cluster proxy; Marin Harbor validation commit [`7faf878c14b6`](https://github.com/marin-community/harbor/tree/7faf878c14b6d72737579ec936ebf5f74ba3194d). Apptainer/Harbor package versions and complete CPU/memory/GPU allocation: **Not recorded**.
42
+
43
+ Latest recorded validation trial per source task (17,202 timed trials per stage): mean **20.50 s reference**, **19.77 s no-op**, including subsequently archived tasks. Total patching time and complete validation wall time: **Not recorded**.
scaleswe_environment-reliable/archive.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2738d2a630ca44997a9f691cb3a2404174f490bc8027dcb69529149e6efb2ca3
3
- size 4310149
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2e8b39c021d198a42c8a372d16123c89d23ae34bc69c6baf2f104b8b724931e
3
+ size 4308432
scaleswe_environment-reliable/assets/historical_release.py ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Restore only evidence-backed instructions from an immutable historical release."""
2
+ from pathlib import Path, PurePosixPath
3
+ import hashlib
4
+ import io
5
+ import json
6
+ import shutil
7
+ import tarfile
8
+
9
+ import pyarrow as pa
10
+ import pyarrow.parquet as pq
11
+ from validation.contract import files_digest
12
+
13
+
14
+ def files(blob):
15
+ result = {}
16
+ with tarfile.open(fileobj=io.BytesIO(blob), mode='r:*') as archive:
17
+ for member in archive:
18
+ path = PurePosixPath(member.name)
19
+ if path.is_absolute() or '..' in path.parts or not (member.isfile() or member.isdir()):
20
+ raise ValueError('Unsafe historical archive member')
21
+ if member.isfile():
22
+ if str(path) in result:
23
+ raise ValueError('Duplicate historical archive member')
24
+ result[str(path)] = (archive.extractfile(member).read(), member.mode)
25
+ return result
26
+
27
+
28
+ def restore(current, historical, archive, record, dataset, revision, output):
29
+ """Keep current runtime bytes/modes and image locations; restore recorded instructions.
30
+
31
+ Historical archives must differ only in instruction.md. The caller pins and
32
+ verifies historical input files against the stated immutable HF revision.
33
+ """
34
+ import re
35
+ if not re.fullmatch('[0-9a-f]{40}', revision):
36
+ raise ValueError('An immutable historical publication revision is required')
37
+ output = Path(output)
38
+ output.mkdir(parents=True, exist_ok=False)
39
+ run = json.loads(Path(record).read_text())
40
+ provenance = run['patch_provenance'][dataset]
41
+ changes = {x['task_id']: x for x in provenance['tasks']}
42
+ automatic = {x['task_id']: x for x in run['automation_changes'][dataset]['tasks']}
43
+ old = {r['path']: r for b in pq.ParquetFile(historical).iter_batches(batch_size=32) for r in b.to_pylist()}
44
+ source = pq.ParquetFile(current)
45
+ metadata = dict(source.schema_arrow.metadata or {})
46
+ images = json.loads(metadata[b'ot.images.v1']) if b'ot.images.v1' in metadata else None
47
+ audit = []
48
+ rows = []
49
+ for batch in source.iter_batches(batch_size=32):
50
+ for row in batch.to_pylist():
51
+ name = row['path']
52
+ prior = old.pop(name)
53
+ before, after = files(row['task_binary']), files(prior['task_binary'])
54
+ if {k:v for k,v in before.items() if k != 'instruction.md'} != {k:v for k,v in after.items() if k != 'instruction.md'}:
55
+ raise ValueError('Runtime differs from historical evidence: ' + name)
56
+ for payload, values in [(row, before), (prior, after)]:
57
+ if payload['content_sha256'] != files_digest((k,v[0]) for k,v in values.items()):
58
+ raise ValueError('Invalid content digest: ' + name)
59
+ if prior['stages_passed'] != '1,3,4,5' or set(automatic[name]['labels']) != {'anti-cheat-instruction'}:
60
+ raise ValueError('Unreviewed or incomplete historical evidence: ' + name)
61
+ if images:
62
+ if images['tasks'][name]['content_sha256'] != row['content_sha256']:
63
+ raise ValueError('Image task binding mismatch: ' + name)
64
+ images['tasks'][name]['content_sha256'] = prior['content_sha256']
65
+ audit.append({'task_id': name, 'before_content_sha256': row['content_sha256'],
66
+ 'content_sha256': prior['content_sha256'], 'labels': prior['patch_labels'],
67
+ 'path_repair': 'instruction-path-clarified' in changes[name]['labels']})
68
+ for key in ['task_binary', 'content_sha256', 'stages_passed', 'patch_changed', 'patch_labels']:
69
+ row[key] = prior[key]
70
+ row['run'] = f'https://huggingface.co/datasets/FWeindel/validated-tasks/blob/{revision}/runs/{run["run"]}.json'
71
+ rows.append(row)
72
+ if old:
73
+ raise ValueError('Historical/current retained task sets differ')
74
+ summary = {'historical_revision': revision, 'historical_run': run['run'],
75
+ 'retained': len(rows), 'archived': pq.ParquetFile(archive).metadata.num_rows,
76
+ 'changed_retained': len(rows), 'instruction_suffix_restored': len(rows),
77
+ 'instruction_path_repairs_restored': sum(x['path_repair'] for x in audit),
78
+ 'static_archived': 0, 'fresh_runtime_validation': False,
79
+ 'runtime_files_and_modes_identical_to_historical': True,
80
+ 'historical_stages': [1,3,4,5]}
81
+ metadata.pop(b'ot.environment_reliable.v1', None)
82
+ metadata[b'ot.full_release.v1'] = json.dumps(summary).encode()
83
+ if images:
84
+ metadata[b'ot.images.v1'] = json.dumps(images).encode()
85
+ (output/'cached_images').mkdir()
86
+ (output/'cached_images'/'manifest.json').write_text(json.dumps(images, indent=2)+'\n')
87
+ pq.write_table(pa.Table.from_pylist(rows, schema=source.schema_arrow.with_metadata(metadata)), output/'tasks.parquet', compression='zstd')
88
+ archived = pq.read_table(archive)
89
+ if 'run' in archived.column_names:
90
+ index = archived.column_names.index('run')
91
+ archived = archived.set_column(index, archived.schema.field(index), pa.array(
92
+ [f'https://huggingface.co/datasets/FWeindel/validated-tasks/blob/{revision}/runs/{run["run"]}.json'] * archived.num_rows,
93
+ type=archived.schema.field(index).type))
94
+ archive_metadata = dict(archived.schema.metadata or {})
95
+ archive_metadata.pop(b'ot.environment_reliable.v1', None)
96
+ archive_metadata[b'ot.full_release.v1'] = json.dumps(summary).encode()
97
+ pq.write_table(archived.replace_schema_metadata(archive_metadata), output/'archive.parquet', compression='zstd')
98
+ (output.parent/'restoration-audit.json').write_text(json.dumps({'summary':summary, 'tasks':audit}, indent=2)+'\n')
99
+ return summary
scaleswe_environment-reliable/cached_images/manifest.json ADDED
The diff for this file is too large to render. See raw diff
 
scaleswe_environment-reliable/patch.py CHANGED
@@ -1379,7 +1379,24 @@ def main():
1379
  parser.add_argument('--resolution-report', type=Path, action='append', default=[])
1380
  parser.add_argument('--automatic-paths', action='store_true', help='use shared automatic normalization, without a review file')
1381
  parser.add_argument('--review', type=Path, help='review JSON: tasks maps IDs to decisions and unresolved reasons')
 
1382
  args = parser.parse_args()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1383
  if args.validated_tasks:
1384
  if args.source or args.review or args.automatic_paths or args.resolution_report:
1385
  parser.error('Environment preparation cannot be combined with instruction patching')
 
1379
  parser.add_argument('--resolution-report', type=Path, action='append', default=[])
1380
  parser.add_argument('--automatic-paths', action='store_true', help='use shared automatic normalization, without a review file')
1381
  parser.add_argument('--review', type=Path, help='review JSON: tasks maps IDs to decisions and unresolved reasons')
1382
+ parser.add_argument('--restore-historical-instructions', type=Path, help='Current release tasks; restore recorded historical instructions and preserve runtime/image bindings')
1383
  args = parser.parse_args()
1384
+ if args.restore_historical_instructions:
1385
+ if not all((args.validated_tasks, args.validated_archive, args.run_record, args.publication_revision)):
1386
+ parser.error('Historical restoration requires validated tasks, archive, run record and immutable publication revision')
1387
+ helper = Path(__file__).resolve().parent / 'assets' / 'historical_release.py'
1388
+ if helper.is_file():
1389
+ import importlib.util
1390
+ spec = importlib.util.spec_from_file_location('historical_release', helper)
1391
+ module = importlib.util.module_from_spec(spec)
1392
+ spec.loader.exec_module(module)
1393
+ restore = module.restore
1394
+ else:
1395
+ from data.utils.historical_release import restore
1396
+ print(json.dumps(restore(args.restore_historical_instructions, args.validated_tasks,
1397
+ args.validated_archive, args.run_record, 'scaleswe',
1398
+ args.publication_revision, args.output), indent=2))
1399
+ return
1400
  if args.validated_tasks:
1401
  if args.source or args.review or args.automatic_paths or args.resolution_report:
1402
  parser.error('Environment preparation cannot be combined with instruction patching')
scaleswe_environment-reliable/tasks.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c2a5da158f8efe787f8e8f1cd05c4fcda55333f6ae8b78c090ccaef6dba83af8
3
- size 117585420
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28c9439d706bd9293101b985908dc896f9c31d0ee17fd6982bbac6a0e1095adf
3
+ size 1067022154