Skip to content

Conversation

@AliceRoselia
Copy link
Contributor

@AliceRoselia AliceRoselia commented Nov 3, 2025

bench: 2403242

Removes 1 function (from_to) from the Move type, change them to simpler raw. Remove the "and" use in the correction history structure calculation. Adjust the indexing.

Passed simplification STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 42880 W: 11327 L: 11113 D: 20440
Ptnml(0-2): 161, 4852, 11212, 5042, 173
https://tests.stockfishchess.org/tests/view/690593b8ea4b268f1fac1e8a
Passed simplification LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 43560 W: 11276 L: 11079 D: 21205
Ptnml(0-2): 17, 4679, 12197, 4864, 23
https://tests.stockfishchess.org/tests/view/6906f819ea4b268f1fac216b

Also probably gaining though the patches were run at a simplification bound.

bench: 2519320
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

clang-format 20 needs to be run on this PR.
If you do not have clang-format installed, the maintainer will run it when merging.
For the exact version please see https://packages.ubuntu.com/plucky/clang-format-20.

(execution 19358797923 / attempt 1)

@AliceRoselia
Copy link
Contributor Author

AliceRoselia commented Nov 3, 2025

Oops. The bench was pre-rebase. I edited the bench. Can you please run the checks again?

@rn5f107s2
Copy link
Contributor

You need to edit the bench in the commit message, not the pr description. If you then push, the CI should rerun by itself

@AliceRoselia AliceRoselia force-pushed the Simplify_history_indexing branch from b8dcb3f to da43974 Compare November 3, 2025 17:02
@anematode
Copy link
Contributor

The fishtest results look like they could actually be gaining Elo... any ideas as to the mechanism? Maybe prevents bad aliasing with underpromotions? (I tried ignoring underpromotions in corrhist before and it didn't work.) Or maybe just fewer pawn key collisions

@mstembera
Copy link
Contributor

mstembera commented Nov 4, 2025

How much extra memory is this using per thread? If it's a lot do we want to accept non regression bounds?
[Edit] Also many of the history entries may now go unused because most moves have the high bits above from_to() at 0.

@anematode
Copy link
Contributor

sizeof(Worker) goes from 31955840 to 32480128, i.e. 524 kilobytes.

@anematode
Copy link
Contributor

Separately, now that memory pressure is greatly reduced on single-threaded fishtest, I'm wondering whether a comprehensive check of the various history sizes could be useful...

@AliceRoselia
Copy link
Contributor Author

How much extra memory is this using per thread? If it's a lot do we want to accept non regression bounds? [Edit] Also many of the history entries may now go unused because most moves have the high bits above from_to() at 0.

The unused history entries are almost free. They don't get loaded into the cache. The raw main history had above 1.5 LLR at STC gainer bound. I stopped that one because this patch would do what it did anyway and qualifies as a simplification. The bigger correction history size was slightly positive, so could be green or yellow. I think this actually gains, but I choose to pass as a simplification because I think the reduced logic qualifies it as such.

@vondele vondele added simplification to be merged Will be merged shortly labels Nov 14, 2025
@vondele vondele closed this in 7b7a948 Nov 14, 2025
mstembera added a commit to mstembera/Stockfish that referenced this pull request Nov 16, 2025
See if the ones indexed by move from_to() were better previously.
bench: 3012156
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

simplification to be merged Will be merged shortly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants