feat(offline): port DAWG cursor + move generator to TS (parity-pinned)
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 1m8s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m38s
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 1m8s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m38s
First engine-first step of PWA offline mode (Phase A): the client-side move generator — the "robot brain" a local vs_ai game will run on-device — with no runtime wiring yet (Phase B). - dawg.ts: add the step-by-step cursor (root/final/next/arcs), a faithful port of dafsa traverse.go over the reader's existing bitstream. - generate.ts: the Appel-Jacobson generator (leftPart/extendRight + cross-sets + counts-rack + board transpose + moveKey ranking), reusing the cursor and validate.ts evaluate/connected. A cross-set LetterSet is a Uint8Array, so the 33-letter Russian alphabet (index 32) is exact under JS bit ops. - validate.ts: export connected for the generator's connectivity filter. - backend/cmd/movegen: dev tool building small sample dictionaries and emitting golden move-generation fixtures from the real Go solver (EN + RU). - tests: dawg.cursor.test.ts (enumeration bijection vs indexOf) and generate.parity.test.ts (7/7 vs the Go solver: empty board, mid-game, blank, single-word rule, Russian index-32 cross-set). The committed EN sample also unblocks the existing skipped dawg.parity.test.ts once wired with DICT_* in CI. Pure additive library code; no runtime behavior change.
This commit is contained in:
BIN
Binary file not shown.
+9802
File diff suppressed because it is too large
Load Diff
+122
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"alphabet": "en",
|
||||
"numAdded": 18,
|
||||
"words": [
|
||||
"a",
|
||||
"an",
|
||||
"and",
|
||||
"ant",
|
||||
"car",
|
||||
"care",
|
||||
"cared",
|
||||
"cares",
|
||||
"cars",
|
||||
"cat",
|
||||
"cats",
|
||||
"do",
|
||||
"doe",
|
||||
"does",
|
||||
"dog",
|
||||
"dogs",
|
||||
"done",
|
||||
"dot"
|
||||
],
|
||||
"indexes": [
|
||||
[
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
13
|
||||
],
|
||||
[
|
||||
0,
|
||||
13,
|
||||
3
|
||||
],
|
||||
[
|
||||
0,
|
||||
13,
|
||||
19
|
||||
],
|
||||
[
|
||||
2,
|
||||
0,
|
||||
17
|
||||
],
|
||||
[
|
||||
2,
|
||||
0,
|
||||
17,
|
||||
4
|
||||
],
|
||||
[
|
||||
2,
|
||||
0,
|
||||
17,
|
||||
4,
|
||||
3
|
||||
],
|
||||
[
|
||||
2,
|
||||
0,
|
||||
17,
|
||||
4,
|
||||
18
|
||||
],
|
||||
[
|
||||
2,
|
||||
0,
|
||||
17,
|
||||
18
|
||||
],
|
||||
[
|
||||
2,
|
||||
0,
|
||||
19
|
||||
],
|
||||
[
|
||||
2,
|
||||
0,
|
||||
19,
|
||||
18
|
||||
],
|
||||
[
|
||||
3,
|
||||
14
|
||||
],
|
||||
[
|
||||
3,
|
||||
14,
|
||||
4
|
||||
],
|
||||
[
|
||||
3,
|
||||
14,
|
||||
4,
|
||||
18
|
||||
],
|
||||
[
|
||||
3,
|
||||
14,
|
||||
6
|
||||
],
|
||||
[
|
||||
3,
|
||||
14,
|
||||
6,
|
||||
18
|
||||
],
|
||||
[
|
||||
3,
|
||||
14,
|
||||
13,
|
||||
4
|
||||
],
|
||||
[
|
||||
3,
|
||||
14,
|
||||
19
|
||||
]
|
||||
]
|
||||
}
|
||||
BIN
Binary file not shown.
+1271
File diff suppressed because it is too large
Load Diff
+38
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"alphabet": "ru",
|
||||
"numAdded": 6,
|
||||
"words": [
|
||||
"ад",
|
||||
"ар",
|
||||
"оса",
|
||||
"я",
|
||||
"яд",
|
||||
"яр"
|
||||
],
|
||||
"indexes": [
|
||||
[
|
||||
0,
|
||||
4
|
||||
],
|
||||
[
|
||||
0,
|
||||
17
|
||||
],
|
||||
[
|
||||
15,
|
||||
18,
|
||||
0
|
||||
],
|
||||
[
|
||||
32
|
||||
],
|
||||
[
|
||||
32,
|
||||
4
|
||||
],
|
||||
[
|
||||
32,
|
||||
17
|
||||
]
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user