Repository navigation
live --record-trace / --replay-trace: a session recorded and replayed exactly (Phase 5b, R49) - #184
Merged
Merged
Conversation
… exactly (Phase 5b, R49) On libcvc's input trace (cvc.input_trace/v1, transfix/libcvc#1168). - grl_snam/ariadne/_trace.py: Recorder (the app's world_clock at 0.01 s, the navigator every 5 quanta; the header describes the first arm's world with the arms, seed, start, goal, plant and frame in its meta; writes to nav/nav_plant/run/world recorded as they land, sim_world's own telemetry skipped; a Retarget is nav's own nav.retarget; the state's hash each frame) and Player (the clock in replay mode, the sets at their ticks, nav's events to every arm's world, every hash compared). The hash is the arm's own for one arm, so libcvc's headless replay (cvc trace verify) replays a one-arm trace; over every arm's world for several. - live: --record-trace (without --arms: one arm, the trained policy) and --replay-trace (the recorded arms, or --arms: other policies on the same inputs). run_arms keeps its worlds in a holder that a seek back rebuilds (sim_world has no restore: from tick 0 again). Headless replay runs to the end and exits 1 when the recorded policies depart; a window has a Trace window with a Position slider and Restart. v1: the kinematic plant. - tests/test_lab_acceptance.py: the Laboratory's §9 tests 5 and 6: one retarget for every arm with distinct Stats rows; exact replay (byte-identical poses, the same final hash); a one-arm trace in libcvc's own replay; seeking back; two policy builds matching until the first tick their coefficients differ. The trace tests skip on a pycvc without input traces (3.7.13).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is Phase 5b of the plan: Laboratory R49, the live/replay harness. It records a
livesession's inputs and replays them exactly, built on libcvc's input trace (cvc.input_trace/v1, transfix/libcvc#1168, which is merged). That trace support isn't in a released pycvc yet, so CI's 3.7.13 skips the trace tests. They pass against a build of libcvc master.Recording (
grl_snam/ariadne/_trace.py,Recorder)world_clock(0.01 s quantum, the navigator every 5 quanta), not live's own pacer. Every input therefore carries the tick that consumed it.nav_trace_header: the maps, the starts and goals, the policies' sha256). Itsmetaholds the arms (spec and.cvcnavsha256), the seed, the start, the goal, the plant, the frame and the GRL-SNAM build.nav,nav_plant,runandworldkeys are recorded as they land. sim_world's own telemetry (e.g.nav.tick) is skipped.nav.retargetevent. It goes throughnav_trace_retargeton the first arm's world, and the same retarget is applied to the others. The UI's retarget is applied at the start of a frame, before the clock moves.nav_trace_state_hash, so libcvc's headless replay (cvc trace verify) replays a one-arm trace by itself (tested).--arms,--record-tracerecords one arm, the trained policy, which live --arms: policies side by side, with Stats and Ledger windows (Laboratory Phase 5) #175 showed is the single-policy run tick for tick.Replaying (
Player)--arms: it runs other policies on the same inputs, reports where they depart, and exits 0.run_armskeeps its worlds in a holder that a seek back rebuilds. sim_world has no save and restore, so a seek back re-simulates from tick 0.live.arishows the hashes compared, with a Position slider and Restart. The Retarget controls are hidden in a replay.v1 covers the kinematic plant. libcvc refuses to describe a world on a vehicle plant, because Jolt is deterministic only within one binary.
Tests:
tests/test_lab_acceptance.py(the Laboratory's §9)nav.retargetand onenav.vehicle.vmaxset: the button press, and a slider write mid-run.nav_trace_replaywith every hash matched.Results
cvc trace inforeads the one-arm trace: a completecvc.nav.sim_world/v1world, 450 checks and an end hash; the trace is 49 KB.