dvgrn wrote:... and the forbidden zone is offset significantly to the left of the visible edge -- 16 cells. The opposite offset shows up on the left side, but the bottom boundary again matches the visible edge exactly.
All very minor and cosmetic, and doesn't really justify a new build all by itself, but maybe something to put on the backlog.
This behaviour is known and is caused by a performance optimization.
LifeViewer doesn't calculate the first or last 16 x 16 cell tile in each row of the grid since they don't have enough neighbours to use the optimized algorithm. This is why the
forbidden zone is 16 pixels from the boundary. The top and bottom work since it creates a single phantom extra row of cells.
I have a couple of items on the backlog of relevance associated with further performance improvements. For context LifeViewer performs three main tasks per generation:
- Computes the next generation of cells on the grid which is a set of bits
- Updates the colour grid which is a set of 256 pen colours stored as bytes and is used to add the history
- Projects and renders the colour grid onto an in-memory Canvas converting the pens to RGBA values stored as 32bit unsigned integers
The performance of tasks 1 and 2 is proportional to the number of tiles containing cells.
The performance of task 3 is proportional to the number of pixels in the Viewer window.
The relevant backlog items are:
- I'm planning some work on changing the memory order representation of the grid and colour grid to keep each tile as a consecutive series of bytes. This will be more friendly to the processor cache so it's possible I'll get some speed up. The changes to the algorithms to reflect this will also remove the need for the optimization above. The hope is that this work will speed up tasks 1 and 2 above.
- I've been playing a little bit with WebGL which should accelerate the projection and rendering of the colour grid onto the Canvas. However I've got some learning to do and I'm not yet sure how easy it will be to implement the adaptive sub-sampling I use at ZOOMs < 1 to ensure significant cells are always displayed. This work should speed up task 3 above. However, I'll need to ensure compatibility with older hardware and browsers that may not support WebGL.
Oh and before you find it the other thing known to be
not quite right (as opposed to all the unknown and undiscovered things that are
not quite right) is the [R]History custom colours don't yet work properly for the ON, OFF and HISTORY states (because the Theme colour manager is currently not talking politely to the State colour manager).