Upload folder using huggingface_hub
Browse filesFiles changed (17)
- code/cube_ops.pyAdded+100
- code/cube_tokenizer.pyAdded+93
- code/eval_canonical.pyAdded+113
- code/eval_value_search.pyAdded+100
- code/fixtures/canonical_states.jsonAdded+1
- code/fixtures/prompt_pairs.jsonAdded+74
- code/gen_data.pyAdded+287
- code/gen_rollout_data.pyAdded+152
- code/run_benchmark.shAdded+68
- code/search.pyAdded+89
- code/serve.pyAdded+305
- code/test_serve.pyAdded+48
- code/train.pyAdded+253
- code/train_value.pyAdded+216
- code/train_value_iteration.pyAdded+307
- code/vast_bootstrap.shAdded+250
- code/verify_data.pyAdded+43
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100"""Vectorized cube moves over numpy arrays of facelet indices.
`gen_data.apply_move` rebuilds a 54-character Python string per move, which isfine when the bottleneck is a Kociemba call. Value iteration has no solver inthe loop: every training step expands all 18 children of every state in thebatch, so at batch 1024 that is ~18k move applications per step and the stringpath becomes the whole cost.
A move is a fixed permutation of the 54 facelets -- `new[i] = old[perm[i]]` --so a batch of states is one fancy-index away: `states[:, perm]`. Quarter turnscompose by indexing a permutation with itself (`p2 = p[p]`), which is how thehalf- and counter-turns are built rather than by applying the quarter turnrepeatedly.
States are (N, 54) uint8 of colour indices into COLORS, not strings. Use`encode`/`decode` at the boundaries only."""import numpy as np
from gen_data import QT, MOVES, SOLVED
COLORS = "URFDLB"_C2I = {c: i for i, c in enumerate(COLORS)}
# MOVES order is (face, suffix) with suffix in ("", "'", "2") -- 1, 3 and 2# quarter turns respectively. PERMS is indexed by position in MOVES so a move# index from the model maps straight to a permutation._TURNS = {"": 1, "'": 3, "2": 2}
def _compose(perm: np.ndarray, times: int) -> np.ndarray: out = np.arange(54, dtype=np.int64) for _ in range(times): out = out[perm] return out
PERMS = np.stack([_compose(np.array(QT[m[0]], dtype=np.int64), _TURNS[m[1:]]) for m in MOVES])NUM_MOVES = len(MOVES)assert PERMS.shape == (NUM_MOVES, 54)
def encode(states) -> np.ndarray: """Facelet string(s) -> (N, 54) uint8.""" if isinstance(states, str): states = [states] return np.array([[_C2I[c] for c in s] for s in states], dtype=np.uint8)
def decode(arr: np.ndarray): """(N, 54) uint8 -> list of facelet strings.""" return ["".join(COLORS[i] for i in row) for row in np.asarray(arr)]
SOLVED_ARR = encode(SOLVED)[0]
def apply_moves(states: np.ndarray, move_ids) -> np.ndarray: """Applies one move per state. `move_ids` is an int array of length N.""" rows = np.arange(len(states))[:, None] return states[rows, PERMS[np.asarray(move_ids)]]
def all_children(states: np.ndarray) -> np.ndarray: """(N, 54) -> (N, 18, 54): every state's 18 successors, in MOVES order.""" return states[:, PERMS]
def is_solved(states: np.ndarray) -> np.ndarray: """(N, 54) -> (N,) bool.""" return (states == SOLVED_ARR).all(axis=1)
def random_walk(n: int, max_depth: int, rng: np.random.Generator): """n states from independent walks off solved, depths uniform in 1..max_depth.
Returns (states, depths). The walk never turns the same face twice in a row, matching gen_data.random_state -- consecutive turns of one face are a single different move, so allowing them biases the effective depth downward.
Depths are returned for reporting only. They are an upper bound on the true distance, never the label: value iteration derives its own targets, and a walk of length 12 routinely lands somewhere far nearer to solved. """ depths = rng.integers(1, max_depth + 1, size=n) states = np.repeat(SOLVED_ARR[None, :], n, axis=0) prev_face = np.full(n, -1) for step in range(max_depth): live = np.where(depths > step)[0] if not len(live): break mv = rng.integers(0, NUM_MOVES, size=len(live)) clash = (mv // 3) == prev_face[live] while clash.any(): mv[clash] = rng.integers(0, NUM_MOVES, size=int(clash.sum())) clash = (mv // 3) == prev_face[live] states[live] = states[live][np.arange(len(live))[:, None], PERMS[mv]] prev_face[live] = mv // 3 return states, depths123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293"""Tokenizer for the cube task.
Deliberately not a text tokenizer. The task has a tiny closed vocabulary -- sixsticker colours in, eighteen moves out -- so every token is one symbol with onemeaning, and a sequence is a fixed 54-token state followed by a short solution.A BPE tokenizer would only introduce ambiguity (multi-character merges, casing,whitespace) into an input that has none.
Sequence layout:
[BOS] s0 s1 ... s53 [SEP] m0 m1 ... mk [EOS]
Loss is taken only on the move span and [EOS]. The state is the conditioningprompt -- training the model to predict the scrambled state would spend capacitylearning the distribution of cube states, which is not the task and which themodel gets for free as input anyway.
Both the trainer and the serving shim import this module, so their vocabulariescannot drift apart. A silent mismatch there would look exactly like a model thatfailed to learn."""from typing import List
COLORS = list("URFDLB")MOVES = [f + s for f in "URFDLB" for s in ("", "'", "2")]SPECIALS = ["<pad>", "<bos>", "<sep>", "<eos>"]
VOCAB = SPECIALS + COLORS + MOVESSTOI = {t: i for i, t in enumerate(VOCAB)}ITOS = {i: t for t, i in STOI.items()}
PAD, BOS, SEP, EOS = (STOI[t] for t in SPECIALS)VOCAB_SIZE = len(VOCAB)
# Colour token ids are contiguous, so a facelet's colour *index* (0..5, as used by# cube_ops' array form) becomes a token id by adding this. Exposed here rather# than as a literal in the array-based trainers, for the reason stated above: one# definition of the encoding, so the two representations cannot drift apart.# Colour token ids, indexed by the colour *index* (0..5) that cube_ops' array form# uses. Exposed here rather than recomputed in the array-based trainers, for the# reason stated above: one definition of the encoding, so the two representations# cannot drift apart.## These are NOT contiguous from len(SPECIALS), and the reason is a latent wart:# MOVES contains the bare face turns "U", "R", ... which collide with the colour# names, and STOI is built by dict comprehension, so the MOVES entries overwrite# the COLORS ones. Consequences:# - a colour and its bare-face move share one embedding (ids 10,13,16,19,22,25),# - VOCAB_SIZE is 28 but only 22 ids are distinct, and 4..9 are never emitted.# Harmless for a value net, which only ever reads state tokens, and a mild# confound for the policy. Left as-is deliberately: every trained checkpoint# encodes states this way, so "fixing" it silently invalidates all of them.# Derive from STOI, never by arithmetic on len(SPECIALS).COLOR_IDS = [STOI[c] for c in COLORS]
# 54 state tokens + BOS + SEP + a solution (Kociemba stays at or under 22 in the# half-turn metric, God's Number being 20 for optimal solves) + EOS.STATE_LEN = 54MAX_SOLUTION = 26MAX_SEQ = 1 + STATE_LEN + 1 + MAX_SOLUTION + 1
def encode_state(state: str) -> List[int]: """[BOS] + 54 colour tokens + [SEP] -- the prompt the model conditions on.""" if len(state) != STATE_LEN: raise ValueError(f"expected {STATE_LEN} facelets, got {len(state)}") return [BOS] + [STOI[c] for c in state] + [SEP]
def encode_solution(moves: List[str]) -> List[int]: return [STOI[m] for m in moves] + [EOS]
def decode_solution(ids: List[int]) -> List[str]: """Stops at [EOS]; ignores anything that is not a move token.""" out = [] for i in ids: if i == EOS: break tok = ITOS.get(int(i)) if tok in STOI and tok in MOVES: out.append(tok) return out
def encode_pair(state: str, moves: List[str]): """Returns (input_ids, labels) with labels masked to -100 over the prompt.""" prompt = encode_state(state) answer = encode_solution(moves) ids = prompt + answer labels = [-100] * len(prompt) + answer return ids, labels123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113"""Evaluates the model on the harness's own canonical benchmark scrambles.
Separate from the in-training holdout on purpose. The holdout comes from the samesampler as the training data, so it measures generalization to unseen states butnot robustness to a different generator. These states come from`generateScrambleSet` -- a different code path, the one every LLM on the board wasactually scored against, at the standard seed = depth * 1000 -- so a gap betweenthe two numbers would say the model fitted its own sampler's distribution ratherthan the task.
python eval_canonical.py --checkpoint checkpoints/cube python eval_canonical.py --distribution-only # no model needed"""import argparse, json, sysfrom collections import defaultdictfrom pathlib import Path
FIXTURE = Path(__file__).parent / "fixtures" / "canonical_states.json"
def distribution_report(states): """Kociemba solution length per depth bucket.
This is the God's Number plateau made visible: if scramble depth stops being a difficulty axis past ~20 moves, then depth 25, 50 and 100 should all show the same distance-to-solved as depth 20, and only the shallow buckets should look different. It also shows whether the shallow buckets are genuinely easier, or whether the scramble generator's redundant moves make a nominal depth-6 state closer to solved than 6. """ import kociemba
by_depth = defaultdict(list) for s in states: by_depth[s["depth"]].append(len(kociemba.solve(s["facelets"]).split()))
print(f"{'depth':>6} {'n':>4} {'mean':>7} {'min':>4} {'max':>4}") for depth in sorted(by_depth): lens = by_depth[depth] print(f"{depth:>6} {len(lens):>4} {sum(lens)/len(lens):>7.2f} {min(lens):>4} {max(lens):>4}")
def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument("--checkpoint", default="") p.add_argument("--distribution-only", action="store_true") p.add_argument("--limit-per-depth", type=int, default=0) p.add_argument("--chunk", type=int, default=0, help="Solve interactively: apply this many moves, then re-show the " "model the true state and ask again. 0 = one-shot (default). " "Interactive results are a different mode -- never table them " "alongside one-shot scores.") p.add_argument("--max-rounds", type=int, default=12) p.add_argument("--beam", type=int, default=0, help="Beam-search the model's distribution, verified by the engine. " "0 = greedy. Searches only what the model already ranks highly; " "it adds no independent distance estimate.") args = p.parse_args()
states = json.loads(FIXTURE.read_text()) if args.limit_per_depth: seen = defaultdict(int) keep = [] for s in states: if seen[s["depth"]] < args.limit_per_depth: keep.append(s) seen[s["depth"]] += 1 states = keep
if args.distribution_only: distribution_report(states) return
if not args.checkpoint: p.error("--checkpoint is required unless --distribution-only")
import torch from transformers import LlamaForCausalLM from gen_data import SOLVED, apply_sequence from serve import solve, solve_beam, solve_chunked
device = "cuda" if torch.cuda.is_available() else "cpu" model = LlamaForCausalLM.from_pretrained(args.checkpoint).to(device).eval()
mode = (f"chunked (chunk={args.chunk}, max_rounds={args.max_rounds})" if args.chunk else f"beam-{args.beam}" if args.beam else "one-shot") print(f"mode: {mode}") by_depth = defaultdict(lambda: [0, 0, 0]) for s in states: if args.chunk: moves = solve_chunked(model, s["facelets"], device, chunk=args.chunk, max_rounds=args.max_rounds) elif args.beam: moves = solve_beam(model, s["facelets"], device, beam=args.beam) else: moves = solve(model, s["facelets"], device).split() ok = bool(moves) and apply_sequence(s["facelets"], moves) == SOLVED by_depth[s["depth"]][0] += ok by_depth[s["depth"]][1] += 1 by_depth[s["depth"]][2] += len(moves)
print(f"{'depth':>6} {'solved':>8} {'n':>4} {'rate':>7} {'avg moves':>10}") total_ok = total_n = 0 for depth in sorted(by_depth): ok, n, mv = by_depth[depth] total_ok, total_n = total_ok + ok, total_n + n print(f"{depth:>6} {ok:>8} {n:>4} {ok/n:>6.1%} {mv/n:>10.1f}") print(f"{'ALL':>6} {total_ok:>8} {total_n:>4} {total_ok/total_n:>6.1%}")
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100"""Scores the value function + state search on the canonical benchmark scrambles.
Separate from eval_canonical.py because this is a different system: that onedecodes a policy (greedy, beam, or chunked), this one searches the state spacewith a learned distance estimate as the heuristic and the engine as thetransition function. The policy is not involved at all.
Run on a GPU. Each solve evaluates `beam * 18` child states per step for up to`--max-depth` steps -- tens of thousands of network calls, which is nothing on aGPU and hopeless on a few CPU cores.
python eval_value_search.py --value <path-or-hub> --beam 64 --limit-per-depth 25"""import argparse, json, os, sys, timefrom collections import defaultdictfrom pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))from gen_data import SOLVED, apply_sequence
FIXTURE = Path(__file__).parent / "fixtures" / "canonical_states.json"
def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument("--value", required=True, help="Path to value.pt, or a Hub repo id to download it from.") p.add_argument("--beam", default="64", help="Beam width, or a comma-separated list to sweep. A sweep " "reuses one box for every width, which matters because " "the deep buckets are where width decides the outcome and " "a single guess at it wastes the whole run.") p.add_argument("--lam", default="0.0", help="Weight on path length: states are ranked by h + lam*g. " "0 is pure greedy on the heuristic (fastest, and longest " "solutions), 1.0 is standard A*. Accepts a comma-separated " "list to sweep.") p.add_argument("--max-depth", type=int, default=26) p.add_argument("--limit-per-depth", type=int, default=25) p.add_argument("--depths", default="") args = p.parse_args()
import torch from search import load_value_model, solve_value_beam
path = args.value if not os.path.exists(path): from huggingface_hub import hf_hub_download path = hf_hub_download(args.value, "value.pt", token=os.environ.get("HF_TOKEN")) device = "cuda" if torch.cuda.is_available() else "cpu" model = load_value_model(path, device) print(f"value model on {device} | beam {args.beam} | lam {args.lam}", flush=True)
states = json.loads(FIXTURE.read_text()) if args.depths: keep = {int(d) for d in args.depths.split(",")} states = [s for s in states if s["depth"] in keep] if args.limit_per_depth: seen = defaultdict(int) kept = [] for s in states: if seen[s["depth"]] < args.limit_per_depth: kept.append(s) seen[s["depth"]] += 1 states = kept
grid = [(b, l) for b in [int(x) for x in str(args.beam).split(",")] for l in [float(x) for x in str(args.lam).split(",")]] for beam, lam in grid: print(f"\n=== beam {beam} lam {lam} ===", flush=True) by_depth = defaultdict(lambda: [0, 0, 0, 0.0]) print(f"{'depth':>6} {'solved':>8} {'n':>4} {'rate':>7} {'moves':>7} {'s/solve':>8}", flush=True) for s_ in states: t0 = time.time() moves = solve_value_beam(model, s_["facelets"], device, beam=beam, max_depth=args.max_depth, lam=lam) ok = bool(moves) and apply_sequence(s_["facelets"], moves) == SOLVED b = by_depth[s_["depth"]] b[0] += ok b[1] += 1 b[2] += len(moves) if ok else 0 b[3] += time.time() - t0 # Printed per depth as each depth's last scramble lands, rather than # only at the end: a wide beam on the deep buckets can run for a long # time, and a box that is killed or times out mid-sweep should still # have reported every bucket it did finish. if b[1] == sum(1 for x in states if x["depth"] == s_["depth"]): ok_, n_, mv_, secs_ = b print(f"{s_['depth']:>6} {ok_:>8} {n_:>4} {ok_/n_:>6.1%} " f"{mv_/max(ok_,1):>7.1f} {secs_/n_:>8.1f}", flush=True)
tot_ok = sum(v[0] for v in by_depth.values()) tot_n = sum(v[1] for v in by_depth.values()) print(f"{'ALL':>6} {tot_ok:>8} {tot_n:>4} {tot_ok/tot_n:>6.1%}", flush=True)
if __name__ == "__main__": main()1[{"depth":3,"index":0,"facelets":"BUUFUUFLLDLLRRURRUDBBDFFRFFBDDBDDFRRULLRLLRDDFFLBBUBBU"},{"depth":3,"index":1,"facelets":"BRRLUULUUBBDURDURDURRFFFFFFRRRDDDFLLUFFULDLLDBBLBBLBBD"},{"depth":3,"index":2,"facelets":"UDBUUBUUBLLLRRRRRRFFDFFDFFDDDBDDBDUBRLLRLLRLLUBFUBFUBF"},{"depth":3,"index":3,"facelets":"FRRUUUUUULLUDRRDFFBBBFFLFFLLLBDDDDDDDRRLLUBBUFFLBBBRRR"},{"depth":3,"index":4,"facelets":"RRDBUBBUBDDFRRRRRRUFRUFUUFUFDFFDFLLFULLULLBLLLBBDBBDDD"},{"depth":3,"index":5,"facelets":"UUDUUDUUDRRRRRRLLLBBBBFBBFBUDDUDDUDDRRRLLLLLLFFFFBFFBF"},{"depth":3,"index":6,"facelets":"UUUUUULRRDLLDRRLLUBFFBFFBBBDDDDDDLLRRRULLUDRRFFFBBBBFF"},{"depth":3,"index":7,"facelets":"BBRUUFUUFRRBRRBRRDRRDUFDUFDFDBFDBFDLUFFLLLLLLULLUBDBBD"},{"depth":3,"index":8,"facelets":"UURUUUBBURRDRRBRRBRRFFFFFFFDDDDDDDDLFFULLLLLLBLLUBBUBB"},{"depth":3,"index":9,"facelets":"UUUUUULLRDLLRRULLUBBFFFFBBBDDDDDDLRRRRUDLLDRRFFFBBFBBF"},{"depth":3,"index":10,"facelets":"DDFUUFLLLURRURRFLLFFFFFFUDDLRRDDBUUBRLDRLDRLBUBBUBBDBB"},{"depth":3,"index":11,"facelets":"DUUDUUDBBDBBRRRRRRBRRBFULFUUDFUDFBDFLLLLLLUFFLLFDBFDBR"},{"depth":3,"index":12,"facelets":"RRRUUBUUBRRFRRDFFUFFUFFUULLLDDLDDLFFBLLULLBBBDDDBBBRRD"},{"depth":3,"index":13,"facelets":"LLFUUFUUBDRRLRRLUUFFRFFDBBDRRFDDBDDBDLLDLLRRUUBBUBBLFF"},{"depth":3,"index":14,"facelets":"UUUUUUFRRDRRDRRDBBLFFRFFRFFBLLUDDUDDLLULLDFFDBBBBBBLLR"},{"depth":3,"index":15,"facelets":"RUUBUULLLBRRURRUFFUUULFFLFFFRRFDDLDDBLFBLDBLDBBDBBDRRD"},{"depth":3,"index":16,"facelets":"BUUBUURLLBRRDRRDRRDUUFFFFFFLLLFDDFDDLLFLLURRUBBDBBDBBU"},{"depth":3,"index":17,"facelets":"BDBBUUUUURRLRRLRRLBFFBFFBFFDDDFDDFUFLLRLLRLLRUBDUBDUBD"},{"depth":3,"index":18,"facelets":"LLLUUURDDFRULRULBBURRFFFFFFUUUDDRDDRDLBDLRFFRBBBBBBDLL"},{"depth":3,"index":19,"facelets":"LLLDUUDUURRDRRUDLLBFFBFFBBBRRRDDUDDUULLDLLRRUFFFBBBBFF"},{"depth":3,"index":20,"facelets":"RLDUUDUURULLURRURRFFBFFBBBBDDLDDULRUDLLDLLDRRBBFFBFFBF"},{"depth":3,"index":21,"facelets":"BBBLUULUUBBDURRURRURRUFFLFFFRRFDDFDDUFFLLLDDDLLLBBDBBR"},{"depth":3,"index":22,"facelets":"DDDUURUURFFLDRLDRBLLUFFFFFFLLLDDDRUURBBRLUFLUBBBBBBRRD"},{"depth":3,"index":23,"facelets":"DDLRUURUUBBFDRRDRRDRRBFFBFFULLUDDRDDBFFULLULLULLBBFBBF"},{"depth":3,"index":24,"facelets":"FFLUULUULUUURRURRURRFDFFDFFBDDBDDRRRDFFDLLDLLBLLBBBBBB"},{"depth":3,"index":25,"facelets":"UDUUUUUUULRRLRRLRRFFBFFBFFBDDDDDDDUDRLLRLLRLLBBFBBFBBF"},{"depth":3,"index":26,"facelets":"UUBUUFUUFRRLRRLUBBBBDFFDRRLBBFDDDDDDRRRLLLFFDUFFUBBLLL"},{"depth":3,"index":27,"facelets":"DDDDUUUUULLRRRLRRLFBBFFBFFBUUUDDUDDDRRLLLRLLRFFBFBBFBB"},{"depth":3,"index":28,"facelets":"FRRFUUFUULLDRRDRRDLBBUFFUFFBDDFDDFLLUUULLRLLRBBRBBDBBD"},{"depth":3,"index":29,"facelets":"FLLUUDUUDRRURRUFFDFFBFFBLLLDDDDDDBRRULLULLUBBBBRBBRFFR"},{"depth":3,"index":30,"facelets":"UUUUUUUUBDRRDRRRBBFFRFFRFFUDDFRDDRDDLLLLLLFFLBBBBBBLLD"},{"depth":3,"index":31,"facelets":"UUFUUFUUURDDRRRFRRFFFFFFDDLRRDDDBDDBLLLLLLLLBRBBUBBUBB"},{"depth":3,"index":32,"facelets":"UUFUUFLLFRRRRRRUUDFFDFFDBBLRRFDDFDDBLLDLLDLLUUBBUBBRBB"},{"depth":3,"index":33,"facelets":"RUUBUUBDDBRRLRRLFFULLUFFDFFLUUFDDFDDBLLBLLRRFBBDBBDRRU"},{"depth":3,"index":34,"facelets":"UUUUUUDDDRFFRRRFFFBBBBFFBLLUDDUDDUDDBBLLLLLLLRRRBBFRRF"},{"depth":3,"index":35,"facelets":"DUUDUULRRDRRDRRLLUFFFBFFBBBUDDUDDRLLRRDULLULLBBBBBFFFF"},{"depth":3,"index":36,"facelets":"DDDUUUBLLURLURLUFFRFFLFFLFFFRRUDDUDDRLURLDBBDBBBBBBRRL"},{"depth":3,"index":37,"facelets":"UURUUFRRRBRBDRBDRBDDDRFFRFFFLLDDBDDLFFFLLULLUULLUBBUBB"},{"depth":3,"index":38,"facelets":"UUDUUDLLRURRURRDLLFFBFFBFBBLRRDDUDDURRDLLDLLUFFFFBBBBB"},{"depth":3,"index":39,"facelets":"UUUUUUBFFDBBRRRRRRRLLDFFDFFBDDBDDFDDFFURLLRLLLLLBBUBBU"},{"depth":3,"index":40,"facelets":"LLLUUUUUULLDLRDLRDBBBFFFFFFUUUDDDRRRDRRDLRDLRFBBFBBFBB"},{"depth":3,"index":41,"facelets":"DDLUULUULFFFURRDRRLLDFFFBBBRRRDDUDDUFBBLLDLLUURRFBBFBB"},{"depth":3,"index":42,"facelets":"DRBDUULUURRDRRDBBDBFFBFFBRRRDDUDDULFFFULLULLULBRLBFLBF"},{"depth":3,"index":43,"facelets":"RRDUUFUUFRRBRRBFFBFFDFFDLLLDDDDDDLLUFLLULLUBBRUURBBRBB"},{"depth":3,"index":44,"facelets":"DDLDUUDLLURDURDURDBFFBFFBFFURRUDDUURRLLRLLRLLFBBFBBFBB"},{"depth":3,"index":45,"facelets":"RUDDUDDLLURRURRDRRBFFBFFBBBURRUDULDUULLDLLDLLFBBFBFFBF"},{"depth":3,"index":46,"facelets":"FUUFUUFLRULLURRURRRFBDFBDFBBRLBDDFDDDDDRLLRLLFFLBBUBBU"},{"depth":3,"index":47,"facelets":"UUUDUULLLURRURRURRFFFFFFBBBLLLUDDDDDRLDRLDRLDBBFBBFBBF"},{"depth":3,"index":48,"facelets":"LLFUUFUULFRRFRRFUUFFDFFDDLDRDRRDBRDBDLLDLLBBBUBBUBBLRU"},{"depth":3,"index":49,"facelets":"DUUDUUDUURRRRRRBRRLFFBFFLLLUUUDDDDDDFFFLLLLLFBBRBBFBBB"},{"depth":6,"index":0,"facelets":"UUFBUFLFRDLLURRBBBURFUFBUUDRRLBDLBDLBDFLLFRRFDLRDBDUFD"},{"depth":6,"index":1,"facelets":"BUDUUDUUFLBBRRRRRBRRUFFBFFFDDDDDDLLULFFULLULLRBDFBLRBB"},{"depth":6,"index":2,"facelets":"BBFUUFLLBLURLRRBBDFFDFFDRRRUDDUDDFRRULDRLDUBBULLBBUFFL"},{"depth":6,"index":3,"facelets":"RDDFUURUUBBFRRULDDDRRDFFLBFBRULDBLDBFLFFLFBBULLULBURRD"},{"depth":6,"index":4,"facelets":"BUUBUFLURBRFBRLLRLULDUFDRRUDDBDDBUUDLLFLLFRFFRRDFBDFBB"},{"depth":6,"index":5,"facelets":"FFURUULDDLBRLRUBBUUFFUFFFRRRDDBDDBRBUUFDLFDLDBRRLBLLBL"},{"depth":6,"index":6,"facelets":"BDDBUULRRULRURRULLFBBBFFDFFRRRUDFBDFLLDLLULRBFFDDBDUBU"},{"depth":6,"index":7,"facelets":"UURUUFRFDLLUDRRBRRBUFBFFUDDLLLBDFUUFFRDRLDRLBFLLDBBDBB"},{"depth":6,"index":8,"facelets":"FLLUURURRBUFRRFLLUBDDLFFLBBFDDBDDDDBUBRLLURRDUFRUBBLFF"},{"depth":6,"index":9,"facelets":"FDDUUUUFBRRLLRLBFDRLUUFDUFLFDUBDUDDBDBFRLLRRLBBLBBFRRF"},{"depth":6,"index":10,"facelets":"DDFFUBURRFLLURLRRUBUUFFBLFFBDDBDDBLLBURLLRRRUDBLDBUFFD"},{"depth":6,"index":11,"facelets":"FLRUUDDDRBRUURUULFBBDDFBUFBBDLBDFDLLLRLRLLRRRFUUFBFDBF"},{"depth":6,"index":12,"facelets":"BUUDUUDUUBBBFRRFBDBRRBFUURURDLBDDRFFDLLFLLFRFLLRFBDLLD"},{"depth":6,"index":13,"facelets":"UFFUULDDDLURLRDLLDBFFBFFRDFURUBDDBRRLBLULLRRBUUBBBRFFD"},{"depth":6,"index":14,"facelets":"BDDFUDFLFLFLURLDRRDDULFBLFRBLFBDDBUURRLRLURRUBBUBBUFFD"},{"depth":6,"index":15,"facelets":"BDDBUULLLUFBDRRRLLFFFFFLDDUBBFBDURUURRDBLDFLLRRUFBUBRD"},{"depth":6,"index":16,"facelets":"LDDFUUBUURRRRRLBBFDFFDFFULLBUUBDDLUUFLRFLRBRRFLDBBDLBD"},{"depth":6,"index":17,"facelets":"DRRDUUDLLULUURRBBBBFFBFFRFLBDUUDUFDULLLDLLDRDFFFBBRRBR"},{"depth":6,"index":18,"facelets":"RDRUUBUUBRRFRRURRLFFUFFUURULDFLDFLBBBLLDLLDBBDLDBBFDDF"},{"depth":6,"index":19,"facelets":"DUUDUFLLFRRRRRRDUFBBDFFUBBLDDBDDFLLRLLULLDFRRBBFBBFUUU"},{"depth":6,"index":20,"facelets":"UUDUUDUBULRRBRRBFDRDBLFRLDRULDDDUBBFBBFLLFDFFFRRFBULLL"},{"depth":6,"index":21,"facelets":"BDDBUUBDBLRRLRRBFDDFDBFDLLLUUUUDUUDFRRRLLLFBFFBUFBFLRR"},{"depth":6,"index":22,"facelets":"DDLUULLLBLUULRFFBRFFDFFDURRFUURDDRFBFBDLLDDBLBRRUBBURB"},{"depth":6,"index":23,"facelets":"LBDUUFUUFRRBRRBLLLRRDFFDFFFDDUDDUULUDFFDLLRLLRUBRBBBBB"},{"depth":6,"index":24,"facelets":"LULUULRDDBFFRRRRRRULLBFFFFFUDDUDDLDDBFBULLDLRURUBBBBBF"},{"depth":6,"index":25,"facelets":"UDDUUDUUDLLBLRRLLLBBFFFBRRBDDDUDUUDUFRRRLLFFFRBLBBFBFR"},{"depth":6,"index":26,"facelets":"RRRDUURRRURULRDLRLBBBBFFBFFUUUUDDDDDDLDULLLLLFFFBBBFFB"},{"depth":6,"index":27,"facelets":"FLFUUUUDUFFDLRULRULRLFFBFFBDDDDDURRRULBDLRDLLRFRBBBBBB"},{"depth":6,"index":28,"facelets":"DUUDUUDDDFBBLRRLBRRRRBFBRLBUUDDDDUUULLBLLRLFBLRFFBFFFF"},{"depth":6,"index":29,"facelets":"LLFUUFRDDFRRLRRLUUURRDFFLBDURFUDBBDBDLBDLLRFFUBBUBBLFD"},{"depth":6,"index":30,"facelets":"UUULUUBBDLFFURRUBRUUFRFLDFLBRFFDLRDDBDLFLDFLLRRRBBDBBD"},{"depth":6,"index":31,"facelets":"DDDDUDLURFBLRRLFBBFRUFFBFFURRLLDUUUURRDULDBFDBLBBBFRLL"},{"depth":6,"index":32,"facelets":"FRUBURBUFLFFDRDBUDDBUUFFDLLLUUDDFRLLRRRLLRBLFRDDBBFBBU"},{"depth":6,"index":33,"facelets":"ULRBUUFUULLDDRLDFFDBBBFRUURRRFDDUBFUBRLLLDDFFBFRDBBLRL"},{"depth":6,"index":34,"facelets":"LLLUUBUUDRRDRRDRLFBBBDFFUBFFDDBDFLLRBRRULRBLLFUUFBFUDD"},{"depth":6,"index":35,"facelets":"FRFBUUDDLBFUURRBRRFFULFRUUDBBLFDDFDDULRLLULLRLFRBBDBBD"},{"depth":6,"index":36,"facelets":"DRBDUBDRLUDDLRRBLLRUFFFBFFUUURFDUFUULLBLLRDDRLBFDBFBBR"},{"depth":6,"index":37,"facelets":"DRRDUURBBRRDDRDUFFDUUFFFBBLLLFLDRLDRLLFLLUUUDBBFBBFURB"},{"depth":6,"index":38,"facelets":"DDUUUFFLLUDBRRRRRRDUFBFFBBFRLDUDDUDDBRLLLUFFULLLBBFBBR"},{"depth":6,"index":39,"facelets":"UDLUUFUDDFRFLRFBLLBRRDFFDLLLUUBDBBDBRRRBLFRRFUBFUBUDLD"},{"depth":6,"index":40,"facelets":"RDFFUBFUBRRUBRUBRLDRUDFLBFLDDUDDFDUBFLLFLLRRRLBULBUDBF"},{"depth":6,"index":41,"facelets":"UUUUUBRRBDDRRRRDLUDDRFFUFFLDDBFDDFLLLLFLLURRLBBBBBBFFU"},{"depth":6,"index":42,"facelets":"RRRLUULDDLRDURDFLUUFFLFFBBDLLRDDDRRBUFFULUURDBBBBBBLFF"},{"depth":6,"index":43,"facelets":"FDFLUULUUBBRRRLFFLBRRDFBDFDBURBDRBDDLUURLLRLLUFUFBDFBD"},{"depth":6,"index":44,"facelets":"DUUDUFFRLBDFLRRURRRUUBFDBLLRUFFDDLLDBBDULLDRURBLBBFBFF"},{"depth":6,"index":45,"facelets":"UULUULRLLUDDFRRBRRFFFBFDBBULRRUDFDUFLLULLDBFDFBBDBBDRR"},{"depth":6,"index":46,"facelets":"RRFDUFDDDBLLBRRDDLFFLFFLULBRURDDRUUUULRULRLBFDBBUBBBFF"},{"depth":6,"index":47,"facelets":"BLUBURLLRFFBDRRDRRUUUFFBLLBFFRLDUBUFLUFDLDUBDLDDBBRDFR"},{"depth":6,"index":48,"facelets":"FLLDULRRRDUUBRBDUBFFFFFUURFBDLLDRBRRLFUDLUDFRBBUDBLDBL"},{"depth":6,"index":49,"facelets":"RUDFUFRLBUDFBRRFRRDDLRFDRBUBLLFDBLUBFLFFLDBRDLBUUBUULD"},{"depth":10,"index":0,"facelets":"UUBUUBBRDBLLLRDFBDRBLFFUFRUDFLDDUBDRRRURLLRLLUFFFBDFBD"},{"depth":10,"index":1,"facelets":"DDFFUDUBBRLDBRLUFUFUUFFLDUFBLRUDDDDBRRLRLUFRLRBBFBBLRL"},{"depth":10,"index":2,"facelets":"BFLBUDRRDFLFLRDDDDFURBFULFLFUBFDBUUBRRULLLBDDURURBFRBL"},{"depth":10,"index":3,"facelets":"UUBUUDDFFDFRDRRBRLFLLBFRBBDUDLUDFFFFBBRLLLRLLDRRBBDUUU"},{"depth":10,"index":4,"facelets":"BUBBUBUFRFDDDRFLLUBRULFRRUDBRFDDFRLLUURRLUFLDLFLDBBFBD"},{"depth":10,"index":5,"facelets":"RBDUULUUUFFRFRRUDDBRLDFRDUBBFLBDFRDFFLRBLLDLLFRUDBULBB"},{"depth":10,"index":6,"facelets":"BBLFULFFUFUURRFDBDRRLDFDFFLUDBUDUDDFRLDBLLBRRBLUUBRLBR"},{"depth":10,"index":7,"facelets":"BFFBUDURDBLURRFDDDRBLDFUDFBLURDDRRLRUUFULFBBFLLLRBLFBU"},{"depth":10,"index":8,"facelets":"DLLFUURUURLUDRUFFDBFFUFBUFUBDLBDLFDLFRDLLRLRRBBRBBDBRD"},{"depth":10,"index":9,"facelets":"RUFRURLRRDBRDRUBDUUFFUFFBUULRRFDBFLBBDFLLFLLDUBDLBDLBD"},{"depth":10,"index":10,"facelets":"RLLBUULUURRUFRDURDFFFFFDFLLRFFDDDDLLURDULRBLDBUBBBBBBR"},{"depth":10,"index":11,"facelets":"BBLRUUFDLUBUDRFDRUDBFFFLFBLRLBUDDUUFDFLULLRRDBRRDBFRLB"},{"depth":10,"index":12,"facelets":"LRFDUUULBDLLURDDDLRBRRFBRBRUDFLDFLUBBLFULFFFBDBURBFDRU"},{"depth":10,"index":13,"facelets":"DDUFUFUDUFURRRRFRRRLLFFDDULBLDRDFLLFRDFULLUBLBBBUBBDBB"},{"depth":10,"index":14,"facelets":"RURDUUUBLFFBURBULBFRDBFBFFBRDLUDFBDRFRLFLLDRDULUDBRDLL"},{"depth":10,"index":15,"facelets":"FURBUFDDBDRBLRFFFLLRRUFUULULDLBDLRBBULFFLBFRBURRUBDDDD"},{"depth":10,"index":16,"facelets":"LBBFUBLDBURRLRUFLRDRLUFUFBRLLUFDFRDBFUBFLRFRUDDDBBDULD"},{"depth":10,"index":17,"facelets":"LDFDUFBUDFUULRLBRBLBRBFBULRRDDUDFBLUFFDBLRLRFLRDUBDRFU"},{"depth":10,"index":18,"facelets":"RFDBUBFLDFUBDRFLDDLURBFFFBUDDBRDLUULFLURLRRDLRLURBUBFB"},{"depth":10,"index":19,"facelets":"DDDDURRRBLDFURFUDBFFDFFLFUBLRLLDFUURFLURLURBULBRLBBDBB"},{"depth":10,"index":20,"facelets":"BBFBUFFDULRRBRRUFBRBBDFRDLLRFFDDDDLULLDULLFRBUUDUBFRUL"},{"depth":10,"index":21,"facelets":"FUURUUFURUBBDRLLBDDLBRFLRRBDBDLDDFDBLULRLFRBFLFUFBDRFU"},{"depth":10,"index":22,"facelets":"BFDRUDFBURLRFRRDBFDLFRFRUFLLLBDDURUURBLDLUDBBFUUDBFLLB"},{"depth":10,"index":23,"facelets":"BLLDUBDLLULBRRUUFFRFFBFULFFFRRFDDUDDUBBULRRUDDDLBBLRRB"},{"depth":10,"index":24,"facelets":"DBFRUFRDLFUDLRBULFBFDFFURLRFDBUDBUFUBDDRLLBBURRLDBULRL"},{"depth":10,"index":25,"facelets":"BLRRUDUUURBFRRLLRLFFFDFFRLBUDDUDBFFUDULULRLBBDBRFBLBDD"},{"depth":10,"index":26,"facelets":"BBDRUDULBLLFDRRURBBFDBFFRBLDDFUDFRURUURULRUFFLLLDBBDLF"},{"depth":10,"index":27,"facelets":"UDRFULRDDBUFURLDFBUFLRFRLLFBBLLDURURFRBRLBUDUDBLFBDDBF"},{"depth":10,"index":28,"facelets":"RRLUUDFLBUFDURLBBUUBLRFLBRDDFLFDDFDLUBRDLUDURFBBFBRFLR"},{"depth":10,"index":29,"facelets":"LUFFUUDLRFRULRRBBFFBUUFFBRRLDDLDDUFLBURDLLRDDLBUBBFDRB"},{"depth":10,"index":30,"facelets":"DRLFUUBBRDRULRDUFULDFRFFDBRLLBUDRRDLRUDULDULFBBBFBBFLF"},{"depth":10,"index":31,"facelets":"UFLDURDFDRUFLRRLRRBUBBFDFFDUDFUDFLLFBBLULRULRULRDBBDBB"},{"depth":10,"index":32,"facelets":"BUBRUBFURBLLBRRRFDLBDDFDFFURLFBDDLFLRUUFLLDRDULUDBUBRF"},{"depth":10,"index":33,"facelets":"DBBDUDUFFULLLRRBURBRRDFFDRRLDDBDLUUFBFRRLBLLFUULUBBDFF"},{"depth":10,"index":34,"facelets":"UUUUUFFFLFRLRRUUUBRLDFFBBBFDDRBDRLLLBBDRLDBLRFLRFBDUDD"},{"depth":10,"index":35,"facelets":"RBBFUBFRLDDLLRBDDDLFBDFFFDRURFUDFUBFBUUULLRRRUUDLBLLRB"},{"depth":10,"index":36,"facelets":"DBDDUBLLLULRURRFRRDDFBFFBBLURDUDURDBRRBFLDULLFUBFBLUFF"},{"depth":10,"index":37,"facelets":"URLFUBRUBLLFBRUDRFBLDBFUBFFUDLFDDBRDRRDLLDULLUUFFBDRBR"},{"depth":10,"index":38,"facelets":"BLDUUDBDRFFFURUUBBRRUBFRBFLLRFUDRFDRUFULLDDBDLFLLBBDLR"},{"depth":10,"index":39,"facelets":"FFUUUDLLRFLBRRBRRDFFUUFBURBFFUDDUDDLRLDULFBBLLDDLBBBRR"},{"depth":10,"index":40,"facelets":"BRDLUDRBURLLDRRLUUDLFBFBLRFFUUFDFRLRUUFFLUDDDBBLDBRBFB"},{"depth":10,"index":41,"facelets":"FLRFUFFUFULDDRDBRBRBRRFFLBDUDLUDBLUUDRDLLDUFFBBLLBURRB"},{"depth":10,"index":42,"facelets":"LURRURDBBRFFDRLDDLLUUFFFLLBUURDDRULBBBFBLUFBFDRUDBLDFR"},{"depth":10,"index":43,"facelets":"LRRBUFLDLDLULRUFBFBBBLFUULDBBRFDUBULURURLDRDRFFFFBDDRD"},{"depth":10,"index":44,"facelets":"RDUUUUDDUFRRFRRDDBRRLFFLLLRDBFDDFDULFBBLLRFBBBLUBBUUFL"},{"depth":10,"index":45,"facelets":"ULUDURDUBDURRRLBFLFLRDFBFFLDDUBDLUUBRRRRLBLULBDFBBFDFF"},{"depth":10,"index":46,"facelets":"LDBFUDUURULRDRLLFLLRBLFRRBFDDUBDUULDDRBRLUFUFDFBFBBFBR"},{"depth":10,"index":47,"facelets":"BBRUUBDLRURDURFRRDBUBFFBULUFDFFDFRRFURLBLUFLLBLLDBDLDD"},{"depth":10,"index":48,"facelets":"LDRFUDLLBRLDRRFURUUUUBFDDFFLDRLDBRRBDRFULLFFFBBBUBBLUD"},{"depth":10,"index":49,"facelets":"DUDBUBRRRDLBDRFURFUFFLFFUFLLLFDDDLURLRBLLDBBBRBFUBUURD"},{"depth":15,"index":0,"facelets":"UDRUULULDFUDFRRUBLFFRBFRDBFLURUDLDLUBRLDLRLFFBBRDBFBDB"},{"depth":15,"index":1,"facelets":"LDLDUUBRDRFDFRLRULLUBRFLFRFUFDBDBRLUURDFLBBDRFLFUBDBBU"},{"depth":15,"index":2,"facelets":"URDBUDRRBULLURURFDUFLDFLRBFBUDFDLFUFRLBRLBUDDBBFRBDLFL"},{"depth":15,"index":3,"facelets":"ULLUUDBBFDLFURDLBDRRLFFBFRURDBUDDRLLRRULLRDFDUUFFBFBBB"},{"depth":15,"index":4,"facelets":"BDFUURUBBRBDDRFFRLRUUFFLDUUBLLLDUBBDUFFDLRRBLRFLLBRFDD"},{"depth":15,"index":5,"facelets":"RRLFULRUDFUURRDFFFUBRUFBLLLDDDFDDFFRBRBLLRUUBBDDBBBULL"},{"depth":15,"index":6,"facelets":"DRFDUDDUFRLULRURRURBDFFBLUUFLFFDUBRBBBBFLLUDDLDLFBRLBR"},{"depth":15,"index":7,"facelets":"LUBFUBFBBULURRULDRDDLRFDRRFFFURDLBFFDULFLURBURLBBBLDDD"},{"depth":15,"index":8,"facelets":"FDLDURBRBDDUBRFFLLRFRUFULBLURDLDBRLBUFUULLFDFBBRUBRDFD"},{"depth":15,"index":9,"facelets":"BDBBUUDLLBRURRFFFLBBUUFDFFDUDRBDLFRFDDLLLBLRRRLRUBUUFD"},{"depth":15,"index":10,"facelets":"RDRFULDLBUUDRRLRLFBFLUFFUUFBRDRDDUDLFULDLBLBRBRUBBBDFF"},{"depth":15,"index":11,"facelets":"BDUDUFLRUBLFURFUUBDDRFFBFDLRFFLDRLLLDLBRLUDBDRBRRBBUUF"},{"depth":15,"index":12,"facelets":"LUUFUBFUFRRLRRDDLRDLDFFDUUBLFRFDBRBBDRLLLLUDBFRBBBDUUF"},{"depth":15,"index":13,"facelets":"FLBRUUURFRLRBRBLFUBUDRFRFLFUFUFDDLDBDDRBLFBURDBLDBULLD"},{"depth":15,"index":14,"facelets":"UBFUULBFBRBLRRURDBLDUDFBRFFFUDRDLLRRLRDFLBFFUDUBLBLDDU"},{"depth":15,"index":15,"facelets":"RULUURFDBDDUBRDUFLDBRFFLURLBBFRDDFBBDLLFLRRURBFFLBLDUU"},{"depth":15,"index":16,"facelets":"BRBUUBULUBLDLRUDDFRDRBFFUBRLRFFDFLDUDFFLLUDRBLDRRBULBF"},{"depth":15,"index":17,"facelets":"FDBFUDRLUFBURRRDBRBULBFULFLFLBDDULBFUUDDLRUFDRRRFBLDLB"},{"depth":15,"index":18,"facelets":"BDUDUURUDLBRLRLBFBFFFBFFFLLLDUUDRFUDDRUDLRDLUBBRBBFLRR"},{"depth":15,"index":19,"facelets":"FDUUUBBBLFRRURBBUFLLDRFRBDRULDFDLUDDLFDLLDFRLBFUUBFRBR"},{"depth":15,"index":20,"facelets":"LLFLUUBLDFBRFRRLULDDRDFRUBBFDDUDRUBUFFRBLFRFLUUDDBLBRB"},{"depth":15,"index":21,"facelets":"RRBBUFRDDFLLLRDFUUBFRUFBUBLRUDDDFBULUDDRLRDLFUFBRBBFLL"},{"depth":15,"index":22,"facelets":"BFDDULBLDLFRRRUDBBUBFRFBUUBRLRBDDFDDRLLFLUUUFFDUFBRLRL"},{"depth":15,"index":23,"facelets":"FLBDUDLBFDFDDRLUBRBRLUFLDBLFUFFDDDUBURULLRBRRLFRUBBUFR"},{"depth":15,"index":24,"facelets":"DDLUURLBLUFULRBLUBFLFUFFULBBDDUDLUDRFRDRLBFFRBRRDBBDFR"},{"depth":15,"index":25,"facelets":"FFLFUBBBLFDBLRRRLLRRDUFFULDFBBRDDRUURDURLBUULDUDFBDBLF"},{"depth":15,"index":26,"facelets":"UDDRUFFBDLRBBRULRLRRFLFDFUUULBFDULUFBDDFLBBLRRLRBBDUFD"},{"depth":15,"index":27,"facelets":"RDDBUFUUURUBBRBFFDLRFLFUBLDLDRFDRFLFUDBFLBULDRRBRBDLUL"},{"depth":15,"index":28,"facelets":"LFFUURLRRBFDBRUFLDBBDBFDFLRLDUFDUBBLFRUDLUUDURLDFBRBLR"},{"depth":15,"index":29,"facelets":"BURDUFLLLULDURBFFBDDFUFBDUDLRRDDRFLUUBBFLLRRFBFLRBDRBU"},{"depth":15,"index":30,"facelets":"LDRUUFDLURLDRRBBLLLUFFFDBLLRBURDDDUFDRFFLRRBUBFBDBUUBF"},{"depth":15,"index":31,"facelets":"BUDLUDFFURBLURBRLUDDFLFFDBFRRDFDUUDBRDLRLFLRBBBULBULRF"},{"depth":15,"index":32,"facelets":"DDFBURLFRFULFRBULFBDULFRBDLRRFFDDLUDRRUBLUBLUDBBUBLRFD"},{"depth":15,"index":33,"facelets":"LFRBULLDDRDFBRUUBRDFBUFLURLBFFFDUFBUBRBDLLLLRDUURBRFDD"},{"depth":15,"index":34,"facelets":"URLBUDRLLURBURBFLFBFFLFBURDLURUDDURLBLDDLUFFBDBRDBFDFR"},{"depth":15,"index":35,"facelets":"DRUUUUFFULRRRRLFLULLBFFBLDDDBRLDDLDFRBURLUDBBBFBUBDRFF"},{"depth":15,"index":36,"facelets":"BLDDUFBBBRDRLRFFRRUUUBFDURLFUDUDFDLUDRLRLDLFLFBRLBBFUB"},{"depth":15,"index":37,"facelets":"FULBUDLULULURRDDBUFBFLFUDLLRUBRDDUFFRRDDLBRFBBFDFBRRLB"},{"depth":15,"index":38,"facelets":"BDRBULDDBRBUURLDRFRRUUFBBUFULLUDFRDULDBRLFFRLFFDFBBLLD"},{"depth":15,"index":39,"facelets":"LDRFULRDFRUDLRFFUBULDUFFFBRDRUDDRULDUDBFLBBRLBBFRBULBL"},{"depth":15,"index":40,"facelets":"LFFLUUULURLLDRBLUBBFFLFRDBFFUUDDRBFRBBRULDDBRDDURBFDRL"},{"depth":15,"index":41,"facelets":"UDRDUBURRURDURFDFLFDBRFBLDLFBBLDUDFURFLLLURUDBLFLBBBRF"},{"depth":15,"index":42,"facelets":"RLLUULUDBUBBFRRLBFRFLDFRRFFUUUUDDBDLDRFULLRBBDFFBBLDRD"},{"depth":15,"index":43,"facelets":"RBDRUDBLLULFURUUBBDFFFFFRFFURRDDLBBLDDRLLDDBBLRFRBUUUL"},{"depth":15,"index":44,"facelets":"RDFFULBBFDBUDRRDFBUULLFLFLRUFFRDDLDUBULRLUBBRLBDUBFRRD"},{"depth":15,"index":45,"facelets":"URBFURFRRFBDLRBLBDLUUBFDBUUDLBRDLRUFBLUDLUFDRLFRDBFLFD"},{"depth":15,"index":46,"facelets":"RFBLUBRURBDDLRRURLDBDDFFBLBRBLBDUFDDFUFDLRURULUUFBLFFL"},{"depth":15,"index":47,"facelets":"RUUUUUUUULBLRRBDDDBFBRFFDFBBLRDDBUFFDRRDLBFRLFLFLBLLDR"},{"depth":15,"index":48,"facelets":"DLFRUDUBFDRUURFBFDBLLDFBRBLFRUDDUBLLFFRRLBRFULDRLBUBUD"},{"depth":15,"index":49,"facelets":"LURLURRFFDDULRFRDBUULBFFBBDLRBUDFDULUBBDLDRRDFBFRBLULF"},{"depth":20,"index":0,"facelets":"LDBBURDFRFBLDRRRFRBRUFFLBLDRBBUDDUUFFULULLLLUUBDDBFDRF"},{"depth":20,"index":1,"facelets":"LDULUFBDRBLFRRRFBULBDRFFUDDLRRUDUFDRFBDULBUFBRLDUBLBFL"},{"depth":20,"index":2,"facelets":"FDBFURRLFLDDLRDBRDFBUFFUFBUDURLDULBBRLUFLUUDLLBDFBRRRB"},{"depth":20,"index":3,"facelets":"RFBUULBUFDFUDRBBRBLFLUFLFDRRFDLDBFRLFRDULLUBDRRUDBBUDL"},{"depth":20,"index":4,"facelets":"DLFFUUFRFDFDRRUBRULFLUFUUBDRRLBDDUFRRLULLBBDFRBBLBDBDL"},{"depth":20,"index":5,"facelets":"DBBRUURUFLFLRRFDBUBLURFFRBLUUBBDRRDFLDDLLUFDBULFDBFRLD"},{"depth":20,"index":6,"facelets":"UDLBUBRUDRDFBRFLUDDFBDFLUFURLBUDRDLFBRFBLFLLFURRRBULDB"},{"depth":20,"index":7,"facelets":"URBBUFLDULLUDRBBRFDLBLFFFDRUBDUDFDRDFRBULBFLRRDLUBFRUL"},{"depth":20,"index":8,"facelets":"FUUBUDFDBURRLRDDULLFLUFDBBBLRRRDLFRDRLUFLFRFDBBDBBLFUU"},{"depth":20,"index":9,"facelets":"BLRRUBLRLDRFDRURFLUFBBFBUFULDFUDUBUDRDFFLLRLBDDURBLFBD"},{"depth":20,"index":10,"facelets":"FLBLUURLFLBRDRBUUFFFUFFFBUBRRLBDFDDLRDUDLRLLUDUDRBBDRB"},{"depth":20,"index":11,"facelets":"UBDLURLRDRBRFRURDBFDBBFDLBUUDFLDLDRULUDFLULFFFLBRBURFB"},{"depth":20,"index":12,"facelets":"UDDLUDFLBUBBRRBDBURFLDFFLULFLBUDUFUFBBDFLLURDRRRRBDRFL"},{"depth":20,"index":13,"facelets":"URUDUFURFDUBLRUDDRRULBFUFBLRLBBDFBLDFLFRLDURDLFLBBDBFR"},{"depth":20,"index":14,"facelets":"RBFDURBLDBFULRRFFRUDLFFFULLRBDRDDULFBBLRLURDFLUDUBBDUB"},{"depth":20,"index":15,"facelets":"UDRUUBRLDRLBRRBLRDDFBFFDDDFLLUFDBBFLRLFRLULRFUBFUBUBDU"},{"depth":20,"index":16,"facelets":"UULFUBLLUBRULRBFBDFFRLFUBRUDULDDDDDRRRDULDLFRBFFLBBFRB"},{"depth":20,"index":17,"facelets":"BDFBUBUFUBLRURLFBBFLRDFRLRLBFDFDDDDRLRLBLLRUUUFDUBUDRF"},{"depth":20,"index":18,"facelets":"DBBDURFUBUDULRLRBBLLLRFFLUDFFBDDURFDFFURLUULDRDRBBBLRF"},{"depth":20,"index":19,"facelets":"LRLRURFFUBFBBRLFFULDRRFURDDFBRUDLBUBFBUBLDRLUDUDDBLLFD"},{"depth":20,"index":20,"facelets":"BBDFUFLRURRFDRUDBBDDFLFFLFRULFUDLLURRUBDLDULFLRUBBBDRB"},{"depth":20,"index":21,"facelets":"LFLDUDFUBLLFLRLRRURFDBFBLUDBLBUDBBDFFRDFLUURUURDFBDRBR"},{"depth":20,"index":22,"facelets":"BBFFUDUFFLLLFRDDBUBRURFDRLRBUFBDLURFLLRULDBRDDUDBBFRUL"},{"depth":20,"index":23,"facelets":"LBFBUFDDDBLURRBBRFRLLLFUDFUFDRLDFUDLBRBULUFBRLDUUBFDRR"},{"depth":20,"index":24,"facelets":"FBFLUDDDDLLUFRURBBRFFDFRBBULUFUDRRLLRUBLLRBFDLDDRBFUBU"},{"depth":20,"index":25,"facelets":"UBDFUURRRFBLDRRRLLUUUBFFRBFBDDLDDDFFLLBRLLFUDBRBFBDUUL"},{"depth":20,"index":26,"facelets":"FURRUBRLFDUDDRFFLLUFLRFBLFRURULDDDLURUBRLBLBFBFDDBDBUB"},{"depth":20,"index":27,"facelets":"UFFFUBUDLFRULRFFURBLDUFBDDDBBRDDLRBULRRLLRDRLLDBUBFFUB"},{"depth":20,"index":28,"facelets":"FDFRUFLDFUDDURLUDBFLRBFRRURBLBUDRDFLLFDLLRLBDRBUBBFUUB"},{"depth":20,"index":29,"facelets":"LLDRUBRDRDUFLRBBBDFFFFFUUUDFFLDDLURBBUURLLRRLLDUDBBRFB"},{"depth":20,"index":30,"facelets":"FLDBUDFRBUFLLRRUUDUULLFUUBRFUBRDFDDFRDRLLDBFLBFDBBBLRR"},{"depth":20,"index":31,"facelets":"BUDRUDBFLFBBFRUUDLLLDFFDFBFLRRLDLDLURUDRLRRBURBUFBDBUF"},{"depth":20,"index":32,"facelets":"LLRFUFURBLDUURLUBRBFDDFRBDLURFFDDRUDFURRLLFLLFUDBBBBBD"},{"depth":20,"index":33,"facelets":"RRLBURBUUBFULRDFLRLRRBFUFULLFDDDFDDFFUDDLLBFUBBULBBDRR"},{"depth":20,"index":34,"facelets":"FFFRUDBUBDLURRDBRDLLRLFFLFLFUUUDURBRUDDLLFBBDLDRBBBFRU"},{"depth":20,"index":35,"facelets":"DFUFULUDDRUBURFLBLBFBDFBRBDFDFRDLBLFFURULRDBULRRLBRUDL"},{"depth":20,"index":36,"facelets":"LUFFUUUDBDBDDRBLBRLLRDFRLLFFBURDDRUBDRBFLFUUDRFBRBLULF"},{"depth":20,"index":37,"facelets":"FRLUUDBFLBBDURULFLDRULFRFUBRLDBDDURFUBRLLDRLDFDRFBFUBB"},{"depth":20,"index":38,"facelets":"DFDRUBUFBRUFLRRULRRLUDFBLFBUDLBDUBRDFFFBLLDDFLURUBRBDL"},{"depth":20,"index":39,"facelets":"URBBUUBDDFRLURFFDDDLRLFBFRUUDLFDBLFLBLRFLUDRRUBRUBLBDF"},{"depth":20,"index":40,"facelets":"BFFFUULFBRFLRRLUDUDLULFBUULRBFDDRFRBDRBBLDDBFDDRUBLLUR"},{"depth":20,"index":41,"facelets":"FRDDUDLUULBBRRFRFRDLBFFBUUFFBDUDLUBBDLBULRFFLRDLDBRULR"},{"depth":20,"index":42,"facelets":"LDBUUULUDRLLLRRDDUDFBBFFBRRRUFFDLLDFFBBBLLFRUUFDDBRRBU"},{"depth":20,"index":43,"facelets":"UULFUBBDFLUULRBRFDLBUUFUBBDRRBRDRDLRRDDFLFFDUBRFLBLFDL"},{"depth":20,"index":44,"facelets":"RUUDUFFFULRRBRLDFBLLBBFDFRLUUBLDDLFRDRULLRDBRBBFDBUDUF"},{"depth":20,"index":45,"facelets":"URUUUDBLDFFFRRDUUFRBRLFFBUBLLLDDRRBLFFUULFDRDRBLLBBDDB"},{"depth":20,"index":46,"facelets":"RBBLUDUDFUBUURUUFLLRRLFLFFLDDFFDLBUBDBBULDRRLRRFBBRDFD"},{"depth":20,"index":47,"facelets":"LUDBUUBLUBBFBRLBRRDURFFLUUDFRLRDFFDFBDRLLDRBLLFUDBFDRU"},{"depth":20,"index":48,"facelets":"LDRUUDUDBDLBRRLBUFLFRUFFFBDRDLRDLRLLUFBBLBUUDURFFBRDBF"},{"depth":20,"index":49,"facelets":"RRURUDFURURBBRLRFFLFBLFLDFFLDDBDRDFRBUUBLDLUFLBDUBDULB"},{"depth":25,"index":0,"facelets":"LLRBUFRRFLDBFRDLBLBDURFUDLDFBFRDDUUBBRDLLFFURUFULBUDBR"},{"depth":25,"index":1,"facelets":"FUDFUDUUBRLRLRRRRFRRUUFFBDDUBBDDDBFLLUFLLBDFLFLUBBBDRL"},{"depth":25,"index":2,"facelets":"LURFUFUUDLLFURDBRRFFFLFLRFLFRUDDBUBDDDLBLBRLUDRBRBUBDB"},{"depth":25,"index":3,"facelets":"DUURULLLDLDBRRFULBDFFBFBULRFUBFDBRURFUBRLDUDLLBRRBDDFF"},{"depth":25,"index":4,"facelets":"RLDDUFUDBRRLURLDRBRLUUFLLDRFBFUDDUULBFFBLBLRDBFDBBRUFF"},{"depth":25,"index":5,"facelets":"RDUDULUBUBFFBRDRUDLURFFRDLFBDDBDLLUFBFBRLUFLLRRDBBFLRU"},{"depth":25,"index":6,"facelets":"BBFLULRFURFDRRBLDUBUFRFFFDUDFBLDLRDLLUDULDBBLRUDRBRFBU"},{"depth":25,"index":7,"facelets":"BBRLUFBRURUDURLDDBLFFBFRFLRDFFBDFFUUUDDRLRUDLBLLUBDRBL"},{"depth":25,"index":8,"facelets":"DRDBUDUDUBFFBRULUBFLRUFRDBUBDBUDLFRRFLLFLFRRLLFRBBLDDU"},{"depth":25,"index":9,"facelets":"FBDUUUUURBFRURDFRBBBDDFLBDRURULDBUFDDRRBLFLFLFLLLBDLRF"},{"depth":25,"index":10,"facelets":"UDFBULLDDRFRBRFDLDBFBDFDBRLRUBUDBLURFRUFLRDBUULLUBRFLF"},{"depth":25,"index":11,"facelets":"LLRBULBDLFBFURLRDFRBDRFRBFDLUBBDLUFUBRUDLFFUDDFUUBRLDR"},{"depth":25,"index":12,"facelets":"LBBUUFULFRDULRRRLRFDDBFBFRUDDFUDUBLDBRLBLDDFLRUUFBRBFL"},{"depth":25,"index":13,"facelets":"LURUUFLBLUDDDRDBULBRFDFRRRUDFRLDBRBDDRUULLUFFBFBBBLFLF"},{"depth":25,"index":14,"facelets":"RDRFUUBDLFRBLRBDRBLBDLFFFLRLUFLDFUDRFUDBLDBBUUFUUBRDRL"},{"depth":25,"index":15,"facelets":"FDFRUFLDLDLUFRBRURFRBFFDUBBLDUUDLUBDRBDFLRFRBLLDUBUBLR"},{"depth":25,"index":16,"facelets":"UDDLURUFDRBRFRDLULRLBFFULUFFRULDLBUUBBFRLRDDDFBRFBDBBL"},{"depth":25,"index":17,"facelets":"UURLUBLBURUDDRFFLLDDFRFLFUDDLRFDBBRUFFBRLFUULBRLDBBBDR"},{"depth":25,"index":18,"facelets":"RRFRUBBFLFURLRRDUBUDDLFDFLLLUBBDFDRUBBLLLBRDUUFDUBFRDF"},{"depth":25,"index":19,"facelets":"RLBBULLLFUDRRRRFDDUFRBFFBULUFDDDBLDRUUFLLRBFLDBBUBUFRD"},{"depth":25,"index":20,"facelets":"UDRUUDDFFLBULRRFLDLRULFBLFDBURDDUBRBBBFLLDDFUFRRBBFRUL"},{"depth":25,"index":21,"facelets":"FLRFUDDLBRRURRLUDDFDURFUDUBLBLDDBLLBLRRFLBBFFFBUFBURUD"},{"depth":25,"index":22,"facelets":"RLDLUUFFURRFRRUFBBRDFLFBBRUDFLRDDLLDUBDULFUDRLDBBBFLUB"},{"depth":25,"index":23,"facelets":"LFRLUBDBRBUBRRDUDFLRDFFFLRFBURUDLFUUDBFDLLDFUUDBBBRLLR"},{"depth":25,"index":24,"facelets":"UUDUURLBUFBLFRDUFDFDLRFLBDRUFBLDUBBRRRDULFRDLBLFRBBFLD"},{"depth":25,"index":25,"facelets":"URUUURFLBLUFDRDLRDDDDFFFURUFFBBDDRLRBLLLLUDULRBRBBBFFB"},{"depth":25,"index":26,"facelets":"RLDFUDUFULBFBRRBRURRBFFUBLDDFLLDDUDLDDFRLURBRLUFUBBFLB"},{"depth":25,"index":27,"facelets":"LBRFUFFLRBRBDRLDDBRDDUFRLBLULBUDBFFLFDDULBRFFURDUBRULU"},{"depth":25,"index":28,"facelets":"UURDUFDLFLRFDRRURRBBUUFFULFLFRDDBLFDBBLDLLDRBDBRUBLBUF"},{"depth":25,"index":29,"facelets":"BURUUURDLURBRRLUURDFFLFFFDBDRLDDBDRUDLFLLBLBLUFRDBFFBB"},{"depth":25,"index":30,"facelets":"RLURUDRURFBLLRFLURBBUFFBFFBDDDRDLLRFUBDFLLUULFDBRBUDDB"},{"depth":25,"index":31,"facelets":"UUUBUURRLFBBFRURDFBBDDFLFLBRDUFDRBDRFLDFLBDRDLRLLBUUFL"},{"depth":25,"index":32,"facelets":"FBDDURDRURDLFRUBLBLBFLFRLRUBURUDFDBRLFFFLDRLUBLUBBUDDF"},{"depth":25,"index":33,"facelets":"RBRRUDDUURLFLRBUBLBFFBFFFFBDRLUDRDDFUULFLLBLLDDBUBDURR"},{"depth":25,"index":34,"facelets":"RLFBUURLDLBUDRRDLDFBFFFRDUBFFRBDFLFLUDULLDURRLUBUBDBRB"},{"depth":25,"index":35,"facelets":"DLLFUUFDLDBUFRUFBUDFBDFRRLDUURBDDUFLRULRLLFRBBBBRBDFLR"},{"depth":25,"index":36,"facelets":"RUDLUBBBRBRFBRRFBLLLDFFDFFURULFDURRUUDDULLUDDLRBFBLBDF"},{"depth":25,"index":37,"facelets":"DDRUULRRRFBBFRBFRBDBURFLBULULDBDFUFRBRFDLDLDLUFLUBLDUF"},{"depth":25,"index":38,"facelets":"UBDRULBRDLUBURLFBLUFFUFFBDDRFRBDULRBRDLFLRFDURLFDBLDBU"},{"depth":25,"index":39,"facelets":"RDBLUULRDFBRDRLUUUFBRRFFULLLBFBDFDUFUDDRLFLDBDRBFBURLB"},{"depth":25,"index":40,"facelets":"BDDFUBRBRDDFFRLBUFULFLFUBDDUFLRDBURRDRBLLDLBLLRRFBUUUF"},{"depth":25,"index":41,"facelets":"RLRFUULFLBRFDRLUDUFRUDFFDDFBLRFDRUBLBLDRLBRULDUDBBBFUB"},{"depth":25,"index":42,"facelets":"BRUUUDFRRFLLURFBLLRUUFFBRLLUUULDBDRDLFDDLDBFBFDDRBBFBR"},{"depth":25,"index":43,"facelets":"RLLLUDDDBURFRRLFRRBBLUFULUDFBRFDBFBBBFLRLFRDDUUDDBFULU"},{"depth":25,"index":44,"facelets":"BLRBURDLRFUFRRBRULBFUUFFULBLDUUDLUFDDDLDLBLFBDBRRBRFDF"},{"depth":25,"index":45,"facelets":"DBBUULLFBUUUURRRDLDLLFFRRLFFBDFDLLFFRBBRLRDDURDBBBDUUF"},{"depth":25,"index":46,"facelets":"FRRDURUDLUBFBRLDURBLFLFDDRFBDLUDFLRDUFRFLBUBLDFRUBLBUB"},{"depth":25,"index":47,"facelets":"FDDBUULFLDFBFRDRDFUDBLFLDRBLFUUDRBBRRLFULULBFRBDLBRURU"},{"depth":25,"index":48,"facelets":"RLBUURBUUFDLURFDDBLRLLFLLFRFRFDDFBLRFBDBLBUBDUFUUBRDDR"},{"depth":25,"index":49,"facelets":"RLFDURURLUDLBRBBURLUFLFDFBDRRLRDFBBUUFBFLDRFDDUBUBLFLD"},{"depth":30,"index":0,"facelets":"BULBURDBURBBLRLDBULLFFFFUDRBRFFDULFLDDFULDURRDLRDBRFUB"},{"depth":30,"index":1,"facelets":"UFRUUUDFFRRDLRRUDULUDDFUDFRBLBBDFUBBRBFDLLLLLBRFDBBLRF"},{"depth":30,"index":2,"facelets":"RLRDUBLRRUUFDRUDLUFDBDFBBBLULBUDFDRLFLDBLFBRLDUUFBRFFR"},{"depth":30,"index":3,"facelets":"LBDDUFRRBUURRRDFBDBBLLFFBRRRUULDLFULFFDDLDUFUFUDRBBBLL"},{"depth":30,"index":4,"facelets":"FRFFULLDLFBRFRULURDBDLFDDLFRFUFDLLRBRUBULDURBUBDBBRUDB"},{"depth":30,"index":5,"facelets":"URRRUURLRUFFFRLLRUBFBBFRFBBUUDUDDFLBFUDFLDLLRDBLBBDLDD"},{"depth":30,"index":6,"facelets":"RRBBURFLDRUUBRDFLLDUBLFRFBRLDUFDFLBUDLLRLDBUURDFFBFBUD"},{"depth":30,"index":7,"facelets":"BRRBUFRUUBDDDRFFFLDLRBFLFRLUFDUDLURBULFDLRLBRBULUBBDDF"},{"depth":30,"index":8,"facelets":"UBDDUUDRFDBBFRRULDBBLRFLUDFFFRRDBULRLLLULDRFLRDBUBFFUB"},{"depth":30,"index":9,"facelets":"UUURUDLDBLFRFRFFDLFLDLFUBBRDUUDDRFBUFBDLLUDBRBRLRBFBLR"},{"depth":30,"index":10,"facelets":"BFBRUDUDLDFRLRLDUBFLBBFFUBRRRFUDFLRLRDLULDDLFDRUBBBUUF"},{"depth":30,"index":11,"facelets":"UUFDULDRDBDURRLDFRRBLFFFBBFRDLLDLRFULRBBLUFBULRBUBUFDD"},{"depth":30,"index":12,"facelets":"ULURUDURDBFLBRLFLRBULRFRDBDRDRUDBDLULFRFLDFBBFDBFBUFUL"},{"depth":30,"index":13,"facelets":"UFRRUFBUBDLURRFRLLUBRLFFLBFURDDDUDDBBDLRLBFLFFDRUBUDBL"},{"depth":30,"index":14,"facelets":"BLLLUURBBULBRRFFDLDULDFBUUURRLFDRBDDRDFFLBRLFDBURBUFFD"},{"depth":30,"index":15,"facelets":"LFRDUUDLRDRUDRUUFULBFUFRRLRBDBLDLBRLDBFFLBLUDFRBFBDFBU"},{"depth":30,"index":16,"facelets":"FRDFULDBULDRRRLRFLRRBUFUFUBDFUDDDULBURBLLBLBLFDRBBFDUF"},{"depth":30,"index":17,"facelets":"FDFRUFLDUBURDRRDLDBBRFFLLBRULFUDUBUBDBULLRDBFUFLDBFRRL"},{"depth":30,"index":18,"facelets":"DDFBULRBBRFULRDDURDUUFFDUUFLLLBDRURDBRFDLUFLBLFLRBBBFR"},{"depth":30,"index":19,"facelets":"LLLUULRRLFFBDRFRBDUUDBFRLUDBBBFDRFURUFBDLDRRUDBFDBLFLU"},{"depth":30,"index":20,"facelets":"RUDBUBURDBLFDRBULRBFLRFFLUFULRBDDUFFBRRDLUBDFLFDUBRDLL"},{"depth":30,"index":21,"facelets":"DBUBUULRURLRDRRURDBUFFFBBDLLFFDDBDRBFUUULLFLDBLRFBFRDL"},{"depth":30,"index":22,"facelets":"LFRRUDFBBDFBURDBLDULRFFBFFLRRULDDDBLUURBLLFUDUUFRBDBRL"},{"depth":30,"index":23,"facelets":"DDFBUUURRFLDDRFDLRFUUBFFUBFLLLBDDRRDBULULRBDBRRLLBFBFU"},{"depth":30,"index":24,"facelets":"RBFRUFLFDRLLLRUUDRDUBLFUBDLRFFFDRUBUDBBLLDBRUDUFRBBFDL"},{"depth":30,"index":25,"facelets":"FUULUURFULBRFRRRRDFLBFFDDDFBRDBDULLBLBUBLUDDLBLUFBRRDF"},{"depth":30,"index":26,"facelets":"RDLFULLBFUBDRRBDURURRUFFBDLUFBDDLBUFBLFDLRUBLFRDUBLDFR"},{"depth":30,"index":27,"facelets":"LFBDUDRUBDRUURLLUFFBRRFFFFURRBBDLDRUFBULLBLLDRDDFBDLUB"},{"depth":30,"index":28,"facelets":"LDFRUUULBRFDLRUFRDRDUBFFUDLLRDBDFLLBDUFRLLFDBRFBBBBRUU"},{"depth":30,"index":29,"facelets":"DBFLULLDLFUDDRRRRUDLDFFBBDBURUFDBUFFRBBFLULLLRUBUBRRDF"},{"depth":30,"index":30,"facelets":"RDUBUDRRULFLURLDDLDBBUFLBDBLBRFDRURDFLFBLRRUDFLUFBUFFB"},{"depth":30,"index":31,"facelets":"LDBRURFLLDDLLRRFBDDFBDFUFBDURRFDUULBUULBLLRURUFFFBDRBB"},{"depth":30,"index":32,"facelets":"LRULUUUUUBLFLRFRUFLFRLFFDBFLDDBDBDUUDDBRLBBRFRDBDBFLRR"},{"depth":30,"index":33,"facelets":"LDDUUURLDBBRBRRLRUBFLBFLRDDULFFDDUFFBLDBLDLUBFFUUBRRRF"},{"depth":30,"index":34,"facelets":"LRRBUDLUDBLUFRRLLUFLLRFRRFUDUBFDBRBRUDDLLBDDFFDFUBFBUB"},{"depth":30,"index":35,"facelets":"BRFRUUFFBULDBRRFLULDLDFURFLULDFDBBDFDUUFLLDUBRBRDBRRBL"},{"depth":30,"index":36,"facelets":"DUFLUDLBURLDFRLBBBURFBFRLUUFRRFDLBUDRFFRLDLDDRBBUBDLFU"},{"depth":30,"index":37,"facelets":"ULDUUDLDFLLLRRBRDDFFULFFRFBFLUUDBDFRLRDRLUBBUBBBRBDFUR"},{"depth":30,"index":38,"facelets":"RLDFUDLURDFBLRBLBLBRFUFDUBDRDFDDRDRFUUUFLBLRFRUBLBLUFB"},{"depth":30,"index":39,"facelets":"LRUBUDDFRDBLURUULLRUFLFRLBRFRBDDDFLUDUBFLFRRDFFBLBDBBU"},{"depth":30,"index":40,"facelets":"FFRBULRUBLUDDRFURFURDDFRDUBLBLDDBFDDLLBFLBRLFBUURBLRFU"},{"depth":30,"index":41,"facelets":"UURLUFLBLDRFRRLUDFFUBLFBRLRBBBDDRUURFDDBLUBFDDRLFBDUFL"},{"depth":30,"index":42,"facelets":"DLLFUUUBBDBDURBDBBLRRFFLFFLUUBRDDLDUFRBRLLFURFDRLBDRFU"},{"depth":30,"index":43,"facelets":"LFFRUURFURLDDRBFFLBRFUFRLUUDFLDDDBBDBBDULBULBRLULBRFDR"},{"depth":30,"index":44,"facelets":"BRLLULFUDLDFBRRRLUULFFFDLDFBRDFDBDBRLFRFLUBDUUBDUBRBUR"},{"depth":30,"index":45,"facelets":"FDRLURULBRUDLRFBUFFDURFUDRLBBUDDFDBRDBLDLFRBLBRLLBFUUF"},{"depth":30,"index":46,"facelets":"DRUDUDBBDFLBFRFRBLRRRRFDLLDUBBFDUFDBLBULLFRLFLUFUBUDRU"},{"depth":30,"index":47,"facelets":"RULLURDUFDFULRDBLLRFLRFBFBDURLRDUFFFUDBFLDDURBBBBBLUDR"},{"depth":30,"index":48,"facelets":"FUULURBDBDBLRRFDBDRBRUFURFLFLBRDLBDRDDUULLLFUFFLDBBFRU"},{"depth":30,"index":49,"facelets":"URFUURLDLDDDLRFDRUFLBFFBUDBBBRBDFFUBRBDULLURRRUFDBLLFL"},{"depth":40,"index":0,"facelets":"URBDUBBFRFLLBRRLFFDUUUFRLRBFDDUDDRLUBLRBLBFLDUURFBDLFD"},{"depth":40,"index":1,"facelets":"URDDURLFFUBRBRLBDDBDRUFUFFRLUDRDRLLFBBULLLBUUFFRDBFLBD"},{"depth":40,"index":2,"facelets":"FFURUBDFUFUFLRRDRURRLFFUDLFBFLBDBLLRRDBLLUUDLRDDUBDBBB"},{"depth":40,"index":3,"facelets":"ULLUUFLBUBRDFRBBUBULRFFURBLBUUBDRFDDRLFRLLDRDFDFDBDLFR"},{"depth":40,"index":4,"facelets":"BLUFULDRFLUFDRFDDURBUBFLRRLDUBUDBLFBRDBRLUDFFRBULBDLRF"},{"depth":40,"index":5,"facelets":"RFBBURFULUFLDRBUULUFFLFRRRRDBBBDRBFDBLRLLUDDFULDUBDFDL"},{"depth":40,"index":6,"facelets":"URRUULBBBLUDRRDFRDRUDLFURDDFBRFDFULFLFUDLBLLUBBBFBRLDF"},{"depth":40,"index":7,"facelets":"FRRDUBURLDDDFRLLURRBBFFULUUULBRDBFLBDRFLLDDUFBFLFBDUBR"},{"depth":40,"index":8,"facelets":"DDUFUFDBLDDBLRBLRFRLBUFDUFFBLULDBFURFRBULFLURLRRDBRUBD"},{"depth":40,"index":9,"facelets":"LRUUUFDRLDLFBRDFUFLUBLFDBUDRBRRDFBBUBLFDLDRFURBUFBRLLD"},{"depth":40,"index":10,"facelets":"RLRLUDFUUFFBLRFUDLUBLRFDLFBFRLUDRDUBBURBLBRFDUBDLBDDRF"},{"depth":40,"index":11,"facelets":"DBUFURRDUBULBRLLLLFLRDFRDDDBFFFDFRUURRUULRFULFDBBBBBLD"},{"depth":40,"index":12,"facelets":"LULFULBBDRFBRRFUDBRDBBFDRBFDURDDLULLFUURLLLFFDRDRBBUUF"},{"depth":40,"index":13,"facelets":"UBDBURLULUFLBRFUDRFBFRFRBUFDRRLDLBUFLLDULDUFRBDBDBFDLR"},{"depth":40,"index":14,"facelets":"RFDBUBDDBLRRDRBFLLRFDRFRRULURDDDFFUUFUBBLFULBFUUDBLBLL"},{"depth":40,"index":15,"facelets":"RLFLUDBUFLRDRRFRLLLLUBFBLUBFRURDBUUUBFDDLDFFDRDDUBFBBR"},{"depth":40,"index":16,"facelets":"FFFDUULLBRFDRRFDBRUBUBFBFRLUUBUDDBDDDFFDLULLRRRLLBLBRU"},{"depth":40,"index":17,"facelets":"RUBDUFLRDRDULRFFURBBBBFDDRULFLRDLLUUDBUDLLBUFRBFLBRFFD"},{"depth":40,"index":18,"facelets":"FBLUURURUFUUDRLRDFBFLDFRBLDLUBBDLFLLRFRBLFRRDBDDFBUDBU"},{"depth":40,"index":19,"facelets":"BUUDUURLDRLFRRUFRBDDBLFDFLLLFDUDFUDDUFFBLBRRURFLBBRLBB"},{"depth":40,"index":20,"facelets":"RLLRUBDBLDDURRLRFDLRBUFDBRBDUULDDULRFFFULFLURBDUBBBFFF"},{"depth":40,"index":21,"facelets":"BRBRURFFFRDDDRLFUDDRDLFFRBUFDLLDFLUBRULBLUUDULBUFBLRBB"},{"depth":40,"index":22,"facelets":"DLBRULUBDLFURRRBUBFDFFFFUURLLDBDBRDDFDLBLUURBRDRUBLLFF"},{"depth":40,"index":23,"facelets":"RDUUURDFDLBLBRLULBRRFRFDRFBUULUDFFDDFBBFLUDLBFRUBBDLLR"},{"depth":40,"index":24,"facelets":"UBFFUULLUBRDURBLFLDDRLFLRRFBBUUDULDURRBDLFDBDRLFDBRBFF"},{"depth":40,"index":25,"facelets":"RDBUULFRDRFURRBBDLDBBDFFUBDLDLFDLFUFFRLULRDUBRFULBLUBR"},{"depth":40,"index":26,"facelets":"ULFFURBDFRDLBRDBBFUFDFFUFRRLUDBDRBURBULDLRDLUDFRBBLULL"},{"depth":40,"index":27,"facelets":"BFDDUUBFRFLRDRRBBUDUURFFDBLLLURDULDLRBRDLFBBFFLUUBRFLD"},{"depth":40,"index":28,"facelets":"BLFRUUBBLUBLURULRBRDFLFLRFUFUBRDBFLDDDUFLBDFUDDRRBDLFR"},{"depth":40,"index":29,"facelets":"UDBUUFUFLFLRFRRFLFBUDRFDLUDDLRBDBLRURBRBLDURBDLFFBDLUB"},{"depth":40,"index":30,"facelets":"URFDULDLBRFDRRLDBFRBUUFBFDLUFBLDULFLLBBULRFDRRDBUBFDRU"},{"depth":40,"index":31,"facelets":"LFLUULUDBRFFLRBDFRRRUUFDDBFBLLBDDDRDBBFULFRDLURURBLBUF"},{"depth":40,"index":32,"facelets":"RLDRUDBLBLBFFRLRUURUDBFLFFDRDBRDFUFBFBUDLULUDLDUBBRLRF"},{"depth":40,"index":33,"facelets":"DBBFUBULDFDRDRLFRBLFRFFLLRRUBUDDULDUBRBBLUDRFDLLUBURFF"},{"depth":40,"index":34,"facelets":"FRBUULBFRUFLBRUDDLDUBLFRDLRLBFFDLFDBLRRRLURDFUFUBBDDBU"},{"depth":40,"index":35,"facelets":"RLRFULFRDLFDURDFBBRFFBFRUDURBLDDRBULUUDFLLDRFBUBLBDUBL"},{"depth":40,"index":36,"facelets":"LRRUUUBRBRRUBRFUBFUBUUFDFDLRFFDDLBFLDLLULFRLDFDBRBBDLD"},{"depth":40,"index":37,"facelets":"BBLUUFRULFLBDRRRURDLDDFLUDUFRFFDBRBBURFBLFDULDLLFBDURB"},{"depth":40,"index":38,"facelets":"BRLUUDRRLBFDFRLRDFBDUDFRRUUDLFLDLUUULBDRLBRFFFUDBBBLFB"},{"depth":40,"index":39,"facelets":"UDBLUDLLDLBDBRBRRBUDFDFRRFFBUDLDFLRURBFFLFUUDLRFUBLRUB"},{"depth":40,"index":40,"facelets":"BFDRUBDRLFUBBRLLLFFDDUFRURFLUULDDRFRLFRBLFBUBRDDBBDULU"},{"depth":40,"index":41,"facelets":"DRFDUBBRBLDRURBBDLDDDUFFLFUFLRRDFBRFFLRLLLLBDUFRUBBUUU"},{"depth":40,"index":42,"facelets":"BFFLUBBLRUDLFRRRBRUFBLFUURUFBFFDURLDLULRLDFRLDDDDBUBBD"},{"depth":40,"index":43,"facelets":"ULDFULLDUFDFURRDBDBFLFFLRBBFURFDDDRLBRUBLURLULBRDBRBUF"},{"depth":40,"index":44,"facelets":"DBBRUUUDLULRURURFBBBFRFFDFULLFLDDFDLBFRBLDDBFDRLRBUULR"},{"depth":40,"index":45,"facelets":"DRLRULRFULDBLRDRLFDRBBFBRUDFLBUDFBFULBFULUUFUDDFBBRLDR"},{"depth":40,"index":46,"facelets":"RBBFUFBDDLLDBRULURDRFUFLLRUUFBLDBRRBFDRULLFDFLDUFBRUBD"},{"depth":40,"index":47,"facelets":"UDDUUBRURDRBFRLFDBFBFFFDFULLFDUDBLDDBLULLRURURLRFBBLRB"},{"depth":40,"index":48,"facelets":"LFFDURRRULFULRFRBFFBBLFDURDBUBFDUFBDDBURLULLRLDBUBDRLD"},{"depth":40,"index":49,"facelets":"FRLLUUFDRFFBLRULRLRBUUFDRLUUFBFDBDLFDBDFLRBDBDDLBBRUUR"},{"depth":50,"index":0,"facelets":"UBUBUURFLBBRURRBLFBRULFLFUDDFLUDFFDRFRDLLDDRLBDLDBBUFR"},{"depth":50,"index":1,"facelets":"BRDDUBFFLDURURRLDUULBFFLLFFFUULDBDLBRFRRLRBDDFUUDBBLBR"},{"depth":50,"index":2,"facelets":"BDFRURFFFLUDURLLLUUUUBFLBBUDDBDDDDURLFRRLLFRRRFDFBBBBL"},{"depth":50,"index":3,"facelets":"LRDDURBURDULLRUDRLRFFRFBBLBUFRDDBUFDULUULDFBLBFFBBLFDR"},{"depth":50,"index":4,"facelets":"UFDDULLBBRBBRRRUUFDRUDFDLFFBLRRDLRULFLBDLBFUURULFBFDBD"},{"depth":50,"index":5,"facelets":"DBUFUUBBBDLFURLLDLUDRFFBDDBFFDFDRUUFLRLDLURLRRRFBBLURB"},{"depth":50,"index":6,"facelets":"DUDFUBLBRUULBRRFDBFRBUFLDLURFLLDRFBLFDDFLLRDBBRRFBUUDU"},{"depth":50,"index":7,"facelets":"UBDLURRFBUULBRFFDDFRLLFRRFUDULDDLFRBBFUBLULBFBURDBLRDD"},{"depth":50,"index":8,"facelets":"DFLBULRFBLDULRFLURURDFFBRUFFBUUDRDDDLDBBLURLUBLFDBRBRF"},{"depth":50,"index":9,"facelets":"LLUFUDBLLDRFURBBFUUUBBFFDFRFLDDDRBRLFDLULDULRRBDRBBFUR"},{"depth":50,"index":10,"facelets":"FUBBUBDRLDLUDRLFBBLUBFFLLDRURUBDRLLRRUFDLRUDFRFDUBFDFB"},{"depth":50,"index":11,"facelets":"FDRUUUFBBDFBFRLUDLDRRRFLULLLDFRDFFBBRLLULFRDBUBDBBRDUU"},{"depth":50,"index":12,"facelets":"LUFUURBRFRFRDRBULUDBDFFFFFRLLBLDDBDBFRRBLUDBUULDDBULRL"},{"depth":50,"index":13,"facelets":"DFLLURRUUFBBFRDBUUFRLLFRBLRUUDLDFLBRFDUDLFDBLDDRRBBBUF"},{"depth":50,"index":14,"facelets":"LDRFUUDLFUFFURDBUFLFRRFLLRRDUDRDBBLUBRFDLBUDBDFULBBLBR"},{"depth":50,"index":15,"facelets":"LDDLUFUDLFLBFRRRLLRFDLFUFFBRRUUDBFUUDUFBLDURDRBBDBRBBL"},{"depth":50,"index":16,"facelets":"LRDDUDRUFDLLFRUBDRFFLBFLFRULBRFDFFBDBBUULLDRUBDURBLBUR"},{"depth":50,"index":17,"facelets":"LBURUDFRRDFBLRFDRBUFFUFUDLFRBLRDUBDUUBRDLFDDBLUFLBLRBL"},{"depth":50,"index":18,"facelets":"URRLUUUBRBRFRRUUDFLLDLFFLDLDBFDDRRULBFBLLUUFBDBRBBDDFF"},{"depth":50,"index":19,"facelets":"FLBBUDDBUFFLFRRRRUFULBFUDLURUFRDUDLRDDRBLRLFBUDLDBLBFB"},{"depth":50,"index":20,"facelets":"BBLUURBLDFBFLRDBDRUDRUFFFRRDFDRDFUDBLBLULFFULULDBBLURR"},{"depth":50,"index":21,"facelets":"DDDDUBUDFLULRRUFBLBBULFBBDRULUFDLRLDRFRFLFFRLBRBRBUFUD"},{"depth":50,"index":22,"facelets":"BDBFULURUBUDRRUUBDFBRLFFLRFFURDDLLURDLLDLDURDLFRFBBFBB"},{"depth":50,"index":23,"facelets":"LFBBULRLRFFDLRBLBRBDURFBDLUFUBFDDFUBFRDRLDUDRLRDUBUUFL"},{"depth":50,"index":24,"facelets":"LDDFUFFDBDLRURBLLUULRRFBURBLUDUDBBULFRRRLBUFBFFDDBDFLR"},{"depth":50,"index":25,"facelets":"DBUDULBUBUFRURRRRRLRLFFBDUULLFDDFLFFRLDDLDFRFBLBBBBDUU"},{"depth":50,"index":26,"facelets":"LRDBURRFFLDFLRBBUDBUUFFUULDRDLRDBBLRBDDBLDUUFLFURBLFFR"},{"depth":50,"index":27,"facelets":"RBDDURLRRDDBBRFFBBFUFDFRBBRLUULDLFRLUFDFLLUUDRDBUBLUFL"},{"depth":50,"index":28,"facelets":"FLRBUURFBUFDFRBFRLULLLFDBBDLRRRDUFDDUDBBLUUFDBDRUBLFRL"},{"depth":50,"index":29,"facelets":"URRLUULDURLDRRLFRUUFFBFULBLDRDFDDFBRLFFULDDUBBFBDBBBLR"},{"depth":50,"index":30,"facelets":"DDLUULDRRDFFLRFRFRRBFUFBDLBBUUDDULDULRBDLBUBLULFRBRFFB"},{"depth":50,"index":31,"facelets":"LUULURFLDLFRFRBLDURUFUFDDBFRRUDDBUUBDFDLLRFRBBFBLBDLBR"},{"depth":50,"index":32,"facelets":"BUDUULBFFUDFBRLUBDRURRFLUDLLRFLDDDRRDRUDLFLFBLBRUBFFBB"},{"depth":50,"index":33,"facelets":"RUFRUUBBULRULRDFFDDLBDFUUULRBDLDRBDRUBRFLBDDFLFBRBLFFL"},{"depth":50,"index":34,"facelets":"LLFDUUFRBUBLURLDBBUFLLFFUDRBBFBDRBRDUFRULFRLRDDFUBRLDD"},{"depth":50,"index":35,"facelets":"RRLLURDLRFBDURBLBRBUUDFFDRUFDBDDLLFBBFLBLFFLRFUDUBDURU"},{"depth":50,"index":36,"facelets":"ULUFURLRBLBFLRUURRUDDLFBDBBFULUDFLDDBDFFLDDRRRFRLBUBBF"},{"depth":50,"index":37,"facelets":"RLFUUDDRLBLUFRULFRFDULFLDDBRBDRDDLRBFBRFLUDBBLBURBUUFF"},{"depth":50,"index":38,"facelets":"URBUUBUFRDLDFRURDLBDFDFRRDUBRFFDBLLFLBRBLLDLDLUBFBRUUF"},{"depth":50,"index":39,"facelets":"URFLUUURDRBUBRRDDDRBBFFDBFFRRLFDFDULLDFLLURLULDBUBBBLF"},{"depth":50,"index":40,"facelets":"RLLDUFBLFLRDDRLBDRDBUDFFDRLBUUUDBRRBDLRULRUBLFUFFBFUBF"},{"depth":50,"index":41,"facelets":"RDLDURBRFDBFFRBRDRUULRFUBLUDFFBDLBRBDFLULFDURUBFLBLUDL"},{"depth":50,"index":42,"facelets":"ULDDUBFFLBLLRRDLUBUDULFBDDDRBFBDFDRUFLRRLURUBBFLRBFRUF"},{"depth":50,"index":43,"facelets":"UDRLURBBULUDURULBULLBUFLFRDRDFDDRRRLBDDLLBUFDBBRFBFFFF"},{"depth":50,"index":44,"facelets":"LRRBUFBFFUDDRRFFRFLLRLFBRBDUDRUDUBUUFLDLLDLBBBDDRBULFU"},{"depth":50,"index":45,"facelets":"ULUUUFFDDRDBDRFFRUURBBFBFLLRDDBDFDFRFLRRLULRDLBLLBUBUB"},{"depth":50,"index":46,"facelets":"RDFLULDRLFBUURUURDFBDDFFRFFBLRRDFULLUURRLFBUDLBBBBDBDL"},{"depth":50,"index":47,"facelets":"RDUFUBRBDBRLURFUBRDLLUFLULRLDBFDULLDFDFDLRDUBFBURBRBFF"},{"depth":50,"index":48,"facelets":"DDDBUDRRBULBLRBFUDDULDFUFRUUBLLDFBRFBLFRLBUFRRFLUBDLFR"},{"depth":50,"index":49,"facelets":"FBUFULDDFLUFRRRRUDRFUUFBLLBDBULDFLDRDRBBLRUFBRULDBDFLB"},{"depth":100,"index":0,"facelets":"BDRRURUFFRFUBRBBDLLUDDFUDBUBRRRDBLUFDUBFLFDDLFLRLBLULF"},{"depth":100,"index":1,"facelets":"BFUFUBUDLFRLLRRRRUBLDBFUFLDRFBBDDLUFLURULLUDDFDDFBBRRB"},{"depth":100,"index":2,"facelets":"BLBDUFLBUFRRRRBUUDDDLUFURLRFBBLDBLLRURBFLFDDUDFLRBDFUF"},{"depth":100,"index":3,"facelets":"FRFLUULDBDRUBRFRLBBLRRFDRFBDDUUDFDLDUBUULBFBFLDRRBFLUL"},{"depth":100,"index":4,"facelets":"RRBFURDFDBURLRFLBFLRLBFFBDURBBBDRRLUDDFULUULUDDFUBLLDF"},{"depth":100,"index":5,"facelets":"BFRDUBBRLURFLRLUBDRUFUFBDUFLFRDDDBFBULUFLBDRFDDLUBLRRL"},{"depth":100,"index":6,"facelets":"RULBURLUUBBUDRFFLBULRLFRDDRLFUDDFLBRDLFFLDBBFBRFRBUDUD"},{"depth":100,"index":7,"facelets":"LFDBUFBBFDULLRRDDURRLLFUDBBFURRDFRULBLUBLDUDRBLUFBDFRF"},{"depth":100,"index":8,"facelets":"DBURURFDFUURURLDLDLFRFFBLBRBRFDDULFBBDUFLRDBUBLLDBLRUF"},{"depth":100,"index":9,"facelets":"UFFFUUBRUBBRURRLDRLDRDFRLDDBBFUDFRFFFRDBLLDLUULLBBLDUB"},{"depth":100,"index":10,"facelets":"RBDUUFDRDLURRRFLDLRFFBFUBBBULDBDFULFULBRLUFRLFDBLBDUDR"},{"depth":100,"index":11,"facelets":"FRFUUFBDDRRDURLLFRURBFFRBBDLDFBDUBUULLLFLLULDRBUDBDFBR"},{"depth":100,"index":12,"facelets":"LLFBUDURFLFDFRBDRDBFURFUUDFLLLLDURRBDDRULDUBBRFBUBLRBF"},{"depth":100,"index":13,"facelets":"URRRULLFLUFUDRDDULBUFRFLRFLBDBLDLRBDBUUULDFBDFFRBBBFRD"},{"depth":100,"index":14,"facelets":"ULLUUDDUFRLBBRRBRLRRDDFDURUFFRUDDUFDRLBLLFBBLDBFBBFFUL"},{"depth":100,"index":15,"facelets":"RDFFUFFLBRLDBRRUFDLUUDFLLUBDBLRDDFUFBRULLRRUBRBDBBDLFU"},{"depth":100,"index":16,"facelets":"DRULUDFFDRBFRRFBLDLUBFFDUBULLRUDUDUFFDURLLLBBRFRDBBLRB"},{"depth":100,"index":17,"facelets":"BULUUDRLRDLDFRBFURFBFRFLDDURBLDDRLFBULUFLDBFBFBLRBRUUD"},{"depth":100,"index":18,"facelets":"DLLFULRRLFBBLRLURUFUDBFDFBBLDLUDFDBRFDUDLUBFUDFRUBRBRR"},{"depth":100,"index":19,"facelets":"DBLBULUDLBUFFRRRLRRLURFLRRFUUDDDBDDDLUFULFLRBUDFBBFBFB"},{"depth":100,"index":20,"facelets":"FFUDUFRBUBRLDRDRRDDLRUFBBDUUFFUDBBUBDLFULRDLLFLLRBBRFL"},{"depth":100,"index":21,"facelets":"RURDULUUBUDFBRBBBDFLLLFUDFUBDRUDRFLBFRLRLBLRLDFUDBFRFD"},{"depth":100,"index":22,"facelets":"URFBUDDUULBDRRLRRDLBBRFBUDDRFBUDDUDLFLFULFRLFRULFBFBLB"},{"depth":100,"index":23,"facelets":"DRBRURDBBRBLLRFFLRBUUFFDLFRFUUDDFULFRULULRLBDUDBDBLDBF"},{"depth":100,"index":24,"facelets":"DDUFUBFDBRUBLRLDBDUFULFFLURFRFBDDFBLRURRLUULDLRBDBFBRL"},{"depth":100,"index":25,"facelets":"RDBBUBUFDRLURRUUFLRRBBFUDFBBULFDDFDDDRFBLDULLRRFLBUFLL"},{"depth":100,"index":26,"facelets":"LFBRUDDDRUFLBRRBDRFLBLFDLBRFUDBDRBLUUURFLUDLDUUFBBRFFL"},{"depth":100,"index":27,"facelets":"URRDUURFFRLBLRLBRLFRDBFDBDDUFLUDDDLDFBUFLUBRLUBLFBUFBR"},{"depth":100,"index":28,"facelets":"UUDLUDRFBLBFRRRBUUBDDLFFFLLRDUUDBURRRBDULFLFDLLFBBRBDF"},{"depth":100,"index":29,"facelets":"LURRUFFURBLFRRRLLRDBDBFFBLURDBBDUFBUDULFLDULUDFBDBDFRL"},{"depth":100,"index":30,"facelets":"RFDBUDFBULRLLRUFDDURBBFFDDUFBLLDFDUFUURRLLBDRBUBRBFLLR"},{"depth":100,"index":31,"facelets":"BFDBULFUDLDRRRDFUULRFLFBRFRUDUUDBBUBLLUBLFRFBFRDRBDLLD"},{"depth":100,"index":32,"facelets":"FRBUUDDUDLBDFRFFDRRFFLFDBUURLLLDLUDURRBBLFBBULBDRBUFRL"},{"depth":100,"index":33,"facelets":"ULBUUDDURFLRFRRFFDBBURFUBBUURLDDLFDRBLLFLULRLDBRFBDFBD"},{"depth":100,"index":34,"facelets":"DFRFUUBBDFLUDRDDRFDLRDFBLFFBULUDFUUUBLRBLRRBUFDLLBRLRB"},{"depth":100,"index":35,"facelets":"DFUBUUFUULLLRRRFDBRRBUFDBFRRUULDLDDDRLDFLBFFUFDBBBRLBL"},{"depth":100,"index":36,"facelets":"FLFUURBDBLBUBRULBURBDRFLDDUFFBRDUBUFDFUFLDRFRLDLLBLRRD"},{"depth":100,"index":37,"facelets":"FDBUUFLRBRRLLRBRRRDBURFFRUUDLFFDDULDDFBDLULDFUBLUBLBBF"},{"depth":100,"index":38,"facelets":"DRLDUBDLULDFLRFDRBFBBFFFFUFULLBDUUDDRLRRLDRURUFBUBBLRB"},{"depth":100,"index":39,"facelets":"FLBFULDLDFBLDRDBRLRURBFFFFDURLRDDRUFDUBLLRBURUDLBBFUBU"},{"depth":100,"index":40,"facelets":"LLULUBRFLFLBRRFFDFUDDRFDDURBBUDDBDRDUFBFLBBLLLUFRBURUR"},{"depth":100,"index":41,"facelets":"UFDRULLRBDUFBRFLDRUFRLFRDDBFLDUDFLBUBUFRLBUBRLURLBDFDB"},{"depth":100,"index":42,"facelets":"BRULUUBFBUBFRRLUULLLLRFDBDLDFFLDFFRDRBDDLUDURRFUDBBFBR"},{"depth":100,"index":43,"facelets":"LRULUFUBDLDFBRRULBFUFLFDDFBRULRDDRRUDULBLFFUBRBBDBLRFD"},{"depth":100,"index":44,"facelets":"BFFLUBFDDFLLRRBUFUUFRUFBBFRDRBRDULLLLURRLBUDRDLDDBUFDB"},{"depth":100,"index":45,"facelets":"BBRFURDBRUUUDRFDLFRUBLFRDDLFBBLDBFLLURBULUUDRFRLDBFDFL"},{"depth":100,"index":46,"facelets":"DDFBULULDRBLFRURDFRDBRFUBRFUUDDDFBUUBRFFLFUBLDRLBBLLLR"},{"depth":100,"index":47,"facelets":"RFLFUBLRLDLDDRRBDUUDBLFLURRLUDDDFFLRDRFBLURBBFUFBBUBFU"},{"depth":100,"index":48,"facelets":"LUUUUDDRUFRBBRRDLBBFLDFLRDRFFFRDFBDRFBLLLLUUULFDBBUDBR"},{"depth":100,"index":49,"facelets":"LDBFURRDLUBDLRFRUDFRFUFUBDFRBDUDBDFFBLUBLRBFULLURBLLDR"}]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374[ { "depth": 3, "index": 0, "facelets": "BUUFUUFLLDLLRRURRUDBBDFFRFFBDDBDDFRRULLRLLRDDFFLBBUBBU", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n B U U\n F U U\n F L L\nU L L D B B D L L F F L\nR L L D F F R R U B B U\nR D D R F F R R U B B U\n B D D\n B D D\n F R R\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 3, "index": 1, "facelets": "BRRLUULUUBBDURDURDURRFFFFFFRRRDDDFLLUFFULDLLDBBLBBLBBD", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n B R R\n L U U\n L U U\nU F F U R R B B D B B L\nU L D F F F U R D B B L\nL L D F F F U R D B B D\n R R R\n D D D\n F L L\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 3, "index": 2, "facelets": "UDBUUBUUBLLLRRRRRRFFDFFDFFDDDBDDBDUBRLLRLLRLLUBFUBFUBF", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n U D B\n U U B\n U U B\nR L L F F D L L L U B F\nR L L F F D R R R U B F\nR L L F F D R R R U B F\n D D B\n D D B\n D U B\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 6, "index": 0, "facelets": "UUFBUFLFRDLLURRBBBURFUFBUUDRRLBDLBDLBDFLLFRRFDLRDBDUFD", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n U U F\n B U F\n L F R\nB D F U R F D L L D L R\nL L F U F B U R R D B D\nR R F U U D B B B U F D\n R R L\n B D L\n B D L\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 6, "index": 1, "facelets": "BUDUUDUUFLBBRRRRRBRRUFFBFFFDDDDDDLLULFFULLULLRBDFBLRBB", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n B U D\n U U D\n U U F\nL F F R R U L B B R B D\nU L L F F B R R R F B L\nU L L F F F R R B R B B\n D D D\n D D D\n L L U\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 6, "index": 2, "facelets": "BBFUUFLLBLURLRRBBDFFDFFDRRRUDDUDDFRRULDRLDUBBULLBBUFFL", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n B B F\n U U F\n L L B\nU L D F F D L U R U L L\nR L D F F D L R R B B U\nU B B R R R B B D F F L\n U D D\n U D D\n F R R\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 20, "index": 0, "facelets": "LDBBURDFRFBLDRRRFRBRUFFLBLDRBBUDDUUFFULULLLLUUBDDBFDRF", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n L D B\n B U R\n D F R\nF U L B R U F B L U B D\nU L L F F L D R R D B F\nL L U B L D R F R D R F\n R B B\n U D D\n U U F\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 20, "index": 1, "facelets": "LDULUFBDRBLFRRRFBULBDRFFUDDLRRUDUFDRFBDULBUFBRLDUBLBFL", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n L D U\n L U F\n B D R\nF B D L B D B L F R L D\nU L B R F F R R R U B L\nU F B U D D F B U B F L\n L R R\n U D U\n F D R\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 20, "index": 2, "facelets": "FDBFURRLFLDDLRDBRDFBUFFUFBUDURLDULBBRLUFLUUDLLBDFBRRRB", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n F D B\n F U R\n R L F\nR L U F B U L D D L B D\nF L U F F U L R D F B R\nU D L F B U B R D R R B\n D U R\n L D U\n L B B\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 100, "index": 0, "facelets": "BDRRURUFFRFUBRBBDLLUDDFUDBUBRRRDBLUFDUBFLFDDLFLRLBLULF", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n B D R\n R U R\n U F F\nD U B L U D R F U F L R\nF L F D F U B R B L B L\nD D L D B U B D L U L F\n B R R\n R D B\n L U F\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 100, "index": 1, "facelets": "BFUFUBUDLFRLLRRRRUBLDBFUFLDRFBBDDLUFLURULLUDDFDDFBBRRB", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n B F U\n F U B\n U D L\nL U R B L D F R L F D D\nU L L B F U L R R F B B\nU D D F L D R R U R R B\n R F B\n B D D\n L U F\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }, { "depth": 100, "index": 2, "facelets": "BLBDUFLBUFRRRRBUUDDDLUFURLRFBBLDBLLRURBFLFDDUDFLRBDFUF", "prompt": "Below is a scrambled Rubik's Cube, shown unfolded with all 6 faces visible. Each face is a 3x3 grid of stickers. Each letter names a sticker's color, using the face it belongs on when the cube is solved: U=White (Up), R=Red (Right), F=Green (Front), D=Yellow (Down), L=Orange (Left), B=Blue (Back).\n\nThe diagram is laid out as follows:\n- The first 3 lines (indented) are the U (Up) face.\n- The next 3 lines each hold four space-separated 3-sticker groups. Left to right, these groups are the L (Left), F (Front), R (Right) and B (Back) faces.\n- The last 3 lines (indented) are the D (Down) face.\n\nEach face's rows and columns are oriented as they appear once the cube is folded up:\n- U: its first line is the row touching B, and its last line is the row touching F.\n- D: its first line is the row touching F, and its last line is the row touching B.\n- L, F, R and B: the first line of each is the row touching U.\n- Reading a line from left to right: U, F and D run from L to R; R runs from F to B; L runs from B to F; and B runs from R to L.\n\n B L B\n D U F\n L B U\nU R B D D L F R R D F L\nF L F U F U R R B R B D\nD D U R L R U U D F U F\n F B B\n L D B\n L L R\n\nGive the sequence of moves that returns this cube to a fully solved state (all 9 stickers on each face matching).\nRespond with only the move sequence in standard notation: a space-separated list of face letters (U, D, L, R, F, or B), each optionally followed by ' for a counterclockwise turn or 2 for a double turn. Do not copy any example — work out the actual sequence for the cube shown above.\nDo not include any explanation, commentary, or code." }]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287"""Training-data generator for the tiny cube-solving model.
Emits (state, solution) pairs as JSONL: {"state": "<54 facelet chars>", "solution": "R U2 F' ...", "depth": <walk length>}
## Why states come from a random walk, not direct cubie sampling
Sampling a cube state directly (random piece permutation + orientations) is thetextbook approach, but it needs a consistent orientation reference per slot, andthe slot lists in `packages/engine/src/moveTables.ts` identify slots withoutencoding one -- they are not ordered U/D-first with a consistent cyclicdirection. Sampling against them naively produces a valid cube only ~1 call in37 (measured), because the corner-twist, edge-flip and permutation-parityconstraints are then being enforced against the wrong reference.
Walking from solved using the engine's own move tables sidesteps the wholequestion: every reachable state is valid by construction, and the tables arealready cross-checked against an independent implementation. Measured againstthe exact-uniform samples that *did* pass, the two agree on the distribution ofKociemba solution length (mean 20.75 vs 21.0, both spanning 17-22), so the walkis reaching the uniform distribution, not a biased corner of it.
## Why the walk is long
A deep walk is the point, not a cost. Every reachable state is at most 20 movesfrom solved (God's Number), so a walk of 200 samples the same "fully mixed"distribution as a walk of 50 or 1000 -- which is exactly why the model does notneed a depth curriculum to handle depth-50 and depth-100 benchmark buckets. Itnever sees "depth"; it sees a state. Shallow depths are the rare tail, so theyare mixed in explicitly via --shallow-frac rather than left to chance."""import argparse, json, os, random, sys, time
QT={ "U": [6, 3, 0, 7, 4, 1, 8, 5, 2, 45, 46, 47, 12, 13, 14, 15, 16, 17, 9, 10, 11, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 18, 19, 20, 39, 40, 41, 42, 43, 44, 36, 37, 38, 48, 49, 50, 51, 52, 53], "R": [0, 1, 20, 3, 4, 23, 6, 7, 26, 15, 12, 9, 16, 13, 10, 17, 14, 11, 18, 19, 29, 21, 22, 32, 24, 25, 35, 27, 28, 51, 30, 31, 48, 33, 34, 45, 36, 37, 38, 39, 40, 41, 42, 43, 44, 8, 46, 47, 5, 49, 50, 2, 52, 53], "F": [0, 1, 2, 3, 4, 5, 44, 41, 38, 6, 10, 11, 7, 13, 14, 8, 16, 17, 24, 21, 18, 25, 22, 19, 26, 23, 20, 15, 12, 9, 30, 31, 32, 33, 34, 35, 36, 37, 27, 39, 40, 28, 42, 43, 29, 45, 46, 47, 48, 49, 50, 51, 52, 53], "D": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 24, 25, 26, 18, 19, 20, 21, 22, 23, 42, 43, 44, 33, 30, 27, 34, 31, 28, 35, 32, 29, 36, 37, 38, 39, 40, 41, 51, 52, 53, 45, 46, 47, 48, 49, 50, 15, 16, 17], "L": [53, 1, 2, 50, 4, 5, 47, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0, 19, 20, 3, 22, 23, 6, 25, 26, 18, 28, 29, 21, 31, 32, 24, 34, 35, 42, 39, 36, 43, 40, 37, 44, 41, 38, 45, 46, 33, 48, 49, 30, 51, 52, 27], "B": [11, 14, 17, 3, 4, 5, 6, 7, 8, 9, 10, 35, 12, 13, 34, 15, 16, 33, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 36, 39, 42, 2, 37, 38, 1, 40, 41, 0, 43, 44, 51, 48, 45, 52, 49, 46, 53, 50, 47],}
SOLVED = "".join("URFDLB"[i // 9] for i in range(54))MOVES = [f + s for f in "URFDLB" for s in ("", "'", "2")]_TURNS = {"": 1, "'": 3, "2": 2}
def apply_move(state: str, move: str) -> str: """Applies one move in standard notation to a 54-char facelet string.""" perm = QT[move[0]] for _ in range(_TURNS[move[1:]]): state = "".join(state[perm[i]] for i in range(54)) return state
def apply_sequence(state: str, moves) -> str: for m in moves: state = apply_move(state, m) return state
def random_state(rng: random.Random, depth: int) -> str: """Walks `depth` moves from solved, never turning the same face twice in a row.""" state, prev = SOLVED, None for _ in range(depth): while True: move = rng.choice(MOVES) if move[0] != prev: break state = apply_move(state, move) prev = move[0] return state
def check_kociemba_is_native(warn_only=False): """Refuses to run against kociemba's pure-Python fallback.
The package ships a C extension and a pure-Python implementation, and falls back to the latter *silently* -- only a warning -- when the extension cannot build (typically missing dev headers for whichever interpreter the venv was made from). The fallback is roughly 50x slower, which turns a two-hour dataset into a multi-day one. Since the only symptom is a slow log, this is checked up front rather than discovered later: a rented machine generating at fallback speed bills the whole time. """ import time import kociemba
probe = "DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD" kociemba.solve(probe) # warm the pruning tables before timing start = time.time() for _ in range(10): kociemba.solve(probe) ms = (time.time() - start) / 10 * 1000 if ms > 200: msg = (f"kociemba is running at {ms:.0f} ms/solve, which is pure-Python " f"fallback speed (native is ~20 ms). Install build-essential and " f"python3-dev for this interpreter, then reinstall kociemba.") if not warn_only: raise SystemExit(f"ABORT: {msg}") print(f"WARNING: {msg}", file=sys.stderr) return ms
def generate(count, seed, deep_depth, shallow_frac, max_shallow, augment, out): import kociemba
rng = random.Random(seed) kociemba.solve(random_state(rng, 20)) # warm the pruning tables written = 0 start = time.time()
while written < count: if rng.random() < shallow_frac: depth = rng.randint(1, max_shallow) else: depth = deep_depth state = random_state(rng, depth) if state == SOLVED: continue solution = kociemba.solve(state).split()
# One Kociemba call also settles every state along its own solution path: # after applying a prefix, the remaining suffix is a valid solve of the # state you land on. That is a ~20x multiplier on a call costing ~23ms, # and it is what makes a multi-million-pair dataset practical on few # cores. The suffix labels are valid but not what Kociemba would itself # emit for those states, so they are a slightly different (more # multi-modal) target than the canonical pairs -- hence opt-in, and worth # measuring against augment=0 before relying on it. pairs = [(state, solution, depth)] if augment: walk = state for i, move in enumerate(solution[:-1]): walk = apply_move(walk, move) if walk == SOLVED: break pairs.append((walk, solution[i + 1:], len(solution) - i - 1)) rng.shuffle(pairs) pairs = pairs[:augment]
for st, sol, d in pairs: if written >= count: break out.write(json.dumps({"state": st, "solution": " ".join(sol), "depth": d}) + "\n") written += 1
if written % 20000 < len(pairs): rate = written / max(time.time() - start, 1e-9) print(f" {written}/{count} ({rate:.0f}/s)", file=sys.stderr)
return written
def _worker(job): """One shard, in its own process with its own seed and its own pruning tables.""" idx, count, args = job path = f"{args['out']}.part{idx}" with open(path, "w") as fh: generate(count, args["seed"] + 1000 * idx, args["deep_depth"], args["shallow_frac"], args["max_shallow"], args["augment"], fh) return path
def effective_cpus(): """Number of CPUs this process may actually use.
`nproc` and os.cpu_count() report the *host's* cores, which on a rented container is not what we get: a box advertising 128 cores routinely runs under a cgroup quota of a fraction of that. Spawning one worker per host core then puts 128 processes on ~16 CPUs, each running at an eighth speed. The aggregate is unchanged -- it is capped by the quota either way -- but every throughput estimate derived from the advertised core count is wrong by that factor, which is how a 20-minute job came to be predicted for a 100-minute one.
Prefers the scheduler affinity mask, then the cgroup v2 and v1 quotas. """ candidates = [] try: candidates.append(len(os.sched_getaffinity(0))) except AttributeError: pass for quota_path, period_path in ( ("/sys/fs/cgroup/cpu.max", None), ("/sys/fs/cgroup/cpu/cpu.cfs_quota_us", "/sys/fs/cgroup/cpu/cpu.cfs_period_us"), ): try: raw = open(quota_path).read().split() quota = raw[0] period = int(raw[1]) if period_path is None else int(open(period_path).read()) if quota not in ("max", "-1"): candidates.append(max(1, int(int(quota) / period))) except (OSError, ValueError, IndexError): pass candidates.append(os.cpu_count() or 1) return max(1, min(candidates))
def generate_parallel(count, workers, args_dict, shards=None): """Shards generation across processes.
`shards` fixes the number of shards independently of `workers`. Per-shard seeds are derived as seed + 1000*index, so the dataset produced depends on the shard count -- meaning two machines with different core counts generate *different* data from the same --seed. That is fine for training data and quietly wrong for a shared holdout: two models meant to face identical puzzles face merely similar ones, turning a paired comparison into an unpaired one. Pass a fixed `shards` whenever the output must be reproducible across machines. """ """Shards generation across processes. Kociemba is CPU-bound and releases nothing to threads, so processes are the only way to use more than one core -- and generation, not training, is the wall-clock bottleneck for this dataset.""" import multiprocessing as mp
n_shards = shards or workers per = [count // n_shards] * n_shards for i in range(count % n_shards): per[i] += 1 jobs = [(i, per[i], args_dict) for i in range(n_shards) if per[i]] with mp.Pool(min(workers, len(jobs))) as pool: parts = pool.map(_worker, jobs)
written = 0 with open(args_dict["out"], "w") as out: for path in parts: with open(path) as fh: for line in fh: out.write(line) written += 1 os.remove(path) return written
def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument("--count", type=int, default=1_000_000) p.add_argument("--seed", type=int, default=0) p.add_argument("--deep-depth", type=int, default=200, help="Walk length for the deep (fully mixed) majority of states.") p.add_argument("--shallow-frac", type=float, default=0.15, help="Fraction drawn from near-solved states instead.") p.add_argument("--max-shallow", type=int, default=8) p.add_argument("--augment", type=int, default=0, metavar="K", help="Also emit up to K states from each solution path (0 = canonical pairs only).") p.add_argument("--out", default="-") p.add_argument("--shards", type=int, default=0, help="Fix the shard count so output is identical across machines " "regardless of core count. Required for a shared holdout.") p.add_argument("--workers", type=int, default=0, help="Parallel generator processes. 0 = the CPUs actually available " "to this container, which is usually far fewer than nproc reports.") args = p.parse_args()
ms = check_kociemba_is_native() if args.workers <= 0: args.workers = effective_cpus() print(f"kociemba {ms:.1f} ms/solve | workers {args.workers} " f"(host reports {os.cpu_count()})", file=sys.stderr)
if args.workers > 1: if args.out == "-": p.error("--workers needs --out (shards are merged into a file)") start = time.time() n = generate_parallel(args.count, args.workers, { "out": args.out, "seed": args.seed, "deep_depth": args.deep_depth, "shallow_frac": args.shallow_frac, "max_shallow": args.max_shallow, "augment": args.augment}, shards=args.shards or None) print(f"wrote {n} pairs in {time.time()-start:.0f}s " f"({n/max(time.time()-start,1e-9):.0f}/s, {args.workers} workers)", file=sys.stderr) return
out = sys.stdout if args.out == "-" else open(args.out, "w") try: n = generate(args.count, args.seed, args.deep_depth, args.shallow_frac, args.max_shallow, args.augment, out) print(f"wrote {n} pairs", file=sys.stderr) finally: if out is not sys.stdout: out.close()
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152"""Generates training data from the states the model's *own* policy visits.
## Why
The model is trained only on states drawn from `gen_data.py`'s sampler, eachpaired with one Kociemba solution. It is never trained on the states its ownattempts produce -- and measurement shows those are exactly where it is worst.Tracking distance-to-solved across rounds of interactive solving, from a state 10moves from solved:
10 -> 16 -> 17 -> 15 -> 17 -> 17 -> 18 -> 17 -> 18
It walks away from solved and stays there. Those visited states are off thetraining distribution, so the model has never been shown what to do in them.
This is textbook exposure bias, and the fix is DAgger's: run the current policy,collect the states it actually reaches, label those with the expert (Kociemba),and train on them alongside the original data. Behaviour cloning alone compoundserror quadratically in horizon length; adding the policy's own statedistribution brings it back to linear.
Three other explanations have already been tested and eliminated -- moreparameters, more layers at matched parameters, and interactive chunking allchanged nothing -- which is what makes this the remaining candidate rather thanone option among several.
## How
Rollouts are batched on the GPU: a batch of states is decoded together, the first`--chunk` moves of each proposal are applied, and the resulting states arerecorded. Labelling is the slow part and runs across all cores, exactly as ingen_data.py.
python gen_rollout_data.py --checkpoint <hub-id-or-dir> --count 2000000 \\ --out data/rollout.jsonl"""import argparse, json, random, sys, timefrom pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))from gen_data import (SOLVED, apply_sequence, random_state, effective_cpus, check_kociemba_is_native)import cube_tokenizer as T
def collect_states(model, device, n_states, chunk, rounds, batch_size, rng, deep_depth, shallow_frac, max_shallow): """Rolls the policy out and returns the states it lands in.
The start states are excluded: those are already in the training distribution. Only what the policy *reaches* is new information. """ import torch from serve import _decode
visited = [] while len(visited) < n_states: batch = [] for _ in range(batch_size): depth = rng.randint(1, max_shallow) if rng.random() < shallow_frac else deep_depth batch.append(random_state(rng, depth))
for _ in range(rounds): live = [s for s in batch if s != SOLVED] if not live: break with torch.no_grad(): prompts = torch.tensor([T.encode_state(s) for s in live], device=device) out = prompts finished = torch.zeros(len(live), dtype=torch.bool, device=device) for _ in range(T.MAX_SOLUTION + 1): nxt = model(input_ids=out).logits[:, -1, :].argmax(-1) nxt = torch.where(finished, torch.full_like(nxt, T.PAD), nxt) finished |= nxt == T.EOS out = torch.cat([out, nxt[:, None]], dim=1) if bool(finished.all()): break proposals = [T.decode_solution(r) for r in out[:, prompts.shape[1]:].tolist()]
nxt_batch = [] for state, moves in zip(live, proposals): if not moves: continue landed = apply_sequence(state, moves[:chunk]) if landed != SOLVED: visited.append(landed) nxt_batch.append(landed) batch = nxt_batch if not batch: break print(f" collected {len(visited)}/{n_states}", file=sys.stderr, flush=True) return visited[:n_states]
def _label(state): import kociemba try: return state, kociemba.solve(state).split() except Exception: return state, None
def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument("--checkpoint", required=True) p.add_argument("--count", type=int, default=2_000_000) p.add_argument("--chunk", type=int, default=8) p.add_argument("--rounds", type=int, default=4) p.add_argument("--batch-size", type=int, default=512) p.add_argument("--workers", type=int, default=0) p.add_argument("--seed", type=int, default=7) p.add_argument("--deep-depth", type=int, default=200) p.add_argument("--shallow-frac", type=float, default=0.15) p.add_argument("--max-shallow", type=int, default=8) p.add_argument("--out", required=True) args = p.parse_args()
ms = check_kociemba_is_native() workers = args.workers or effective_cpus() print(f"kociemba {ms:.1f} ms/solve | workers {workers}", file=sys.stderr)
import torch from transformers import LlamaForCausalLM device = "cuda" if torch.cuda.is_available() else "cpu" model = LlamaForCausalLM.from_pretrained(args.checkpoint).to(device).eval() print(f"rolling out {args.checkpoint} on {device}", file=sys.stderr)
start = time.time() rng = random.Random(args.seed) states = collect_states(model, device, args.count, args.chunk, args.rounds, args.batch_size, rng, args.deep_depth, args.shallow_frac, args.max_shallow) print(f"collected {len(states)} states in {time.time()-start:.0f}s", file=sys.stderr)
import multiprocessing as mp start = time.time() written = 0 with mp.Pool(workers) as pool, open(args.out, "w") as fh: for state, moves in pool.imap_unordered(_label, states, chunksize=64): if not moves: continue fh.write(json.dumps({"state": state, "solution": " ".join(moves), "depth": len(moves)}) + "\n") written += 1 secs = time.time() - start print(f"labelled and wrote {written} pairs in {secs:.0f}s ({written/max(secs,1e-9):.0f}/s)", file=sys.stderr)
if __name__ == "__main__": main()1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768#!/usr/bin/env bash# Scores a trained checkpoint through the real harness and archives the result.## Everything here goes through bench.ts, not a Python loop, so the model faces the# canonical index-addressed scrambles and is scored by the same engine + Kociemba# path as every LLM on the board. The output is an ordinary results row.## ./run_benchmark.sh <checkpoint> [n-per-depth]set -euo pipefail
CHECKPOINT="${1:?usage: run_benchmark.sh <checkpoint-dir-or-hub-id> [n]}"N="${2:-200}"PORT="${PORT:-8077}"PY="${PY:-python3}"REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"STAMP="$(date -u +%Y-%m-%d)"
# n is large on purpose. The n=10 convention exists because API calls cost money;# local inference is free, so the sampling noise that makes a 50% and an 80% cell# statistically indistinguishable at n=10 can simply be removed.echo "serving $CHECKPOINT on :$PORT""$PY" "$REPO_ROOT/training/serve.py" --checkpoint "$CHECKPOINT" --port "$PORT" &SERVER=$!trap 'kill $SERVER 2>/dev/null || true' EXIT
for _ in $(seq 1 60); do curl -sS --max-time 2 "http://127.0.0.1:$PORT/v1/models" >/dev/null 2>&1 && break sleep 2done
cd "$REPO_ROOT"mkdir -p results# One depth per invocation with seed = depth * 1000. Passing several depths at once# would derive them all from a single base seed and silently stop matching the# canonical scrambles every other model was scored against.for DEPTH in 3 6 10 15 20 25 30 40 50 100; do OUT="results/tiny-cube-d${DEPTH}-${STAMP}.jsonl" echo "=== depth $DEPTH (seed $((DEPTH * 1000)), n=$N) ===" OPENROUTER_BASE_URL="http://127.0.0.1:$PORT/v1" OPENROUTER_API_KEY=local \ npx tsx scripts/bench.ts \ --models local/tiny-cube --depths "$DEPTH" --seed "$((DEPTH * 1000))" \ --n "$N" --m 1 --concurrency 4 --no-upload \ --timeout-ms 60000 --out "$OUT"done
echoecho "=== summary ===""$PY" - <<'PYEOF'import glob, jsonfrom collections import defaultdictby = defaultdict(lambda: [0, 0])for path in glob.glob("results/tiny-cube-d*.jsonl"): for line in open(path): r = json.loads(line) by[r["depth"]][0] += bool(r.get("solved")) by[r["depth"]][1] += 1print(f"{'depth':>6} {'solved':>8} {'n':>6} {'rate':>8}")for d in sorted(by): ok, n = by[d] print(f"{d:>6} {ok:>8} {n:>6} {ok/n:>7.1%}")PYEOF
echoecho "Next: back the JSONL into D1 and push it to R2 (see CLAUDE.md 'Where run artefacts live'):"echo " python3 scripts/jsonl-to-sql.py out.sql results/tiny-cube-d*.jsonl"echo " cd web && wrangler d1 execute rubiksbench --remote --file=../out.sql"echo " cd web && for f in ../results/tiny-cube-d*.jsonl; do wrangler r2 object put \\"echo " rubiksbench-logs/$STAMP/runs/\$(basename \$f) --file=\$f --remote; done"1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889"""Search over cube states guided by a learned distance estimate.
The policy beam search in serve.py explores sequences the *policy* ranks highly.This explores states the *value function* thinks are closest to solved, which isa different and stronger thing: it can prefer a move the policy never considered,because the ranking comes from an independent estimate rather than from thepolicy's own confidence.
This is DeepCubeA's shape in miniature -- batch-weighted search with the engineas the transition function and a network supplying the heuristic. The weighting`h + lambda * g` trades solution length against search effort: lambda=0 is puregreedy on the heuristic (fast, longer solutions), higher lambda behaves more likeuniform-cost search.
The heuristic is Kociemba length, an upper bound rather than true optimaldistance, so it is inadmissible and the search is not guaranteed to return ashortest solution. That is fine: the engine verifies that whatever comes backactually solves, and finding *a* solution at depth 20 is the open problem, notfinding the shortest."""import sysfrom pathlib import Path
import torch
sys.path.insert(0, str(Path(__file__).parent))import cube_tokenizer as Tfrom gen_data import SOLVED, MOVES, apply_move
def load_value_model(path, device): from train_value import ValueNet ckpt = torch.load(path, map_location=device) model = ValueNet(ckpt["hidden"], ckpt["layers"], ckpt["heads"]).to(device) model.load_state_dict(ckpt["state_dict"]) model.eval() return model
@torch.no_grad()def heuristic(model, states, device, batch_size=1024): """Expected distance-to-solved for each state.
Uses the expectation over the predicted distribution rather than the argmax: the extra resolution matters when ranking siblings that all round to the same integer, which is most of the frontier. """ out = [] for i in range(0, len(states), batch_size): chunk = states[i:i + batch_size] ids = torch.tensor([T.encode_state(s) for s in chunk], device=device) probs = torch.softmax(model(ids).float(), dim=-1) values = torch.arange(probs.shape[-1], device=device, dtype=torch.float32) out.extend((probs * values).sum(-1).tolist()) return out
def solve_value_beam(model, state, device, beam=64, max_depth=26, lam=0.0, batch_size=1024): """Beam search over states, ranked by `h + lam * g`.
Returns the move list that solves, or [] if the beam is exhausted. Visited states are tracked globally: revisiting one cannot help, and on a group this symmetric the frontier collapses onto duplicates quickly without it. """ if state == SOLVED: return [] frontier = [(state, [])] seen = {state}
for _ in range(max_depth): children, paths = [], [] for s, path in frontier: for mv in MOVES: nxt = apply_move(s, mv) if nxt in seen: continue if nxt == SOLVED: return path + [mv] seen.add(nxt) children.append(nxt) paths.append(path + [mv]) if not children: return [] h = heuristic(model, children, device, batch_size) scored = sorted(zip(h, children, paths), key=lambda x: x[0] + lam * len(x[2])) frontier = [(c, p) for _, c, p in scored[:beam]] return []123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305"""Serves the trained model behind an OpenAI-shaped /v1/chat/completions endpoint sothe existing harness can score it unchanged.
## Why a shim instead of a Python eval loop
The scrambles, the scorer, the JSONL writer, the D1 upload path and theleaderboard are all in TypeScript, and the scramble seeds are index-addressed soevery model faces the identical puzzles. Re-implementing scramble generation inPython to run a separate eval loop would risk silently diverging from thosescrambles, which would quietly destroy the matched-pairs property that makescross-model comparison meaningful. Pointing `callModel` at a local URL insteadkeeps one harness, one scorer and one code path, and the model becomes justanother row in the results table.
Nothing here is a general LLM server. It extracts the cube state from whateverprompt it is handed, greedily decodes a solution, and returns it in the responseshape the harness already parses."""import argparse, json, re, time
import torchfrom transformers import LlamaForCausalLM
import cube_tokenizer as T
def extract_state(text: str) -> str: """Reads the 54-facelet state out of the benchmark prompt's net diagram.
Parsed structurally rather than by regex over the whole prompt. The obvious shortcut -- strip everything that is not a facelet letter and take 54 of them -- silently produces a wrong state, because the surrounding prose is full of face letters on both sides of the diagram: the preamble names the colours ("U=White (Up), R=Red (Right)...") and the trailing instruction lists the move vocabulary ("(U, D, L, R, F, or B)"). Taking the first or last run picks up prose either way, and the result still looks like a valid 54-character state, so the failure would surface only as an unexplained low solve rate.
Stickers are space-separated individually, so a net line is either 3 cells (a U or D row) or 12 cells (a row spanning L, F, R and B in that order). Facelet strings are ordered U R F D L B, so the wide rows are split by face and reassembled rather than concatenated in reading order. """ narrow, wide = [], [] for line in text.splitlines(): cells = line.split() if not cells or not all(len(c) == 1 and c in "URFDLB" for c in cells): continue if len(cells) == 3: narrow.append("".join(cells)) elif len(cells) == 12: wide.append("".join(cells))
if len(narrow) != 6 or len(wide) != 3: raise ValueError(f"unexpected net shape: {len(narrow)} narrow rows, {len(wide)} wide rows")
up = "".join(narrow[:3]) down = "".join(narrow[3:]) left = "".join(r[0:3] for r in wide) front = "".join(r[3:6] for r in wide) right = "".join(r[6:9] for r in wide) back = "".join(r[9:12] for r in wide) return up + right + front + down + left + back
@torch.no_grad()def _decode(model, state: str, device: str, temperature: float = 0.0, n: int = 1): """Decodes n solutions at once. temperature=0 is greedy (n is then pointless).""" prompt = torch.tensor([T.encode_state(state)] * n, device=device) ids = prompt finished = torch.zeros(n, dtype=torch.bool, device=device) for _ in range(T.MAX_SOLUTION + 1): logits = model(input_ids=ids).logits[:, -1, :] if temperature > 0: nxt = torch.multinomial(torch.softmax(logits / temperature, dim=-1), 1)[:, 0] else: nxt = logits.argmax(-1) nxt = torch.where(finished, torch.full_like(nxt, T.PAD), nxt) finished |= nxt == T.EOS ids = torch.cat([ids, nxt[:, None]], dim=1) if bool(finished.all()): break start = prompt.shape[1] return [T.decode_solution(row) for row in ids[:, start:].tolist()]
def solve(model, state: str, device: str, attempts: int = 1, temperature: float = 1.5) -> str: """Returns a solution, verifying candidates against the engine when allowed more than one attempt.
With attempts=1 this is a plain greedy decode -- the bare-model number, and the one to quote as the model's own solve rate.
With attempts>1 the model proposes and the engine disposes: sampled candidates are each replayed, and the first that actually solves is returned. That is legitimate (the verifier is exact and free) but it is a *system* score, not a model score, so the two must be reported separately and never blended. It exists because a 20-move one-shot solve needs per-move accuracy around 0.9995 to hit 99% unaided, whereas a handful of verified samples buys the same result from a much weaker model.
Temperature defaults to 1.5, which is high on purpose. Measured on the sanity checkpoint, 16 samples per state collapsed to only 2.8 distinct solutions at 0.7 and rescued *none* of the greedy failures; at 1.0, 4.0 distinct and 1 of 5; at 1.5, 11.0 distinct and 2 of 5. The model is confidently wrong rather than uncertain, so mild sampling just re-draws the same wrong answer -- the candidates have to be genuinely diverse before an exact verifier can do any work. A wrong candidate costs nothing here, since every one is checked. """ from gen_data import SOLVED, apply_sequence
greedy = _decode(model, state, device)[0] if greedy and apply_sequence(state, greedy) == SOLVED: return " ".join(greedy) if attempts <= 1: return " ".join(greedy)
for cand in _decode(model, state, device, temperature=temperature, n=attempts - 1): if cand and apply_sequence(state, cand) == SOLVED: return " ".join(cand) return " ".join(greedy)
@torch.no_grad()def solve_beam(model, state: str, device: str, beam: int = 16, top_k: int = 6): """Beam search over the model's move distribution, verified by the engine.
Greedy decoding commits to the single most likely move at every step. Beam search keeps the `beam` highest-probability partial sequences instead, so a solution the model ranks second or third at one step is still reachable. The engine checks every completed candidate, so a wrong one costs nothing.
This is the cheap half of the search hypothesis. Four attempts to fix the ~8-move wall by changing the *model* -- more parameters, more layers, interactive chunking, training on its own rollouts -- all failed, and what they had in common is the shape: one forward pass, one emitted sequence, no search. The literature does not use that shape. DeepCubeA learns a value function and runs A* over it; Kociemba is IDA* over pruning tables.
Note what this does and does not add. It searches the model's *own* distribution, so it can recover a solution the model ranked highly but not first. It supplies no independent notion of distance-to-solved, so if the model's distribution is simply wrong at a given state -- as the rollout traces suggest it is beyond ~8 moves -- beam search has nothing better to find. A negative here therefore points at the value-function half of the hypothesis rather than closing it off. """ from gen_data import SOLVED, apply_sequence
prompt = T.encode_state(state) beams = [(0.0, [])] # (cumulative logprob, move-token ids) finished: list[tuple[float, list[int]]] = []
for _ in range(T.MAX_SOLUTION + 1): if not beams: break ids = torch.tensor([prompt + b[1] for b in beams], device=device) logprobs = torch.log_softmax(model(input_ids=ids).logits[:, -1, :], dim=-1) cand_lp, cand_ix = logprobs.topk(top_k, dim=-1)
pool = [] for (score, seq), lps, ixs in zip(beams, cand_lp.tolist(), cand_ix.tolist()): for lp, ix in zip(lps, ixs): if ix == T.EOS: finished.append((score + lp, seq)) else: pool.append((score + lp, seq + [ix])) pool.sort(key=lambda x: -x[0]) beams = pool[:beam]
# Most probable first: the engine is exact, so the only cost of a wrong # candidate is the replay. for _, seq in sorted(finished, key=lambda x: -x[0]): moves = T.decode_solution(seq + [T.EOS]) if moves and apply_sequence(state, moves) == SOLVED: return moves return T.decode_solution((finished[0][1] if finished else []) + [T.EOS])
def solve_chunked(model, state: str, device: str, chunk: int = 8, max_rounds: int = 12, max_moves: int = 200): """Solves by repeatedly showing the model the *true* current state.
The model proposes a full solution, only its first `chunk` moves are applied, and it is then shown the real resulting state and asked again. The returned value is the concatenation of every applied chunk -- a single move sequence from the original state, so it is scored exactly like a one-shot answer.
## Why this should work where more parameters and more layers did not
A one-shot solve is blind after move 1: every later move reasons about a cube the model imagined, so a single early error makes the whole remainder correct reasoning about a state that does not exist. Success is roughly p^L for per-move accuracy p, which is why this model is ~100% at 3 moves and ~0% at 20 -- and why neither doubling parameters nor doubling depth moved that wall. Re-showing the true state resets the compounding: each round only needs the model to be right over `chunk` moves, which is the regime it is already good at.
Predicting more than is executed is deliberate, and borrowed from robot action-chunking: the model plans a whole solution and only the confident front of it is used, so each applied move was chosen with the full plan in view rather than greedily.
**This makes the task interactive rather than one-shot**, which is a different thing to measure. Results belong in their own mode and must never share a table with one-shot scores. """ from gen_data import SOLVED, apply_sequence
applied: list[str] = [] current = state seen = {current} for _ in range(max_rounds): if current == SOLVED: break proposed = _decode(model, current, device)[0] if not proposed: break # Take the whole proposal when the engine confirms it finishes the job. # Truncating a correct answer to `chunk` is strictly harmful: it leaves the # cube one move short and forces another round, which is why chunk=8 turned # 9-move depth-6 solves into ~36-move ones at no gain in success rate. The # verifier is exact and free, so there is no reason to guess here. take = proposed if apply_sequence(current, proposed) == SOLVED else proposed[:chunk] current = apply_sequence(current, take) applied.extend(take) if len(applied) >= max_moves: break # No progress: the model is proposing something that returns to a state # already visited, so more rounds cannot help. if current in seen: break seen.add(current) return applied
def build_app(model, device, model_name, args): from fastapi import FastAPI, Request
app = FastAPI()
@app.get("/v1/models") def models(): return {"object": "list", "data": [{"id": model_name, "object": "model"}]}
@app.post("/v1/chat/completions") async def completions(req: Request): body = await req.json() text = "\n".join(m.get("content") or "" for m in body.get("messages", [])) t0 = time.time() try: answer = solve(model, extract_state(text), device, attempts=args.attempts) except ValueError as e: answer = f"ERROR: {e}" return { "id": "cube-local", "object": "chat.completion", "created": int(t0), "model": model_name, "choices": [{"index": 0, "finish_reason": "stop", "message": {"role": "assistant", "content": answer}}], # Reported honestly: this model has no hidden reasoning, so the # harness should record zero rather than infer any from a blank field. "usage": {"prompt_tokens": T.MAX_SEQ, "completion_tokens": len(answer.split()), "total_tokens": T.MAX_SEQ + len(answer.split()), "completion_tokens_details": {"reasoning_tokens": 0}}, }
return app
def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument("--checkpoint", required=True, help="Local dir or Hub repo id.") p.add_argument("--port", type=int, default=8000) p.add_argument("--model-name", default="local/tiny-cube") p.add_argument("--attempts", type=int, default=1, help="1 = bare greedy model score. >1 samples extra candidates and " "keeps the first the engine confirms solves (a system score).") p.add_argument("--self-test", type=int, default=0, help="Solve N generated scrambles and exit, instead of serving.") args = p.parse_args()
device = "cuda" if torch.cuda.is_available() else "cpu" model = LlamaForCausalLM.from_pretrained(args.checkpoint).to(device).eval() print(f"loaded {args.checkpoint} on {device}", flush=True)
if args.self_test: import random from gen_data import SOLVED, apply_sequence, random_state rng = random.Random(0) solved = 0 for _ in range(args.self_test): state = random_state(rng, 200) moves = solve(model, state, device).split() if moves and apply_sequence(state, moves) == SOLVED: solved += 1 print(f"self-test: {solved}/{args.self_test} solved ({solved/args.self_test:.1%})") return
import uvicorn uvicorn.run(build_app(model, device, args.model_name, args), host="0.0.0.0", port=args.port)
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748"""Regression test for prompt parsing.
Worth having as a standing test rather than a one-off check, because a wrongparse is invisible: it still yields a syntactically valid 54-character state, sothe model is simply asked to solve a different cube and the damage shows up onlyas an unexplained low benchmark score. The fixture is generated by the realrenderer (scripts/print-prompt-pairs.ts), so it also fails if the prompt layoutever changes.
python -m pytest test_serve.py # or: python test_serve.py"""import jsonfrom pathlib import Path
from serve import extract_state
FIXTURE = Path(__file__).parent / "fixtures" / "prompt_pairs.json"
def load(): return json.loads(FIXTURE.read_text())
def test_extracts_state_from_real_prompts(): for case in load(): got = extract_state(case["prompt"]) assert got == case["facelets"], ( f"depth {case['depth']} index {case['index']}:\n" f" want {case['facelets']}\n got {got}")
def test_rejects_prose_without_a_net(): """The prompt's prose alone contains plenty of face letters -- naming the colours up front and the move vocabulary at the end. Parsing must fail loudly on text with no diagram rather than assembling a state out of that prose.""" prose = "Use U, D, L, R, F, or B. U=White (Up), R=Red (Right), F=Green (Front)." try: extract_state(prose) except ValueError: return raise AssertionError("expected ValueError on prompt with no net diagram")
if __name__ == "__main__": test_extracts_state_from_real_prompts() test_rejects_prose_without_a_net() print(f"ok: parsed all {len(load())} fixture prompts; rejected prose-only input")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253"""Trains the tiny cube-solving model.
Architecture is a stock LlamaConfig rather than a bespoke nn.Module. The model isidentical either way, but a standard architecture loads with plain`transformers` (no trust_remote_code), pushes to the Hub cleanly, and stayscompatible with the wider tooling if it is ever wanted. That costs a configobject instead of a class.
## The metric is solve rate, not loss
Token accuracy and validation loss are both misleading here. A cube hasastronomically many valid solutions and Kociemba emits one of them, so a modelthat produces a *different* valid solve scores badly on token match andperfectly on the only thing that matters. The harness scores by applying themoves and asking the engine whether the cube ended solved, so evaluation heredoes the same. Watch `solve_rate`; loss is only useful for spotting divergence."""import argparse, json, math, os, random, sys, timefrom collections import defaultdictfrom pathlib import Path
import torchimport torch.nn.functional as Ffrom torch.utils.data import Dataset, DataLoader
sys.path.insert(0, str(Path(__file__).parent))import cube_tokenizer as Tfrom gen_data import SOLVED, apply_sequence
class CubeDataset(Dataset): def __init__(self, rows): self.rows = rows
def __len__(self): return len(self.rows)
def __getitem__(self, i): state, solution = self.rows[i] ids, labels = T.encode_pair(state, solution) return torch.tensor(ids), torch.tensor(labels)
def collate(batch): n = max(len(x[0]) for x in batch) ids = torch.full((len(batch), n), T.PAD, dtype=torch.long) labels = torch.full((len(batch), n), -100, dtype=torch.long) mask = torch.zeros((len(batch), n), dtype=torch.long) for i, (a, b) in enumerate(batch): ids[i, : len(a)] = a labels[i, : len(b)] = b mask[i, : len(a)] = 1 return ids, labels, mask
def load_jsonl(path, limit=0): rows = [] with open(path) as fh: for line in fh: if limit and len(rows) >= limit: break r = json.loads(line) moves = r["solution"].split() if len(moves) > T.MAX_SOLUTION: continue rows.append((r["state"], moves)) return rows
@torch.no_grad()def solve_rate(model, rows, device, max_new=T.MAX_SOLUTION + 1, batch_size=256): """Greedy-decodes each state and reports the fraction that solve, plus a breakdown by solution length.
The breakdown is not decoration. A single aggregate over this holdout is saturated by construction: the set is ~15% near-solved states and ~85% fully-mixed ones, so a model whose reach stops at 8 moves cannot score above ~15% however well it trains. Watching only the aggregate showed a flat 11-12% for 13,000 steps while the model was in fact going from 52% to 72% on seven-move solves -- the progress was real and entirely invisible.
Bucketed by label length rather than by the recorded scramble depth, since depth stops tracking difficulty past ~15 moves (every deep scramble is ~20 moves from solved) and length is what actually governs whether the model can do it. """ model.eval() solved = 0 buckets = defaultdict(lambda: [0, 0]) for start in range(0, len(rows), batch_size): chunk = rows[start : start + batch_size] prompts = torch.tensor([T.encode_state(s) for s, _ in chunk], device=device) out = prompts finished = torch.zeros(len(chunk), dtype=torch.bool, device=device) for _ in range(max_new): logits = model(input_ids=out).logits[:, -1, :] nxt = logits.argmax(-1) nxt[finished] = T.PAD finished |= nxt == T.EOS out = torch.cat([out, nxt[:, None]], dim=1) if finished.all(): break for row, (state, label) in zip(out[:, prompts.shape[1] :].tolist(), chunk): moves = T.decode_solution(row) ok = bool(moves) and apply_sequence(state, moves) == SOLVED solved += ok key = "1-8" if len(label) <= 8 else ("9-14" if len(label) <= 14 else "15+") buckets[key][0] += ok buckets[key][1] += 1 model.train() parts = " ".join(f"{k}:{buckets[k][0]}/{buckets[k][1]}" for k in ("1-8", "9-14", "15+") if buckets[k][1]) return solved / max(len(rows), 1), parts
def build_model(args): from transformers import LlamaConfig, LlamaForCausalLM
cfg = LlamaConfig( vocab_size=T.VOCAB_SIZE, hidden_size=args.hidden, intermediate_size=args.hidden * 4, num_hidden_layers=args.layers, num_attention_heads=args.heads, num_key_value_heads=args.heads, max_position_embeddings=T.MAX_SEQ, rms_norm_eps=1e-5, pad_token_id=T.PAD, bos_token_id=T.BOS, eos_token_id=T.EOS, tie_word_embeddings=True, ) return LlamaForCausalLM(cfg)
def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument("--data", required=True) p.add_argument("--val-data", default="", help="Held-out set; defaults to a slice of --data.") p.add_argument("--limit", type=int, default=0) p.add_argument("--hidden", type=int, default=256) p.add_argument("--layers", type=int, default=6) p.add_argument("--heads", type=int, default=8) p.add_argument("--batch-size", type=int, default=256) p.add_argument("--lr", type=float, default=3e-4) p.add_argument("--epochs", type=int, default=1) p.add_argument("--max-steps", type=int, default=0) p.add_argument("--warmup", type=int, default=200) p.add_argument("--eval-every", type=int, default=500) p.add_argument("--eval-n", type=int, default=256) p.add_argument("--out", default="checkpoints/cube") p.add_argument("--hub-repo", default="", help="Push checkpoints here (e.g. user/tiny-cube).") p.add_argument("--seed", type=int, default=0) p.add_argument("--resume", default="", help="Checkpoint to continue from (local dir or Hub repo id).") args = p.parse_args()
torch.manual_seed(args.seed) random.seed(args.seed) device = "cuda" if torch.cuda.is_available() else "cpu"
rows = load_jsonl(args.data, args.limit) if args.val_data: val = load_jsonl(args.val_data, args.eval_n) else: split = max(len(rows) - args.eval_n, 1) rows, val = rows[:split], rows[split:] print(f"train {len(rows)} | val {len(val)} | device {device}", flush=True)
# Resuming matters on a preemptible box: a reclaimed instance otherwise # restarts a multi-hour run from random init. Weights come back from the Hub, # which is why checkpoints are pushed there rather than kept only on disk. # Optimizer state is not restored -- only the weights -- so the LR schedule # restarts; that costs a little progress but keeps the checkpoint portable. if args.resume: from transformers import LlamaForCausalLM model = LlamaForCausalLM.from_pretrained(args.resume).to(device) print(f"resumed from {args.resume}", flush=True) else: model = build_model(args).to(device) n_params = sum(p.numel() for p in model.parameters()) print(f"params {n_params/1e6:.1f}M", flush=True)
loader = DataLoader(CubeDataset(rows), batch_size=args.batch_size, shuffle=True, collate_fn=collate, drop_last=True, num_workers=2) steps = args.max_steps or len(loader) * args.epochs opt = torch.optim.AdamW(model.parameters(), lr=args.lr, weight_decay=0.1, betas=(0.9, 0.95)) sched = torch.optim.lr_scheduler.LambdaLR( opt, lambda s: min((s + 1) / max(args.warmup, 1), 1.0) * 0.5 * (1 + math.cos(math.pi * min(s / max(steps, 1), 1.0))))
# bf16 needs Ampere or newer. Falling back to fp16 rather than assuming, so a # cheaper pre-Ampere box (T4, V100, P100) trains correctly instead of silently # producing garbage or refusing to start. use_amp = device == "cuda" amp_dtype = torch.bfloat16 if use_amp and not torch.cuda.is_bf16_supported(): amp_dtype = torch.float16 print("bf16 unsupported on this GPU; using fp16", flush=True) scaler = torch.amp.GradScaler("cuda", enabled=use_amp and amp_dtype is torch.float16) Path(args.out).mkdir(parents=True, exist_ok=True) step, t0, best = 0, time.time(), -1.0 done = False
while not done: for ids, labels, mask in loader: ids, labels, mask = ids.to(device), labels.to(device), mask.to(device) with torch.autocast("cuda", dtype=amp_dtype, enabled=use_amp): loss = model(input_ids=ids, attention_mask=mask, labels=labels).loss scaler.scale(loss).backward() scaler.unscale_(opt) torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) scaler.step(opt) scaler.update() sched.step() opt.zero_grad(set_to_none=True) step += 1
if step % 50 == 0: print(f"step {step}/{steps} loss {loss.item():.4f} " f"lr {sched.get_last_lr()[0]:.2e} {step/(time.time()-t0):.1f} it/s", flush=True)
if step % args.eval_every == 0 or step == steps: rate, breakdown = solve_rate(model, val, device) print(f" step {step} SOLVE RATE {rate:.1%} ({len(val)} held out) " f"by solution length: {breakdown}", flush=True) # Always keep the latest weights, and additionally keep the best. # Saving only on improvement silently threw away 22,000 steps on the # first real run: the holdout metric is saturated (see solve_rate), # so it peaked mid-run and every later checkpoint -- including the # final one -- was discarded. A metric that cannot distinguish two # models must not be the thing that chooses between them. model.save_pretrained(args.out) if rate >= best: best = rate model.save_pretrained(f"{args.out}-best") if args.hub_repo: try: model.push_to_hub(args.hub_repo, commit_message=f"step {step} solve {rate:.3f}") except Exception as e: print(f" hub push failed (continuing): {e}", flush=True)
if step >= steps: done = True break
print(f"done. best solve rate {best:.1%}. final weights in {args.out}, " f"best-scoring in {args.out}-best", flush=True)
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216"""Trains a value function: cube state -> distance to solved.
## Why this and not another policy
Four attempts to make a sequence-predicting policy reach past ~8 moves allfailed (capacity, depth, chunked inference, training on its own rollouts), andbeam search over that policy raised depth 6 to 94% while leaving depth 15+ atexactly zero. Beam search explores only what the policy already ranks highly; ithas no independent notion of which states are closer to solved, so where thepolicy is wrong there is nothing better to find.
A value function supplies that missing compass. This is DeepCubeA's shape(Agostinelli et al., Nature MI 2019), which solves the full cube with a networkof roughly this size by learning distance-to-solved and searching over it.
## Why this is cheaper here than in the paper
DeepCubeA has no expert, so it bootstraps the value function by approximatevalue iteration -- expensive, and the bulk of its compute. We *do* have anexpert: Kociemba's solution length is the distance, and every training rowalready carries it. So this is plain supervised learning on labels we generatefor free.
The labels are Kociemba two-phase lengths, which are upper bounds rather thantrue optimal distances. That makes the heuristic inadmissible (A* over it is notguaranteed optimal), which does not matter here: the goal is to find *a*solution, not the shortest. The lengths were separately confirmed monotonic alongsolution paths, so the signal is consistent.
## Classification, not regression
Distance is predicted as a distribution over 0..MAX_DIST rather than a scalar.Regression to a mean is actively harmful on this task: the state space isoverwhelmingly distance 18-21, so a squared-error model collapses toward thatmode and loses exactly the near-solved discrimination the search depends on.
**The number to watch is mean absolute error.** Search needs the heuristic torank neighbouring states correctly; at MAE around 1 move that works, and at MAEof several moves it cannot, whatever the loss curve says."""import argparse, json, math, random, sys, timefrom collections import defaultdictfrom pathlib import Path
import torchimport torch.nn.functional as Ffrom torch.utils.data import Dataset, DataLoader
sys.path.insert(0, str(Path(__file__).parent))import cube_tokenizer as T
MAX_DIST = 26
class ValueDataset(Dataset): def __init__(self, rows): self.rows = rows
def __len__(self): return len(self.rows)
def __getitem__(self, i): state, dist = self.rows[i] return torch.tensor(T.encode_state(state)), torch.tensor(dist)
def load_value_rows(path, limit=0): """Label is the solution length -- the distance -- regardless of how the row was generated, so augmented and canonical rows are equally usable.""" rows = [] with open(path) as fh: for line in fh: if limit and len(rows) >= limit: break r = json.loads(line) d = len(r["solution"].split()) if 0 < d <= MAX_DIST: rows.append((r["state"], d)) return rows
class ValueNet(torch.nn.Module): """Llama encoder over the 56-token state, mean-pooled, then a distance head."""
def __init__(self, hidden, layers, heads): super().__init__() from transformers import LlamaConfig, LlamaModel cfg = LlamaConfig( vocab_size=T.VOCAB_SIZE, hidden_size=hidden, intermediate_size=hidden * 4, num_hidden_layers=layers, num_attention_heads=heads, num_key_value_heads=heads, max_position_embeddings=T.MAX_SEQ, pad_token_id=T.PAD, ) self.encoder = LlamaModel(cfg) self.head = torch.nn.Linear(hidden, MAX_DIST + 1)
def forward(self, ids): h = self.encoder(input_ids=ids).last_hidden_state.mean(dim=1) return self.head(h)
@torch.no_grad()def evaluate(model, rows, device, batch_size=512): """Reports MAE and exact-match, plus MAE split by distance band.
The split matters: an aggregate MAE can look fine while the near-solved band -- the only place the heuristic has to be sharp for search to make progress -- is useless. """ model.eval() abs_err, exact, n = 0.0, 0, 0 bands = defaultdict(lambda: [0.0, 0]) for i in range(0, len(rows), batch_size): chunk = rows[i:i + batch_size] ids = torch.tensor([T.encode_state(s) for s, _ in chunk], device=device) true = torch.tensor([d for _, d in chunk], device=device) pred = model(ids).argmax(-1) err = (pred - true).abs().float() abs_err += err.sum().item() exact += (pred == true).sum().item() n += len(chunk) for e, t in zip(err.tolist(), true.tolist()): key = "1-8" if t <= 8 else ("9-14" if t <= 14 else "15+") bands[key][0] += e bands[key][1] += 1 model.train() parts = " ".join(f"{k}:{bands[k][0]/bands[k][1]:.2f}" for k in ("1-8", "9-14", "15+") if bands[k][1]) return abs_err / n, exact / n, parts
def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument("--data", required=True) p.add_argument("--val-data", default="") p.add_argument("--limit", type=int, default=0) p.add_argument("--hidden", type=int, default=512) p.add_argument("--layers", type=int, default=8) p.add_argument("--heads", type=int, default=8) p.add_argument("--batch-size", type=int, default=1024) p.add_argument("--lr", type=float, default=6e-4) p.add_argument("--max-steps", type=int, default=30000) p.add_argument("--warmup", type=int, default=200) p.add_argument("--eval-every", type=int, default=1000) p.add_argument("--eval-n", type=int, default=4096) p.add_argument("--out", default="checkpoints/value") p.add_argument("--hub-repo", default="") p.add_argument("--seed", type=int, default=0) args = p.parse_args()
torch.manual_seed(args.seed) random.seed(args.seed) device = "cuda" if torch.cuda.is_available() else "cpu"
rows = load_value_rows(args.data, args.limit) val = load_value_rows(args.val_data, args.eval_n) if args.val_data else rows[-args.eval_n:] if not args.val_data: rows = rows[:-args.eval_n] print(f"train {len(rows)} | val {len(val)} | device {device}", flush=True)
model = ValueNet(args.hidden, args.layers, args.heads).to(device) print(f"params {sum(q.numel() for q in model.parameters())/1e6:.1f}M", flush=True)
loader = DataLoader(ValueDataset(rows), batch_size=args.batch_size, shuffle=True, drop_last=True, num_workers=2) opt = torch.optim.AdamW(model.parameters(), lr=args.lr, weight_decay=0.1, betas=(0.9, 0.95)) sched = torch.optim.lr_scheduler.LambdaLR( opt, lambda s: min((s + 1) / max(args.warmup, 1), 1.0) * 0.5 * (1 + math.cos(math.pi * min(s / max(args.max_steps, 1), 1.0)))) use_amp = device == "cuda" amp_dtype = torch.bfloat16 if (use_amp and torch.cuda.is_bf16_supported()) else torch.float16 scaler = torch.amp.GradScaler("cuda", enabled=use_amp and amp_dtype is torch.float16)
Path(args.out).mkdir(parents=True, exist_ok=True) step, t0, best = 0, time.time(), 1e9 while step < args.max_steps: for ids, dist in loader: ids, dist = ids.to(device), dist.to(device) with torch.autocast("cuda", dtype=amp_dtype, enabled=use_amp): loss = F.cross_entropy(model(ids), dist) scaler.scale(loss).backward() scaler.unscale_(opt) torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) scaler.step(opt) scaler.update() sched.step() opt.zero_grad(set_to_none=True) step += 1 if step % 100 == 0: print(f"step {step}/{args.max_steps} loss {loss.item():.4f} " f"{step/(time.time()-t0):.1f} it/s", flush=True) if step % args.eval_every == 0 or step >= args.max_steps: mae, exact, parts = evaluate(model, val, device) print(f" step {step} MAE {mae:.3f} moves exact {exact:.1%} " f"by true distance: {parts}", flush=True) torch.save({"state_dict": model.state_dict(), "hidden": args.hidden, "layers": args.layers, "heads": args.heads}, f"{args.out}/value.pt") if mae < best: best = mae torch.save({"state_dict": model.state_dict(), "hidden": args.hidden, "layers": args.layers, "heads": args.heads}, f"{args.out}/value-best.pt") if args.hub_repo: try: from huggingface_hub import HfApi HfApi().upload_file(path_or_fileobj=f"{args.out}/value.pt", path_in_repo="value.pt", repo_id=args.hub_repo) except Exception as e: print(f" hub push failed (continuing): {e}", flush=True) if step >= args.max_steps: break print(f"done. best MAE {best:.3f} moves. weights in {args.out}", flush=True)
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307"""Trains a value function by approximate value iteration -- no solver in the loop.
## Why this replaces the supervised version
`train_value.py` learns distance-to-solved from Kociemba's solution lengths.That reached MAE 1.333 and, with beam search, solved canonical depth 10 at 100%-- but depth 15/20 stayed at 28%/16%, and the reason turned out to be thelabels, not the model:
Kociemba length on uniform random states: 47% are exactly 21, 79% in 20-22.
They are two-phase *upper bounds*, and they cluster. Above distance ~15 there isalmost no label variance to learn from, so nothing can learn to tell adistance-19 state from a distance-21 one. Measured directly: in the 15+ band(85.5% of that holdout) the supervised model scored MAE 1.44 against 0.57 for aconstant that always answers 21 -- 2.5x worse than ignoring the cube. Searchworked where the heuristic was informative and wandered where it was not.
More capacity, steps or data cannot fix a label that carries no information.
## The method (DeepCubeA's DAVI, Agostinelli et al., Nature MI 2019)
Bootstrap the targets instead of labelling them. For a state s, its cost-to-gois one move plus the best of its successors:
J(s) = 0 if s is solved J(s) = min over a of (1 + J_target(s')) otherwise
Start from a randomly initialised net and iterate. Accuracy radiates outwardfrom the solved state: once distance-1 states are right, distance-2 statesbecome learnable, and so on. The targets are real distances the net discovers,not a solver's upper bounds, so they stay informative at every distance -- whichis precisely what the supervised labels stopped being past 15.
Two details that make it converge rather than chase itself:
- **A target network.** Targets come from a frozen copy, refreshed only when the training loss falls below `--update-threshold`. Bootstrapping against the live net is the standard way this diverges.- **Regression, not classification.** `train_value.py` argues for classification because a squared-error model collapses toward the 18-21 mode of the *Kociemba label* distribution. That argument does not transfer: these targets are bootstrapped and spread across the whole range, and DAVI's `min` needs a scalar it can compare and add 1 to.
## What to watch
Not the loss -- it is measured against a moving target, so it says little aboutquality. **Watch the greedy solve rate**, reported per canonical depth bucket.That is the heuristic doing the actual job: descend to the lowest-valued childeach step and see whether it reaches solved. It needs no labels, which is thepoint, since out here there is no ground-truth distance to compare against."""import argparse, json, sys, timefrom pathlib import Path
import numpy as npimport torchimport torch.nn.functional as F
sys.path.insert(0, str(Path(__file__).parent))import cube_ops as Cimport cube_tokenizer as T
class ValueNet(torch.nn.Module): """Llama encoder over the 54-facelet state, mean-pooled, to one scalar."""
def __init__(self, hidden, layers, heads): super().__init__() from transformers import LlamaConfig, LlamaModel cfg = LlamaConfig( vocab_size=T.VOCAB_SIZE, hidden_size=hidden, intermediate_size=hidden * 4, num_hidden_layers=layers, num_attention_heads=heads, num_key_value_heads=heads, max_position_embeddings=T.MAX_SEQ, pad_token_id=T.PAD, ) self.encoder = LlamaModel(cfg) self.head = torch.nn.Linear(hidden, 1)
def forward(self, ids): h = self.encoder(input_ids=ids).last_hidden_state.mean(dim=1) return self.head(h).squeeze(-1)
# Colour-index -> token-id lookup, taken from the tokenizer so the array path and# T.encode_state produce byte-identical sequences (verified in tests)._COLOR_IDS = np.array(T.COLOR_IDS, dtype=np.int64)
# The tokenizer's encode_state wraps a state in BOS/SEP for the seq2seq policy.# Reused unchanged so a state has one encoding across every model here.def encode_batch(states: np.ndarray, device): """(N, 54) uint8 facelet indices -> (N, MAX) token ids on `device`.""" toks = _COLOR_IDS[states.astype(np.int64)] bos = np.full((len(states), 1), T.BOS, dtype=np.int64) sep = np.full((len(states), 1), T.SEP, dtype=np.int64) return torch.from_numpy(np.concatenate([bos, toks, sep], axis=1)).to(device)
@torch.no_grad()def value_of(net, states: np.ndarray, device, batch_size=4096, amp=True): """Scalar value per state, in eval mode, batched.""" net.eval() out = np.empty(len(states), dtype=np.float32) for i in range(0, len(states), batch_size): chunk = states[i:i + batch_size] ids = encode_batch(chunk, device) with torch.autocast("cuda", dtype=torch.bfloat16, enabled=amp and device == "cuda"): v = net(ids) out[i:i + len(chunk)] = v.float().cpu().numpy() net.train() # A solved state is worth 0 by definition, never by prediction: the search # and the targets both lean on that being exact. out[C.is_solved(states)] = 0.0 return np.maximum(out, 0.0)
def davi_targets(target_net, states: np.ndarray, device, amp=True): """J(s) = min over the 18 moves of (1 + J_target(s')), and 0 where s is solved.""" kids = C.all_children(states) # (N, 18, 54) flat = kids.reshape(-1, 54) v = value_of(target_net, flat, device, amp=amp).reshape(len(states), C.NUM_MOVES) # A move onto the solved state costs exactly 1 and nothing more, regardless # of what the net thinks of the solved state. solved_kid = C.is_solved(flat).reshape(len(states), C.NUM_MOVES) v = np.where(solved_kid, 0.0, v) tgt = (1.0 + v).min(axis=1) tgt[C.is_solved(states)] = 0.0 return tgt.astype(np.float32)
@torch.no_grad()def greedy_solve_rate(net, device, depths, n_per_depth, rng, max_steps=40, amp=True): """Fraction of scrambles solved by descending to the lowest-valued child.
The honest metric for this trainer: no labels involved, and it is the heuristic doing the job search will ask of it. Every scramble at every depth is stepped in one batch, so this costs a handful of forward passes rather than one per puzzle. """ out = {} for d in depths: states = _walk_exact(n_per_depth, d, rng) done = C.is_solved(states) for _ in range(max_steps): live = np.where(~done)[0] if not len(live): break kids = C.all_children(states[live]) flat = kids.reshape(-1, 54) v = value_of(net, flat, device, amp=amp).reshape(len(live), C.NUM_MOVES) best = v.argmin(axis=1) states[live] = kids[np.arange(len(live)), best] done[live] = C.is_solved(states[live]) out[d] = float(done.mean()) return out
def _walk_exact(n, depth, rng): """n states each from a walk of exactly `depth` moves.""" states = np.repeat(C.SOLVED_ARR[None, :], n, axis=0) prev = np.full(n, -1) for _ in range(depth): mv = rng.integers(0, C.NUM_MOVES, size=n) clash = (mv // 3) == prev while clash.any(): mv[clash] = rng.integers(0, C.NUM_MOVES, size=int(clash.sum())) clash = (mv // 3) == prev states = states[np.arange(n)[:, None], C.PERMS[mv]] prev = mv // 3 return states
def main(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) p.add_argument("--hidden", type=int, default=512) p.add_argument("--layers", type=int, default=8) p.add_argument("--heads", type=int, default=8) p.add_argument("--batch-size", type=int, default=1024) p.add_argument("--lr", type=float, default=3e-4) p.add_argument("--max-steps", type=int, default=100000) p.add_argument("--scramble-depth", type=int, default=30, help="States are sampled from walks of 1..this many moves. Past " "~20 every state is fully mixed (God's Number), so a larger " "value buys nothing.") p.add_argument("--update-threshold", type=float, default=0.05, help="Refresh the target network once training loss falls below " "this. Lower is more stable and slower.") p.add_argument("--min-update-steps", type=int, default=500, help="Never refresh the target network more often than this, so " "an early lucky batch cannot ratchet it forward.") p.add_argument("--eval-every", type=int, default=2000) p.add_argument("--eval-n", type=int, default=200) p.add_argument("--eval-depths", default="3,6,10,15,20") p.add_argument("--out", default="checkpoints/value_iter") p.add_argument("--hub-repo", default="") p.add_argument("--upload-every", type=int, default=1, help="Push to the Hub every N evals that improve on the best " "mean greedy solve rate. The point is that a run can be " "stopped the moment its frontier plateaus without losing " "the model -- an end-of-run-only upload makes stopping " "early cost the whole run.") p.add_argument("--seed", type=int, default=0) args = p.parse_args()
device = "cuda" if torch.cuda.is_available() else "cpu" amp = device == "cuda" torch.manual_seed(args.seed) rng = np.random.default_rng(args.seed)
net = ValueNet(args.hidden, args.layers, args.heads).to(device) target_net = ValueNet(args.hidden, args.layers, args.heads).to(device) target_net.load_state_dict(net.state_dict()) for q in target_net.parameters(): q.requires_grad_(False)
params = sum(q.numel() for q in net.parameters()) print(f"value-iteration net: {params/1e6:.1f}M params | {device} | " f"batch {args.batch_size} | walk depth 1..{args.scramble_depth}", flush=True)
opt = torch.optim.AdamW(net.parameters(), lr=args.lr) eval_depths = [int(d) for d in args.eval_depths.split(",")] out_dir = Path(args.out) out_dir.mkdir(parents=True, exist_ok=True)
api = None if args.hub_repo: import os from huggingface_hub import HfApi api = HfApi(token=os.environ.get("HF_TOKEN"))
def publish(tag): if api is None: return try: api.upload_folder(repo_id=args.hub_repo, folder_path=str(out_dir), path_in_repo="checkpoints/value_iter") print(f" uploaded ({tag})", flush=True) except Exception as e: # A transient Hub failure must not kill a run that is otherwise fine; # the next improvement retries, and the local copy is still on disk. print(f" upload failed ({tag}): {type(e).__name__}: {e}", flush=True)
best = -1.0 improved = 0 updates = 0 last_update = 0 run = [] t0 = time.time() for step in range(1, args.max_steps + 1): states, _ = C.random_walk(args.batch_size, args.scramble_depth, rng) tgt = davi_targets(target_net, states, device, amp=amp)
ids = encode_batch(states, device) y = torch.from_numpy(tgt).to(device) with torch.autocast("cuda", dtype=torch.bfloat16, enabled=amp): pred = net(ids) loss = F.mse_loss(pred.float(), y) opt.zero_grad(set_to_none=True) loss.backward() torch.nn.utils.clip_grad_norm_(net.parameters(), 1.0) opt.step()
l = loss.item() if l < args.update_threshold and step - last_update >= args.min_update_steps: target_net.load_state_dict(net.state_dict()) updates += 1 last_update = step print(f" step {step}: target net updated (#{updates}, loss {l:.4f})", flush=True)
if step % 100 == 0: print(f"step {step}/{args.max_steps} loss {l:.4f} " f"tgt_updates {updates} {step/(time.time()-t0):.1f} it/s", flush=True)
if step % args.eval_every == 0 or step == args.max_steps: rates = greedy_solve_rate(net, device, eval_depths, args.eval_n, np.random.default_rng(12345), amp=amp) parts = " ".join(f"d{d}:{r:.0%}" for d, r in rates.items()) mean = float(np.mean(list(rates.values()))) print(f" step {step} greedy solve {parts} | mean {mean:.1%}", flush=True) run.append({"step": step, "loss": l, "target_updates": updates, "greedy": rates, "mean": mean}) torch.save({"model": net.state_dict(), "hidden": args.hidden, "layers": args.layers, "heads": args.heads, "step": step}, out_dir / "value_iter.pt") (out_dir / "history.json").write_text(json.dumps(run, indent=2)) if mean > best: best = mean improved += 1 torch.save({"model": net.state_dict(), "hidden": args.hidden, "layers": args.layers, "heads": args.heads, "step": step}, out_dir / "value_iter_best.pt") if improved % args.upload_every == 0: publish(f"step {step}, mean {mean:.1%}")
print(f"done. best mean greedy solve rate {best:.1%}. weights in {out_dir}", flush=True)
publish("final")
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250#!/usr/bin/env bash# Provisions a vast.ai instance and runs the full pipeline: generate -> verify -># train -> push to the Hub. Written to be re-runnable: a reclaimed instance can be# replaced and this script started again from scratch.## Expects, in the environment:# HF_TOKEN write token, for checkpoint pushes# HUB_REPO e.g. yourname/tiny-cube-solver# Optional: PAIRS (default 10000000), STEPS, HIDDEN, LAYERSset -euo pipefail
PAIRS="${PAIRS:-10000000}"STEPS="${STEPS:-40000}"HIDDEN="${HIDDEN:-384}"LAYERS="${LAYERS:-8}"CORES="$(nproc)"
echo "=== $CORES cores, $(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null || echo 'no GPU') ==="
# Build against SYSTEM python, not the image's conda python. kociemba ships a C# extension and a pure-Python fallback, and it falls back *silently* when the# extension cannot build -- which is what happens if the venv's interpreter has no# matching dev headers. python3-dev is therefore not optional here.apt-get update -qq# libffi-dev is the one that actually matters and is the least obvious: kociemba's# native extension is built through cffi, which needs ffi.h. Without it the# compile dies with "fatal error: ffi.h: No such file or directory", kociemba# installs its pure-Python fallback instead, and pip still exits 0.apt-get install -y -qq build-essential python3-dev python3-venv libffi-dev git# Prefer python3.11. kociemba 1.2.1 builds its C extension cleanly on 3.11 (the# version this repo is developed against) but silently produces no extension on# the 3.10 that ships as system python in the Ubuntu 22.04 based images -- pip# still reports success, so the only symptom is the fallback. The PyTorch images# carry a conda 3.11, so prefer that and fall back to system python.PYBIN=""for cand in /opt/conda/bin/python3.11 /opt/conda/bin/python "$(command -v python3.11 || true)" /usr/bin/python3; do [ -x "$cand" ] || continue if "$cand" -c 'import sys; sys.exit(0 if sys.version_info[:2] >= (3,11) else 1)' 2>/dev/null; then PYBIN="$cand"; break fidone[ -z "$PYBIN" ] && PYBIN=/usr/bin/python3echo "building venv from $PYBIN ($($PYBIN -V 2>&1))""$PYBIN" -m venv /opt/venv/opt/venv/bin/pip install -q --upgrade pip# kociemba's setup.py predates modern setuptools' removal of install_layout./opt/venv/bin/pip install -q "setuptools<60" wheel# Full output, not a tail: when the C extension fails to build, kociemba still# installs successfully (as pure Python), so the compiler error is the only# evidence of what went wrong and it must not be truncated away./opt/venv/bin/pip install --no-build-isolation kociemba 2>&1 | tail -40
# Last resort before giving up: build from the upstream git source, whose build# metadata is newer than the 2017 PyPI sdist.if ! /opt/venv/bin/python -c "import kociemba.ckociembawrapper" 2>/dev/null; then echo "=== sdist build produced no extension; trying upstream git ===" /opt/venv/bin/pip install --force-reinstall --no-build-isolation \ "git+https://github.com/muodov/kociemba.git" 2>&1 | tail -15 || truefi
if ! /opt/venv/bin/python -c "import kociemba.ckociembawrapper" 2>/dev/null; then echo "=== NATIVE BUILD FAILED -- diagnostics ===" echo "python: $(/opt/venv/bin/python -V 2>&1) at $(/opt/venv/bin/python -c 'import sys;print(sys.executable)')" echo "gcc: $(gcc --version 2>&1 | head -1)" echo "includes: $(/opt/venv/bin/python -c 'import sysconfig;print(sysconfig.get_paths()["include"])')" ls -l "$(/opt/venv/bin/python -c 'import sysconfig;print(sysconfig.get_paths()["include"])')/Python.h" 2>&1 || echo " Python.h MISSING" dpkg -l | grep -E "python3.*dev|build-essential" || echo " no dev packages found" echo "=== retrying verbosely ===" /opt/venv/bin/pip install --force-reinstall --no-build-isolation -v kociemba 2>&1 | grep -iE "error|gcc|Python.h|fatal" | head -30fi/opt/venv/bin/pip install -q torch --index-url https://download.pytorch.org/whl/cu128/opt/venv/bin/pip install -q transformers huggingface_hub
# Search evaluation only: skip data generation and training entirely, download a# trained value model and score the state search on the canonical scrambles. The# search needs a GPU -- each solve evaluates beam*18 children per step -- so it# cannot be done from the session container.if [ -n "${EVAL_VALUE_ONLY:-}" ]; then cd "${CODE_DIR:-/workspace/code}" echo "=== evaluating value search from ${EVAL_VALUE_ONLY} ===" /opt/venv/bin/python eval_value_search.py --value "$EVAL_VALUE_ONLY" \ --beam "${SEARCH_BEAM:-64}" --limit-per-depth "${SEARCH_N:-25}" \ ${SEARCH_DEPTHS:+--depths "$SEARCH_DEPTHS"} ${SEARCH_LAM:+--lam "$SEARCH_LAM"} echo "=== done ===" exit 0fi
# Value iteration needs no dataset and no solver: it derives its own targets by# bootstrapping from the solved state. So this mode skips both the kociemba gate# and the multi-million-pair generation that dominates every other run's startup# -- it goes straight from a GPU check to training.if [ -n "${TRAIN_VALUE_ITER:-}" ]; then cd "${CODE_DIR:-/workspace/code}" mkdir -p checkpoints echo "=== GPU check ===" /opt/venv/bin/python - <<'PYVI'import sys, torchif not torch.cuda.is_available(): sys.exit("ABORT: no CUDA device")print(f"gpu: {torch.cuda.get_device_name(0)} sm_{''.join(map(str,torch.cuda.get_device_capability(0)))} " f"{torch.cuda.get_device_properties(0).total_memory/1e9:.0f}GB | torch {torch.__version__}")PYVI echo "=== training value function by value iteration ===" /opt/venv/bin/python train_value_iteration.py \ --hidden "${HIDDEN:-512}" --layers "${LAYERS:-8}" --heads 8 \ --batch-size "${BATCH:-1024}" --lr "${LR:-3e-4}" --max-steps "${STEPS:-30000}" \ --scramble-depth "${WALK_DEPTH:-30}" \ --update-threshold "${UPDATE_THRESHOLD:-0.05}" \ --min-update-steps "${MIN_UPDATE_STEPS:-1000}" \ --eval-every "${EVAL_EVERY:-1000}" --eval-n "${EVAL_N:-200}" \ --out checkpoints/value_iter --hub-repo "${HUB_REPO:-}" echo "=== done ===" exit 0fi
# Hard gate. The pure-Python fallback is ~50x slower, so generating this dataset# with it would take days rather than hours -- and the only symptom is a warning# buried in the log while the meter runs. Fail here instead.echo "=== verifying native kociemba ==="/opt/venv/bin/python - <<'PYCHECK'import sys, timeimport kociembafrom kociemba import ckociembawrapper # absent entirely when the C build failedSOLVED = "".join("URFDLB"[i // 9] for i in range(54))kociemba.solve("DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD")t = time.time()for _ in range(20): kociemba.solve("DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD")ms = (time.time() - t) / 20 * 1000print(f"kociemba: {ms:.1f} ms/solve (native)")if ms > 200: sys.exit(f"ABORT: {ms:.0f} ms/solve is fallback-speed; refusing to generate")PYCHECK
cd "${CODE_DIR:-/workspace/code}"mkdir -p data checkpoints
# Smoke-test the GPU *before* generating anything. A torch build without kernels# for this GPU fails only when the first tensor op runs, which used to be training# -- so an unusable GPU was discovered an hour and a full dataset later. This# runs the real model for one forward and backward pass, so it catches missing# kernels rather than merely that a device is visible.echo "=== verifying GPU can run the model ==="/opt/venv/bin/python - <<PYCHECKimport sys, torchif not torch.cuda.is_available(): sys.exit("ABORT: no CUDA device visible")name = torch.cuda.get_device_name(0)cap = torch.cuda.get_device_capability(0)vram = torch.cuda.get_device_properties(0).total_memory / 1e9print(f"gpu: {name} sm_{cap[0]}{cap[1]} {vram:.0f}GB | torch {torch.__version__} | arch {torch.cuda.get_arch_list()}")try: from transformers import LlamaConfig, LlamaForCausalLM # The REAL config and batch size. A scaled-down probe is worse than useless # here: it passes on a GPU that cannot hold the actual model, so the OOM # surfaces only after data generation has already been paid for. cfg = LlamaConfig(vocab_size=28, hidden_size=$HIDDEN, intermediate_size=$HIDDEN * 4, num_hidden_layers=$LAYERS, num_attention_heads=8, num_key_value_heads=8, max_position_embeddings=83, tie_word_embeddings=True) m = LlamaForCausalLM(cfg).cuda() opt = torch.optim.AdamW(m.parameters(), lr=1e-4) ids = torch.randint(0, 28, ($BATCH, 83), device="cuda") with torch.autocast("cuda", dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16): loss = m(input_ids=ids, labels=ids).loss loss.backward() opt.step() # optimizer state is where the memory actually peaks torch.cuda.synchronize() peak = torch.cuda.max_memory_allocated() / 1e9 print(f"gpu smoke test: full step at batch $BATCH OK, peak {peak:.1f}GB of {vram:.0f}GB")except torch.OutOfMemoryError: sys.exit(f"ABORT: batch $BATCH of a $LAYERS-layer/$HIDDEN-wide model does not fit in {vram:.0f}GB")except Exception as e: sys.exit(f"ABORT: GPU cannot run the model ({type(e).__name__}: {e})")PYCHECK
cd "${CODE_DIR:-/workspace/code}"mkdir -p data checkpoints
# Generation is the wall-clock bottleneck, not training -- use every core.echo "=== generating $PAIRS pairs on $CORES cores ==="# --workers 0 detects the cgroup quota. --augment takes several states from each# solution path, so one Kociemba solve yields several pairs: an ~8x cut in solves,# which is the actual bottleneck. It also samples distance-to-solved far more# evenly than uniform states do (those are ~95% distance-18-to-20), which happens# to match a benchmark whose buckets run from depth 3 upward./opt/venv/bin/python gen_data.py --count "$PAIRS" --workers 0 --augment 8 --out data/train.jsonl
# A separate seed, and canonical labels only: the holdout must reflect the real# task, not the augmented training mix, or the reported solve rate is inflated.echo "=== generating canonical holdout ==="# Holdout stays unaugmented and uniform: the hard case. Scoring against the# augmented mix would flatter the model, since those states sit partway along a# solution path and are nearer to solved.# --shards 32 fixes the shard count so the holdout is byte-identical on every# machine. Without it the per-shard seeds follow the core count, so two boxes# comparing two models evaluate them against merely similar holdouts rather than# the same one -- silently downgrading a paired comparison to an unpaired one,# exactly where the pairing matters most./opt/venv/bin/python gen_data.py --count 20000 --workers 0 --shards 32 --seed 999999 \ --augment 0 --out data/val.jsonl
# DAgger phase: if ROLLOUT_FROM names a checkpoint, roll that policy out, label# the states it actually reaches, and append them to the training set.## The model is otherwise trained only on states from the sampler and never on the# ones its own attempts produce -- which is where it measurably fails, walking# from 10 moves out to 18 and staying there. Behaviour cloning alone compounds# error quadratically in horizon; training on the policy's own state# distribution is the standard fix.if [ -n "${ROLLOUT_FROM:-}" ]; then echo "=== rolling out ${ROLLOUT_FROM} for ${ROLLOUT_PAIRS:-2000000} states ===" /opt/venv/bin/python gen_rollout_data.py --checkpoint "$ROLLOUT_FROM" \ --count "${ROLLOUT_PAIRS:-2000000}" --batch-size "${ROLLOUT_BATCH:-2048}" --rounds 4 \ --out data/rollout.jsonl /opt/venv/bin/python verify_data.py data/rollout.jsonl --limit 20000 cat data/rollout.jsonl >> data/train.jsonl echo "=== training set is now $(wc -l < data/train.jsonl) pairs ==="fi
echo "=== verifying (must report 0 FAILED) ==="/opt/venv/bin/python verify_data.py data/train.jsonl --limit 100000/opt/venv/bin/python verify_data.py data/val.jsonl
# TRAIN_VALUE switches the objective from "emit a solution" to "estimate distance# to solved". The policy shape has been shown four times over not to reach past# ~8 moves; this is the heuristic that lets search steer. Same data either way --# the label is just the solution length instead of the solution.
if [ -n "${TRAIN_VALUE:-}" ]; then echo "=== training value function ===" /opt/venv/bin/python train_value.py \ --data data/train.jsonl --val-data data/val.jsonl \ --hidden "$HIDDEN" --layers "$LAYERS" --heads 8 \ --batch-size "${BATCH:-1024}" --lr 6e-4 --max-steps "$STEPS" \ --eval-every 1000 --eval-n 8192 \ --out checkpoints/value --hub-repo "${HUB_REPO:-}" echo "=== done ===" exit 0fi
echo "=== training ==="/opt/venv/bin/python train.py \ --data data/train.jsonl --val-data data/val.jsonl \ --hidden "$HIDDEN" --layers "$LAYERS" --heads 8 \ --batch-size "${BATCH:-1024}" --lr 6e-4 --max-steps "$STEPS" \ --eval-every 1000 --eval-n 512 \ --out checkpoints/cube --hub-repo "${HUB_REPO:-}" ${RESUME:+--resume "$RESUME"}
echo "=== done ==="12345678910111213141516171819202122232425262728293031323334353637383940414243"""Checks a generated dataset by replaying it: applies each recorded solution to itsrecorded state and confirms the cube ends solved.
This is the one check worth running on every dataset before training on it. Agenerator bug that corrupts states or mislabels them is silent otherwise -- themodel simply learns the wrong function and the failure only surfaces much later,as a bad benchmark number that looks like a modelling problem."""import argparse, json, sysfrom gen_data import SOLVED, apply_sequence
def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument("path") p.add_argument("--limit", type=int, default=0, help="Check only the first N rows (0 = all).") args = p.parse_args()
checked = failed = 0 lengths = [] with open(args.path) as fh: for line in fh: if args.limit and checked >= args.limit: break row = json.loads(line) if len(row["state"]) != 54: failed += 1 continue moves = row["solution"].split() lengths.append(len(moves)) if apply_sequence(row["state"], moves) != SOLVED: failed += 1 checked += 1
mean = sum(lengths) / len(lengths) if lengths else 0 print(f"checked {checked}, solved {checked - failed}, FAILED {failed}") print(f"solution length: mean {mean:.2f} min {min(lengths, default=0)} max {max(lengths, default=0)}") sys.exit(1 if failed else 0)
if __name__ == "__main__": main()code/cube_ops.pyAdded+100
code/cube_tokenizer.pyAdded+93
code/eval_canonical.pyAdded+113
code/eval_value_search.pyAdded+100
code/fixtures/canonical_states.jsonAdded+1
code/fixtures/prompt_pairs.jsonAdded+74
code/gen_data.pyAdded+287
code/gen_rollout_data.pyAdded+152
code/run_benchmark.shAdded+68
code/search.pyAdded+89
code/serve.pyAdded+305
code/test_serve.pyAdded+48
code/train.pyAdded+253
code/train_value.pyAdded+216
code/train_value_iteration.pyAdded+307
code/vast_bootstrap.shAdded+250
code/verify_data.pyAdded+43