story: DGR-033 Build a standalone fake C++ gRPC Shard worker

This commit is contained in:
Dobromir Popov
2026-07-25 22:38:00 +03:00
parent 25e53bfeab
commit 766e480ba5
12 changed files with 3860 additions and 12 deletions

View File

@@ -62,6 +62,21 @@ message(STATUS "Pinned gRPC ${gRPC_VERSION}: building ShardRuntime service stubs
enable_testing()
# The standalone fake Shard worker (DGR-033): a real gRPC server over the
# ShardRuntime service, backed by the model-free FakeShardEngine. It links the
# grpc service stubs only — no llama.cpp, no graph-execution entry point.
add_executable(shard_worker
worker/shard_worker_main.cpp
worker/shard_service.cpp)
target_include_directories(shard_worker PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/worker")
target_link_libraries(shard_worker PRIVATE shard_runtime_grpc gRPC::grpc++)
# Pure-C++ CTest: the worker binds an ephemeral port, self-drives the full
# lifecycle (capability, health, fragmented prefill, decode, release) over a
# real loopback gRPC channel, and exits non-zero on any mismatch. This proves
# the worker serves the contract without needing a Python environment.
add_test(NAME shard_worker_selftest COMMAND shard_worker --selftest)
add_executable(shard_protocol_conformance tests/test_shard_protocol_conformance.cpp)
target_link_libraries(shard_protocol_conformance PRIVATE shard_runtime_proto)