Yuval Tassa
7eb8231fda
Represent only the lower triangle in Newton solver's reduced dof-dof matrix.
...
PiperOrigin-RevId: 712488529
Change-Id: Iad91c72654376539791d7856765a0d0ac9088251
2025-01-06 04:58:55 -08:00
Yuval Tassa
daed8f46c8
Don't assume compressed input in mju_transposeSparse, allow NULL pointer for matrix values, to only transpose the structure.
...
PiperOrigin-RevId: 712472432
Change-Id: I6dd34583ab181f0c9677c55230cecdf0aed46f9e
2025-01-06 03:51:35 -08:00
Yuval Tassa
6c880eb0fa
Clean up mju_sqrMatTDSparse
...
PiperOrigin-RevId: 711486739
Change-Id: I5f9145dcd8522a9cb372cbdf60611d7d05cb524e
2025-01-02 12:02:10 -08:00
Yuval Tassa
e42370c982
Avoid allocation and copying in implicit solver's addJTBJSparse
...
PiperOrigin-RevId: 710679558
Change-Id: Ie75fdcd1127ff619c2668f568ab6a8a11e079dda
2024-12-30 04:19:10 -08:00
Yuval Tassa
a8a9607712
Inline mju_dotSparse in engine_util_sparse.h
...
PiperOrigin-RevId: 709577108
Change-Id: I76547122b5780bec76a12384effcb66315f84e13
2024-12-25 08:09:42 -08:00
Yuval Tassa
2691887500
Add engine-internal convenience macro for allocating typed arrays, improve error message.
...
PiperOrigin-RevId: 705126655
Change-Id: I2bd8fada6d33a919d2fb82297f93ac57958355a4
2024-12-11 09:04:44 -08:00
Yuval Tassa
70d944b458
micro-optimization to mju_mulMatTVecSparse
...
PiperOrigin-RevId: 691431137
Change-Id: I95f94ff38ae911194b21aa220af35c7374af9739
2024-10-30 08:41:18 -07:00
Taylor Howell
a36f2cccb6
Add nnz argument for size of allocated memory to mju_dense2sparse and check if this number is too small for number of non-zeros.
...
PiperOrigin-RevId: 690545825
Change-Id: I0e31cb907a1151cb2e4766d5f0cdfecb5629a2a6
2024-10-28 03:46:50 -07:00
Taylor Howell
94e9912d28
Add mju_mulMatTVecSparse to multiply transposed sparse matrix and dense vector.
...
PiperOrigin-RevId: 688535240
Change-Id: I0bacf1e911cde99014b2dcb0a1434e61a4f41d51
2024-10-22 07:06:29 -07:00
Yuval Tassa
0ffaeb4d56
Improve comments in mju_cholFactorNNZ, clarify that this function reads from the upper triangle of the source matrix.
...
PiperOrigin-RevId: 686113654
Change-Id: I029f9279d177f4cb9ff60396a26d64821aee3a6c
2024-10-15 08:26:07 -07:00
Yuval Tassa
7ec94f46d4
Refactor Newton solver: move Hessian from arena back to the stack.
...
The changes in 9a0dc20821 , moving the Hessian from the stack to the arena, should be rolled back: they prevent future threading over islands. Unlike the stack, arena allocations are not thread-friendly. The reason for the original move was to save memory, but the savings are small: `O(ctx->nH)` and only linear in `nv`. The significant reduction of the Cholesky factor, from quadratic in `nv` to quadratic in the largest dof island — the reduction afforded by 2dd518734f — remains in place.
Also refactor and improve readability.
PiperOrigin-RevId: 685717356
Change-Id: Ia9ec3e44a62d459a3b9cffb578cf6479d5aa1d7f
2024-10-14 08:34:16 -07:00
Yuval Tassa
3f3fe92860
Remove unused argument in mju_sqrMatTDSparseInit
...
PiperOrigin-RevId: 682375566
Change-Id: If05f5d15a2f8925eee9dd0ebc5d485164d90d787
2024-10-04 10:45:33 -07:00
Yuval Tassa
176345b4e1
Remove meaningless const qualifier for scalar arguments in sparse function signatures.
...
PiperOrigin-RevId: 679568516
Change-Id: I910626cd9555966c3b0a9ffba4064d263b2c16e1
2024-09-27 06:37:18 -07:00
Taylor Howell
6a6e10d779
Add mju_cholFactorNNZ to compute the number of non-zeros per row for sparse Cholesky factorization.
...
PiperOrigin-RevId: 679553197
Change-Id: I6f92deec347dae97d2e219cfb5376f92e777da1a
2024-09-27 05:39:08 -07:00
Yuval Tassa
e4d4153352
Move sanitizer instrumentation to a separate header file. Fixes #2049 .
...
PiperOrigin-RevId: 672986547
Change-Id: I42522f4925237a73168e965364a2dd65c0f067cb
2024-09-10 09:05:35 -07:00
Yuval Tassa
a9ee497e33
Add spaces around comparison operators.
...
PiperOrigin-RevId: 573620198
Change-Id: Icf295cc0dd381a4a7f0e2c94f2e12b499193e862
2023-10-15 07:40:10 -07:00
Alessio Quaglino
5a70ad08ab
Add Flex component.
...
PiperOrigin-RevId: 572830650
Change-Id: I6908228087b7b9683be3506c8d9cdc725ed5dcd5
2023-10-12 10:49:35 +01:00
Saran Tunyasuvunakool
4929077211
Remove mjMARKSTACK and mjFREESTACK macros.
...
PiperOrigin-RevId: 562844184
Change-Id: Id2f57f5d132c47094dad75c6dab7297d7aa73458
2023-09-05 11:41:43 -07:00
Yuval Tassa
d5292976de
Add internal utility for zeroing int vectors.
...
Remove unnecessary branches in related functions.
PiperOrigin-RevId: 562768873
Change-Id: I3964a7a953d95bcd4e29137a7b590be5ffa6e311
2023-09-05 07:15:14 -07:00
Yuval Tassa
9308e1d383
Add internal utility for zeroing int vectors.
...
PiperOrigin-RevId: 562608956
Change-Id: I25ff1bbf9abf8fe2a636ed1d728d10ae862e04c9
2023-09-04 14:27:11 -07:00
Yuval Tassa
29aa5e4a41
Allow dot products with sparse vectors to specify that one vector uses uncompressed memory.
...
PiperOrigin-RevId: 561951337
Change-Id: I1310d7c09d9a85ad9b43877155844a9d0ce6edab
2023-09-01 07:40:16 -07:00
Saran Tunyasuvunakool
b979a26b10
Rename mj_stackAlloc to mj_stackAllocNum.
...
PiperOrigin-RevId: 561040193
Change-Id: I49ea21ffb5b596471d2aacefb1961c11c5c905d0
2023-08-29 08:43:03 -07:00
Kyle Bayes
ea5e00cad8
Move mju_combineSparseCount into engine_util_sparse.
...
PiperOrigin-RevId: 561025741
Change-Id: I0bdc48554928fc4545a38a8cea3bdeb593bd7ecd
2023-08-29 07:40:53 -07:00
Kyle Bayes
ba12a1354b
Optimize and refactor combineSparse and combineSparseCount.
...
PiperOrigin-RevId: 558126391
Change-Id: Iead14c31136e789560f3c8124b84bd4e383158f4
2023-08-18 06:14:09 -07:00
Kyle Bayes
8ea690ed70
Remove unused parameters from mju_sqrMatTDSparseInit.
...
PiperOrigin-RevId: 557114227
Change-Id: Ia7d3fedfba612a68ff01d68f1b9dadb45bd76e85
2023-08-15 06:30:19 -07:00
Yuval Tassa
455b1cd2e2
Add spaces around comparison operators in engine source files.
...
PiperOrigin-RevId: 535989348
Change-Id: I883f7e82351299933c49b35a31842b5d8d6aea04
2023-05-28 05:02:34 -07:00
Saran Tunyasuvunakool
f887c1e928
Add ASAN and MSAN instrumentation for arena and mjData stack.
...
PiperOrigin-RevId: 535635490
Change-Id: Ia1e58771bae25bf72c861f57452fb8faa2b918fb
2023-05-26 09:17:26 -07:00
Kyle Bayes
9924cce4b7
Add nnz per row precount method for mju_sqrMatTDSparse.
...
PiperOrigin-RevId: 521744893
Change-Id: Ie0fbfab552a680127f4acf9041b07916f8a2a490
2023-04-04 06:21:22 -07:00
Kyle Bayes
8696247f9d
Add mj_stackAllocInt to get correct size for allocating ints on mjData stack. Reducing stack memory usage by 10% - 15%.
...
PiperOrigin-RevId: 517672195
Change-Id: Ie14e6c9c99e8b9e1c5d3686b77631f2df0651c67
2023-03-18 13:04:14 -07:00
Kyle Bayes
056e849273
Provide improved mju_sqrMatTDSparse implementation that doesn't require dense memory allocation for sparse matrices.
...
PiperOrigin-RevId: 516812783
Change-Id: Ieb43337831d8d3b2c7f18a7facd8e0a0f2b0eff5
2023-03-15 06:56:16 -07:00
Yuval Tassa
7e7cb177a4
Cosmetic changes.
...
PiperOrigin-RevId: 511008317
Change-Id: Id8d7cd4f4e22e0658857d16b47d51053f1477bb9
2023-02-20 09:23:32 -08:00
Kyle Bayes
ffe27d9680
Extract AVX code from sparse utils.
...
PiperOrigin-RevId: 506851218
Change-Id: I23cc3ffb26face97fc2380bc9cb702cc41b8b29d
2023-02-03 02:42:39 -08:00
Yuval Tassa
a7888d473c
mju_transposeSparse: extract local integer, remove extra blank line.
...
PiperOrigin-RevId: 506243573
Change-Id: Ia573c9289ef1deb1cc7b5477d441752370caa470
2023-02-01 01:27:46 -08:00
Kyle Bayes
c741dfce7d
Implement a more performant mju_transposeSparse that doesn't require dense memory allocation.
...
PiperOrigin-RevId: 505044194
Change-Id: Ibe0e39e3ad711b2b5bdad45180ca4f83b5c8fc82
2023-01-27 00:20:01 -08:00
Alessio Quaglino
2d304d65e5
Use memcmp for mju_compare if no AVX. 15% faster on Humanoid.
...
PiperOrigin-RevId: 493324356
Change-Id: I5f71dc1a8ae40c18864ea80f00a5f86ff952f72c
2022-12-06 09:14:33 -08:00
Alessio Quaglino
7b0fbc63f8
Speed improvement with no AVX. 40% on Linux Intel Xeon and 60% on ARM Mac.
...
PiperOrigin-RevId: 488360660
Change-Id: I423269cd362fdcc2434393b691638ac6ed778ef2
2022-11-14 07:31:32 -08:00
Saran Tunyasuvunakool
b849023069
Miscellaneous linting in src/engine.
...
PiperOrigin-RevId: 462415459
Change-Id: I6c79c592613c6b0a665af06faf945586bb6ba32d
2022-07-21 10:16:49 -07:00
Yuval Tassa
e6480c76a9
Remove unused imports.
...
PiperOrigin-RevId: 461829404
Change-Id: I9ae44085af211013ed2b677b7d3a545ccec34605
2022-07-19 02:11:56 -07:00
Saran Tunyasuvunakool
1913a02b40
Initial open sourcing of MuJoCo.
...
PiperOrigin-RevId: 450374687
Change-Id: Ie3225a46ce095fc28ae8e63c326a640261f562bb
2022-05-23 01:08:49 -07:00