Snakes in the box in dimensions 13 to 16
Find longer snakes, induced paths in the hypercube, in dimensions 13 to 16: beat 2946, 5850, 11,673 and 23,318 edges.
| 1 | # The checks and how to submit |
| 2 | |
| 3 | The checks run the judge in `checks/judge/` at the project's approved version, with your pushed commit as input, so a |
| 4 | route cannot change how it is judged. The judge is plain Python 3 with no dependencies: run it yourself before you push, |
| 5 | `python3 checks/judge/check.py routes/<branch>`, and rerun its own tests with `python3 -I checks/test_judge.py`. |
| 6 | |
| 7 | ## Files |
| 8 | |
| 9 | - `constructions/d13.json` to `constructions/d16.json`: the record snakes, in the submission format, with a `source` |
| 10 | key saying where each comes from. Taylor's vertex lists are turned into steps from the vertex 0, which loses nothing: |
| 11 | the hypercube looks the same from every vertex. |
| 12 | - `tools/check_format.py`: checks that files follow the submission format; it does not follow the paths. |
| 13 | |
| 14 | ## Submission format |
| 15 | |
| 16 | - **Files.** A candidate is a file whose name ends in `.json`, anywhere in your route's folder `routes/<branch>/`, whose |
| 17 | content is a JSON object with the keys `"d"` and `"transitions"`; other keys are ignored. A `.json` file whose |
| 18 | content is not an object with `"transitions"` is not a candidate and is ignored, but a `.json` file that is not valid |
| 19 | JSON fails the check. Keep each file under 1 MB. |
| 20 | - **`"d"`**: a JSON integer from 13 to 16. |
| 21 | - **`"transitions"`**: the snake as its steps from the vertex $0$, one per edge, each the coordinate it flips, from 0 |
| 22 | to $d-1$: either a string of base-36 digits (`0`-`9`, then `a` = 10 to `f` = 15; whitespace is ignored), as the |
| 23 | record pages and SnakeBox write them, or a list of integers, as EinsteinArena's `"actions"`. |
| 24 | - **Value.** The number of edges, when the path is a snake. A path that returns to a vertex or has a chord (two |
| 25 | vertices adjacent in $Q_d$ but not consecutive on it) is not a snake: `verify` fails and says where. |
| 26 | - **Score.** For each dimension, the route's longest snake divided by the record, where a dimension counts as its |
| 27 | record when the route has nothing longer. The score is the mean of the four ratios, higher is better: the records |
| 28 | score exactly 1, and a route scores above 1 exactly when it holds a snake longer than some record. `verify` writes it |
| 29 | to `metrics.json` as `score` (a float) and `score_exact` (the exact fraction), with each dimension's longest snake in |
| 30 | `subtasks` and the dimensions above their records in `new_records`. |
| 31 | |
| 32 | ## How to check and submit |
| 33 | |
| 34 | - Check a folder before you push: `python3 tools/check_format.py routes/<branch>`. |
| 35 | - Push your work to your route. Two checks run on every push: |
| 36 | - **`verify`** checks every candidate in your route's folder exactly. It prints one line per candidate, |
| 37 | `<dimension>: <length> edges (<file>), <difference> against the record`, ending `; a new record` when the snake is |
| 38 | longer than the record, then the score and the new records. It fails if a `.json` file is unreadable or a |
| 39 | candidate is malformed or not a snake; a route with no candidate passes with "no candidates to check". On `main` it |
| 40 | also reads `constructions/`. |
| 41 | - **`improves`** only informs: it never blocks a merge. For each dimension your route has a snake for, it prints |
| 42 | your longest snake against the longest `main` holds (in `constructions/` and `routes/`) and says whether it is a new |
| 43 | record. It passes when, for some dimension, your snake is longer than `main`'s. |
| 44 | - Open a pull request into `main` when `improves` passes: the site's maintainer takes improvements in. Any other |
| 45 | result, such as a method that others can reuse or a negative result, is judged by review: say in your route's notes |
| 46 | exactly what you claim and how to check it. |
