Implement backtracking for multi_phase_search, set max depth for 4x4x4 phase3 solver by Nogesma · Pull Request #165 · cubing/twips · GitHub
Skip to content

Implement backtracking for multi_phase_search, set max depth for 4x4x4 phase3 solver - #165

Open
Nogesma wants to merge 2 commits into
cubing:mainfrom
Nogesma:main
Open

Nogesma wants to merge 2 commits into
cubing:mainfrom
Nogesma:main

Conversation

@Nogesma

@Nogesma Nogesma commented Jul 22, 2026

Copy link
Copy Markdown

Switch the SearchPhase trait solutions to not take a mutable reference, and instead use a RefCell to get interior mutability for increasing the size of the prune table.

Also sets the max_depth_exclusive to 15 for the 4x4x4 phase3.
From what I benchmarked, setting it to 14, as it was in the comment makes it take several times longer to solve. Increasing it to 15 fixes it.

This is basically a ~1% regression for scrambles that were finding a solution without backtracking, due to the introduction of the RefCell, but a improvement of 10-35% for the rest. The benchmark code I used is in src/lib/bin/bench4x4x4.rs

Nogesma added 2 commits July 22, 2026 18:49
Switch the SearchPhase trait solutions to not take a mutable reference,
and instead use a RefCell to get interior mutability for increasing the
size of the prune table.
@lgarron

lgarron commented Jul 22, 2026

Copy link
Copy Markdown
Member

@Nogesma

Nogesma commented Jul 22, 2026

Copy link
Copy Markdown
Author

The code is entirely mine, but I did use an LLM to get better understanding of the repo before I implemented this ie. asking question about the code, but never asking it to write code.

@Nogesma

Nogesma commented Jul 29, 2026

Copy link
Copy Markdown
Author

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.

2 participants