-
Notifications
You must be signed in to change notification settings - Fork 14
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
Positions with 64 pieces cause overflows #492
Comments
Yep. I already identified and eliminated this limitation in PR #441. I’m currently reviewing a new version of that branch that is built off the most recent develop branch and will let everyone know when it’s ready.
Sent from the all new AOL app for iOS
On Sunday, May 19, 2024, 12:44 PM, Thomas Maeder ***@***.***> wrote:
The main reason seems to be that the 64th piece gets piece id 64 (binary 1000000), which doesn't fit in the space reserved in the piece flags.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
I see; cool! |
Ah, interesting. Any idea what a safe MaxPieceId value would be?
Sent from the all new AOL app for iOS
On Sunday, May 19, 2024, 2:30 PM, Thomas Maeder ***@***.***> wrote:
I see; cool!
Please note that apart from using that last of the 64 "slots", we should also add a check. Even on a 8x8 board, a user can add more than 64 pieces by adding multiple pieces on the same square.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Unless we do a significant redesign, we only have 6 bits for piece ids.
|
Hmm. |
After further investigation, I think that that redesign wouldn't be as significant as I was afraifd of. Currently, Flag is a typedef for unsigned long. I hesitate to change this for now. We can safely assume that unsigned long is >=32 bit. That seems to give us no less than 14 bit for piece ids. |
Resolving Issue #423 requires That written, I don't think we should jump so easily to making
and hence imposes some penalty. Moreover, once we declare a piece id value legal (by ensuring it's ≤
We should absolutely do this! There's no reason to give the user the impression that we can handle something we can't. If a user hits this limit then they can put in a feature request. |
As I noticed yesterday, PieceIdWidth is already ==7, i.e. >=7 Yesterday, I set MaxPieceId to 127 without any other modification, for testing. All the test and example problems (except those in the 'lengthy' directories) ran through without a difference in the solving result (bar little differences in solving time). |
Ok - I added the input check, and some more along the same lines. As per your comment of 20.5.2024, 01:28:17: i don't really see a problem raising MaxPieceId to 127 now. |
I can't tell exactly which comment you're referring to, but in case it's mine I'll clarify that I trust your judgment in determining the most appropriate value for |
The main reason seems to be that the 64th piece gets piece id 64 (binary 1000000), which doesn't fit in the space reserved in the piece flags.
The text was updated successfully, but these errors were encountered: