Conversation
… cases
- ExtendedNotation: expands wide turns, M/E/S slices, and x/y/z
rotations to outer moves with frame tracking, so the standard OLL
and PLL algorithm sheets transcribe verbatim; net frame must be
identity or a pure y rotation; H-perm slice expansion is an anchor
- CFOPAlgorithms: the full 57-case OLL + 21-case PLL sets; recognition
keys are derived from each algorithm (its inverse builds the case),
and validationIssues() checks parse, F2L preservation, uniqueness,
and exhaustive coverage of all 216 orientation + 288 permutation
last-layer states — the test suite requires the list to be empty
- CFOPSolver: cross via a 190,080-entry exact distance table (always
≤ 8 moves); F2L pairs via Dijkstra over the tracked corner+edge
space with an alphabet of standard triggers (each provably clean,
so no 41-case table to transcribe), inserted in greedy cheapest-
first order; OLL by pattern lookup under U rotations; PLL by trial
with AUF on both sides; ~60-move average solutions
- Shared [Move].rotatedY/merged and PieceAction code tables lifted
from BeginnerSolver, which now delegates
- App: CFOP method row; staged playback carries case names
("OLL 27 (Sune)", "PLL · Gc")
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Adds CFOP as a fifth solving method: the speedcubing method, with staged playback showing Cross, the four F2L pairs, and the recognized last-layer cases by name ("OLL 27 (Sune)", "PLL · Gc"). Measured average solution: 60.6 moves over 40 seeded random states.
Design
Cross — table-optimal. An exact BFS distance table over the four cross edges (P(12,4) · 2⁴ = 190,080 entries, built once per process in milliseconds) drives a greedy descent. The cross is never longer than 8 moves, and the test suite asserts it.
F2L — macro search instead of a transcribed case table. The plan called for the standard 41-case algorithm table; the implementation instead runs a per-pair Dijkstra over the tracked corner+edge state (24 × 24 codes) with an alphabet of the standard triggers — U turns, the slot's six inserts (R U R' and F' U F families, y-conjugated per slot), and pop-out triggers for the other unsolved slots. Every macro provably preserves the cross and all solved pairs, so any path is clean by construction: no transcription risk, automatic extraction of buried pieces, complete coverage without enumerating cases — and the output still reads like textbook F2L because the macros are the textbook triggers. Pairs are inserted in greedy cheapest-first order.
OLL/PLL — the full 57 + 21 algorithm sets, with nothing resting on transcription.
ExtendedNotationparser expands wide turns, M/E/S slices, and x/y/z rotations to outer moves using the same fixed-center equivalences as the scene (M ≙ L′ R + x′ …), tracking the cumulative frame so letters after a rotation land on the right faces. The net frame must end as identity or a pure y rotation (anything else would tilt the U axis and change the algorithm's meaning). Anchor test:M2 U M2 U2 M2 U M2must equal the H-perm.validationIssues()re-checks every entry — parseability, first-two-layer preservation, case uniqueness modulo U rotation — and proves exhaustive coverage of all 216 legal last-layer orientation patterns and all 288 permutation states. The test suite requires the issue list to be empty, so a single mistyped algorithm fails CI with a message naming the entry.Shared refactor:
[Move].rotatedY/merged()and the per-move piece-action code tables moved out ofBeginnerSolverinto shared internal helpers (MoveTransforms.swift); BeginnerSolver delegates, its tests unchanged. TheCubeState.rotatedYconjugation the plan sketched turned out to be unnecessary — slot conjugation happens at the move level only.Verification
swift test -c release: 85 tests pass (9 new). The new suite includes: parser anchors; the full table-validation pass (all 119 algorithms checked, both coverage proofs); by-construction tests for every OLL and PLL entry (build the case from the algorithm's inverse plus a random AUF, solve, assert the recognized case name matches); a 200-state sweep with cumulative per-stage invariants (cross → pairs → oriented → solved) and cross-length ≤ 8; average length ≤ 70 (measured 60.6).🤖 Generated with Claude Code