Skip to content

Fix rendering freeze when loading a new module#118

Merged
ford442 merged 2 commits intomainfrom
claude/refactor-large-files-OV69q
Apr 8, 2026
Merged

Fix rendering freeze when loading a new module#118
ford442 merged 2 commits intomainfrom
claude/refactor-large-files-OV69q

Conversation

@ford442
Copy link
Copy Markdown
Owner

@ford442 ford442 commented Apr 8, 2026

The cells buffer update effect was using renderParamsRef.current.matrix as a React dep — a mutable ref read that can be ambiguous when React evaluates the dependency array. This meant the GPU cells buffer could fail to refresh on module load, leaving stale pattern data on screen.

Fix: pass matrix and padTopChannel as explicit parameters to useWebGPURender and use them directly as effect deps. React now reliably detects the new-module identity change and rebuilds the cells buffer and bind group. Same fix applied to the channels buffer effect (matrix?.numChannels → matrix?.numChannels via direct param).

https://claude.ai/code/session_01GnHw4NyaiJ3PA7TUzui6t4

claude and others added 2 commits March 22, 2026 05:37
The cells buffer update effect was using `renderParamsRef.current.matrix`
as a React dep — a mutable ref read that can be ambiguous when React
evaluates the dependency array. This meant the GPU cells buffer could
fail to refresh on module load, leaving stale pattern data on screen.

Fix: pass `matrix` and `padTopChannel` as explicit parameters to
`useWebGPURender` and use them directly as effect deps. React now
reliably detects the new-module identity change and rebuilds the cells
buffer and bind group. Same fix applied to the channels buffer effect
(matrix?.numChannels → matrix?.numChannels via direct param).

https://claude.ai/code/session_01GnHw4NyaiJ3PA7TUzui6t4
@ford442 ford442 merged commit 36fc549 into main Apr 8, 2026
1 of 2 checks passed
@ford442 ford442 deleted the claude/refactor-large-files-OV69q branch April 8, 2026 03:53
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