The floor was printed on the board

Clarify is a daily liquid sort puzzle. Every bottle stacks its liquid by density, so each colour you finish only needs one pour to come home. That gave us a lower bound we could read straight off the board: count the liquid layers, subtract the colours. We ran that arithmetic across all 399 levels in the daily pool. It never once equaled the solver's answer.

Today's Clarify board: five six-unit bottles of mixed colour on a warm cream background, each holding a few stacked liquid layers.
Today's board (31 October), level GEN-thu-3698. Five bottles, ten liquid layers, five colours. The floor says five moves. The solver proved six. The tax here is one.

A bound you can compute with your eyes

The rules are strict. A bottle only gives up its topmost layer, and a layer always sinks to where its density belongs. Two consequences fall out immediately, and they are both cheap to state: first, every finished colour has exactly one pour left in it, the one that returns it to its home bottle, and second, every pour moves at most one layer. Put those together and the minimum possible move count for a board is the number of liquid layers on the board minus the number of colours, which is a number you can read off the board without opening the code, so call it the floor. A board with ten layers and five colours cannot be solved in fewer than five moves, because five pours is the fewest that could bring five colours home.

What made me stop was how small the gap between that floor and the real answer turned out to be. We have a solver in the repo. It runs breadth-first search over board states with a node budget, and it stops at the first solved state it finds, which means the path it returns is the shortest one. Every one of the 399 daily levels shipped with a par that was proven that way, not estimated. So we could line up three numbers for every level: the floor, the solver's true optimum, and the difference between them.

The solver's optimum never fell below the floor, which is the whole point of a lower bound, and it held for all 399 levels. The mean par was 5.17 moves and the median was 5, with the smallest in the pool at 2 and the largest at 9, and only one level in the entire pool sits at that ceiling. The pool also contains three hand-written tutorials with par 1, 3, and 4, and their pars were checked by the same search.

The floor undercounts, and the undercount has a name

Here is the distribution of the gap across all 399 levels, which I am going to call the detour tax:

4 levels had a tax of 0, meaning the greedy strategy of always peeling the lightest layer off and parking it somewhere solved them at the floor, and those four are the only levels in the pool where the obvious route is the right route. 115 levels had a tax of 1. 212 had a tax of 2, which is the mode. 63 had a tax of 3. 5 had a tax of 4, the maximum observed anywhere in the pool. The mean tax was 1.875 moves, which adds up to 875 wasted moves across the whole pool if every player had followed the obvious route and never noticed.

Read that table sideways and a pattern shows up. The tax climbs with par. Monday's 57 levels, all four-bottle boards with three colours, average a tax of 1.18 moves, and none exceeds 2. By Thursday and Friday the five-bottle boards average 2.05 and 2.14, with a ceiling of 4. Sunday's average is 2.16. In other words, the harder a level is, the more often the obvious greedy route is not the right route.

Why does the floor exist in the first place? Because in this genre, the greedy route is very good. The lightest colour in any bottle is always on top and always pourable. A light layer poured onto a heavier one floats on top of it, so you can always lift it straight back off. That makes layer-peeling almost always legal and almost always useful. The floor is right within a move or two of the optimum on every single board, which is not a property you get from most puzzle rulesets.

The tax is where the difficulty actually lives. A tax of 0 means the greedy strategy is the solution. A tax of 3 means that somewhere along the way you have to pour a layer into a bottle you will later regret, or park a colour in the wrong place on purpose, in order to free up the slack that the real solution needs. That is the whole of the puzzle. The settling physics does not make the difficulty. It makes the floor.

The tax is what the solver pays for

The next thing we checked was whether the tax predicted how expensive a level is to verify. It did, cleanly. Levels with a tax of 1 or less take a median of 1,473 nodes for the breadth-first search to prove. The 68 levels with a tax of 3 take a median of 108,626 nodes, which is about 74 times more. The 5 levels with a tax of 4 take a median of 133,837. The hardest board in the pool, a Saturday with six seven-unit bottles, needs 575,365 nodes. The generator records that number next to each level when it is first proven, and we treat it as a property of the level, not an implementation detail.

That correlation changed how we read the design doc. We had been thinking of difficulty as a number on the par, which is true but incomplete. The par is the tax. The floor is basically free to compute, and it tells you almost nothing about difficulty, because it is almost always right. The tax is the expensive part, both for the player and for the solver, and it is the part that actually separates a level from its neighbour.

What we ship

The shipped pool gates each level on two things: the solver proves a solution exists within the budget, and the par lands in a band of 1 to 9 moves. We set the band's ceiling at 9 because the tax caps out there in our measurements, and because a level whose optimum is 10 would be one more move than any we have verified, which felt like we were past the edge of the data. The budget floor for the verifier is 3 million nodes per level, 5 million for Sundays, which is about ten times the hardest observed proof. We would rather reject a candidate and regenerate it than ship a level whose par we cannot state.

The rule that survived the measurement is a small one and it is worth putting next to the other: when a puzzle's difficulty lives in a gap of one to four moves above a formula you can compute in your head, the formula is a feature, not a bug. It tells the player what the level is worth, and it tells the solver where to stop looking.

← Back to the blog