# Patch's practice: actual pytoolz/WSRF training

The practice table compares the original 14-input Square Patchwork model with a new model trained on less familiar, still finishable openings. All 45 existing game models and rules remain unchanged. This is supervised action-value regression with the installed **`pytoolz.wsrf.WSRFRegressor`**, not simulated training animation or online learning.

## What changed in the practice data

Each episode starts from the original seeded quilt and plays one to four randomly chosen **solvable** placements before model control begins. All legal actions at the resulting and subsequent visited states receive the existing teacher score: +30 when the remaining quilt can still be tiled, −40 otherwise, with the original small size/edge bonuses. The exact packing search is used offline for safe openings and action labels. It is not consulted by either browser model during play, inspection or preview.

The original model uses 14 geometric/inventory inputs. The eight bounds added in the earlier Comfort release remain the practice inputs: compulsory singles, spare singles, separate medium/large packing capacities, capacity margins, and medium capacity after one large placement. The new run changes training positions rather than adding features or changing game rules. These geometric bounds do not expose the mixed-size exact finishability label.

Inputs: `tile side, tile area, ones left, twos left, threes left, two-square spaces, three-square spaces, isolated holes, empty regions, small-region area, edge contact, filled area, large priority, edge priority, squares needing singles, spare singles, medium packing capacity, large packing capacity, medium capacity margin, large capacity margin, medium capacity after one large, large fits leaving medium room`.

## Training, selection and separation

`pytoolz.indexrng.Index("afternoon-packing-practice-v1", backend="blake2b")` supplies distinct train, recovery, validation, test, guided and gallery streams. The checked qrand browser adapter determines the seeded world and opening choices. Priorities vary in train/recovery streams; solo validation and testing use balanced priority. The two zones correspond to the tile-size/area display. Guided evaluation changes priority and zone every two model decisions.

The first fit uses **640 reference episodes** and **47,183 action rows**, 16 trees per zone and depth 14. Another **256 guided early-model episodes** supply further states and action labels. The final candidate fits **65,308 rows**, 32 trees per zone and depth 20. Both use minimum leaf size 2, all features, seed 2026, one worker, no adaptive complexity, no zone prior and no calibration. Full estimator parameters and versions are recorded in the report.

Early, final and the currently shipped game model each play the same **128 validation openings**. Completion, mean score and fewer moves determine selection, with a final-practice preference for ties. Early and final finish 128/128; the shipped champion finishes 127/128. Selected for the practice table: **practice**. No test or gallery result participates in fitting or selection.

## Fresh measurements after selection

| Policy | Completed / 256 fresh openings | Mean covered squares |
| --- | --- | --- |
| Original 14-input model | 194/256 | 34.254 |
| Currently shipped game model | 256/256 | 36.000 |
| Early practice candidate | 256/256 | 36.000 |
| Final practice candidate | 256/256 | 36.000 |

The selected practice model also finishes **64/64** separate guided openings. The exact reference finishes **256/256**; random legal play finishes **8/256**.

The original model improves from 194/256 to 256/256 in this comparison. The currently shipped model also scores 256/256 on these fresh tests; the practice model's advantage over it appears in validation, not this test sample. Do not interpret these results as proof of universal superiority. Seed streams are disjoint, but different seeds can reach equivalent boards in this finite puzzle family. Arbitrary human-created positions and other packing problems are outside this evaluation.

Both newly fitted candidates were checked against their complete browser exports: **155,874 exact Python/JavaScript predictions**, with maximum observed error **0**. Fixtures include held-out action features and float32 neighbors around every candidate tree threshold. Training exports all trees; the browser evaluates them directly.

## Six illustrations, separate from test results

The gallery draws from another 192-seed stream and deliberately selects the first six positions where the original model loses and the selected practice model finishes. Each card stores its seed, legal opening moves and recorded outcomes. These examples demonstrate the failure mode; they are neither a random sample nor additional held-out performance evidence. The page identifies their selection, and the rule test reconstructs every opening and outcome. Nudges can change the live outcome from the recorded balanced-priority demonstration.

The browser shows two cloned starting quilts. Each click advances each model by one legal move. Autoplay can pause at any time and pauses on blur/hidden pages. Optional inspection reports actual action values, tree standard deviation, input values and tree paths. Preview applies a selected action only to a copy. The original model's final eight input columns are marked unused: only its feature-name metadata is extended for compatibility, while all original tree nodes remain unchanged.

## Reproduce and inspect

Run from the arcade root with the recorded Python environment:

```sh
/home/wiliamrocha/.spenv/bin/python -B tools/practice/train.py
/home/wiliamrocha/.spenv/bin/python -B tools/practice/document.py
node tools/test-practice.cjs
npm run build
```

See [training source](../tools/practice/train.py), [opening generation and simulation](../tools/practice/data.cjs), [gallery selection](../tools/practice/gallery.cjs), [full report, seeds, versions and source hashes](training/report.json), [early fixtures](training/early-validation.json.gz), [practice fixtures](training/practice-validation.json.gz), [original forest](original-forest.json), [selected forest](forest.json), and [existing square-game training](../games/square-patchwork/TRAINING.md).

The original pytoolz/WSRF checkouts were used without modification. Training caches are excluded from the static deployment. The deployed game requires no Python runtime, account or external model service.
