Repository navigation
GRL-SNAM on libcvc 4.0.3+: the trace clock at libcvc's 1/120 s quantum, and the replay's play head to the microsecond - #204
Merged
Conversation
…m, and the replay's play head to the microsecond libcvc 4.0.3 moved the simulation tick to 7 quanta of 1/120 s (7/120 s, transfix/libcvc#1378), and CI picked up 4.0.4 on 2026-11-22. Two things here assumed the old 0.06 s tick: - live --record-trace stepped its own world_clock at 0.01 s, which 7/120 s is not a whole number of, so clock_follower.for_step threw ("ticks_per_step: the step is not a whole number of clock quanta") and every session exited 2. _trace.QUANTUM is now pycvc.SIM_QUANTUM (1/120 s since 4.0.3, 0.01 s in 4.0.2), with 0.01 s when pycvc has none. A replay paces itself at its trace's own quantum (the header's fixed_dt, Player.fixed_dt), so a trace recorded at 0.01 s still plays at its speed. - The replay wrote play.t to 4 decimals, so 2 s plus one tick read 2.0583, not 2.058333. It is written to 6 now. The docstrings and help that said the tick is 0.06 s since 4.0.2 say what each release has.
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.
Fixes main's
ci, red since aba8ecc (run 45002106676, 2026-11-22). It is the first run on libcvc 4.0.4 from the cvcpkg catalog. Six tests failed on cp311, cp312 and cp313.Cause
libcvc 4.0.3 changed the simulation tick from 0.06 s to 7 quanta of 1/120 s, which is 7/120 s or about 0.0583 s (transfix/libcvc#1378,
cvc/core/sim_tick.h). Two places in GRL-SNAM still assumed the old tick:live --record-tracestepped its ownworld_clockat a 0.01 s quantum (_trace.QUANTUM). 7/120 s is not a whole number of 0.01 s quanta, soclock_follower.for_stepthrew:ticks_per_step: the step is not a whole number of clock quanta. Every session exited with code 2, which failed the fivetest_6_*tests intests/test_lab_acceptance.py.play.tto 4 decimals. So 2 s plus one tick read back as 2.0583 instead of 2.058333, which failedtest_ariadne_live_arms.py::test_the_replay_steps_seeks_and_restarts.Changes
_trace.QUANTUMis nowpycvc.SIM_QUANTUM, the quantum libcvc's own tick is a whole number of:SIM_QUANTUM(the tick was 0.05 s).Player.fixed_dtis the trace's own quantum, the header'sfixed_dt.live's replay paces itself by that instead of the module constant, so a trace recorded at 0.01 s still plays at its own speed.PlayHeadwritesplay.tto 6 decimals.scrub --tickshelp and two test comments said the tick has been 0.06 s since 4.0.2. They now give the tick for each release.Verification
world_clockwithclock_follower.for_step(clock, pycvc.SIM_TICK)raises the same error as CI. At_trace.QUANTUM(1/120 s) it runs 17 steps in 1 s.PlayHeadat 2 s plus one step writesplay.t2.058333, which is within the test's tolerance.black --checkis clean on the changed files.Not changed
These are left as they are, since nothing fails because of them:
fleet.py'splant_host(fixed_dt=0.01). libcvc's ownpycvc_gl.carsnow usesSIM_QUANTUM.SimPacer.SUITE_QUANTUM. It already falls back to the tick itself when 0.01 s does not divide it.coph_cars.py's 0.06 s fallback and help text. That file is the CoPH work's.