Skip to content

Add a single-precision job to GitHub CI - #3448

Open
yuvaltassa wants to merge 2 commits into
google-deepmind:mainfrom
yuvaltassa:ci-single-precision
Open

Add a single-precision job to GitHub CI#3448
yuvaltassa wants to merge 2 commits into
google-deepmind:mainfrom
yuvaltassa:ci-single-precision

Conversation

@yuvaltassa

@yuvaltassa yuvaltassa commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

The GitHub Actions matrix builds only double precision, so changes that break mjUSESINGLE builds or tests pass CI, and the breakage is only discovered downstream.

This adds a dedicated single job (ubuntu-24.04, clang-18) that builds the library and test suite with -DmjUSESINGLE and runs ctest. One fast configuration is enough to catch the common breakages (mjtNum-vs-double type confusion, tests without single-precision tolerances); the job runs in parallel with the rest of the workflow, so total wall-clock time is unchanged.

The first commit is mechanical, required by the org-level zizmor gate that scans any PR touching workflow files: it pins all third-party actions in build.yml to the commit hashes of their current tags (no version changes), and routes the one remaining inline ${{ matrix.* }} expansion in a run block (the samples build step) through the environment, matching every other build step.

Notes:

  • The mjUSESINGLE define is passed via CMAKE_C_FLAGS/CMAKE_CXX_FLAGS so that MujocoDependencies.cmake also builds libccd in single precision.
  • No Python/samples/install steps: the Python bindings require double precision.
  • Validated on a fork run (Add a single-precision job to GitHub CI yuvaltassa/mujoco#3): 1944 tests passed, 0 failed, 17 skipped via their mjUSESINGLE guards; 8m46s with a cold cache.

The organization-level zizmor scanner gates workflow changes and requires
hash-pinned action references (unpinned-uses, blanket policy). It also
flags the one remaining inline template expansion in a run block
(template-injection): the samples build step. Pin all third-party actions
to the commit hashes of their current tags, and pass the samples build
arguments through the environment under an explicit bash shell, matching
every other build step. No version changes: each hash is the commit its
existing tag points to.
The GitHub build matrix only tests double precision, so pull requests
that break single-precision (mjUSESINGLE) builds or tests look green on
GitHub and only fail on internal import. Add a dedicated `single` job:
one fast configuration (ubuntu / clang-18) that builds the library and
test suite with -DmjUSESINGLE and runs the C/C++ tests.
@yuvaltassa
yuvaltassa force-pushed the ci-single-precision branch from 8c49035 to 137403c Compare August 2, 2026 08:50
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