<feed xmlns='http://www.w3.org/2005/Atom'>
<title>typhoon.git/src/board_representation/EVAL.md, branch master</title>
<subtitle>The typhoon chess playing engine.
</subtitle>
<id>https://git.acknak.org/cgit/typhoon.git/atom?h=master</id>
<link rel='self' href='https://git.acknak.org/cgit/typhoon.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.acknak.org/cgit/typhoon.git/'/>
<updated>2026-09-05T09:22:58Z</updated>
<entry>
<title>Update EVAL.md: progress log, lessons learned, corrected next steps</title>
<updated>2026-09-05T09:22:58Z</updated>
<author>
<name>Scott Gasch</name>
<email>scott@gasch.org</email>
</author>
<published>2026-09-05T09:22:58Z</published>
<link rel='alternate' type='text/html' href='https://git.acknak.org/cgit/typhoon.git/commit/?id=863bc8f6c82595de32b382bbde6a0fe81f0a6dcf'/>
<id>urn:sha1:863bc8f6c82595de32b382bbde6a0fe81f0a6dcf</id>
<content type='text'>
Records what's actually landed (pawns, bbOccupied, dispatch loop,
knight, bishop -- commits 57502d6/2ce3570/6e86450/7e3e6b6/de3f366),
corrects section 4's per-piece #define toggle strategy (not what was
actually used -- direct incremental rewrites with transitional
helpers instead), and documents methodology worth repeating:

- One piece type at a time, each landed and verified before the next
  starts, learned the hard way after a combined knight+bishop+rook+
  queen+king attempt produced a real bug that was hard to isolate
  with five things changed at once and had to be reverted.
- Keep writing DEBUG asserts against the still-live rgSquare mailbox
  representation as independent ground truth for as long as it
  exists -- this is specifically what caught bishop's x-ray-chain
  behavior gap during routine smoke testing.
- Verification bar changes once a step ships a deliberate behavior
  change (bishop's x-ray simplification): full ecm_ringers solve
  parity + bounded node-count deltas, not byte-identical counts.
- This effort errs on the side of speed over exact fidelity,
  explicitly -- a real, recorded change from the original plan's
  "must be byte-identical" bar.
- What's next: rook, then queen, then _EvalKing/_WhoControlsSquareFast,
  culminating in deleting bvAttacks/ATTACK_BITV/the c|8 mechanism
  entirely once nothing writes it anymore. Transitional helpers get
  rewritten incrementally as each piece converts, not left to
  accumulate special cases.
- Pawn hash hit/miss cost measurements (90 vs 1741 cycles) and the
  EVAL_TIME per-term breakdown methodology, both worth reusing on
  rook/queen once they land.
- Noted intent to revisit the non-mobility scoring terms in
  _EvalKnight/_EvalBishop/_EvalRook/_EvalQueen once the attack-bits
  work is done -- separate, later pass, not scoped further yet.

Co-Authored-By: Claude Sonnet 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01P6g6iF6mD1Hau6nCZCzwYj
</content>
</entry>
<entry>
<title>Maintain pos-&gt;bbOccupied incrementally, dedupe its two from-scratch builders</title>
<updated>2026-09-05T07:19:59Z</updated>
<author>
<name>Scott Gasch</name>
<email>scott@gasch.org</email>
</author>
<published>2026-09-05T07:19:59Z</published>
<link rel='alternate' type='text/html' href='https://git.acknak.org/cgit/typhoon.git/commit/?id=2ce3570dc6aa67f82dd6f02fc4e518be3e33aabf'/>
<id>urn:sha1:2ce3570dc6aa67f82dd6f02fc4e518be3e33aabf</id>
<content type='text'>
chess.h: add POSITION::bbOccupied (full-board occupancy, both colors,
every piece including kings), maintained incrementally alongside
bbPieces/bbPawns rather than rebuilt on demand -- resolves the open
question in EVAL.md section 0 about whether this is worth doing given
both generate.c and the planned eval.c mobility rewrite need it.

move.c: SlidePiece/SlidePawn/LiftPiece/PlacePiece and their
WithoutSigs variants now maintain bbOccupied at the same choke points
that already maintain bbPieces/bbPawns -- unconditionally, since
occupancy doesn't care about piece type or color. Kings only ever
move through SlidePiece/SlidePieceWithoutSigs (never Lift/Place), so
no separate king-specific update site was needed.

fen.c: populate bbOccupied when parsing a FEN.

board.c: VerifyPositionConsistency cross-checks pos-&gt;bbOccupied
against a from-scratch rebuild, same pattern already used for
bbPieces/bbPawns.

generate.c/movesup.c/see.c: replace call sites that rebuilt full
occupancy via _BuildFullOccupiedBB/_BuildOccupiedBB with direct reads
of pos-&gt;bbOccupied; delete see.c's _BuildOccupiedBB, which was a
byte-for-byte duplicate of generate.c's _BuildFullOccupiedBB (kept
only as the from-scratch ground truth for the new consistency check
and testgenerate.c's benchmark harness).

testsup.c: GenerateRandomLegalPosition builds POSITIONs by poking
rgSquare/bbPieces/bbPawns directly, bypassing both move.c and fen.c --
a third construction path the above missed. It never set bbOccupied,
so the new VerifyPositionConsistency check failed on every generated
position, and since generation retries until a position verifies, the
self-test suite spun forever (100% CPU, no progress) instead of
crashing outright. Fixed by setting bbOccupied at all four placement
sites (both kings, pawn, non-pawn piece). Full self-test suite and
precommit_check.sh verified clean afterward.

board_representation/EVAL.md: record the bbOccupied decision and
rationale, resolving section 0's open question.

Co-Authored-By: Claude Sonnet 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01P6g6iF6mD1Hau6nCZCzwYj
</content>
</entry>
<entry>
<title>Add Eval() bitboard-migration plan, per-term EVAL_TIME cycle breakdown, drop redundant pawn-location bitboard</title>
<updated>2026-09-05T06:54:51Z</updated>
<author>
<name>Scott Gasch</name>
<email>scott@gasch.org</email>
</author>
<published>2026-09-05T06:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.acknak.org/cgit/typhoon.git/commit/?id=5883f5a64f4f464b877b7637b8e13c25f7d208fc'/>
<id>urn:sha1:5883f5a64f4f464b877b7637b8e13c25f7d208fc</id>
<content type='text'>
board_representation/EVAL.md: rewritten migration plan for a
bitboard-backed Eval() (mobility ray-walks + bvAttacks replacement),
plus a performance-philosophy section recording the profiling-first,
cut-aggressively-except-mobility/safety-awareness approach agreed on
this session, and findings on CountKingSafetyDefects' structural
inability to share bvAttacks-derived state with _EvalKing.

EVAL_TIME per-term instrumentation (chess.h/eval.c/root.c): breaks
the existing whole-Eval() cycle counter down by pawns/knight/bishop/
rook/queen/king, the always-paid pre-lazy-exit segment, and the
full-eval-only post-lazy segment, printed alongside the existing
"Avg. cpu cycles in eval" line. Diagnostic only (EVAL_TIME-gated),
no effect on the normal release profile.

Drop PAWN_HASH_ENTRY's bbPawnLocations[2]: it duplicated
POSITION's own incrementally-maintained bbPawns[2], rebuilt bit-by-bit
on every pawn-hash miss for no reason. eval.c now reads pos-&gt;bbPawns[]
directly; removed a stale per-iteration invariant assert in _EvalPawns
that only made sense when the bitboard was being built bit-by-bit in
that same loop.

Co-Authored-By: Claude Sonnet 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01P6g6iF6mD1Hau6nCZCzwYj
</content>
</entry>
</feed>
