Commit Graph

2379 Commits

Author SHA1 Message Date
Kyle Bayes 0eec09dd60 Add runtime assertions to mji functions.
PiperOrigin-RevId: 933106771
Change-Id: I523cdceb89c90611f27983731c49fd4887034431
2026-06-16 08:36:32 -07:00
Kyle Bayes d9b677b49b Refactor remaining primitive and convex collision code to use mjPreContact instead of mjContact. Introduce internal struct mjcPair in engine_collision_driver.c for readability and extensibility for flex objects. This is a no-op.
PiperOrigin-RevId: 933105275
Change-Id: Id862b01774df63dcdb42629a5b7dd12019f12ffd
2026-06-16 08:33:09 -07:00
Kyle Bayes b469144a81 Modify mjc_FlexSDF to support mjPreContact directly.
PiperOrigin-RevId: 933068825
Change-Id: I328d64bb05270067ce146908b0df3ca83f10ed9b
2026-06-16 07:04:16 -07:00
Yuval Tassa 8efb396b26 Reorder and adjust GUI physics options.
PiperOrigin-RevId: 933007222
Change-Id: Ia6944744112baa309de165144179ad96d914a734
2026-06-16 04:06:35 -07:00
Haroon Qureshi c0fa33f97f Rename mjrFilamentConfig to mjrfContextConfig.
PiperOrigin-RevId: 932996526
Change-Id: Ia81ee074471ab4ff41e0829fa5ba70203599fdb6
2026-06-16 03:36:22 -07:00
Haroon Qureshi ecee1e0c53 Rename nattributes to num_attributes for consistency.
PiperOrigin-RevId: 932973447
Change-Id: Idbf9a52c89e24f34ae360d1617cb72dfaa92aa4e
2026-06-16 02:40:13 -07:00
Copybara-Service c9ba1e452d Merge pull request #3338 from devshahofficial:devshahofficial/filament-emissive-factors
PiperOrigin-RevId: 932483570
Change-Id: If8ff968d2650551118a38ea4837063796bd85f66
2026-06-15 08:45:48 -07:00
Haroon Qureshi 7472440dbd Make mjrfilament.h conform to C standards.
PiperOrigin-RevId: 932424719
Change-Id: I1f8d8d91041ea1c2b77010761404bf0e519bcc29
2026-06-15 06:33:18 -07:00
Haroon Qureshi 9e45ce9801 Use num_ prefix consistently in API.
PiperOrigin-RevId: 932391786
Change-Id: I71c7f300fdb84ce1129ea3da6336df2fcffc5712
2026-06-15 05:08:34 -07:00
devshahofficial 7646a56e82 Fix Filament emissive material factors 2026-06-13 15:58:30 -07:00
Yuval Tassa 67a1ea6dca Track authored flags for global attributes
PiperOrigin-RevId: 931585539
Change-Id: Ifdc8c59de6c5a553daf6e0af09d8192aff6b0610
2026-06-13 02:58:32 -07:00
Haroon Qureshi 0ea9c7cb3a Expose function for determining if tendons should be drawn using a catenary.
PiperOrigin-RevId: 931170146
Change-Id: Ia3352a3e2bdc5e4df932e9d476e1e34200b62df1
2026-06-12 08:45:22 -07:00
Michael Moss 4bb02e299d Resolve Studio assets path dynamically.
PiperOrigin-RevId: 931162732
Change-Id: Ib44a74790facfa797ca2c4f107edb0062a89c117
2026-06-12 08:26:24 -07:00
Haroon Qureshi 2c125dd447 Add Update function to LightManager.
PiperOrigin-RevId: 931152006
Change-Id: I6fe5d4ab0dbc8032fe84fd12968666d755d1d7d5
2026-06-12 07:58:43 -07:00
Haroon Qureshi 01d5be61e3 Move ModelObjects and LightManager to filament/support.
PiperOrigin-RevId: 931136854
Change-Id: I3ce3b7265c5d3c9a49fa84be46e87a76c6e2c8b5
2026-06-12 07:18:07 -07:00
Haroon Qureshi a37389ccfb Split SceneObjects out from ModelObjects.
PiperOrigin-RevId: 930960334
Change-Id: I7958a8240a90e2eb7fb87e58e5bea561459a7695
2026-06-11 23:36:10 -07:00
Yuval Tassa a070535c65 Fix GCC -Wformat-truncation error in legacy log adapter
Widen snprintf buffer from 1024 to 2048 bytes in mju_defaultLogHandler
to avoid truncation warning when formatting "func: subject".

