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

livesim: Automatically tune nbextrastep #4

Open
7 tasks
HadrienG2 opened this issue Jul 7, 2023 · 0 comments
Open
7 tasks

livesim: Automatically tune nbextrastep #4

HadrienG2 opened this issue Jul 7, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@HadrienG2
Copy link
Owner

HadrienG2 commented Jul 7, 2023

Manual selection of the number of simulation steps per frame does not mix very well with frame time budgets and VSync.

Instead, go for the following logic :

  • Start at steps_per_image = 1
  • Monitor the frame time in the event loop until we have enough statistics to tell if a frame takes abnormally long (need some sort of 95% upper bound). Ignore the first Nswapchain frames, which will have different perf characteristics.
  • If framerate is already terrible (<45Hz), don't try to increase steps_per_image.
  • Otherwise, double steps_per_image until such an abnormal frame (>95% upper bound) is observed.
  • Subsequently decrease steps_per_image by 1, down to a minimum of 1, whenever an abnormally long frame time is observed. With this, steps_per_image will slowly converge to a lower bound of the optimal value, which is better than the visual jank we would observe if we allowed it to go up again (causing steps_per_image to oscillate).
  • Log steps_per_image changes to make them observable.
  • Use this logic when no nbextrastep is specified on CLI. Otherwise, do as the CLI said.
@HadrienG2 HadrienG2 added the enhancement New feature or request label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant