policy_client: wire-format codecs (openpi msgpack + lerobot pickle)#251
Open
shantanuparab-tr wants to merge 3 commits into
Open
policy_client: wire-format codecs (openpi msgpack + lerobot pickle)#251shantanuparab-tr wants to merge 3 commits into
shantanuparab-tr wants to merge 3 commits into
Conversation
This was referenced Jun 15, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jun 15, 2026
shantanuparab-tr
force-pushed
the
06-15-policy-client-03-codecs
branch
2 times, most recently
from
June 15, 2026 18:45
8960bf7 to
ea1db70
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-02-neutral-types
branch
from
June 16, 2026 21:51
295906a to
b7572cd
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-03-codecs
branch
from
June 16, 2026 21:51
ea1db70 to
b334671
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-02-neutral-types
branch
from
June 16, 2026 21:57
b7572cd to
9c329c3
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-03-codecs
branch
from
June 16, 2026 21:58
b334671 to
9758bde
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-02-neutral-types
branch
from
July 16, 2026 15:12
9c329c3 to
03a323a
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-03-codecs
branch
from
July 16, 2026 15:12
9758bde to
346766b
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-02-neutral-types
branch
from
July 16, 2026 15:41
03a323a to
9d8fa58
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-03-codecs
branch
from
July 16, 2026 15:41
346766b to
909b956
Compare
Adds the two codecs that translate the neutral Observation/ActionChunk to and from each server family's wire bytes: msgpack_ndarray (openpi msgpack-numpy) and lerobot_codec (pinned LeRobot pickle/torch, fixture-tested). Introduces the TROSSEN_SDK_ENABLE_POLICY_CLIENT build gate (FetchContent msgpack-cxx).
- The lerobot emit path (encode_observation, encode_policy_setup) shipped with no automated test while decode had a byte-exact tripwire, so any future edit or numpy pin bump would silently corrupt the wire format. Add EmitObservationParity / EmitPolicySetupParity comparing emitter output against reviewed goldens (structurally verified against the CPython disassembly; emitter omits the memo table by design, so the goldens are emitter-produced, not the CPython .pkl) (PR251-F1/F2). - Guard pack_ndarray against >4 GiB payloads that would truncate the msgpack bin32 length prefix (PR251-F7). - Document that emitted numpy._core.multiarray requires the server run numpy >= 2.0 (PR251-F3); correct the emit fidelity comment that wrongly claimed byte-identical numpy output (PR251-F5).
Update the codec pin comment and captured codec fixtures to LeRobot v0.6.0 (commit 30da8e68).
shantanuparab-tr
force-pushed
the
06-15-policy-client-02-neutral-types
branch
from
July 17, 2026 14:17
9d8fa58 to
b869979
Compare
shantanuparab-tr
force-pushed
the
06-15-policy-client-03-codecs
branch
from
July 17, 2026 14:17
79b4728 to
03e39a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds the two wire-format codecs that translate the neutral
Observation/ActionChunkto and from each server family's bytes, and introduces theTROSSEN_SDK_ENABLE_POLICY_CLIENTbuild gate (off by default). No transport or client yet — just the encode/decode primitives, fixture-tested.Changes
include/trossen_sdk/hw/policy/msgpack_ndarray.{hpp}+src/hw/policy/msgpack_ndarray.cpp: openpi msgpack-numpy ndarray encode/decode.include/trossen_sdk/hw/policy/lerobot_codec.hpp+src/hw/policy/lerobot_codec.cpp: a pinned, self-contained LeRobot pickle/torch reader/writer (no libtorch dependency) — decodes the server's pickled action chunks and emits the pickled policy-setup/observation payloads.CMakeLists.txt+cmake/policy_client.cmake: introduce theTROSSEN_SDK_ENABLE_POLICY_CLIENToption (default OFF) andFetchContentofmsgpack-cxx; append the codec sources totrossen_sdkbehind the gate.tests/test_msgpack_ndarray.cpp,tests/test_lerobot_codec.cpp,tests/fixtures/lerobot_codec/*,tests/CMakeLists.txt: round-trip + parity tests against pinned fixtures captured from the real LeRobot version (capture_fixtures.py+versions.jsondocument provenance); malformed-input/whitelist-safety cases.Test Plan
-DTROSSEN_SDK_ENABLE_POLICY_CLIENT=ONtest_msgpack_ndarray,test_lerobot_codec(fixture parity exact)pre-commit run --all-files)Breaking Changes
None. New gated sources; the build gate defaults OFF so existing builds are unaffected.
Related
Based on #248. Stacked on #250; followed by #252–#255.