PiperOrigin-RevId: 930823501
Change-Id: I0b2246f23c44e983bea76976b684d2efdfdff29c
2026-06-11 17:23:43 -07:00
Yuval Tassa 58f6d52491 Introduce new logging API, fixes #858
PiperOrigin-RevId: 930744288
Change-Id: I6ec1203b55c031390f3eef23192e2337508ce886
2026-06-11 14:36:57 -07:00
Yuval Tassa a2abaf7aef Render perturbation box as a wireframe.
PiperOrigin-RevId: 930707140
Change-Id: Iab3577c8b45a235870f57001d38b6b1cd8acd170
2026-06-11 13:31:16 -07:00
Haroon Qureshi 96781fa793 Move filament renderer out of experimental into src/render/filament.
Also:
- renames the main header file to mjrfilament.h.
- moves filament_util under a "support" folder.
PiperOrigin-RevId: 930448415
Change-Id: Iad89756aaf1ddf4c3e67e1afc3a13776f71fa20f
2026-06-11 04:43:20 -07:00
Kevin Zakka 1aaced190a Copybara import of the project:
--
3439d8a5cd745dfd2776593916eead65cb456afc by Kevin Zakka <kevinarmandzakka@gmail.com>:

Respect an explicit CMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF

The default-LTO guard checked the value rather than whether it was DEFINED, so an
explicit -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF (used in CI to cut build time)
was silently flipped back ON. Check DEFINED instead; default-on for Release is
preserved when the caller makes no choice.

--
bd15d1b264e5ab9594669b58fa1e0388d0a16f6b by Kevin Zakka <kevinarmandzakka@gmail.com>:

Speed up CI

~10x faster on the POSIX jobs (~45m -> ~4-5m) and ~2x overall wall-clock.

- Build Studio/Filament and WASM only in their dedicated canary jobs, not in
  every matrix job (WASM uses emcc, which ignores the host compiler).
- Compiler matrix -> build_matrix.json with core/extended tiers: PRs build the
  core set, pushes to main run the full sweep.
- ccache across build jobs (studio cache keyed on the Filament pin); fix the
  Python-bindings build so ccache hits (CCACHE_BASEDIR).
- Disable IPO/LTO on POSIX (it was silently on); keep it on Windows where /GL-off
  exposes a latent test bug and build time is not the bottleneck.
- Run ctest in parallel on POSIX (~2x); uv for Python installs (~29s -> ~8s).
- Move MJX (compiler-independent) to a single dedicated job.
- Restrict GITHUB_TOKEN to contents: read; bump actions off deprecated Node20.

--
c0618ab7aef524b238e0a30f2f23c50c4ce0c9b1 by Kevin Zakka <kevinarmandzakka@gmail.com>:

Build the gcc jobs with LTO off too

