-
Notifications
You must be signed in to change notification settings - Fork 2
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
Reviews #2
base: capstone
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust part looks good, didn't check wgsl part as I'm not a friend with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting project! You've done a great job simulating water droplets with the wgpu
library 😃
Here are some suggestions for improvement:
- While default configuration values in the code are fine, enhancing your solution to fetch these values from a configuration file (e.g. settings.toml) or environmental variables would be fantastic.
- Consider consolidating both the UI and simulation into a single crate as their functionalities are closely related. However, if you anticipate adding alternative ways to interact with the simulation in the future (e.g., updating configurations from a website), maintaining separate crates might be preferable.
- Hardcoding the TCP port and address might lead to program panics if any other service is bound to port 12345. Providing flexibility in port selection (e.g via config / cli ) could resolve this issue.
- Currently, the entire
settings
is serialized and sent to the simulation even when only one value is updated in the UI. Consider optimizing this process by transmitting only delta updates from the UI to the simulation. - Solution crashes the window manager on macOS. It is worth to debug it and find the root cause of this issue.
- In
main.rs
, consider spawning multiple threads for different parts of the simulation instead of spawning commands. This approach could enhance performance and resource utilization.
let mut simulation_process = Command::new("target/debug/simulation") | ||
.env("RUST_LOG", "error") | ||
.spawn() | ||
.expect("Failed to spawn simulation"); | ||
|
||
let mut gui_process = Command::new("target/debug/settings_ui") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Is it possible to make it also build/run with --release flag? I see you've hardcoded the debug build. I suspect it may be a bit more performant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt it's going to change much, because main logic happens on the GPU. CPU only handles setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair!
No description provided.