Skip to content

Replace MoveList with unboxed vectors - #3

Open
chris-moreton wants to merge 5 commits into
mainfrom
unboxed-vector-moves
Open

Replace MoveList with unboxed vectors#3
chris-moreton wants to merge 5 commits into
mainfrom
unboxed-vector-moves

Conversation

@chris-moreton

@chris-moreton chris-moreton commented Mar 21, 2025

Copy link
Copy Markdown
Owner

My Note

  • No noticable performance gain

Summary

  • Replace [Move] with Data.Vector.Unboxed for move lists
  • Update move generation functions to work with vectors
  • Modify move list operations to use vector operations like V.concat and V.cons
  • Preallocate move buffers with empty vectors instead of empty lists

Test plan

  • Run perft tests to confirm move generation still produces the same results
  • Test speed improvements in move generation by running performance benchmarks

Note: This is only the first step of this optimization. Further changes would include:

  1. Updating other modules that use MoveList to leverage vector operations
  2. Implementing more true preallocation with vector sizes

🤖 Generated with Claude Code

chris-moreton and others added 5 commits March 21, 2025 13:55
- Replace [Move] with Data.Vector.Unboxed for move lists
- Modify move generation functions to work with vectors
- Update various helper functions to use vector operations
- Use V.concat, V.cons, and other vector operations instead of list operations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add import for Data.Vector.Unboxed
- Update canLeadToDrawByRepetition to use V.toList on move vectors
- Modify sortMoves to handle Vector input/output
- Update bestMoveFirst to convert Vector moves to list

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing V.toList conversion in the newPositions function in SearchHelper.hs
- Add Data.Vector.Unboxed import in Quiesce.hs
- Update quiescePositions function in Quiesce.hs to use V.toList

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Data.Vector.Unboxed import
- Convert vector to list before mapping over moves in startSearch

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Data.Vector.Unboxed import
- Convert vector to list before mapping over moves in perft function

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant