Repository navigation
test(world): set a sleep threshold on a sleeping body - #348
Merged
Merged
Conversation
siracozmen01
commented
Nov 5, 2026
siracozmen01
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review at 997ad36: ready. Read, not run.
The keep-old-value mutant fails on the threshold's effect, not only on the awake flag.
- After the call, the body is woken at 0.03 m/s and run for a second, and the check needs it still awake:
!GlideAfterThreshold(0.02f, ...). - 0.03 is above the new 0.02 and below the old 0.05. So if the old value is kept, the body sleeps again within that second (the run before the call shows it does at 0.05), and the first check fails. That is the right reason.
- The near miss (0.05 set again, the same run) has to sleep again. This shows the only thing separating the two runs is the threshold, not the wake by
m2Body_SetLinearVelocityor the time allowed.
The wake mutant. asleep is read straight after the call and again 30 steps later. Both checks need stillAsleep, so a wake on the call fails both.
Each assertion can fail, nothing is weakened or removed, and the body has Problem, Change and Verification.
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
m2Body_SetSleepThreshold's header says the change applies from the next step and a sleeping body stays asleep. No test sets a threshold on a sleeping body, so a wake on the call, or a threshold lost while asleep, would pass every suite (#347).Change
test/test_islands.cgainsTestThresholdOnASleepingBody:m2Body_SetLinearVelocity, and stays awake for a second: the threshold set while asleep governs.A test-only change.
Verification
test_islandspasses.test_islands:tools/check.sh changedpasses. The changed file compiles 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 #347