From d069c5bd0059208ce3ded3d161da60010f3f92ac Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Thu, 31 Oct 2024 13:18:35 -0700 Subject: [PATCH] FREEZE.indexed --- src/cubing/search/inside/api.ts | 19 ++- src/cubing/vendor/mpl/twsearch/index.js | 108 +++++++++--------- .../mpl/twsearch/twsearch_wasm_bg-EDFRIWUK.js | 3 - .../mpl/twsearch/twsearch_wasm_bg-JRZN3X3U.js | 3 + .../vendored-twsearch-git-version.txt | 2 +- 5 files changed, 67 insertions(+), 68 deletions(-) delete mode 100644 src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-EDFRIWUK.js create mode 100644 src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-JRZN3X3U.js diff --git a/src/cubing/search/inside/api.ts b/src/cubing/search/inside/api.ts index 84a918ddb..bd35bc890 100644 --- a/src/cubing/search/inside/api.ts +++ b/src/cubing/search/inside/api.ts @@ -26,7 +26,6 @@ import { solveMegaminx } from "./solve/puzzles/megaminx"; import { solvePyraminx } from "./solve/puzzles/pyraminx"; import { randomRediCubeScramble } from "./solve/puzzles/redi_cube"; import { solveSkewb } from "./solve/puzzles/skewb"; -import { getRandomSquare1Scramble } from "./solve/puzzles/sq1"; import { wasmRandomScrambleForEvent, wasmTwsearch, @@ -113,7 +112,7 @@ async function randomScrambleForEvent( case "minx": case "pyram": case "skewb": - // case "sq1": + case "sq1": // case "444bf": case "555bf": // case "333mbf": @@ -143,14 +142,14 @@ async function randomScrambleForEvent( "random444OrientedScramble", random444OrientedScramble, ); - case "sq1": - return measurePerf( - "getRandomSquare1Scramble", - getRandomSquare1Scramble, - { - isPrefetch: options?.isPrefetch, - }, - ); + // case "sq1": + // return measurePerf( + // "getRandomSquare1Scramble", + // getRandomSquare1Scramble, + // { + // isPrefetch: options?.isPrefetch, + // }, + // ); case "fto": return measurePerf("randomFTOScramble", randomFTOScramble, { isPrefetch: options?.isPrefetch, diff --git a/src/cubing/vendor/mpl/twsearch/index.js b/src/cubing/vendor/mpl/twsearch/index.js index 13a97e735..93875f76b 100644 --- a/src/cubing/vendor/mpl/twsearch/index.js +++ b/src/cubing/vendor/mpl/twsearch/index.js @@ -7,6 +7,23 @@ import { Alg } from "../../../alg"; // .temp/rust-wasm/twsearch_wasm.js import { getBuiltinModule } from "getbuiltinmodule-ponyfill"; var wasm; +var heap = new Array(128).fill(void 0); +heap.push(void 0, null, true, false); +function getObject(idx) { + return heap[idx]; +} +var heap_next = heap.length; +function dropObject(idx) { + if (idx < 132) + return; + heap[idx] = heap_next; + heap_next = idx; +} +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error("TextDecoder not available"); } }; @@ -24,9 +41,6 @@ function getStringFromWasm0(ptr, len) { ptr = ptr >>> 0; return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } -var heap = new Array(128).fill(void 0); -heap.push(void 0, null, true, false); -var heap_next = heap.length; function addHeapObject(obj) { if (heap_next === heap.length) heap.push(heap.length + 1); @@ -35,20 +49,6 @@ function addHeapObject(obj) { heap[idx] = obj; return idx; } -function getObject(idx) { - return heap[idx]; -} -function dropObject(idx) { - if (idx < 132) - return; - heap[idx] = heap_next; - heap_next = idx; -} -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} function debugString(val) { const type = typeof val; if (type == "number" || type == "boolean" || val == null) { @@ -156,6 +156,13 @@ function getInt32Memory0() { } return cachedInt32Memory0; } +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_export_3(addHeapObject(e)); + } +} function wasmTwsearch(kpuzzle_json, search_pattern_json, options_json) { let deferred5_0; let deferred5_1; @@ -214,13 +221,6 @@ function wasmRandomScrambleForEvent(event_str) { wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1); } } -function handleError(f, args) { - try { - return f.apply(this, args); - } catch (e) { - wasm.__wbindgen_export_3(addHeapObject(e)); - } -} async function __wbg_load(module2, imports) { if (typeof Response === "function" && module2 instanceof Response) { if (typeof WebAssembly.instantiateStreaming === "function") { @@ -248,10 +248,6 @@ async function __wbg_load(module2, imports) { function __wbg_get_imports() { const imports = {}; imports.wbg = {}; - imports.wbg.__wbindgen_string_new = function(arg0, arg1) { - const ret = getStringFromWasm0(arg0, arg1); - return addHeapObject(ret); - }; imports.wbg.__wbg_new_abda76e883ba8a5f = function() { const ret = new Error(); return addHeapObject(ret); @@ -277,10 +273,6 @@ function __wbg_get_imports() { imports.wbg.__wbindgen_object_drop_ref = function(arg0) { takeObject(arg0); }; - imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - const ret = getObject(arg0); - return addHeapObject(ret); - }; imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) { const ret = getObject(arg0).crypto; return addHeapObject(ret); @@ -316,11 +308,9 @@ function __wbg_get_imports() { const ret = typeof getObject(arg0) === "function"; return ret; }; - imports.wbg.__wbg_call_01734de55d61e11d = function() { - return handleError(function(arg0, arg1, arg2) { - const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); - }, arguments); + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); }; imports.wbg.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) { const ret = getObject(arg0).msCrypto; @@ -340,6 +330,16 @@ function __wbg_get_imports() { const ret = getObject(arg0).now(); return ret; }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_call_01734de55d61e11d = function() { + return handleError(function(arg0, arg1, arg2) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments); + }; imports.wbg.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function() { const ret = self.self; @@ -378,6 +378,15 @@ function __wbg_get_imports() { return addHeapObject(ret); }, arguments); }; + imports.wbg.__wbg_subarray_13db269f57aa838d = function(arg0, arg1, arg2) { + const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { + return handleError(function(arg0, arg1) { + getObject(arg0).getRandomValues(getObject(arg1)); + }, arguments); + }; imports.wbg.__wbindgen_memory = function() { const ret = wasm.memory; return addHeapObject(ret); @@ -386,6 +395,13 @@ function __wbg_get_imports() { const ret = getObject(arg0).buffer; return addHeapObject(ret); }; + imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) { + const ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); + }; imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) { const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); @@ -395,22 +411,6 @@ function __wbg_get_imports() { getObject(arg0).randomFillSync(takeObject(arg1)); }, arguments); }; - imports.wbg.__wbg_subarray_13db269f57aa838d = function(arg0, arg1, arg2) { - const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { - return handleError(function(arg0, arg1) { - getObject(arg0).getRandomValues(getObject(arg1)); - }, arguments); - }; - imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) { - const ret = new Uint8Array(getObject(arg0)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) { - getObject(arg0).set(getObject(arg1), arg2 >>> 0); - }; imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { const ret = debugString(getObject(arg1)); const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); @@ -459,7 +459,7 @@ var twsearch_wasm_default = __wbg_init; var cachedInitWrapper; async function initWrapper() { await (cachedInitWrapper ??= (async () => { - const wasmUint8Array = (await import("./twsearch_wasm_bg-EDFRIWUK.js")).default; + const wasmUint8Array = (await import("./twsearch_wasm_bg-JRZN3X3U.js")).default; await twsearch_wasm_default(wasmUint8Array.buffer); })()); } diff --git a/src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-EDFRIWUK.js b/src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-EDFRIWUK.js deleted file mode 100644 index 5bb4a600e..000000000 --- a/src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-EDFRIWUK.js +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:db9bf33f96cd4d9aa82a71c79d4069884a07f4716d8e2abf730dd3a3bdf29ae0 -size 418663 diff --git a/src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-JRZN3X3U.js b/src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-JRZN3X3U.js new file mode 100644 index 000000000..1b753f99a --- /dev/null +++ b/src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-JRZN3X3U.js @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f3b48ab47f687946a9c581ba9562499df375930af79bc9c810a82f47cab1fc2 +size 461555 diff --git a/src/cubing/vendor/mpl/twsearch/vendored-twsearch-git-version.txt b/src/cubing/vendor/mpl/twsearch/vendored-twsearch-git-version.txt index d856b4094..b0df1f3c6 100644 --- a/src/cubing/vendor/mpl/twsearch/vendored-twsearch-git-version.txt +++ b/src/cubing/vendor/mpl/twsearch/vendored-twsearch-git-version.txt @@ -1 +1 @@ -https://github.com/cubing/twsearch/tree/4544d81b7a95f3eb83349b1d247e5b6f2a6012f0 +https://github.com/cubing/twsearch/tree/d7634e6568cba6ab8e58f3b270650f3195425b94