Change mjSpec and mjModel signature mechanism.

The signature now contains the necessary information to safely perform `bind`. The private UIDs are now removed.

Fixes an issue of changing signature when compiling a copy of an mjSpec.

PiperOrigin-RevId: 744670626
Change-Id: Id3c66419cf2afbe78e91bc4b37d2299f5ec00ab1
This commit is contained in:
Alessio Quaglino
2025-04-07 04:20:17 -07:00
committed by Copybara-Service
parent 93251f07d9
commit cc2f57d820
7 changed files with 85 additions and 40 deletions
+4
View File
@@ -550,6 +550,10 @@ TEST_F(PluginTest, RecompileCompare) {
mjModel* m_new = mj_compile(s, nullptr);
mjModel* m_copy = mj_compile(s_copy, nullptr);
// compare signature
EXPECT_EQ(m_old->signature, m_new->signature) << xml;
EXPECT_EQ(m_old->signature, m_copy->signature) << xml;
ASSERT_THAT(m_new, NotNull())
<< "Failed to recompile " << xml << ": " << mjs_getError(s);
ASSERT_THAT(m_copy, NotNull())