Skip to content

Hyper Puzzle Notation

This is a draft

This document is NOT final and might be outdated! Before making anything based on this (including software, documentation, or learning resources), please ping Hactar and/or Luna.

Syntax

Syntax is the same across all puzzles, so that a move sequence may be unambiguously parsed without first selecting a puzzle. Some semantics are shared.

Node

A node is a unit of notation.

Some nodes are repeatable, which means that they can be repeated and/or inverted using a multiplier immediately after them.

Move

A move is a node representing a twist or rotation of the puzzle. It has four components:

Moves are repeatable.

Layer mask

A layer mask is an optional tilde ~ optionally followed by one of the following:

  • Positive integer.
    • Example: 3R means “R on the 3rd layer”
  • Range of positive integers separated by -.
    • Example: 2-4R means “R on layers 2, 3, and 4”
  • Curly braces with positive and negative integers and ranges separated by ...
    • Example: {2..4}R means “R on layers 2, 3, and 4” (equivalent to 2-4R)
    • Example: {1,3..5,7}R means “R on layers 1, 3, 4, 5, and 7”
    • Example: {1..-1}R means “R on all layers”
    • Example: {2..-2}D is one generalization of E to NxNxN puzzles with many layers
    • Example: {3,-2}R means “R on layer 3 and the 2nd layer from the other side”

Reversed ranges are the same: {1..-1} is the same as {-1..1} and 1-3 is the same as 3-1.

Family

A move family is a string of uppercase or lowercase Latin or Greek letters and underscores.

Move families on 33 include R, F, Rw, x, etc. Move families on 34 include R, RO, LDBI, wz, etc. Move families on 35 include U, A, Azx, etc.

A move family often represents a complete move (as is the case on 33), but not always. On 34 and 35, move families such as R require a constraint set afterward to specify a complete move.

Constraint set

A constraint set is a set of curly braces {} containing zero or more comma-separated constraints with optional whitespace around them. There are three kinds of constraints:

  • A -> B, which indicates that A must transform to B
  • A <> B, which indicates that A must transform to B and that B must transform to A
  • A, which indicates that A must transform to itself

A and B here may be any move families.

For example, I{F->U, R->P} represents a double rotation twist on 35. When a transform is underconstrained, the “simplest” transform that matches the constraints is typically correct. (This should only be used for moves where there is an obvious answer.)

This also allows writing moves in an abstract or puzzle-general way.

  • Example: R{F->U} represents an R move on 33 and FTO, and an analogous move on all higher-dimensional 3n

Rotation

A rotation is a node representing a rotation of the whole puzzle. It is similar to a move, but it has no layer mask and the family is optional. A rotation has three components:

Examples:

  • @R is a rotation that moves like an R move.
  • @{F->U} is a rotation that takes F to U.

Rotations are repeatable.

Why @?
  • It’s a mnemonic for “all.”
  • It looks round, like a rotation.
  • It’s not already in use, and is unlikely to be used for anything else.

Pause

A pause is a node representing a pause. It is written using ..

Pauses are sometimes used for reconstruction of speedsolves.

Pauses are not repeatable.

Group

