clone

a browser grid puzzle game where you push words around to rewrite the rules of each level

Record W3 solver parity and measured memory savings

Dami committed e45f38c
commit
e45f38ca3ecbc30f54225f5a17861332d6d1bd8c
parent
c5ec50eef8d5e420e6b43ca7df43f7f94f05ea8c
author
Dami <dami.etoile@gmail.com>
2 files changed, +55 -7
Mopenspec/changes/scale-solver-state-search/tasks.md14++++----
Mopenspec/changes/scale-solver-state-search/verification.md48++++++++++++++++++++++++++++++
M openspec/changes/scale-solver-state-search/tasks.md +7 -7
@@ -13,19 +13,19 @@
1313 ## 3. Memory-bounded search1414 1515 - [x] 3.1 Add a reusable breadth-first core with compact blobs, a queue head, and predecessor links.16-- [ ] 3.2 Replace the CLI solver's full-snapshot frontier and growing path strings with that core.17-- [ ] 3.3 Compare shortest paths, LIMIT counts, BYPASS flags, `--replay`, and already-won behavior with the pre-change solver on representative packs.18-- [ ] 3.4 Separate player-pushed-word BYPASS from all-word-motion HANDS-OFF and test automaton-driven word movement.16+- [x] 3.2 Replace the CLI solver's full-snapshot frontier and growing path strings with that core.17+- [x] 3.3 Compare shortest paths, LIMIT counts, BYPASS flags, `--replay`, and already-won behavior with the pre-change solver on representative packs.18+- [x] 3.4 Separate player-pushed-word BYPASS from all-word-motion HANDS-OFF and test automaton-driven word movement.1919 2020 ## 4. Equivalent fast transitions and constraints2121 2222 - [x] 4.1 Extract a search transition boundary that reuses current parser, movement, transform, automata, and contact semantics without presentation events or Undo history.2323 - [x] 4.2 Differential-test public `step()` and `wait()` against the fast transition across W6 stacked rules, PUSH/STOP, DEFEAT/WIN, transformation chains, SINK removal, and Clockwork phases.24-- [ ] 4.3 Make `--forbid` reject rules active initially or in any intermediate rule-evaluation phase; verify a rule that disappears before the turn settles.25-- [ ] 4.4 Enable the fast transition in the solver only after route parity and performance checks; retain the authoritative fallback.24+- [x] 4.3 Make `--forbid` reject rules active initially or in any intermediate rule-evaluation phase; verify a rule that disappears before the turn settles.25+- [x] 4.4 Enable the fast transition in the solver only after route parity and performance checks; retain the authoritative fallback.2626 2727 ## 5. Verification and worlds handoff2828 29-- [ ] 5.1 Rerun representative worlds at their documented search caps and report route, expansion, elapsed time, and peak memory deltas to the worlds team.30-- [ ] 5.2 Run the full Node suite, production build, mod loading, browser controls, rule-change and Undo flows, and strict OpenSpec validation.29+- [x] 5.1 Rerun representative worlds at their documented search caps and report route, expansion, elapsed time, and peak memory deltas to the worlds team.30+- [x] 5.2 Run the full Node suite, production build, mod loading, browser controls, rule-change and Undo flows, and strict OpenSpec validation.3131 - [ ] 5.3 Coordinate the per-proof search-budget field and bundled-world CI gate with the separate world-authoring change.
M openspec/changes/scale-solver-state-search/verification.md +48 -0
@@ -47,3 +47,51 @@ peaks of **149.0 MiB** for `break-the-rule`, **145.3 MiB** for `mouse-hole`, and
4747 **190.6 MiB** for `pass-it-on`. Those runs included the normal shortest-path4848 search only. The pre-W3 whole-command baseline also includes a BYPASS4949 re-search, so its peak RSS is not a direct one-to-one memory comparison.50+51+For a direct memory comparison, the temporary legacy CLI copy was run again52+with only its normal shortest-path search; BYPASS re-search was disabled in53+that temporary copy. A 20 ms worker-thread RSS sampler measured each process54+under the same proof cap. Routes and search counts were identical to fast55+mode:56+57+| Proof | Legacy / fast elapsed | Legacy full-state RSS | Compact fast RSS | Reduction |58+| --- | ---: | ---: | ---: | ---: |59+| Core `break-the-rule` | 6.38 / 3.75 s | 251.0 MiB | 149.0 MiB | 40.6% |60+| Clockwork `mouse-hole` | 8.57 / 7.99 s | 206.8 MiB | 145.3 MiB | 29.7% |61+| Crossword `pass-it-on` | 26.63 / 25.92 s | 359.8 MiB | 190.6 MiB | 47.0% |62+63+These are measurements on one host rather than CI thresholds. They cover64+representative solved proofs; the multi-million-transition challenge cases65+still need author budget decisions and their own bounded runs.66+67+## Author CLI rollout68+69+`tools/solve.mjs` now calls compact `solveLevel()` in fast mode (`c5ec50e`).70+The CLI tests cover pack and level selection, shortest route, replay, already71+won boards, repeated `--forbid`, an initially forbidden rule, a rule formed72+and sunk in one turn, existential BYPASS/HANDS-OFF flags, and both transition73+and retained-state limits. Mod loading succeeds for the shipped Word Lab pack74+and the Crate Works, Tidewater, and Clockwork drafts. The full Node suite at75+this checkpoint passes 269/269 and the production build passes.76+77+The old CLI incremented `explored` before checking `--max`, so a LIMIT at cap78+`N` printed `after N+1 states`. The new search attempts exactly `N` transitions79+and prints `after N states`. `--max-visited` gives a separate explicit cap on80+retained frontier states and marks that LIMIT as `(visited cap)`.81+82+The committed CLI also completed authored heavy smokes under their documented83+caps: Crossword `pass-it-on` exited 0 in 25.3 s with its exact 25-step route,84+and Clockwork `mouse-hole` exited 0 in 8.1 s with its exact 23-step route.85+Neither reported BYPASS or HANDS-OFF. Word Lab's three proofs, Crate Works86+`night-shift`, Tidewater `low-tide`, and Clockwork `mouse-keeps-time` also87+retained their known routes. The last of these reports BYPASS and not88+HANDS-OFF under the agreed motion definitions; the worlds team has accepted89+separate `allowBypass` and `allowHandsOff` declarations for CI gating.90+91+Browser acceptance after the fast engine and restore-cache changes passed on92+local Vite: `automata.mjs` covered movement, WAIT, Undo, and reset on desktop93+and mobile; `rule-reading.mjs` covered stacked words, DEFEAT-before-WIN, and a94+shared mobile proof; `undo-death.mjs` covered immediate and delayed Undo plus95+restored visual state. All three reported no console or page errors. The full96+Node suite, production build, mod loading, and strict OpenSpec validation also97+passed at this checkpoint.