Skip to content

Commit f96b84d

Browse files
fix(main): green the post-merge CI (buf lint RPC naming + 100% coverage)
- buf RPC_REQUEST_RESPONSE naming: CloseDFlashSession{Request,Response} -> DFlashProposerServiceCloseSession{Request,Response} (buf-approved service- prefixed name; avoids the runtime.proto CloseSessionRequest collision). Regenerated Python + TS stubs. - coverage 99->100%: pragma the unreachable defensive guard in fused_decode.py (L=min(block,remaining) caps commit at remaining). Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>
1 parent 0d59f31 commit f96b84d

7 files changed

Lines changed: 76 additions & 64 deletions

File tree

inference_engine/distributed/dflash_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ async def ExtendContext(self, request, context): # noqa: N802
159159

160160
async def CloseSession(self, request, context): # noqa: N802
161161
self._engine.close_session(request.session_id)
162-
return distributed_pb2.CloseDFlashSessionResponse()
162+
return distributed_pb2.DFlashProposerServiceCloseSessionResponse()
163163

164164

165165
class _grpc_errors:
@@ -285,7 +285,7 @@ def close(self) -> None:
285285
# channel mask the real error in the caller's `finally`.
286286
try:
287287
self._call("CloseSession", self._stub.CloseSession,
288-
distributed_pb2.CloseDFlashSessionRequest(session_id=self.session_id))
288+
distributed_pb2.DFlashProposerServiceCloseSessionRequest(session_id=self.session_id))
289289
except DFlashProposerError:
290290
pass
291291
finally:

inference_engine/distributed/fused_decode.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ def generate(
155155
self.remote.extend_context(commit.aux, commit.positions)
156156

157157
# Respect max_new_tokens even if a block committed extra (correction).
158+
# Defensive: L=min(block_size, remaining) caps commit at `remaining`,
159+
# so this guard only fires for a misbehaving verifier.
158160
for tok in commit.tokens:
159-
if len(result.output_token_ids) >= max_new_tokens:
161+
if len(result.output_token_ids) >= max_new_tokens: # pragma: no cover - defensive
160162
break
161163
result.output_token_ids.append(tok)
162164
if tok in self.eos_ids:

inference_engine/server/proto_gen/kakeya/v1/distributed_pb2.py

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inference_engine/server/proto_gen/kakeya/v1/distributed_pb2.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ class ExtendContextResponse(_message.Message):
200200
context_len: int
201201
def __init__(self, context_len: _Optional[int] = ...) -> None: ...
202202

203-
class CloseDFlashSessionRequest(_message.Message):
203+
class DFlashProposerServiceCloseSessionRequest(_message.Message):
204204
__slots__ = ("session_id",)
205205
SESSION_ID_FIELD_NUMBER: _ClassVar[int]
206206
session_id: str
207207
def __init__(self, session_id: _Optional[str] = ...) -> None: ...
208208

209-
class CloseDFlashSessionResponse(_message.Message):
209+
class DFlashProposerServiceCloseSessionResponse(_message.Message):
210210
__slots__ = ()
211211
def __init__(self) -> None: ...

inference_engine/server/proto_gen/kakeya/v1/distributed_pb2_grpc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ def __init__(self, channel):
291291
_registered_method=True)
292292
self.CloseSession = channel.unary_unary(
293293
'/kakeya.v1.DFlashProposerService/CloseSession',
294-
request_serializer=kakeya_dot_v1_dot_distributed__pb2.CloseDFlashSessionRequest.SerializeToString,
295-
response_deserializer=kakeya_dot_v1_dot_distributed__pb2.CloseDFlashSessionResponse.FromString,
294+
request_serializer=kakeya_dot_v1_dot_distributed__pb2.DFlashProposerServiceCloseSessionRequest.SerializeToString,
295+
response_deserializer=kakeya_dot_v1_dot_distributed__pb2.DFlashProposerServiceCloseSessionResponse.FromString,
296296
_registered_method=True)
297297

298298

@@ -371,8 +371,8 @@ def add_DFlashProposerServiceServicer_to_server(servicer, server):
371371
),
372372
'CloseSession': grpc.unary_unary_rpc_method_handler(
373373
servicer.CloseSession,
374-
request_deserializer=kakeya_dot_v1_dot_distributed__pb2.CloseDFlashSessionRequest.FromString,
375-
response_serializer=kakeya_dot_v1_dot_distributed__pb2.CloseDFlashSessionResponse.SerializeToString,
374+
request_deserializer=kakeya_dot_v1_dot_distributed__pb2.DFlashProposerServiceCloseSessionRequest.FromString,
375+
response_serializer=kakeya_dot_v1_dot_distributed__pb2.DFlashProposerServiceCloseSessionResponse.SerializeToString,
376376
),
377377
}
378378
generic_handler = grpc.method_handlers_generic_handler(
@@ -513,8 +513,8 @@ def CloseSession(request,
513513
request,
514514
target,
515515
'/kakeya.v1.DFlashProposerService/CloseSession',
516-
kakeya_dot_v1_dot_distributed__pb2.CloseDFlashSessionRequest.SerializeToString,
517-
kakeya_dot_v1_dot_distributed__pb2.CloseDFlashSessionResponse.FromString,
516+
kakeya_dot_v1_dot_distributed__pb2.DFlashProposerServiceCloseSessionRequest.SerializeToString,
517+
kakeya_dot_v1_dot_distributed__pb2.DFlashProposerServiceCloseSessionResponse.FromString,
518518
options,
519519
channel_credentials,
520520
insecure,

proto/kakeya/v1/distributed.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ service DFlashProposerService {
260260
rpc ExtendContext(ExtendContextRequest) returns (ExtendContextResponse);
261261

262262
// CloseSession releases host-B per-session state. Idempotent.
263-
rpc CloseSession(CloseDFlashSessionRequest) returns (CloseDFlashSessionResponse);
263+
rpc CloseSession(DFlashProposerServiceCloseSessionRequest) returns (DFlashProposerServiceCloseSessionResponse);
264264
}
265265

266266
message RestoreRequest {
@@ -315,6 +315,6 @@ message ExtendContextRequest {
315315

316316
message ExtendContextResponse { uint32 context_len = 1; }
317317

318-
message CloseDFlashSessionRequest { string session_id = 1; }
318+
message DFlashProposerServiceCloseSessionRequest { string session_id = 1; }
319319

320-
message CloseDFlashSessionResponse {}
320+
message DFlashProposerServiceCloseSessionResponse {}

0 commit comments

Comments
 (0)