verifiers 0.3.2.dev133__py3-none-any.whl → 0.3.2.dev134__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,6 +35,16 @@ logger = logging.getLogger(__name__)
35
35
  EFFECTIVELY_UNBOUNDED_SECONDS = 30 * 24 * 60 * 60
36
36
  """Safety deadline for APIs that require a finite bound. Normal execution remains
37
37
  bounded by idle detection or rollout cancellation; 30 days is above any real run."""
38
+ # The SDK reads finished jobs' output through a bounded pool whose deadline includes time
39
+ # spent queued; its defaults (20 reads, 45s) expire most reads when thousands of rollouts
40
+ # finish a job at once (e.g. every harness's setup at a 3k-rollout start).
41
+ _OUTPUT_READS = 100
42
+ """Concurrent output reads on the shared client."""
43
+ _OUTPUT_DEADLINE_SECONDS = 300
44
+ """Deadline for one read of a finished job's output, queue time included."""
45
+ _OUTPUT_RETRIES = 10
46
+ """Re-reads of a finished job's output that the SDK still failed to fetch, before the
47
+ exec is reported as failed."""
38
48
 
39
49
 
40
50
  BASE_LABELS: list[str] = []
@@ -150,7 +160,9 @@ class PrimeRuntime(Runtime):
150
160
  loop = asyncio.get_running_loop()
151
161
  shared = _shared_clients.get(loop)
152
162
  if shared is None:
153
- shared = _shared_clients[loop] = _SharedClient(AsyncSandboxClient())
163
+ shared = _shared_clients[loop] = _SharedClient(
164
+ AsyncSandboxClient(background_job_output_concurrency=_OUTPUT_READS)
165
+ )
154
166
  shared.leases += 1
155
167
  self._client = shared.client
156
168
  # Map the resources onto prime's API (minutes, split GPU; memory/disk are already
@@ -279,18 +291,34 @@ class PrimeRuntime(Runtime):
279
291
  env=self.process_env(env),
280
292
  )
281
293
  delay = 0.1
294
+ output_retries = 0
295
+ missing = None
282
296
  while True:
283
- result = await self._client.get_background_job(self.info.id, job)
284
- if result.completed:
297
+ result = await self._client.get_background_job(
298
+ self.info.id, job, timeout=_OUTPUT_DEADLINE_SECONDS
299
+ )
300
+ # Under load the SDK can see a job finish yet miss its output (its bounded
301
+ # output reads expire while queued) and reports that as `*_error`. The job
302
+ # is done, so asking again re-reads the output.
303
+ missing = result.stdout_error or result.stderr_error
304
+ if result.completed and (
305
+ missing is None or output_retries == _OUTPUT_RETRIES
306
+ ):
285
307
  break
308
+ if result.completed:
309
+ output_retries += 1
286
310
  await asyncio.sleep(delay)
287
311
  delay = min(delay * 2, 3)
288
312
  except (
289
313
  Exception
290
314
  ) as e: # a sandbox/API failure is one rollout's problem, not the eval's
291
315
  raise SandboxError(f"prime exec failed: {e}") from e
316
+ if missing is not None:
317
+ raise SandboxError(f"prime exec output unavailable: {missing}")
318
+ if result.exit_code is None:
319
+ raise SandboxError("prime exec completed without an exit code")
292
320
  return ProgramResult(
293
- exit_code=result.exit_code or 0,
321
+ exit_code=result.exit_code,
294
322
  stdout=result.stdout or "",
295
323
  stderr=result.stderr or "",
296
324
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev133
3
+ Version: 0.3.2.dev134
4
4
  Summary: Verifiers: Environments for LLM Reinforcement Learning
5
5
  Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
6
6
  Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
@@ -145,7 +145,7 @@ verifiers/v1/runtimes/base.py,sha256=IKmrJSJltWX9M1nPUZExKluPJM4N82VsnqQGFz0ECV8
145
145
  verifiers/v1/runtimes/container.py,sha256=puQD8X9acP6GefoCNEnq40POi-nXPD-729bUjTVShfM,9554
146
146
  verifiers/v1/runtimes/limiters.py,sha256=rOfQJcMdYcLSKq8AL9O09BfGOLqpYmNgrCxXXNcHLmU,2849
147
147
  verifiers/v1/runtimes/modal.py,sha256=6ccitC0HVsAP_l8soJ_RQYNIVKrJjDsz2vAJBtxUZjw,17476
148
- verifiers/v1/runtimes/prime.py,sha256=nTtu-uBjc39UxfMPEyndshfAiIdk1V4L4aE6zSVVSn0,17673
148
+ verifiers/v1/runtimes/prime.py,sha256=Ly7eTEJY06-kjBBZhpJVALtsW23M-ZLJ1mlq27uSS9U,19158
149
149
  verifiers/v1/runtimes/subprocess.py,sha256=QmpQ235_xrX6gowrr8557VgbydOXpLbfFq0KKGfJThk,8774
150
150
  verifiers/v1/runtimes/docker/__init__.py,sha256=2wceP-8V-w0dQBEeLtoJFfCZ135DxP2rcdcUBmSWiNU,18543
151
151
  verifiers/v1/runtimes/docker/egress.py,sha256=wtKWTL2_zFidxMR7lDRmfevQlOsl2Iyk88ebdO4Kqqw,24566
@@ -190,8 +190,8 @@ verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4
190
190
  verifiers/v1/utils/scope.py,sha256=bzUEiWDOVdbj7dXOwGOlzsQ_-Xu0j9NR5TalQB-8TS8,838
191
191
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
192
192
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
193
- verifiers-0.3.2.dev133.dist-info/METADATA,sha256=Ff2GNRZ7xB_YdcKn5Cu6_FLNmVH6PuNJYVXZ-brj6mE,4161
194
- verifiers-0.3.2.dev133.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
195
- verifiers-0.3.2.dev133.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
196
- verifiers-0.3.2.dev133.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
197
- verifiers-0.3.2.dev133.dist-info/RECORD,,
193
+ verifiers-0.3.2.dev134.dist-info/METADATA,sha256=CEOjkwaS7mTLz0q7Z8Bw-4TsRp-2HwXgtegTv3ps5Os,4161
194
+ verifiers-0.3.2.dev134.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
195
+ verifiers-0.3.2.dev134.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
196
+ verifiers-0.3.2.dev134.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
197
+ verifiers-0.3.2.dev134.dist-info/RECORD,,