verifiers 0.3.2.dev161__py3-none-any.whl → 0.3.2.dev162__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.
@@ -185,57 +185,60 @@ class EnvServerPool:
185
185
  while True:
186
186
  events = dict(await self._poller.poll())
187
187
  if self.frontend in events:
188
- (
189
- client_id,
190
- request_id,
191
- method,
192
- payload,
193
- ) = await self.frontend.recv_multipart()
194
- if method == b"health":
195
- await self.frontend.send_multipart(
196
- [client_id, request_id, b"reply", _HEALTH]
188
+ frames = await self.frontend.recv_multipart()
189
+ # Drop malformed requests without skipping ready worker replies.
190
+ if len(frames) != 4:
191
+ logger.warning(
192
+ "frontend: dropping malformed request (%d frames, expected 4)",
193
+ len(frames),
197
194
  )
198
- elif method == b"cancel":
199
- # Route the cancel to the worker holding the target run;
200
- # an unknown/finished target (or an unparseable payload
201
- # — one bad frame must not tear down the broker) is
202
- # answered inline
203
- try:
204
- body = msgpack.unpackb(payload, raw=False)
205
- target = str(body.get("request_id", "")).encode()
206
- except Exception: # noqa: BLE001 - one bad frame must not kill the broker
207
- target = b""
208
- target_entry = pending.get(target)
209
- if target_entry is None:
195
+ else:
196
+ client_id, request_id, method, payload = frames
197
+ if method == b"health":
210
198
  await self.frontend.send_multipart(
211
- [client_id, request_id, b"reply", _CANCEL_MISS]
199
+ [client_id, request_id, b"reply", _HEALTH]
212
200
  )
201
+ elif method == b"cancel":
202
+ # Route the cancel to the worker holding the target run;
203
+ # an unknown/finished target (or an unparseable payload
204
+ # — one bad frame must not tear down the broker) is
205
+ # answered inline
206
+ try:
207
+ body = msgpack.unpackb(payload, raw=False)
208
+ target = str(body.get("request_id", "")).encode()
209
+ except Exception: # noqa: BLE001 - one bad frame must not kill the broker
210
+ target = b""
211
+ target_entry = pending.get(target)
212
+ if target_entry is None:
213
+ await self.frontend.send_multipart(
214
+ [client_id, request_id, b"reply", _CANCEL_MISS]
215
+ )
216
+ else:
217
+ worker = target_entry["worker"]
218
+ worker["active"] += 1
219
+ pending[request_id] = {
220
+ "client_id": client_id,
221
+ "worker": worker,
222
+ }
223
+ in_flight += 1
224
+ await worker["dealer"].send_multipart(
225
+ [request_id, method, payload]
226
+ )
213
227
  else:
214
- worker = target_entry["worker"]
228
+ worker = min(self.workers, key=lambda w: w["active"])
215
229
  worker["active"] += 1
216
230
  pending[request_id] = {
217
231
  "client_id": client_id,
218
232
  "worker": worker,
219
233
  }
220
234
  in_flight += 1
235
+ # forward without client_id — the DEALER identity is the worker's
236
+ # `client_id`; we hold the real one in `pending`.
221
237
  await worker["dealer"].send_multipart(
222
238
  [request_id, method, payload]
223
239
  )
224
- else:
225
- worker = min(self.workers, key=lambda w: w["active"])
226
- worker["active"] += 1
227
- pending[request_id] = {
228
- "client_id": client_id,
229
- "worker": worker,
230
- }
231
- in_flight += 1
232
- # forward without client_id — the DEALER identity is the worker's
233
- # `client_id`; we hold the real one in `pending`.
234
- await worker["dealer"].send_multipart(
235
- [request_id, method, payload]
236
- )
237
- if self.elastic:
238
- self._maybe_scale_up(in_flight)
240
+ if self.elastic:
241
+ self._maybe_scale_up(in_flight)
239
242
  for w in self.workers:
240
243
  if w["dealer"] in events:
241
244
  request_id, kind, data = await w["dealer"].recv_multipart(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev161
3
+ Version: 0.3.2.dev162
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
@@ -154,7 +154,7 @@ verifiers/v1/serve/__init__.py,sha256=wOKuwfugzmDT4yIniwzCXlf4G6tv6Cg8Kc--WMa38B
154
154
  verifiers/v1/serve/client.py,sha256=E2y2x4qqYveWRWC9VZYQEu19aMEryPWTdXnYzbq5uTA,9829
155
155
  verifiers/v1/serve/delta.py,sha256=wSQnfrm57K2bxZLbOsIiR0u161oCtpH3fykYelXwwPo,13633
156
156
  verifiers/v1/serve/encoding.py,sha256=hBZFucAZK9riXOV3DaHcskq9zHTT8gVGkoFVOPfnr30,2499
157
- verifiers/v1/serve/pool.py,sha256=bT-FOlIuOiBtOasuPB-p9887tkpEqvQUJBgn1Q45ph0,15912
157
+ verifiers/v1/serve/pool.py,sha256=pUvUhAvcTkLinFuTJJOp6pqi_sQdWsjJS4clLzgkRhc,16362
158
158
  verifiers/v1/serve/server.py,sha256=kaQFh_tVRcmRaQoB5o6CU4y8Fh9X-zFg-cmcvU2GExg,9913
159
159
  verifiers/v1/serve/types.py,sha256=Qw5IjiJhsZz4giSXUBi9dfInBnQZ5_xiUmgH2qp8jPI,1741
160
160
  verifiers/v1/tasksets/__init__.py,sha256=2ijE3qIlLoUA02g6iysOwWQylyBBQL1GhSpjv8_bp0w,521
@@ -193,8 +193,8 @@ verifiers/v1/utils/scope.py,sha256=bzUEiWDOVdbj7dXOwGOlzsQ_-Xu0j9NR5TalQB-8TS8,8
193
193
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
194
194
  verifiers/v1/utils/trace_store.py,sha256=RsCDonGR-bs-tvEstcppiJm3jFmAdIiG83fA5KtCbAw,2801
195
195
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
196
- verifiers-0.3.2.dev161.dist-info/METADATA,sha256=YLQztvhTrnWx-C4jdpEGMn9mEdCzpXkBmBpFAMiiO4A,4161
197
- verifiers-0.3.2.dev161.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
198
- verifiers-0.3.2.dev161.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
199
- verifiers-0.3.2.dev161.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
- verifiers-0.3.2.dev161.dist-info/RECORD,,
196
+ verifiers-0.3.2.dev162.dist-info/METADATA,sha256=FocAQk6L9uycD720na7FpwMyDf47X7gEqG0E4lzrBUA,4161
197
+ verifiers-0.3.2.dev162.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
198
+ verifiers-0.3.2.dev162.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
199
+ verifiers-0.3.2.dev162.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
+ verifiers-0.3.2.dev162.dist-info/RECORD,,