Repository navigation
test(journal): cover the 1.3.0 writers in the fuzzed walk - #346
Merged
Merged
Conversation
siracozmen01
commented
Nov 5, 2026
siracozmen01
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review at 9244afc: ready. Read, not run.
The flag cannot change the canonical draws when it is off. DoRandomOp tests s_walkLateWriters && Pick(10) == 0. With the flag false, && short-circuits, so Pick(10) is never called and the next draw is the one Pick(100) made before. The other additions draw nothing:
s_walkPool = NewWaterVolume(...)only keeps the id;- the replay check only reads
m2WaterVolume_GetUserDatafrom both worlds.
s_walkLateWriters is a static in walk.h, so each test program has its own, false unless set. test_golden.c does not set it, so its seeds walk exactly as before and the 13 lines stand.
Each 1.3.0 writer is reached with values that matter.
- Sleep threshold, by setter: values from 0 (resolved to the world's) to 0.6 on a random body. They change when a body falls asleep, which the step and the hash read.
- Sleep threshold, by def:
Pick(16) * 0.04, so 0 to 0.6, on a new dynamic body. The body cap is checked first. - Chain friction and restitution: values up to 0.9 on one of the world's chains. Those reach contacts on chain shapes, so they matter in any walk that has a chain.
- Pool user data: the hash leaves it out, so the new check compares it between the recorded and the replayed world. Without that check a lost record would pass, which is why it was added.
- Motor budgets: motor joints are now picked among motor joints alone, so the setter is never refused for the wrong type. With none, one is made with a 2 m offset and budgets of 20 and 5 that bind. The values 0 to 400 for force, and a quarter of that for torque, include ones below the pull, so a lost budget changes the motion.
The five mutants being caught confirms each writer reaches the replayed bits.
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.
Problem
The seeded API walk (
test/walk.h), whichtest_walkandfuzz_walkdrive, calls none of the writers 1.3.0 added. So no fuzzing, and none of the walk's replay, rollback and twin promises, coversm2Body_SetSleepThreshold(or a def'ssleepThreshold),m2Chain_SetFriction,m2Chain_SetRestitution,m2WaterVolume_SetUserData,m2MotorJoint_SetMaxForceorm2MotorJoint_SetMaxTorque. A writer that stopped journaling would pass every walk (#345).Adding them to the canonical walk would move
M2_JOURNAL_HASH, and #343 leaves that to the next minor release.Change
test/walk.hgainss_walkLateWriters. When it is set,DoRandomOpgives one draw in ten toDoLateWriterOp, which makes one of these calls:test_walk.candfuzz_walk.cset the flag, andtest_golden.cdoes not. With the flag clear, the walk draws exactly as before, so the canonical seeds and every golden line are unchanged.RunScenariokeeps the pool's id. After a replay it checks that the pool's game data matches the recorded world's, since the world hash leaves out what the step never reads.A test-only change: the library, its formats and its results are unchanged.
Verification
test_walkpasses: the regression bank's 6 seeds take the new path, and each one runs all three promises.test_walk:m2Body_SetSleepThresholdrecords nothingm2MotorJoint_SetMaxForcerecords nothingThe motor mutant first survived, because the walk reached a motor joint only through
RandomJointand set budgets the motor never used. Picking among the motor joints, making one when there is none, and drawing budgets that bind made it fail.tools/check.sh changedpasses. The changed files compile clean with gcc-14 and clang-20 under the strict flags.test_goldenprints the 13 lines oftest/hashes.txtunchanged in the scalar (linux-clang-20-asan) and AVX2 (linux-clang-20) presets.Closes #345