A group is a sequence of nodes surrounded by parentheses (), with an optional symbol before the opening parenthesis. There are four kinds of groups:

  • Simple groups, which represent a logical grouping
    • Simple groups have no prefix symbol. Example: (R U R' U')
    • A simple group’s move count should be equivalent to the moves on their own.
    • A simple group should affect animation speed slightly or not at all.
  • Macro groups, which represent moves done using a macro in software.
    • Macro groups have ! as a prefix symbol. Example: !(R U R' U')
    • A macro group’s move count should be equivalent to the moves on their own.
    • A macro group should animate very quickly or not at all.
  • Simultaneous groups, which represent moves done simultaneously.
    • Simultaneous groups have & as a prefix symbol. Example: &(U D2)
    • A simultaneous group should count as 1 ETM.
    • A simultaneous group should animate simultaneously if possible. It may animate sequentially, but should take the same amount of time as a single move.
  • NISS groups, which represent moves done on the inverse puzzle state.
    • NISS groups have ^ as a prefix symbol. Example: ^(U F' D2)
    • A NISS group’s move count should be equivalent to the moves on their own.
    • A NISS group’s moves may be animated inverted before the scramble (most useful while constructing a solution) or inverted after the forwards solution (most useful while viewing a completed solution). These two might not be equivalent if the combined scramble + forwards solution + NISS solution is not the identity.

Simultaneous groups must not contain any groups. All other groups may contain any group inside them.

Because groups are a kind of node, they can also have a multiplier after them.

Why don’t macros count as 1 ETM?

Historically, hypercubing fewest-moves has effectively used ETM in whatever program, subject to the types of moves that program allowed. E.g., “MC4DTM” is a shorthand for “ETM, using only moves accessible in MC4D.” This is a common concept that we want to have a name for.

In software where a single move may take multiple mouse clicks or keypresses, ETM is already detached from the number of interactions, which is really the important metric for speedsolving.

Groups are repeatable.

Commutator

A commutator is two sequences of moves in square brackets separated by a comma. Example: [A, B]. It is equivalent to A B A' B'.

Commutators are repeatable.

Conjugate

A conjugate is two sequences of moves in square brackets separated by a comma. Example: [A: B]. It is equivalent to A B A'.

Commutators are repeatable.

Square-1

Square-1 moves are of the form (n, d) (where n and d are signed integers) and /. These cannot be used with layer masks, constraint sets, or multipliers.

Megaminx scrambling

Megaminx scrambling uses the moves R++, R--, D++, and D--. These cannot be used with layer masks, constraint sets, or multipliers.

Multiplier

A multiplier is an optional positive integer and an optional apostrophe ', pronounced “prime,” which negates the multiplier. 2, ', 2', and 42' are all multipliers.

Comment

A line comment starts with // and extends to the next newline. Line comments have no effect on the puzzle.

Conventions

This section defines common conventions for axes and move families. These should be considered when developing notation for new puzzles. These are not strict rules.

  • Uppercase Latin alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Uppercase Greek alphabet: ΓΔΘΛΞΠΣΦΨΩ (Greek letters that are visually similar to Latin letters have been excluded)
  • Lowercase Latin alphabet: abcdefghijklmnopqrstuvwyxz
  • Lowercase Greek alphabet
    • Tall lowercase: βδζθλξ
    • Short lowercase: εηκμπτφψω (Greek letters that are visually similar to Latin letters have been excluded)

Other Greek letters are recommended to NOT be used because they are too similar in appearance to Latin letters.

Uppercase Latin alphabet (semantic)

Letter Common uses
A Anterior (5D+)
B Back (3D-)
C
D Down (2D-)
E Equitorial (2D slice)
F Front (3D+)
G
H
I In (4D-)
J
K
L Left (1D-)
M Middle (1D slice)
N
O Out (4D+)
P Posterior (5D-)
Q
R Right (1D-)
S Standing (3D slice)
T “Top” (generalized F2L)
U Up (2D+), 6th axis
V
W
X
Y
Z

The unused letters here are reserved for execution notation, for variable names, for ad-hoc notation, or for specific puzzles (e.g., X and Y in 120-cell notation1).

Lowercase Latin alphabet (semantic)

  • Specialty uses in 3D notation (rludfb, mes)
  • 3D whole-puzzle rotations (one letter from xyz)
  • 4D+ whole-puzzle rotations (two letters from xyzwvu...)
Letter Common uses
a
b 2Bw
c
d 2Dw
e {2..-2}E
f 2Fw
g
h Half turn (jumbling)
i
j Jumbling turn
k
l 2Lw
m {2..-2}M
n
o
p
q
r 2Rw
s {2..-2}S
t
u 2Uw
v Whole-puzzle rotation around twist/element, 5th axis
w Wide move suffix, 4th axis
x 1st axis
y 2nd axis
z 3rd axis

See Jumbling notation for more about h, j, and k.

In 3D, a single axis letter indicates a rotation around that axis. E.g., y is a rotation around the Y axis from +X to +Z; its inverse is y'.

In 4D+, two axis letters indicates a rotation in that plane from one axis to the other. E.g., zw is a rotation from +Z to +W; its inverse is zw' or wz.

In 5D, two axis letters may be used after an axis name for execution notation.

Sequential alphabet

The letters A-Z are often used to name elements in an ordered sequence, such as the rectangular faces of a polygonal prism. If there are more than 26 names needed, letters from the uppercase Greek alphabet may be added as a prefix, using a base-10 bijective numeration with the digits ΓΔΘΛΞΠΣΦΨΩ:

Letter sequence Number
A 1
B 2
… …
Z 26
ΓA 27
ΓB 28
… …
ΓZ 52
ΔA 53
… …
ΩZ 286

When multiple sets of uppercase letters are needed, they may be distinguished using a lowercase Latin letter as a prefix. If more than 26 prefixes are needed, they may be preceded by a bijective numeration similar to the uppercase letters.

The {100}x{4} duoprism serves as an example of a puzzle that requires more than 26 sequential names.2 It has 104 cells, which in this proposal would be named aA, aB, …, aΘU, aΘV, bA, bB, bC, bD

Lowercase Greek alphabet (sequential)

Lowercase Greek letters are currently unused.

Lowercase Greek alphabet (semantic)

The large lowercase Greek letters are reserved for opposite axis sets. Occasionally, a puzzle will have multiple sets of opposite axes. For example, each face of the Klein Quartic tiling has 2 opposite axes.

Letter Use
β 1st opposite
δ 2nd opposite
ζ …
θ
λ
ξ

For example, βA is the axis opposite from A, on a puzzle where there is otherwise no convenient semantic name for the axis opposite from A. In this usage, β is between the lowercase Latin sequence (if any) and the uppercase Latin sequence. For example, aβA, not βaA.

Cube axes

Cube axes use the following symbols:

Dimension Axis name Side (+/-)
1 X R, L
2 Y U, D
3 Z F, B
4 W O, I
5 V A, P
6 U Γ, Δ
7 Θ, Λ
8 Ξ, Π
9 Σ, Φ
10 Ψ, Ω

These can also serve as letters or letter pairs for when a handful of additional axes are needed and the preferred uppercase Latin letters are unavailable. For example, a megaminx prism (4D) uses I and O for the two additional axes, but if some other 3D puzzle already used those letters then a 4D prism of it could use Γ and Δ for the two additional axes.

Execution notation

Keybinds for high-dimensional puzzles typically assign short (1-2 letter) uppercase names to axes and short (1-2 letter) lowercase names to twist directions. An axis and a twist direction can be combined to specify a move.

Examples:

  • 34 uses the letters x, y, and z after an axis name to specify a twist.
  • n5 and higher dimensions use two of the letters x, y, z, w, v, etc. after an axis name to specify a twist
  • Polygonal duoprisms reuse the hypercube letters I, U, D, F, R, L (all except O and B) to refer to a useful subset of axes.

Jumbling notation

  • h indicates half of a doctrinaire turn (common on Bagua and mixup cubes)
  • j indicates a jumbling angle that is not half of a doctrinaire turn

When there are multiple unique jumbling angles that are not half of a doctrinaire turn, they are labeled ja, jb, … using the lowercase Latin letters. If there are more than 26 jumbling angles, subsequent ones use an uppercase Greek prefix: after jz is jΓa, jΓb, … jΓz, jΔa, etc.

Jumbling labels may be assigned to angles in any order. Generally, shallower jumbling angles should be assigned lower names.

Note that jj is a valid jumbling angle. (It is the tenth jumbling angle.)

Rationale

Why use Greek letters?

In high dimensions, Greek letters become useful.

  • Greek letters provide an extension to the Latin alphabet with more nuanced aesthetics, aiding readability.
    • Greek uppercase letters fit in well with Latin uppercase letters.
    • Greek lowercase letters contrast very strongly with Latin uppercase letters.
      • Short lowercase letters provide a good set of prefixes.
      • Tall lowercase letters are reserved for future use.
  • We want to avoid lowercase letters, because this conflicts with 3D conventions that use lowercase letters for wide moves or inner moves. We also want to avoid uppercase letters with existing uses (M, E, S, P, x, y, z, w, v).
    • This is partially a compatibility concern, but mostly a psychological semantic one. Humans reading lowercase letters may have misconceptions about their uses based on uses in other cubing notation.
  • Greek letters allow us to keep facet names prefix-free while still using single-character names for sequences of 26 elements of fewer.
    • Using only the Latin alphabet, we would get A, B, …, Z, AA (not prefix-free!)
    • We could force names to be 2 letters long when there’s more than 26 of them, but now the rule becomes more complicated.
    • This especially simplifies code to generate these puzzles; generate_nth_uppercase_name() is now a pure function depending only on n and not the total number of names.
  • We want to preserve uppercase letters for ad-hoc definitions, both for nonrigorous communication between humans and for rigorous move input.
  • Writing moves manually using Greek letters is likely to be extremely rare outside a handful of people.
    • E.g., Duoprisms have ASCII execution notation for a common subset of moves.
  • Flat Hypercube already uses Greek letters for hypercubes of dimension 6+:

Why curly-brace layer sets?

It is a very common convention in hypercubing software to hold down any set of number keys to apply a “layer mask” to a move. Given that individual moves may require many characters to write (such as I{F->B,U->R}) it is very awkward to require duplicating this many times.

  • E.g., Suppose we want to write the 74 move {1,3,5,7}IUR using only ridge turns. (This is a contrived example because we do have a way to write edge turns on n4, but on some puzzles these moves can only be easily written using simultaneous move notation.) With layer sets, we can write &({1,3,5,7}IF {1,3,5,7}IR2); without layer sets, we must write &(IF 3IF 5IF 7IF IR2 3IR2 5IR2 7IR2).
    • We could write it the long way, but we lose important semantics and it becomes much less readable.
    • Transform notation makes this problem even worse: {1,3,5,7}I{U->R,F->B} vs. &(I{U->R,F->B} 3I{U->R,F->B} 5I{U->R,F->B} 7I{U->R,F->B})
    • Any layer mask can be used for a single move in hypercubing software, and we treat it as a single move! It should be possible to express concisely in notation.
  • Checkerboard patterns on big cubes are a major example where this problem appears.
  • Negative numbers count from the other side (generalized big cube algorithms!)
    • Generic middle slice on big cubes: ~{1,-1}R or {2..-2}R

Why curly-brace constraint sets?

  • [] is already used for commutator notation.
    • A previous draft used A[B->C|D->E], but | implies “or” semantics when we want “and” semantics.
  • {} has consistent semantics with layer sets: unordered set of elements.
    • Easy for a computer to parse the difference (different position)
    • Easy for a human to parse the difference (numbers vs. letters)

Why invert layer masks?

  • Complex 33 has an anti-R move (equivalent to &(R x')) that is distinct from Lw (which does not exist) because R and L are no longer opposites.
    • Technically you could do 2R by assuming the 6-axis 2-layer laminated construction but that’s very unintuitive and does not generalize to ordinary 33.
  • RKT cancels use “everything except I” extensively
    • E.g., ~IUR for “the UR flip,” which appears constantly in RKT cancel algorithms.
  • Another tool for notation that is generic with respect to number of layers in the puzzle.

Why not v suffix for whole-puzzle rotations?

  • v doesn’t actually apply to twists; it applies to elements.
    • URv is a rotation around the UR edge, but software might not know how to concatenate two axes.
    • This doesn’t generalize at all in higher dimensions.
    • This doesn’t generalize to many shapes; e.g., most edges and all vertices on a polygonal prism do not correspond to rotations that preserve the puzzle symmetry.
  • Syntax for rotations using arbitrary transforms is unclear.
    • U{R->F}v?
    • Uv{R->F}?
    • v{R->F}
    • {R->F}v?
  • Lowercase v may refer to the 5th dimension, particularly in execution notation. (e.g., xv for the rotation from +X to +V)

Why use @ for whole-puzzle rotations?

  • ~ on its own is more useful to mean “all except the first layer”
    • e.g., ~IUR for the very common “UR flip” in RKT cancels on 34 (otherwise expressed as {2..-1}IUR or {1..-2}OUR)
  • * is already used colloquially as a wildcard.
    • e.g., “You can do RKT using either <RO*, I*> or <*O, ~I*>.”
  • @ has the mnemonic “all”

Why have execution notation in addition to general notation?

  • Execution notation is usually optimized for particular puzzles and particular viewpoints.
    • Execution notation often lacks access to certain moves.
  • Execution notation might be more compact or require fewer symbols, making it easier to translate to/from keybinds.
  • Execution notation may provide a way to translate moves between puzzles; e.g., Uy has meaning on both 34 and polygonal duoprisms even though these puzzles are very different.
  • Execution notation can be defined ad-hoc.

Rust data structure

Below is a draft of a Rust data structure representing the notation.

pub enum Node {
    Repeated {
        inner: RepeatableNode,
        amount: Option<i32>,
    },

    /// `(n, m)`
    SquanMove(i32, i32),
    /// `/`
    SquanSlash,
    /// `R++`, `R--`, `D++`, `D--`
    MegaminxScrambleMove(MegaminxScrambleMove),
    /// `#`
    Phys24ScrambleRestack,
}

pub enum RepeatableNode {
    Move(Move),
    /// `@`
    Rotation(Rotation),
    /// `.`
    Pause,
    /// Parenthetical group with optional prefix symbol.
    ///
    /// These moves can always be executed in sequence.
    Group {
        layer_mask: Option<LayerMask>,
        kind: GroupKind,
        elements: Vec<Node>,
    },
    /// ^(...)
    ///
    /// This is separate because it requires special handling.
    Niss(Vec<Node>),
    /// `[A, B]`
    Commutator([Vec<Node>; 2]),
    /// `[A: B]`
    Conjugate([Vec<Node>; 2]),

}

pub enum MegaminxScrambleMove {
    Rpp,
    Rmm,
    Dpp,
    Dmm,
}

pub enum GroupKind {
    Basic, // no char
    Simultaneous, // &
    Macro, // !
}

pub struct Move {
    pub layer_mask: LayerMask,
    pub family: String,
    pub constraint_set: Option<ConstraintSet>,
}

pub struct Rotation {
    pub family: Option<String>,
    pub constraint_set: Option<ConstraintSet>,
}


pub struct ConstraintSet {
    pub constraints: Vec<Constraint>,
}

pub enum Constraint {
    FromTo {
        element_start: String,
        element_end: String,
    }
    Swap {
        element_1: String,
        element_2: String,
    },
    Fixed {
        element: String,
    },
}

pub struct LayerMask {
    pub invert: bool,
    pub ranges: Vec<LayerRange>,
}

/// Layer range
///
/// If start & end are the same, it's a single layer
pub struct LayerRange {
    pub start: i32,
    pub end: i32,
}

  1. The facets of the 120-cell can be divided into eight 15-cell clusters, each containing 12 facets corresponding to faces of a dodecahedron plus three extra ones. Those three extra ones are called I (“In”), X and Y. Each cluster corresponds to one facet of a hypercube. ↩

  2. This puzzle was created as a joke but has actually been solved. ↩