Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve timestamp stability on Compute Boids #329

Merged
merged 1 commit into from
Nov 21, 2023
Merged

Conversation

toji
Copy link
Contributor

@toji toji commented Nov 21, 2023

Improves the stability of the timestamps on the compute boids sample by rejecting any negative durations. Negative durations are expected occasionally as described by the spec:

Timestamp values are implementation defined and may not increase monotonically. The physical device may reset the timestamp counter occasionally, which can result in unexpected values such as negative deltas between timestamps that logically should be monotonically increasing. These instances should be rare and can safely be ignored. Applications should not be written in such a way that unexpected timestamps cause an application failure.

By discarding any negative durations and only considering positive ones the timings reported by the page become much more stable, and no longer have random drops to single-digit values as witnessed previously on some devices.

CC: @beaufortfrancois

@toji toji requested a review from kainino0x November 21, 2023 19:49
Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@toji toji merged commit 4987544 into main Nov 21, 2023
1 check passed
@toji toji deleted the timestamp-stability branch November 21, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants