# Glow Pair Post — XOR associations and WSRF pairing

Glow Pair Post is an untimed XOR card puzzle. Two four-window patterns combine into a delivery address. Matching lights cancel; different lights remain. Warm Windows has four deliveries from eight cards, Twilight Post has five from ten, and the playground lets you try all sixteen patterns without consuming cards.

## Two real learned components

`pytoolz.wsrf_hlib.ParityDetector` discovered the four XOR associations from 192 of the 256 possible card pairs. The 64 untouched pairs matched on all four windows. Those learned coefficients are exported in `associations.json` and used by the game. The browser additionally validates all 256 associations against the XOR truth table when loading; malformed models cannot start the game.

A separate `pytoolz.wsrf.WSRFRegressor` (8.0.0) learned pairing values from **22,931 legal action examples** across 1,536 seeded training routes, including alternate reachable paths. Its 14 features describe future matching opportunities, cards left without associations, and nearby patterns. The target is 1 if the remaining route has an exact completion, otherwise 0. Exact recursive search supplies offline labels; it is not an input feature or a replacement for the live model’s move choice. Rules determine which pairs match the current address.

The fitted forest has 48 trees, split between warm and twilight zones, with depth 15, leaf size 2, and full recorded parameters in [report.json](training/report.json). A separate 128-route validation collection was generated. Architecture was fixed before the fresh test; there was no test-driven candidate selection or subsequent retraining.

## Fresh-route results

| Player | Finished routes | Total |
| --- | ---: | ---: |
| WSRF partner | 510 | 512 |
| Exact search reference | 512 | 512 |
| Random legal pairing | 277 | 512 |

The partner finished **256/256 Warm Windows** routes and **254/256 Twilight Post** routes. The two blocked test routes are retained in the report. A blocked route stops clearly and keeps unlimited Undo available; the browser test replays a real blocked case and finishes it by changing earlier choices. The model can still make a mistake on a new route. A little hint and One model pairing use the same forest, not an undisclosed exact solver.

`pytoolz.indexrng.Index` with namespace `glow-pair-post-v1` separates training, validation, and test streams. All three evaluated policies use the same test routes. Existing checked qrand browser arithmetic generates the routes. Python/JavaScript parity fixtures cover visited features and neighboring float32 values at learned split thresholds. The full forest, compressed fixtures, source hashes, upstream library paths/hashes, and complete episode traces ship with the game.

## Reproduce

```sh
/home/wiliamrocha/.spenv/bin/python -B tools/glow/train.py
node tools/test-glow.cjs
ARCADE_URL=http://127.0.0.1:8016/ CDP_PORT=9236 node tools/test-glow-browser.cjs
```

No upstream library source was changed. The website needs only the fitted model and learned associations, not a Python server. The brain shows actual forest scores, inputs, a tree path, and hlib’s discovered relationships. Playground mode uses the learned XOR relationships but does not claim to run the route-value model.
