Codex-generated pull request #139

Closed
rektdie wants to merge 2 commits from codex/add-fast-islegal-function into main
pull from: codex/add-fast-islegal-function
rektdie commented 2026-02-18 11:48:08 +01:00 (Migrated from github.com)

Codex generated this pull request, but encountered an unexpected error after generation. This is a placeholder PR message.


Codex Task

Codex generated this pull request, but encountered an unexpected error after generation. This is a placeholder PR message. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_699597ae1e9c8321b4888005c0cc8808)
chatgpt-codex-connector[bot] (Migrated from github.com) reviewed 2026-02-18 11:55:04 +01:00
chatgpt-codex-connector[bot] (Migrated from github.com) left a comment

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9f466b37b

ℹ️ 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
  • 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 address that feedback".

### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `a9f466b37b` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](http://chatgpt.com/codex/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - 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 address that feedback". </details>
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-02-18 11:55:04 +01:00

P1 Badge Update piece bitboards when validating capture legality

IsLegal only updates postMoveOccupancy for captures, but the final attack test calls IsSquareAttackedBy, which reads attackers from pieces[]/colors[] (pre-move state). That means a captured enemy attacker is still considered present, so legal capture responses are rejected; for example, in r3k2r/p1ppqpb1/bn2pnp1/2pP4/1p2P3/P1N2n2/1PQBBPPP/R3K2R w KQkq - 0 2, e2f3 is legal via MakeMove but IsLegal returns false. Since search/perft/datagen now filter with IsLegal, this drops legal moves and alters results.

Useful? React with 👍 / 👎.

**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Update piece bitboards when validating capture legality** `IsLegal` only updates `postMoveOccupancy` for captures, but the final attack test calls `IsSquareAttackedBy`, which reads attackers from `pieces[]`/`colors[]` (pre-move state). That means a captured enemy attacker is still considered present, so legal capture responses are rejected; for example, in `r3k2r/p1ppqpb1/bn2pnp1/2pP4/1p2P3/P1N2n2/1PQBBPPP/R3K2R w KQkq - 0 2`, `e2f3` is legal via `MakeMove` but `IsLegal` returns false. Since search/perft/datagen now filter with `IsLegal`, this drops legal moves and alters results. Useful? React with 👍 / 👎.

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.