Skip to content

feat: WASM probe support - fix type warnings and imports#8

Merged
tiye merged 5 commits into
mainfrom
wasm-support
Apr 23, 2026
Merged

feat: WASM probe support - fix type warnings and imports#8
tiye merged 5 commits into
mainfrom
wasm-support

Conversation

@tiye
Copy link
Copy Markdown
Member

@tiye 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

tiye added 2 commits April 22, 2026 20:08
- 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
Copilot AI review requested due to automatic review settings April 23, 2026 02:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cirru snapshot with schema annotations, string ops adjustments, and a new bisection-key.wasm-probe namespace.
  • 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 thread compact.cirru
Comment on lines +129 to +133
defn lookup-i (c) (&str:find-index dictionary c)
:examples $ []
:schema $ :: :fn
{} (:return :number)
:args $ [] :dynamic
Comment thread compact.cirru
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 $ []
Comment thread compact.cirru
: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 thread compact.cirru
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)
Comment thread package.json
"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"
Comment thread compact.cirru
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 |)
Comment thread compact.cirru
@@ -13,24 +13,28 @@
defn bisect (x y)
assert "|[bitsect] arguments should be strings!" $ and (string? x) (string? y)
Comment thread compact.cirru
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
Comment thread compact.cirru
: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")
Comment thread compact.cirru
: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")
@tiye tiye merged commit bf84767 into main Apr 23, 2026
1 check passed
@tiye tiye deleted the wasm-support branch April 23, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants