Skip to content

Make GIF/MP4 export faithful to the recorded trace (deep-dive fix) - #14

Merged
iodriller merged 1 commit into
mainfrom
claude/repo-analysis-bugs-gaps-bte7ko
Jun 22, 2026
Merged

Make GIF/MP4 export faithful to the recorded trace (deep-dive fix)#14
iodriller merged 1 commit into
mainfrom
claude/repo-analysis-bugs-gaps-bte7ko

Conversation

@iodriller

@iodriller iodriller commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

A deep, empirical bug hunt (building edge-case creatures and exercising the whole system, not just re-reading). Most paths held up; one real fidelity bug found and fixed.

Verified OK (no change needed)

  • Multi-level kinematic trees (depth-2 torso→thigh→shin) compose correctly — parent/link indexing and anchor chaining are right, and the root is detected regardless of part order in the list.
  • mutate and the offline tool policy produced 0 invalid creatures / 0 ToolErrors over 2000 iterations each.
  • No NaN/inf scores even under deliberately divergent dynamics (tiny masses, long limbs, big motors, timesteps up to 0.05).
  • Special-character part ids and contact-pool overflow are non-fatal (the trace keeps all contacts; only the live marker pool caps at 16).

DD1 — export was not faithful to the trace (fixed)

render_trace rebuilt the jointed body and reconstructed link poses via forward-kinematics from recorded joint angles (set_pose), discarding the recorded per-link positions. Position-controlled joints sag/lag under load, so FK ≠ the recorded dynamics — on the example tripod the exported limbs were up to ~5.6cm off, and the GIF/MP4 disagreed with the faithful Viser view.

Fix: render_trace now draws each part as an independent mass-0 visual body posed directly from frame.parts — exactly what the Viser viewer does — so export is faithful to the trace and consistent with view. This also removed the now-unused set_pose() method and _root_id.

Verification

  • ruff, ruff format --check, pytest all green — 132 tests (added a regression test: a fixed-joint creature whose trace poses its parts independently still renders, proving the render path is parts-driven, not FK-driven).
  • Re-exported the tripod GIF end-to-end; positions now equal the recorded trace by construction.

Minor follow-ups (noted, not changed)

EpisodeSummary.forward_displacement is centroid-based while the score's forward term is base-based; the viewer's contact-marker pool caps at 16.

…nding)

Deep empirical sweep of the recently enabled features. Most paths verified OK
(multi-level kinematic trees, root detection regardless of part order, mutate /
offline-tool-policy validity over 2000 iters, no NaN scores under aggressive
dynamics, special-char ids, contact-pool overflow). One real fidelity bug:

render_trace rebuilt the jointed multibody and reconstructed link poses via
forward-kinematics from recorded joint angles (set_pose), discarding the
recorded per-link positions. Position-controlled joints deviate from rigid FK
under load, so the export drifted up to ~5.6cm off on the tripod and disagreed
with the faithful Viser `view`.

Fix: render each part as an independent mass-0 visual body posed directly from
frame.parts (exactly what the viewer does) — export is now faithful to the
trace and consistent with `view`. Removes the now-unused set_pose() and
_root_id. Added a regression test (a fixed-joint creature whose trace poses its
parts independently still renders, proving the path is parts-driven, not
FK-driven).

All green: ruff, ruff format --check, pytest (132).

https://claude.ai/code/session_01EcH4uu86dMEDrd6TzyAExd
@iodriller
iodriller merged commit 1fed4eb into main Jun 22, 2026
1 check passed
@iodriller
iodriller deleted the claude/repo-analysis-bugs-gaps-bte7ko branch June 22, 2026 13:08
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.

2 participants