Skip to content

Commit

Permalink
FREEZE.indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Oct 31, 2024
1 parent fdbe7e4 commit d069c5b
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 68 deletions.
19 changes: 9 additions & 10 deletions src/cubing/search/inside/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -113,7 +112,7 @@ async function randomScrambleForEvent(
case "minx":
case "pyram":
case "skewb":
// case "sq1":
case "sq1":
// case "444bf":
case "555bf":
// case "333mbf":
Expand Down Expand Up @@ -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,
Expand Down
108 changes: 54 additions & 54 deletions src/cubing/vendor/mpl/twsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
} };
Expand All @@ -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);
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
})());
}
Expand Down
3 changes: 0 additions & 3 deletions src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-EDFRIWUK.js

This file was deleted.

3 changes: 3 additions & 0 deletions src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-JRZN3X3U.js
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/cubing/twsearch/tree/4544d81b7a95f3eb83349b1d247e5b6f2a6012f0
https://github.com/cubing/twsearch/tree/d7634e6568cba6ab8e58f3b270650f3195425b94

0 comments on commit d069c5b

Please sign in to comment.