Skip to content

cache kwg.seek results and reuse GADDAG state for extension sets#17

Merged
andy-k merged 2 commits intomainfrom
kwg-seek-cache
Mar 28, 2026
Merged

cache kwg.seek results and reuse GADDAG state for extension sets#17
andy-k merged 2 commits intomainfrom
kwg-seek-cache

Conversation

@andy-k
Copy link
Copy Markdown
Owner

@andy-k andy-k commented Mar 28, 2026

Summary

  • Cache kwg.seek results within dirty cross set strips: reuse cached GADDAG state for unchanged tile positions within a group, only seeking when a tile changed or a group boundary moved
  • Reuse cross set buffer GADDAG state for extension sets: gen_extension_sets reads p from cross_set_buffer instead of recomputing, eliminating all kwg.seek() calls from extension set computation

Test plan

  • movegen baseline test passes
  • cargo fmt, clippy, build pass on all commits

andy-k and others added 2 commits March 28, 2026 14:41
Within the reverse scan, reuse cached GADDAG seek results for
tile positions where the tile hasn't changed and the group
boundary (empty/nonempty transition) is in the same place.
Each tile group starts from p=1, so unchanged tiles from the
right edge of a group have identical seek chains.

Only calls kwg.seek() for positions where the tile changed or
a group boundary moved, skipping the linear sibling scan for
the rest.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The cross set reverse scan and extension set computation both
traverse the same strip right-to-left with kwg.seek(). Read
the cached GADDAG state (p) from cross_set_buffer instead of
recomputing it, eliminating all kwg.seek() calls from
gen_extension_sets.

Across extension sets reuse cross_set_buffer_for_down_plays
(both process rows). Down extension sets reuse
cross_set_buffer_for_across_plays (both process columns).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@andy-k andy-k merged commit d6eb9c6 into main Mar 28, 2026
6 checks passed
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