Skip to content

instrument: TT lookup/hit counters (hot-path) + env-gated summary - #365

Open
wopdevries wants to merge 2 commits into
dds-bridge:developfrom
wopdevries:wopdevries-tt-hit-rate-instrumentation
Open

instrument: TT lookup/hit counters (hot-path) + env-gated summary#365
wopdevries wants to merge 2 commits into
dds-bridge:developfrom
wopdevries:wopdevries-tt-hit-rate-instrumentation

Conversation

@wopdevries

@wopdevries wopdevries commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Minimal, low-risk instrumentation to measure the transposition-table hit rate on the search hot path.

Changes:

  • Add tt_lookup_count and tt_hit_count counters to ThreadData
  • Increment counters in apply_ab_tt_lookup (the canonical AB hot-path TT probe)
  • Print env-gated summary at SOLVER_DONE when DDS_PRINT_TT_STATS=1

No behavioral changes — counters are cheap increments, output is gated.

Measurement results on hands/largest.txt (21 hardest hands, single-threaded):

  • TT hit rate: ~66-67% consistently across all hands
  • Harder hands show slightly lower hit rate (63.67% for the hardest)
  • ~1 in 3 lookups misses, suggesting TT size is the binding constraint

How to test:

bazelisk build //library/tests:dtest
DDS_PRINT_TT_STATS=1 ./bazel-bin/library/tests/dtest -f hands/largest.txt -s solve -n 1

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