Open
Conversation
…owing us to save an element and reduce arithmetic.
…ion now that the lower bounds are closed and the upper bounds are open.
Merge branch 'develop' into feature/shift_ep_range
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes a few small tweaks to the en passant machinery that, IMO, make things cleaner. Notes:
en_passant_topto indicate the maximum allowed value of the range, we useen_passant_endto indicate the open upper bound, i.e., the smallest value that is not part of the range.+1) and the test using the strict<. (This ensures that arithmetic overflow can't make those loops infinite.)en_passant_multistep_overto one element lower. (This works because we currently never assign to or read fromen_passant_multistep_over[0].)en_passant_multistep_overwithout sacrificing working space.To be honest, I'm still not sure that the dimension of
en_passant_multistep_overis correct, that it's large enough to hold everything that it might need to. I tried to estimate the maximum size of each range inoptimisations/hash.hasMAX_EN_PASSANT_TOP_DIFFERENCE(nowMAX_NUM_EP_POSSIBILITIES), which I set tonr_rows_on_board - 2. Naïvely I'd expecten_passant_multistep_overto require dimension up toMAX_EN_PASSANT_TOP_DIFFERENCE * maxply=(nr_rows_on_board - 2) * maxply, but neither the current code nor the code in this PR sets it to that. I'd appreciate any explanations and/or guidance here.