Repository navigation
Conversation
When the plugin's Sync node sends an observation as a hex string of its float32 bytes (keys without "2d"), decode it with np.frombuffer instead of receiving a JSON list of numbers. Plain lists and "2d" keys are unchanged, so older plugins keep working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part of #267: decodes the binary observations that the companion plugin PR can send.
What changes
GodotEnv._process_obsnow decodes a non-2dobservation key whose value is a string as hex-encoded float32 bytes:Keys containing
2dand plain JSON lists are handled exactly as before, so older plugins keep working.Why
With 100 agents sending 69 floats each, a step takes 5,435 µs with JSON number lists and 2,355 µs with hex float32, measured end to end with the real
Syncnode andGodotEnv. The observations match bit for bit. Full numbers are in #267.Tests
tests/test_obs_encoding.py: exact float32 round trip, plain lists left untouched, and mixed2d, hex and list keys in one observation. These tests need no Godot binary.black,isortandflake8pass with the settings in theMakefile.Companion plugin PR: edbeeching/godot_rl_agents_plugin#72
🤖 Generated with Claude Code