Skip to content

Fix MJX x64 int dtypes - #3409

Open
devshahofficial wants to merge 2 commits into
google-deepmind:mainfrom
devshahofficial:agent/pr3334-mjx-x64-dtypes
Open

Fix MJX x64 int dtypes#3409
devshahofficial wants to merge 2 commits into
google-deepmind:mainfrom
devshahofficial:agent/pr3334-mjx-x64-dtypes

Conversation

@devshahofficial

Copy link
Copy Markdown
Contributor

Draft follow-up for #3334 / #2565, based on the original x64 dtype fix from @discobot.

Under jax_enable_x64, compiled MJX functions can produce canonical JAX int dtypes for contact geom indices and tendon wrap indices, while put_data / make_data still supplied int32 in a few places. This aligns those fields with the canonical JAX int dtype and adds an AOT-style regression test.

Changes:

  • uses canonical JAX int dtype for ten_wrapadr, ten_wrapnum, and wrap_obj in make_data / put_data
  • casts contact geom1, geom2, and geom in _put_contact
  • keeps solver_niter as int32
  • adds an x64 make_data / put_data / compiled mjx.step interchangeability test

Local validation:

  • python3 -m py_compile mjx/mujoco/mjx/_src/io.py mjx/mujoco/mjx/_src/io_test.py
  • git diff --check

Could not run the focused MJX runtime test locally because this base Python is missing jax, jaxlib, absl-py, and mujoco.

Opening as draft to avoid duplicating the existing open PR unless maintainers want this rebased version.

@devshahofficial
devshahofficial force-pushed the agent/pr3334-mjx-x64-dtypes branch from cd1ad26 to 95fd062 Compare July 19, 2026 14:05
@yuvaltassa
yuvaltassa requested a review from btaba July 19, 2026 23:09
@devshahofficial
devshahofficial marked this pull request as ready for review July 20, 2026 15:34
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.

1 participant