Skip to content

Update Jane Street tests #2048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/build-wasm_of_ocaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ jobs:
matrix:
os:
- ubuntu-latest
os-name:
- Ubuntu
ocaml-compiler:
- "4.14"
- "5.0"
- "5.1"
- "5.3"
- "5.2"
separate_compilation:
- true
jane_street_tests:
Expand All @@ -29,28 +31,36 @@ jobs:
- false
include:
- os: macos-latest
os-name: MacOS
ocaml-compiler: "5.3"
separate_compilation: true
jane_street_tests: false
all_jane_street_tests: false
- os: windows-latest
ocaml-compiler: "5.2"
os-name: Windows
ocaml-compiler: "5.3"
separate_compilation: true
jane_street_tests: true
all_jane_street_tests: true
# Jane Street tests disabled for now (basement only works on Linux)
jane_street_tests: false
all_jane_street_tests: false
- os: ubuntu-latest
ocaml-compiler: "5.2"
os-name: Ubuntu
ocaml-compiler: "5.3"
separate_compilation: true
jane_street_tests: true
all_jane_street_tests: true
- os: ubuntu-latest
ocaml-compiler: "5.2"
os-name: Ubuntu
ocaml-compiler: "5.3"
separate_compilation: false
jane_street_tests: true
all_jane_street_tests: false

runs-on: ${{ matrix.os }}

name:
${{ (! matrix.separate_compilation) && 'Whole program / ' || ''}}${{ matrix.ocaml-compiler }} / ${{ matrix.os-name }}${{ matrix.all_jane_street_tests && ' / Jane Street tests' || ''}}

steps:
- name: Set git to use LF
if: ${{ matrix.os == 'windows-latest' && matrix.ocaml-compiler < 5.2 }}
Expand All @@ -69,7 +79,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: janestreet/opam-repository
ref: 41c89c7824533f6b63cc5b6d75e6ddb1441d1520
ref: 2819773f29b6f6c14b918eae3cb40c8ff6b22d0e
path: janestreet/opam-repository

- name: Set-up Node.js
Expand Down
6 changes: 3 additions & 3 deletions bench.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ocaml/opam:debian-ocaml-5.2
FROM ocaml/opam:debian-ocaml-5.3
WORKDIR /bench-dir

RUN sudo apt-get update \
Expand Down Expand Up @@ -29,7 +29,7 @@ RUN mkdir janestreet \
&& cd janestreet \
&& git clone --depth 20 https://github.com/janestreet/opam-repository \
&& cd opam-repository \
&& git checkout 41c89c7824533f6b63cc5b6d75e6ddb1441d1520 \
&& git checkout 2819773f29b6f6c14b918eae3cb40c8ff6b22d0e \
&& opam remote add js .

# Install dependencies
Expand All @@ -48,7 +48,7 @@ RUN opam exec -- dune exec tools/ci_setup.exe ../janestreet . \
&& opam clean

# Bin_prot packages
RUN opam pin add -n https://github.com/ocaml-wasm/bin_prot.git#wasm-v0.18 \
RUN opam pin add -n https://github.com/janestreet/bin_prot.git#125e336faacd2e2e8c7a1fed2231bde1cebfebdd \
&& opam install ppx_bin_prot

# Copy sources
Expand Down
42 changes: 42 additions & 0 deletions runtime/wasm/bigstring.wat
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,48 @@
(br $loop))))
(ref.i31 (i32.const -1)))

(func (export "caml_bigstring_strncmp")
(param $vs1 (ref eq))
(param $vpos1 (ref eq))
(param $vs2 (ref eq))
(param $vpos2 (ref eq))
(param $vlen (ref eq))
(result (ref eq))

(local $v1 (ref extern))
(local $v2 (ref extern))
(local $pos1 i32)
(local $pos2 i32)
(local $len i32)

(local $i i32)
(local $c1 i32)
(local $c2 i32)

(local.set $v1 (call $caml_ba_get_view (local.get $vs1)))
(local.set $v2 (call $caml_ba_get_view (local.get $vs2)))
(local.set $pos1 (i31.get_s (ref.cast (ref i31) (local.get $vpos1))))
(local.set $pos2 (i31.get_s (ref.cast (ref i31) (local.get $vpos2))))
(local.set $len (i31.get_s (ref.cast (ref i31) (local.get $vlen))))
(loop $loop
(if (i32.lt_u (local.get $i) (local.get $len))
(then
(local.set $c1
(call $dv_get_ui8 (local.get $v1)
(i32.add (local.get $pos1) (local.get $i))))
(local.set $c2
(call $dv_get_ui8 (local.get $v2)
(i32.add (local.get $pos2) (local.get $i))))
(local.set $i (i32.add (local.get $i) (i32.const 1)))
(if (i32.lt_u (local.get $c1) (local.get $c2))
(then (return (ref.i31 (i32.const -1)))))
(if (i32.gt_u (local.get $c1) (local.get $c2))
(then (return (ref.i31 (i32.const 1)))))
(if (i32.eq (local.get $c1) (i32.const 0))
(then (return (ref.i31 (i32.const 0)))))
(br $loop))))
(ref.i31 (i32.const 0)))

(export "caml_bigstring_blit_string_to_ba"
(func $caml_bigstring_blit_bytes_to_ba))
(func $caml_bigstring_blit_bytes_to_ba
Expand Down
Loading