Repository navigation
A loadable MJCF can still be the wrong experiment: a small free-fall acceptance gate #3780
FenjuFu
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The XML parser can tell you whether a scene is legal. It cannot tell you whether you built the experiment you intended.
I tested a small acceptance gate for generated MuJoCo scenes: ask Spark-X2.6-4B for a falling sphere, compile the returned MJCF, and compare the resulting motion with a simple physical expectation before accepting it. The model failed at the first gate twice. The more useful follow-up was that two deliberately altered, loadable scenes still failed the physical task.
What actually ran
The requested scene was a 0.05 m radius, 0.2 kg sphere released from z=1 m, with gravity -9.81 m/s², a free joint, Euler integration and a 1 ms timestep. At 0.2 s it should still be above the ground. I used a 2 mm maximum trajectory-error tolerance against
z(t) = 1 - 0.5 * 9.81 * t**2.<ball>element at line 5. No simulation trajectory exists for this output.worldbody → body → freejoint/geomhierarchy. The response still used<ball>, now at line 3, and compilation failed again.z=0.802819 m. The analytic value is0.803800 m; the maximum discrepancy was0.000981 m, within the chosen tolerance.z=1.000000 m, a0.196200 merror against the requested task. Negative mass was rejected by the compiler.The fixed body and zero-gravity cases are valid configurations for other experiments. They fail this free-fall contract. The reference and its mutations were constructed separately to test the gate; they are not successful model generations.
Reproduce the saved-output experiment
This runs the exact returned XML and the five constructed fixtures below, without needing an API key. It prints compiler acceptance, contract acceptance, and the measured height/error. Expected rejections count as successful reproduction of the observed behavior.
Save this complete program as
reproduce.py:Actual output:
Generation setup and limits
The two real requests used the hosted
spark-x2.6-4bendpoint,temperature=0,max_tokens=1800, andthinking={"type":"disabled"}. The first user message was:The repair used the first response and the actual compiler failure as conversation context, plus explicit nesting guidance. Neither output was manually fixed before its compile test.
Local execution: Windows amd64, Python 3.12.10, MuJoCo 4.0.0, NumPy 2.5.4, Intel Core Ultra 5 125H. The checked-out MuJoCo 4.0.0 tag resolves to
ac60eae30fa7e0d31315c38d9476752fb81be67e; execution used the official Python wheel. The model card was checked at revision64ca8f2a295b8ceb2757b9d4749a6558c4759e5b; the hosted deployment's weight revision was not independently available.This is two responses in one conversation, plus five constructed fixtures, not a model accuracy estimate. The physical test covers only 0.2 seconds of simple free fall, before impact. It does not validate collision response, complex mechanisms, controllers, or arbitrary MJCF. The fixed 2 mm tolerance is specific to this timestep and horizon. A useful next extension would be separate task-specific checks for contacts and constraints, with explicit units and tolerances.
All reactions