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

Increase ~16'million extended tile lists limit #30

Open
simonpoole opened this issue Mar 14, 2022 · 2 comments · May be fixed by #32
Open

Increase ~16'million extended tile lists limit #30

simonpoole opened this issue Mar 14, 2022 · 2 comments · May be fixed by #32

Comments

@simonpoole
Copy link
Owner

Currently the tile encoding

`     6                   4                   3     2 2 2
      3                   7                   1     6 4 3
      XXXX XXXX XXXX XXXX YYYY YYYY YYYY YYYY 1uuu uNNE nnnn nnnn nnnn nnnn nnnn nnnn
 
      X - tile number
      Y - tile number
      u - unused
      1 - always set to 1. This ensures that the value can be distinguished from empty positions in an array.
      N - bits indicating immediate "neigbours"
      E - extended "neighbour" list used
      n - bits for "short" neighbour index, in long list mode used as index

limits the number of elements that can have an extended tile list (that is that need to be copied in to more than just nearby tiles) to 2^24-1 (16'777'215). An easy fix for this, that would likely suffice for a while would simply be to rearrange the encoding as

`     6                   4                   332  2
      3                   7                   109  7
      XXXX XXXX XXXX XXXX YYYY YYYY YYYY YYYY 1ENN nnnn nnnn nnnn nnnn nnnn nnnn nnnn

As the NN bits are not used when the extended lists are in use (that is when E is set), this gives us an extra 6 bits without having to change the logic at all. This would allow to index 2^30-1 (1'073'741'823) extended tile lists. @tordanik comments?

@simonpoole
Copy link
Owner Author

simonpoole commented Mar 15, 2022

As the NN bits are not used when the extended lists are in use (that is when E is set)

This seems to not be quite true and needs a bit more analysis. (fixed) In the same vein it isn't quite clear why their are two different schemes to mark neighbouring tiles and really it would seem that the NN bits could be completely replaced by the existing 24 bit marker scheme.

@simonpoole
Copy link
Owner Author

See #32 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant