Repository navigation
Engine scene generation - #14685
Engine scene generation#14685andrewvarga wants to merge 11 commits into
Conversation
…ation from the error
Signed-off-by: Andrew Varga <grizzly33@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| stopReapplyEffect = effect(() => { | ||
| const generation = kclManager.engineSceneGenerationSignal.value | ||
| if (generation === lastSeenGeneration) { | ||
| // reapplyActiveView does nothing while a sketch is open, so wait for it to close. |
There was a problem hiding this comment.
This bug exists on main too but it was not surfacing anything until using scene generation id from rust.
Merging this PR will not alter performance
Comparing Footnotes
|
| } | ||
|
|
||
| pub(super) async fn bump_engine_scene_generation(&self) { | ||
| self.0.inner().write().await.engine_scene_generation += 1; |
There was a problem hiding this comment.
What happens when it overflows? We should use an explicit policy of wrapping or saturating.
Does this ever get reset?
Supersedes the recently added fromCache: #14645
I realized
fromCachehad issues: when returning from a sketch edit, it was true becauseexit_sketchcallsrun_with_caching, misses the cache, rebuilds the scene, and its outcome stays in Rust.KclManager'sexecuteCode()then hits the cache and reports fromCache: true.It's cleaner to have a counter which all clients can compare to their internal version and decide to update accordingly.
I realized TS already has a counter for the same purpose, so I connected the value coming from Rust to it, so now it's only incremented with actual changes, not on every execution - this surfaced a named view bug that I fixed in this PR and it can be used to avoid updates when the geometry remains the same.