Repository navigation
Fix the South hint in same-board table solves - #455
Merged
Merged
Conversation
When solving a full deal's table, the leaders after North start from a hint. The South hint was meant to be partner North's score, but fut had already been overwritten by East's solve, so South started from East-West's trick count. On random full deals South needed about 6 null-window searches per strain instead of about 2. Results were unaffected, only the amount of work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A deterministic regression test is still needed for the South hint in both table-solving paths because existing tests cannot detect regressions in this selection logic.
1 open issue
What changed in this PR
This PR corrects South’s starting hint in both full-deal table-solving paths, reducing unnecessary null-window searches without changing the calculated trick counts.
Changes:
- Use North’s saved score for South instead of East’s overwritten result.
- Add comments explaining why the saved score is needed.
| File | Description |
|---|---|
library/src/calc_tables.cpp |
Corrects South’s hint in calc_single_common_internal and calc_single_deal_scores. |
Review effort: Balanced
Collaborator
|
@randalburns , can you please add the suggested tests? |
The hint only changes how much work a table solve does, not its results, so existing tests could not catch a regression. Add an optional observer that sees each same-board hint, and check that South's hint equals North-South's tricks with North leading through both CalcDDtableN and CalcAllTablesX. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@zzcgumn Added the regression tests in bbd3e65.
Both tests fail with the old hint restored and pass with the fix. All of |
zzcgumn
approved these changes
Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

When
CalcDDtablesolves a full deal, North's lead is solved in full. East, South and West then re-solve the same board with a null-window search that starts from a hint. South's hint is supposed to be partner North's score. By that point, though,fut.score[0]had already been overwritten by East's solve, so South started from East-West's trick count.The result is unchanged; only the amount of work is affected. On random full deals, South needed about 6 null-window searches per strain instead of about 2.
The fix reads North's score from where it was saved before East's solve:
solved.solved_board[bno].score[0]incalc_single_common_internalandscores[0]incalc_single_deal_scores.🤖 Generated with Claude Code