Gymnasium Compatibility¶
RLMesh follows the Gymnasium environment shape:
env = gym.make("CartPole-v1")
EnvServer(env, "127.0.0.1:5555").serve()
The server reads observation_space, action_space, reset, step, and close. Common Gymnasium
wrappers can stay in place.
Spaces¶
RLMesh supports these Gymnasium spaces. The Stability column matches the API surface policy in
api_metadata.json: Stable spaces follow the compatibility guarantees in Compatibility,
while Experimental spaces may still change.
Fundamental Spaces¶
Gymnasium space |
RLMesh space |
Stability |
Notes |
|---|---|---|---|
|
|
Stable |
Uniform and array bounds are accepted. |
|
|
Stable |
|
|
|
Experimental |
Integer and shaped forms are accepted. |
|
|
Experimental |
One- and two-dimensional |
|
|
Experimental |
Custom charsets are preserved; default charsets are treated as unbounded. |
For Text, RLMesh still preserves min_length and max_length. Only the default Gymnasium charset
is treated as unrestricted, so punctuation and whitespace are not rejected just because the source
space used Gymnasium’s default alphanumeric charset.
Composite Spaces¶
Gymnasium space |
RLMesh space |
Stability |
Notes |
|---|---|---|---|
|
|
Experimental |
Supported when child spaces are. |
|
|
Stable |
Supported when child spaces are. |
Not supported:
GraphSequenceOneOf
Unsupported spaces fail directly instead of silently changing the environment contract.
Value Conformance¶
RLMesh checks values against their declared spaces a little differently from Gymnasium’s
passive_env_checker:
An out-of-bounds
Boxvalue, or an out-of-charset/lengthTextvalue, is delivered with a warning (under therlmesh.conformance.warninginfo key) rather than passed through silently, andNaNis always rejected. See Compatibility for thestrict/offpolicy knob.A value is coerced to its declared dtype before transport, whereas Gymnasium warns but forwards the original dtype. A
float64observation for afloat32space is delivered asfloat32.
Conversion Helpers¶
Use these helpers when you need to convert spaces yourself:
from rlmesh import spaces
rlmesh_space = spaces.from_gymnasium_space(gym_space)
gym_space = spaces.to_gymnasium_space(rlmesh_space)