Repository navigation
Gate disabled profiler timers and accumulate CCD timing - #1064
Open
matthew-walters wants to merge 1 commit into
Open
matthew-walters wants to merge 1 commit into
matthew-walters wants to merge 1 commit into
Conversation
This branch has not been deployed
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 #1051.
With the
profilerfeature enabled, pipeline timers calledInstant::now()even afterCounters::disable(). Theenabledflag guarded the counter helper methods, but several pipeline stages accessed their timers directly.Timers now track whether they are disabled.
Counters::enable()anddisable()update every timer, andCounters::reset()synchronizes timer state for compatibility with callers that modify the publicenabledfield directly. Disabling a running timer discards its open interval, so time spent disabled is not charged after re-enabling.The CCD time-of-impact timer now resumes for each internal clamp pass instead of restarting. Because
Counters::reset()clears it at the beginning of the outer step, it now accumulates timing across all CCD substeps.The regressions verify that:
Counters::enabledtake effect on the next pipeline stepAll three new regressions fail on the unpatched upstream revision and pass with this change.
Validation:
cargo test -p rapier3d --features profiler --test pipeline_counterscargo test -p rapier3d --test pipeline_counterscargo test -p rapier2d --features profiler --libRUSTFLAGS="-D warnings" cargo clippy -p rapier2d -p rapier3d --features profilerRUSTFLAGS="-D warnings" cargo clippy -p rapier3d --features profiler --test pipeline_counterscargo fmt --all -- --checkgit diff --check