Skip to content

Adjust Omega chess to 12x12 board#12

Closed
Belzedar94 wants to merge 3 commits intomasterfrom
codex/implement-256-bit-bitboard-for-16x16
Closed

Adjust Omega chess to 12x12 board#12
Belzedar94 wants to merge 3 commits intomasterfrom
codex/implement-256-bit-bitboard-for-16x16

Conversation

@Belzedar94
Copy link
Copy Markdown
Owner

Summary

  • update the Omega chess variant to use the 12×12 layout with the expanded start FEN and max rank
  • refresh the omega test position to reflect the additional empty ranks
  • build the Python extension with VERY_LARGE_BOARDS so the 12×12 variant can compile

Testing

  • make build -j2 ARCH=x86-64 verylargeboards=yes
  • python3 test.py (fails: segmentation fault when importing pyffish built with VERY_LARGE_BOARDS)

https://chatgpt.com/codex/tasks/task_e_68cc5e69d3348322beb185dbec93be00

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Fairy-Stockfish/src/types.h

Lines 515 to 520 in 8ca7a03

RookniValueMg = 800, RookniValueEg = 950,
ShogiPawnValueMg = 90, ShogiPawnValueEg = 100,
LanceValueMg = 400, LanceValueEg = 240,
ShogiKnightValueMg = 420, ShogiKnightValueEg = 290,
GoldValueMg = 720, GoldValueEg = 700,
DragonHorseValueMg = 1550, DragonHorseValueEg = 1550,

[P0] Repetition cuckoo table remains sized for small boards

The VERY_LARGE_BOARDS path in types.h bumps SQUARE_NB to 256, so Position::init() now iterates over four times as many squares when filling the cuckoo repetition table. However the table allocation and hash masks in position.cpp are still guarded by #ifdef LARGEBOARDS only, leaving an 8192‑entry table and 13‑bit masks for a workload that previously required 65536 entries. With a 256‑square board the insertion loop never finds an empty slot and spins indefinitely (or corrupts memory) during module initialisation. The table sizing and expected count assertions should also include VERY_LARGE_BOARDS to avoid the startup crash.


Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines 12 to 16
else:
args = ["-std=c++17", "-flto", "-Wno-date-time"]

args.extend(["-DLARGEBOARDS", "-DALLVARS", "-DPRECOMPUTED_MAGICS", "-DNNUE_EMBEDDING_OFF"])
args.extend(["-DVERY_LARGE_BOARDS", "-DALLVARS", "-DNNUE_EMBEDDING_OFF"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Extend wide-board FEN parser to VERY_LARGE_BOARDS

Switching the Python extension to compile with -DVERY_LARGE_BOARDS (setup.py line 15) enables 12×12 Omega FENs that contain multi‑digit empty counts such as *10*. The parser in Position::set() only accepts two‑digit numbers when LARGEBOARDS is defined, so the new build falls back to the 8×8 logic and reads 10 as two separate digits. That leaves each rank two squares short and produces an invalid position before any move is played. The Omega start position added in this commit will therefore be misloaded. Please gate the two‑digit handling with || defined(VERY_LARGE_BOARDS) wherever FEN parsing depends on board width.

Useful? React with 👍 / 👎.

@Belzedar94
Copy link
Copy Markdown
Owner Author

@codex fix comments

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

  • Extended the wide-board repetition table hash helpers—including hash functions, table sizing, and count assertions—to handle VERY_LARGE_BOARDS builds without exhausting the cuckoo table on 256-square setups. src/position.cppL132-L215
  • Enabled VERY_LARGE_BOARDS FEN parsing to read multi-digit empty counts and apply CECP-specific en passant adjustments so 12×12 Omega positions load correctly. src/position.cppL279-L290 src/position.cppL429-L440

Testing

  • ⚠️ make build -j2 ARCH=x86-64 verylargeboards=yes (fails: No rule to make target 'build')

View task →

@Belzedar94 Belzedar94 closed this Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant