Skip to content

fix(ocean/tmaze): migrate binding.c from env_binding.h to vecenv.h API - #658

Open
Battleplus wants to merge 2 commits into
PufferAI:4.0from
Battleplus:fix/tmaze-vecenv-migration
Open

fix(ocean/tmaze): migrate binding.c from env_binding.h to vecenv.h API#658
Battleplus wants to merge 2 commits into
PufferAI:4.0from
Battleplus:fix/tmaze-vecenv-migration

Conversation

@Battleplus

Copy link
Copy Markdown

What

Migrate tmaze environment from the deprecated env_binding.h API to the current vecenv.h API.

Why

The tmaze environment uses env_binding.h which no longer exists in PufferLib 4.0, causing compilation errors:

ocean/tmaze/binding.c:4:10: fatal error: '../env_binding.h' file not found

How

  • Use vecenv.h instead of env_binding.h
  • Use dict_get() for reading kwargs (size parameter)
  • Use dict_set() for exporting log values
  • Remove Python-specific PyObject* types

Testing

  • Verified the binding.c compiles with the new API
  • Follows the same pattern as the existing ocean/target/binding.c

Fixes #542 (for tmaze environment)

Battleplus and others added 2 commits August 21, 2026 10:27
Add required num_agents and rng fields to TMaze struct.
Change actions/terminals from int*/uchar* to float* to match
vecenv.h buffer ownership. Remove allocate_TMaze from my_init
since vecenv manages observation/action/reward/terminal buffers.
Fix dict_get call to use ->value accessor (2-arg API).
Cast float actions to int in c_step for discrete action handling.

Fixes PufferAI#542 (tmaze environment only)

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

17/52 Ocean envs fail to use v4 API

1 participant