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

infinite for loops due to iTime can hang and panic. #35

Open
Vipitis opened this issue Aug 2, 2024 · 1 comment
Open

infinite for loops due to iTime can hang and panic. #35

Vipitis opened this issue Aug 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Vipitis
Copy link
Collaborator

Vipitis commented Aug 2, 2024

connection: gfx-rs/wgpu#5926

I seem to run into this quite a bit recently. Some for loop is eventually dependant on some uniform (often iTime) and therefore might be an infinite loop. Infinite loops with hard coded values do get compiled away and are not an issue it seems.

since this behaviour isn't going to be changed in wgpu-core, and the uncaptured error isn't captured in wgpu-py this will panic with a "device is lost", after essentially some timeout.
If we want to mimic the behaviour on the website, this should somehow just work. Maybe by skipping the 0th frame or something, if it starts to hang.

I tried to help the compiler by wrapping the uniforms in max(), min() or maybe abs() (since negative numbers in that examples are a problem) - but nothing seems to help.

Using this issue to track changes to the behaviour in the upstream deps and maybe finding a solution someday.

@Vipitis Vipitis added the bug Something isn't working label Aug 2, 2024
@Vipitis
Copy link
Collaborator Author

Vipitis commented Sep 11, 2024

with 22.1 Vulkan seems to handle some infinite loops (0 increment), but not others(negative).
I will try to figure out what the exact difference is, I suspect it might be the compiler putting in a while True instead.

There is also a translation issue regarding loops, that cause loops to unintentionally become infinite: gfx-rs/wgpu#6208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant