DOORMAX, a rule learner from the literature

First recorded spec · File revision
  • Hypothesis: exploration
  • Date: 2026-11-23

Question #

DOORMAX (Diuk, Cohen and Littman, 2008) learns rules of the form "under this condition, this button has this effect", after a person has told it what the objects in the world are. On the 8-puzzle, how many presses does it need to learn every rule, and what does it cost on the measures the anchors were scored on?

This is a benchmark from the literature, not an agent of ours. It sets the mark that a later agent, which is told less, has to be compared with.

What we expect, written before any run: it learns every rule in 30 to 70 presses (median across runs), it never makes a wrong prediction, and after that it plays every solvable puzzle in the shortest route and calls every impossible puzzle with no presses.

Setup #

World, puzzles, budget. Unchanged from 001b: world.py is a byte-identical copy. 100 runs. Run r draws the same 300 puzzles from seed r as in 001b, 150 solvable and 150 impossible, and gives them to a fresh agent that keeps what it has learned for the whole run. Each puzzle allows 3,000,000 presses. The Goldfish, Elephant and Oracle are not rerun; their numbers are 001b's, measured on the same puzzles.

What DOORMAX is handed. Everything in this list was chosen by us, following the paper's Taxi example. It is the price of the result.

  1. The objects: one gap, eight tiles, and the tray's four walls.
  2. Their positions: the gap and each tile have a column (x) and a row (y).
  3. Twelve yes-or-no facts a condition may mention: the gap touches a wall on its north, south, east or west side; a tile touches a wall on each side; a tile touches the gap on each side. Rules for the gap may also mention whether any tile touches it on each side.
  4. The two kinds of effect the paper uses: add a number to a position, or set a position to a fixed number.
  5. That one button has at most two different effects on one position (the paper's k = 2).
  6. That all tiles follow the same rules.
  7. How to turn nine numbers into these objects and back.

It is not told what any button does, that walls block, or that a tile moves when the gap does.

The learner. The paper's three procedures, followed line by line: predict, learn from one press, and merge two conditions by keeping what they share. It predicts only when it is sure, and otherwise says "don't know". One extension: the paper's examples have one moving object of each kind, and we have eight tiles, so a tile's rule is checked once per tile, using that tile's own facts.

How it plays. The same rule as the Elephant, with predictions in place of notes. If its rules predict a route to the target, it follows the shortest one. Otherwise it goes to the nearest board where it cannot predict some button, and presses the lowest-numbered such button. If it can predict everything it can reach and no route exists, it says "impossible". It stores only its rules: it thinks each puzzle through from scratch.

Metric #

The run is the unit. For each quantity: the median, a 95% confidence interval for the median from order statistics, and the smallest and largest run.

  • Presses to learn every rule: the press after which its rules never change again.
  • Presses it could not predict: how many times it pressed a button without knowing what would happen, and when the last such press was. DOORMAX keeps tidying its rules on presses it already predicted, so this can end earlier than the last rule change.
  • Is what it learned right: at the end of each run, its prediction for every one of the 1,451,520 board-and-button pairs, counted as right, wrong or "don't know". This is exact, and covers the half of the boards it never visited.
  • Wrong predictions made while playing: every real press is compared with what it predicted.
  • The anchors' measures: presses on its first solvable and first impossible puzzle, presses on a typical solvable puzzle, presses per shortest-route press over its last 50 solvable puzzles, puzzles solved and called, total presses.
  • What it stores: the number of rules at the end of a run.
  • Thinking: boards examined in its head, per puzzle, counted as the Elephant's are.

There is no success threshold: this is an exploration.

Checks that the harness is sound.

  • It is DOORMAX. Tests reproduce the paper's worked example of merging two conditions. The same learner code, unchanged, is run on the paper's 5 by 5 Taxi world for 100 runs. The paper reports 529 steps to learn it. The paper leaves some details unstated, so we accept a mean between 265 and 1,058 (half to double). Outside that, the result is still reported, but the agent is called "DOORMAX-style" and the difference is stated first.
  • It is never wrong. A wrong prediction on any real press, or in the final count, means a bug in our code or a broken assumption, and is reported as such.
  • The ruler is separate. Shortest routes come from 001b's search under the true rules, not from the agent.
  • It repeats. Runs 0 to 9 are run twice and must give identical numbers; several processes must give the same numbers as one.

Speed. The code may remember the answers to earlier thinking to save time, as long as every counted number (presses, thinking, rules) is the same as thinking again. A test checks this on a small case. Run under PyPy if the plain version is slow, with runs 0 to 9 in ordinary Python kept as the reference.

Amendments, 2026-11-23, made while building and before the first full run #

What had been seen when these were written: try-out runs of Taxi (20 runs of 352 to 606 steps each once the first change below was made; then 8 runs with a mean of 450 that showed the second problem below), and try-out puzzle runs of 4 to 12 puzzles each (28 unpredicted presses in each, no wrong predictions). All of these were made before the second change below, so they are not results. Two full runs were started and stopped unfinished, with none of their numbers read. The prediction of 30 to 70 presses above was written before any of this.

  • Two steps of the paper's procedure are not followed as printed, because the printed pseudocode and the paper's own text disagree. Each printed version can be switched back on, and a test shows it failing on the paper's own Taxi world.

    Overlap. When a rule's condition is widened, the paper's pseudocode rules out that kind of effect if the wider condition contains another rule's condition. The paper's comment on that step says it is there to check that no two conditions overlap. Two conditions can overlap without one containing the other. Followed to the letter, the learner then holds two rules that fit the same situation and disagree, never predicts that situation, and presses the same button without end. This happened in 8 of 20 Taxi try-outs. We test for any overlap.

    Predicting. The printed predict step answers as soon as the rules that speak agree, even if only one of the two kinds of effect speaks. The paper's proof that the learner is never wrong says it answers "don't know" unless every kind still in play can predict. As printed, a wrong kind of rule that has not yet been discarded can speak alone and be wrong: 4 wrong predictions in 8 Taxi try-outs. We follow the proof.

  • Two shortcuts, and how they are checked. On this puzzle the facts DOORMAX sees depend only on where the gap is, so the code works out what a button does once per gap square and reuses it until the rules change. It also does not rethink a set of boards it has already thought through and found closed. Runs 0 to 9 are run a second time with both shortcuts switched off and must give numbers identical to the main runs. This is also the "run twice" check above.

  • Everything runs under PyPy on 8 processes, for speed. Runs 0 to 9 are run a third time in ordinary Python and must give identical numbers.

  • A count added: how many different sets of rules the 100 runs end with.

Delivery order #

  1. The learner on its own, with the tests from the paper's worked example.
  2. The Taxi world and the 529-step check.
  3. The puzzle described as objects, and the agent that plays with the learner.
  4. The run, the final count of predictions, and RESULT.md.