feat: WASM probe support - fix type warnings and imports#8
Merged
Conversation
Member
tiye
commented
Apr 23, 2026
- Add bisect-vec, c1, c64 to wasm-probe namespace imports
- Update lookup-i schema arg type to :dynamic (accepts :string? from &str:nth)
- Fix key-after to use &set:to-list instead of .to-list
- All probe functions work correctly: probe-all-count=7
- upgrade calcit-version to 0.12.25, @calcit/procs ^0.12.25 - add packageManager yarn@4.12.0, .yarnrc.yml - upgrade CI to node 24, setup-node@v6, corepack+yarn workflow - add schema type annotations to bisection-key.core functions - add bisection-key.wasm-probe namespace with probe-bisect-basic/strings/all-count - TODO.md: document global def init issue and next steps
…m-probe, update lookup-i schema
There was a problem hiding this comment.
Pull request overview
This PR updates the project toolchain and CalcIt snapshot to support WASM probing, resolves several type/import issues, and modernizes the JS/Yarn + CI setup to run tests under the upgraded CalcIt/procs version.
Changes:
- Upgrade CalcIt/@calcit/procs and migrate to Yarn 4 (Corepack), including lockfile + CI updates.
- Update
compact.cirrusnapshot with schema annotations, string ops adjustments, and a newbisection-key.wasm-probenamespace. - Add a WASM support TODO and repository hygiene updates (
.yarnrc.yml,.gitignore).
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Migrates lockfile to Yarn 4+ format and updates CalcIt dependency versions. |
| package.json | Bumps @calcit/procs, pins Yarn via packageManager, and adds test scripts. |
| deps.cirru | Updates CalcIt version and calcit-test dependency. |
| compact.cirru | Updates CalcIt snapshot: schema/type adjustments, lookup changes, util fix, and WASM probe namespace. |
| calcit.cirru | Removes the older, verbose snapshot file. |
| TODO.md | Documents current WASM status, known issues, and next steps. |
| .yarnrc.yml | Sets Yarn linker to node-modules. |
| .gitignore | Ignores CalcIt snippets and Yarn gz artifacts. |
| .github/workflows/tests.yaml | Updates CI to Node 24 + Corepack/Yarn 4, and runs CR + JS tests with the new toolchain. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+129
to
+133
| defn lookup-i (c) (&str:find-index dictionary c) | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :number) | ||
| :args $ [] :dynamic |
Comment on lines
+152
to
+193
| |probe-c32 $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-c32 () c32 | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :string) | ||
| :args $ [] | ||
| |probe-c64 $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-c64 () c64 | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :string) | ||
| :args $ [] | ||
| |probe-mapget-c1 $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-mapget-c1 () $ &str:find-index dictionary c1 | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :number) | ||
| :args $ [] | ||
| |probe-mapget-core $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-mapget-core () $ &str:find-index dictionary c0 | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :number) | ||
| :args $ [] | ||
| |probe-simple-map $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-simple-map () $ &map:get ({} c0 10 c1 20) c1 | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :number) | ||
| :args $ [] | ||
| |probe-str-append $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-str-append () $ str | c0 c32 | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :string) | ||
| :args $ [] |
| :code $ quote | ||
| defn assoc-nth (x n v) | ||
| when-not (has-nth? x n) (raise "\"Succeeded map size") | ||
| when-not (has-nth? x n) (raise "|Succeeded map size") |
Comment on lines
+600
to
+642
| :ns $ %{} :NsEntry (:doc |) | ||
| :code $ quote | ||
| ns bisection-key.util $ :require | ||
| [] bisection-key.core :refer $ [] mid-id max-id min-id bisect | ||
| |bisection-key.wasm-probe $ %{} :FileEntry | ||
| :defs $ {} | ||
| |probe-all-count $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-all-count () $ &+ (probe-bisect-basic) (probe-bisect-strings) | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :number) | ||
| :args $ [] | ||
| |probe-assert-neq $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-assert-neq () $ if (not= |1 |2) 1 0 | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :number) | ||
| :args $ [] | ||
| |probe-assert-order $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-assert-order () $ if | ||
| or (&= |2 |) | ||
| < (&compare |1 |2) 0 | ||
| , 1 0 | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :number) | ||
| :args $ [] | ||
| |probe-assert-str $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-assert-str () $ and (string? |1) (string? |2) | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :bool) | ||
| :args $ [] | ||
| |probe-assert1 $ %{} :CodeEntry (:doc |) | ||
| :code $ quote | ||
| defn probe-assert1 () $ and (string? |1) (string? |2) | ||
| :examples $ [] | ||
| :schema $ :: :fn | ||
| {} (:return :bool) |
| "devDependencies": {} | ||
| "test:cr": "cr --entry test", | ||
| "test:js": "cr --entry test js && node test.mjs", | ||
| "test:wasm": "cr --entry wasm wasm && node wasm-test.mjs" |
| assert "|[bitsect] arguments should be strings!" $ and (string? x) (string? y) | ||
| assert "|[bisection] keys are identical!" $ not= x y | ||
| assert "|[bisection] x > y" $ or (&= y "\"") | ||
| assert "|[bisection] x > y" $ or (&= y |) |
| @@ -13,24 +13,28 @@ | |||
| defn bisect (x y) | |||
| assert "|[bitsect] arguments should be strings!" $ and (string? x) (string? y) | |||
Comment on lines
+117
to
121
| |char->int-map $ %{} :CodeEntry (:doc |) (:schema :dynamic) | ||
| :code $ quote | ||
| def char->int-map $ -> (split dictionary |) | ||
| map-indexed $ fn (idx char) ([] char idx) | ||
| pairs-map |
| :code $ quote | ||
| defn assoc-after-nth (x n v) | ||
| when-not (has-nth? x n) (raise "\"Succeeded map size") | ||
| when-not (has-nth? x n) (raise "|Succeeded map size") |
| :code $ quote | ||
| defn assoc-before-nth (x n v) | ||
| when-not (has-nth? x n) (raise "\"Succeeded map size") | ||
| when-not (has-nth? x n) (raise "|Succeeded map size") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.