Restores LTO-off for gcc (recovering the build-time win). That surfaces known
gcc-12 -Wrestrict false positives in libstdc++ <char_traits> at -O3; two clean,
behavior-preserving rewrites in the XML writer avoid them. Confirmed gcc-12 and
gcc-14 build clean with LTO off (PR #3325).

--
2c38da0f48f77635e58e4b7931b86d60f3c253c7 by Kevin Zakka <kevinarmandzakka@gmail.com>:

Respect explicit IPO=OFF in the Simulate and Sample options too

Apply the same DEFINED check as cmake/MujocoOptions.cmake to the simulate/ and
sample/ subprojects (which carry identical copies of the guard) to keep the three
in sync, as the internal import requires. Since the guard now honors =OFF, stop
forcing IPO=OFF on the tiny samples/simulate CI builds so they keep their default
LTO and don't expose the gcc -Werror false positives that -O3-without-LTO triggers.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/3315 from google-deepmind:speed-up-ci 2c38da0f48f77635e58e4b7931b86d60f3c253c7
PiperOrigin-RevId: 930008698
Change-Id: Ic41dc87881833c95f2ebfc0602de1ed438db3d4f
2026-06-10 12:27:14 -07:00
Kyle Bayes 6957966c7d Terminate early without contact in EPA if upper < lower on first iteration.
PiperOrigin-RevId: 929828707
Change-Id: Ide1106c14ae6eb003a9bbc238609b4bfdde221b0
2026-06-10 07:02:00 -07:00
Google DeepMind 711aa9fcd8 Fix typo in window size check.
Corrected the comparison from `max_window_width != window_height_` to `max_window_height != window_height_` when checking if the window dimensions have changed.

PiperOrigin-RevId: 929825452
Change-Id: I4ae46502495e16f86c19d4efabe8c048d708789b
2026-06-10 06:55:17 -07:00
Kyle Bayes 118baada7c Remove engine threading fallback.
PiperOrigin-RevId: 929825049
Change-Id: Iff959f8d22ed082ff470c3eec426351964c2e89d
2026-06-10 06:54:19 -07:00
Michael Moss 6f6a72f66b CMake updates for Studio integration
PiperOrigin-RevId: 929809674
Change-Id: Iabe670ced44f09fc1ea6d8dcde4b3c9ea4ad270a
2026-06-10 06:20:50 -07:00
Matija Kecman edbe6a6f74 Fix memory and resource leaks in failing resource provider open callbacks
When an mjpResourceProvider's open callback returns 0 (failure), MuJoCo does
not invoke the corresponding close callback. Previously, several resource
provider implementations allocated heap memory or system file handles before
encountering an error, failing to clean them up before returning 0. This change addresses these leaks across the codebase and clarifies the API contract.

PiperOrigin-RevId: 929803942
Change-Id: Ib7344033726895cdf037a8d9356ffc183c78c2d3
2026-06-10 06:08:17 -07:00
Kyle Bayes 2c5b8cae6c Correct projected origin on face when the magnitude of face->v becomes very small in EPA.
PiperOrigin-RevId: 929768876
Change-Id: I5daf0203e998aa1489d9ce4c78cbf0764a8963e3
2026-06-10 04:48:18 -07:00
Haroon Qureshi ecb15a8d9e Cache the render targets.
PiperOrigin-RevId: 929230223
Change-Id: I06571687ba0153c6ee8631685d1d37052419d2ac
2026-06-09 09:11:19 -07:00
Haroon Qureshi b083ae487e Introduce outline render passes and shader.
Use the jump flood algorithm to render an outline around selected
objects. This requires using custom post-processing shaders and
render passes which is managed by a new "Outliner" class.

PiperOrigin-RevId: 929212147
Change-Id: Ie6f475c7c677df7b0d4fc030a8e9520ff9dd03af
2026-06-09 08:31:49 -07:00
Haroon Qureshi e6e5229126 Format header to conform to style guide.
Also moves some types to the mjrender.h header.

PiperOrigin-RevId: 929189125
Change-Id: I19e5598210898c0defb663c60d7ecfb9a19bcd38
2026-06-09 07:43:16 -07:00
Yuval Tassa e349ea5834 Remove MJAPI from templated function declaration.
PiperOrigin-RevId: 928849785
Change-Id: I35ba63f599ba12a5d2bdb0d694240e39ca7d4174
2026-06-08 17:08:17 -07:00
Yuval Tassa 986d73c062 Fix non-unit normals in mesh convex hull compiler.
PiperOrigin-RevId: 928777934
Change-Id: I43d7adcf4c5781b57f0af9805a8ce01ebc2e3872
2026-06-08 14:40:11 -07:00
Haroon Qureshi ae2e8aa940 Rename mjrRenderTargetConfig to mjrfRenderTargetConfig.
This rename was overlooked in the previous commit which updated
the prefixes for all filament-specific render objects.

PiperOrigin-RevId: 928710590
Change-Id: I0ff09cb077f7d5643371d43a43fc992352e6d85d
2026-06-08 12:33:27 -07:00
Haroon Qureshi 2fcd135179 Remove layer mask from public API.
Instead, use materials to determine the layer mask of an object.

This hides the details/complexities of how layers are used
to render different passes from the user and will allow the
renderer to do more advanced rendering passes.

PiperOrigin-RevId: 928682525
Change-Id: I1f53dc8d12d2e574de6528977f55e79f896c6e42
2026-06-08 11:37:47 -07:00
Haroon Qureshi 982e3be9ef Add mjrfCallback type.
PiperOrigin-RevId: 928640487
Change-Id: Iebf470caafe924a976e4a1b39b0c47727e22195b
2026-06-08 10:26:40 -07:00
Adrian Collister 74d1459a4a Enable contact sensors to work with Flex.
The sensor engine now correctly retrieves body IDs for contacts involving Flex elements by using mj_flexBody when a geom ID is -1. This allows contact sensors to detect and report forces/torques on bodies involved in Flex contacts.

PiperOrigin-RevId: 928607416
Change-Id: Ia815e1b3345bcfb393c9c4a829dc98959f2da50c
2026-06-08 09:31:42 -07:00
Yuval Tassa 828052e6f4 CG solver: Replace PRP+ with Hager-Zhang update
Replace the Polak-Ribière-Plus (PRP+) conjugate direction update with the Hager-Zhang  formula in `mj_solPrimal`.

While this change has negligible effect under float64, it leads to a significant 17.5% throughput speedup over PRP+ under float32 (measured via `engine_cg_convergence_test`). This performance gain is driven by:
* A 9.4% reduction in CG iterations per step.
* A 12.1% reduction in line search evaluations per step.

The full output of the comparison is

```
================================================================
1/4: HZ + float64
================================================================

CG Convergence: 2humanoid100.xml
  1000 Newton steps, 100 evaluation points
  nv = 654, nq = 756
  metric: ||qacc_cg - qacc_newton|| / ||qacc_newton||

  Warmstart (tolerance = 0):
   Iters |    Mean Err |     Max Err | Mean Iters | LS evals
  -------+-------------+-------------+------------+---------
       5 |  3.8532e-01 |  1.4285e+00 |       5.00 |    22368
      10 |  2.0809e-01 |  9.9315e-01 |      10.00 |    44591
      20 |  6.4977e-02 |  2.3410e-01 |      20.00 |    89417
      40 |  5.2839e-03 |  2.1916e-02 |      40.00 |   180984
      80 |  3.9709e-05 |  3.0010e-04 |      80.00 |   364241
     160 |  3.2498e-09 |  3.5480e-08 |     160.00 |   730131
  -------+-------------+-------------+------------+---------

  No warmstart (tolerance = 0):
   Iters |    Mean Err |     Max Err | Mean Iters | LS evals
  -------+-------------+-------------+------------+---------
       5 |  9.0740e-01 |  5.0045e+00 |       5.00 |    22123
      10 |  3.9506e-01 |  2.1927e+00 |      10.00 |    44879
      20 |  1.2496e-01 |  6.8911e-01 |      20.00 |    90341
      40 |  1.2846e-02 |  6.9533e-02 |      40.00 |   182869
      80 |  1.0288e-04 |  8.6457e-04 |      80.00 |   368312
     160 |  5.9820e-09 |  5.0903e-08 |     160.00 |   738479
  -------+-------------+-------------+------------+---------

  Tolerance sweep (iterations = 100, warmstart):
         Tol |    Mean Err |     Max Err | Mean Iters |  Max Iters |   Solver us | LS evals
  -----------+-------------+-------------+------------+------------+-------------+---------
       1e-04 |  1.1297e-02 |  8.9331e-02 |      34.88 |         51 |   131002.94 |    12052
       1e-06 |  1.0907e-03 |  7.7468e-03 |      50.87 |         72 |   184172.44 |    16700
       1e-08 |  1.1485e-04 |  1.0085e-03 |      66.82 |         91 |   232189.34 |    20194
       1e-10 |  1.1357e-05 |  8.1547e-05 |      81.97 |        100 |   276114.42 |    23264
       1e-12 |  3.7695e-06 |  2.8592e-05 |      90.47 |        100 |   299526.58 |    24964
           0 |  3.5019e-06 |  2.8592e-05 |     100.00 |        100 |  2062208.36 |   456276
  -----------+-------------+-------------+------------+------------+-------------+---------
  Total solver time: 3185214.08 us, avg time per iter: 74.9445 us

  Pipeline mode (consecutive mj_step, tolerance = 1e-8):
  1000 steps, nv = 654
  Steps/s          : 380
  us/step (total)  : 2630.0
  us/step (constr) : 2103.7  (80.0%)
  CG iters/step    : 63.28
  LS evals/step    : 190.75
  us/iter          : 33.24

================================================================
2/4: PRP+ + float64
================================================================

CG Convergence: 2humanoid100.xml
  1000 Newton steps, 100 evaluation points
  nv = 654, nq = 756
  metric: ||qacc_cg - qacc_newton|| / ||qacc_newton||

  Warmstart (tolerance = 0):
   Iters |    Mean Err |     Max Err | Mean Iters | LS evals
  -------+-------------+-------------+------------+---------
       5 |  3.8533e-01 |  1.4285e+00 |       5.00 |    22228
      10 |  2.0808e-01 |  9.9315e-01 |      10.00 |    44873
      20 |  6.4978e-02 |  2.3410e-01 |      20.00 |    89349
      40 |  5.2895e-03 |  2.1916e-02 |      40.00 |   179827
      80 |  4.0188e-05 |  3.0010e-04 |      80.00 |   363740
     160 |  3.2891e-09 |  3.5480e-08 |     160.00 |   733905
  -------+-------------+-------------+------------+---------

  No warmstart (tolerance = 0):
   Iters |    Mean Err |     Max Err | Mean Iters | LS evals
  -------+-------------+-------------+------------+---------
       5 |  9.0740e-01 |  5.0045e+00 |       5.00 |    22590
      10 |  3.9506e-01 |  2.1927e+00 |      10.00 |    45093
      20 |  1.2496e-01 |  6.8911e-01 |      20.00 |    90393
      40 |  1.2846e-02 |  6.9533e-02 |      40.00 |   182422
      80 |  1.0288e-04 |  8.6457e-04 |      80.00 |   367264
     160 |  5.9811e-09 |  5.0903e-08 |     160.00 |   739556
  -------+-------------+-------------+------------+---------

  Tolerance sweep (iterations = 100, warmstart):
         Tol |    Mean Err |     Max Err | Mean Iters |  Max Iters |   Solver us | LS evals
  -----------+-------------+-------------+------------+------------+-------------+---------
       1e-04 |  1.1325e-02 |  8.9941e-02 |      34.95 |         52 |   129456.81 |    12060
       1e-06 |  1.0910e-03 |  7.7469e-03 |      50.85 |         72 |   181004.51 |    16687
       1e-08 |  1.1488e-04 |  1.0085e-03 |      66.83 |         91 |   228183.13 |    20189
       1e-10 |  1.1401e-05 |  8.1547e-05 |      81.98 |        100 |   269635.40 |    23259
       1e-12 |  3.8040e-06 |  2.8592e-05 |      90.52 |        100 |   293811.25 |    24967
           0 |  3.5543e-06 |  2.8592e-05 |     100.00 |        100 |  2051927.47 |   456000
  -----------+-------------+-------------+------------+------------+-------------+---------
  Total solver time: 3154018.57 us, avg time per iter: 74.1895 us

  Pipeline mode (consecutive mj_step, tolerance = 1e-8):
  1000 steps, nv = 654
  Steps/s          : 382
  us/step (total)  : 2616.6
  us/step (constr) : 2091.8  (79.9%)
  CG iters/step    : 63.57
  LS evals/step    : 193.35
  us/iter          : 32.91

================================================================
3/4: HZ + float32
================================================================

CG Convergence: 2humanoid100.xml
  1000 Newton steps, 100 evaluation points
  nv = 654, nq = 756
  metric: ||qacc_cg - qacc_newton|| / ||qacc_newton||

  Warmstart (tolerance = 0):
   Iters |    Mean Err |     Max Err | Mean Iters | LS evals
  -------+-------------+-------------+------------+---------
       5 |  3.6748e-01 |  1.2281e+00 |       5.00 |    19239
      10 |  2.0034e-01 |  6.8689e-01 |      10.00 |    39001
      20 |  6.1972e-02 |  1.9859e-01 |      20.00 |    80112
      40 |  4.0704e-03 |  1.5797e-02 |      40.00 |   168211
      80 |  2.4380e-05 |  1.5803e-04 |      79.45 |   347735
     160 |  7.7413e-07 |  4.4732e-06 |     157.27 |   704210
  -------+-------------+-------------+------------+---------

  No warmstart (tolerance = 0):
   Iters |    Mean Err |     Max Err | Mean Iters | LS evals
  -------+-------------+-------------+------------+---------
       5 |  9.3385e-01 |  4.9648e+00 |       5.00 |    19272
      10 |  3.6117e-01 |  1.9618e+00 |      10.00 |    37982
      20 |  9.7490e-02 |  5.1451e-01 |      20.00 |    76502
      40 |  9.5924e-03 |  5.5088e-02 |      40.00 |   162782
      80 |  6.7689e-05 |  5.1113e-04 |      79.91 |   344281
     160 |  1.5541e-06 |  7.6955e-06 |     157.30 |   697076
  -------+-------------+-------------+------------+---------

  Tolerance sweep (iterations = 100, warmstart):
         Tol |    Mean Err |     Max Err | Mean Iters |  Max Iters |   Solver us | LS evals
  -----------+-------------+-------------+------------+------------+-------------+---------
       1e-04 |  1.5891e-02 |  1.2929e-01 |      32.56 |         50 |   136254.00 |    10980
       1e-06 |  1.5719e-03 |  1.0990e-02 |      47.42 |         68 |   193566.00 |    15418
       1e-08 |  1.6260e-04 |  1.0680e-03 |      62.70 |         86 |   252661.00 |    20162
       1e-10 |  1.5664e-05 |  1.0999e-04 |      78.10 |        100 |   311535.00 |    24509
       1e-12 |  2.8152e-06 |  1.5236e-05 |      90.39 |        100 |   356814.00 |    27902
           0 |  2.4989e-06 |  1.5025e-05 |      99.05 |        100 |  1980580.00 |   436825
  -----------+-------------+-------------+------------+------------+-------------+---------
  Total solver time: 3231410.00 us, avg time per iter: 78.7726 us

  Pipeline mode (consecutive mj_step, tolerance = 1e-8):
  1000 steps, nv = 654
  Steps/s          : 349
  us/step (total)  : 2862.7
  us/step (constr) : 2379.3  (83.1%)
  CG iters/step    : 61.97
  LS evals/step    : 199.01
  us/iter          : 38.39

================================================================
4/4: PRP+ + float32
================================================================

CG Convergence: 2humanoid100.xml
  1000 Newton steps, 100 evaluation points
  nv = 654, nq = 756
  metric: ||qacc_cg - qacc_newton|| / ||qacc_newton||

  Warmstart (tolerance = 0):
   Iters |    Mean Err |     Max Err | Mean Iters | LS evals
  -------+-------------+-------------+------------+---------
       5 |  3.6753e-01 |  1.2281e+00 |       5.00 |    19052
      10 |  2.0028e-01 |  6.8689e-01 |      10.00 |    38761
      20 |  6.1737e-02 |  1.9863e-01 |      20.00 |    79937
      40 |  4.0915e-03 |  1.5821e-02 |      39.99 |   168159
      80 |  2.4360e-05 |  1.5808e-04 |      79.59 |   348385
     160 |  7.8367e-07 |  4.1549e-06 |     157.04 |   700760
  -------+-------------+-------------+------------+---------

  No warmstart (tolerance = 0):
   Iters |    Mean Err |     Max Err | Mean Iters | LS evals
  -------+-------------+-------------+------------+---------
       5 |  9.3385e-01 |  4.9648e+00 |       5.00 |    19494
      10 |  3.6117e-01 |  1.9618e+00 |      10.00 |    38480
      20 |  9.7485e-02 |  5.1451e-01 |      20.00 |    77213
      40 |  9.5904e-03 |  5.5078e-02 |      40.00 |   162472
      80 |  6.7647e-05 |  5.1087e-04 |      79.87 |   342990
     160 |  1.4979e-06 |  7.2291e-06 |     157.92 |   699052
  -------+-------------+-------------+------------+---------

  Tolerance sweep (iterations = 100, warmstart):
         Tol |    Mean Err |     Max Err | Mean Iters |  Max Iters |   Solver us | LS evals
  -----------+-------------+-------------+------------+------------+-------------+---------
       1e-04 |  1.5998e-02 |  1.3172e-01 |      32.49 |         50 |   135111.00 |    10953
       1e-06 |  1.5878e-03 |  1.1052e-02 |      47.33 |         67 |   190914.00 |    15418
       1e-08 |  1.5901e-04 |  1.0680e-03 |      62.65 |         84 |   250609.00 |    20215
       1e-10 |  1.5953e-05 |  1.1116e-04 |      78.01 |        100 |   307067.00 |    24562
       1e-12 |  2.8520e-06 |  1.5174e-05 |      90.27 |        100 |   353010.00 |    27931
           0 |  2.5161e-06 |  1.5129e-05 |      99.39 |        100 |  1999478.00 |   438790
  -----------+-------------+-------------+------------+------------+-------------+---------
  Total solver time: 3236189.00 us, avg time per iter: 78.9045 us

  Pipeline mode (consecutive mj_step, tolerance = 1e-8):
  1000 steps, nv = 654
  Steps/s          : 298
  us/step (total)  : 3352.8
  us/step (constr) : 2832.0  (84.5%)
  CG iters/step    : 68.43
  LS evals/step    : 226.33
  us/iter          : 41.39
```

PiperOrigin-RevId: 928590104
Change-Id: I1a96730f50f444d6141d8978feb3519009daf320
2026-06-08 08:54:07 -07:00
Haroon Qureshi 7e790879ef Fix namespace for filament-specific "mjrf" API.
PiperOrigin-RevId: 928582582
Change-Id: Idc312607b2f063d8ace8d5cc79bfbc8ac588d13f
2026-06-08 08:37:52 -07:00
Alessio Quaglino 7a7dc7ccad Add support for loading 1D flex components from OBJ line segments.
The obj_decoder plugin is updated to parse line segments ('l') from OBJ files and represent them as degenerate triangles. The user_flexcomp compiler now supports flex dimensions of 1, using these parsed line segments to define the 1D flex elements. The compile sample's error reporting is also improved.

PiperOrigin-RevId: 928566870
Change-Id: I6920729d1b1d5aeb391401c3245ebb1d4784c190
2026-06-08 08:03:30 -07:00
Kyle Bayes ac7f198536 Tune constants for nativeccd to perform better with single precision.
PiperOrigin-RevId: 928549147
Change-Id: Ic28c60f73e92bb1b9578c56f790b6cda94875907
2026-06-08 07:21:17 -07:00
Haroon Qureshi 116cfe9c70 Remove initial width/height arguments.
The ValidateSwapChains function will correctly set up swap chains
before any render calls, negating the need to have something done
in the constructor.

PiperOrigin-RevId: 928529339
Change-Id: Ie584d57f649730adc092f8683f18697892a5a14f
2026-06-08 06:34:40 -07:00
Kyle Bayes 318880126f Provide better dedupe logic in multiccd in edge collision case.
PiperOrigin-RevId: 928519426
Change-Id: I67531d1c346b1b38c098eaf32c3b13fa7d0c8eaf
2026-06-08 06:07:31 -07:00
Yuval Tassa 6c33e16bf1 Canonicalize mjVisual macros to include type and dimension.
PiperOrigin-RevId: 928506110
Change-Id: If5d031f9d87892f13486ae9ccde23c16131212de
2026-06-08 05:30:57 -07:00
Haroon Qureshi da5500c202 Implement additional draw modes:
- Default rendering but without textures.
- Island coloring based on sleep state.
- Selected object highlighting.

PiperOrigin-RevId: 928482603
Change-Id: I5eda1307bc6e71a4b0b2933b5b941e945cb9de75
2026-06-08 04:29:27 -07:00
Haroon Qureshi 543165a6cc Expose hsv2rgb as internally public function.
PiperOrigin-RevId: 928464175
Change-Id: I57ef75f28663b0da89b9af7bf730d82b965093bf
2026-06-08 03:44:50 -07:00
Haroon Qureshi b17b5f7918 Expose mjv_flexBodyIdAndPoint as a helper function.
Use the above in studio rather than a custom implementation.

PiperOrigin-RevId: 928432476
Change-Id: I99d772c4baf7260abbf9ac8f6d8032704f1ba769
2026-06-08 02:28:39 -07:00
Yuval Tassa ea2d785e0a Improve quality of maxhullvert coarse convex hulls using Qhull's Q9 option.
PiperOrigin-RevId: 928417339
Change-Id: I59ecd454f063f2e32e1c3ce08eb4a18506ddf8c8
2026-06-08 01:56:24 -07:00
Haroon Qureshi 0093210173 Remove hard-coded render target formats.
The formats are defined in the config.

PiperOrigin-RevId: 928412818
Change-Id: I20ea72214d8e1484723793d8a3f89cdcb4b617b1
2026-06-08 01:45:24 -07:00
Kevin Zakka 5fe916045c Replace strncpy with memcpy for gridlayout initialization.
memcpy is more appropriate here as the source and destination buffers have the same size, ensuring the entire buffer is copied.

PiperOrigin-RevId: 927395770
Change-Id: Idbe9dade3160f593060fae5783743b28c0452695
2026-06-05 11:25:49 -07:00
Haroon Qureshi 511cf27ff8 Move segmentation coloring logic into renderer.
PiperOrigin-RevId: 927300828
Change-Id: I994c5742ec30993d2245df167042e72820f91ac7
2026-06-05 07:57:59 -07:00