Organisationsahrefsocannle05af9 ()(lint-fmt)

(lint-fmt)

Link Copied
Code Copied

Logs

2025-06-22 13:09.14: New job: test ahrefs/ocannl https://github.com/ahrefs/ocannl.git#refs/heads/master (e05af9c944c022a17d4189c2751f37d18ef61ad1) (linux-x86_64:(lint-fmt))
Base: ocaml/opam:debian-12-ocaml-4.08@sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e
ocamlformat version: version 0.27.0 (from opam)


To reproduce locally:


git clone --recursive "https://github.com/ahrefs/ocannl.git" -b "master" && cd "ocannl" && git reset --hard e05af9c9
cat > Dockerfile <<'END-OF-DOCKERFILE'
FROM ocaml/opam:debian-12-ocaml-4.08@sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e
USER 1000:1000
RUN cd ~/opam-repository && (git cat-file -e 0eea63ad71af2b1116c556023bedc6bf083e6125 || git fetch origin master) && git reset -q --hard 0eea63ad71af2b1116c556023bedc6bf083e6125 && git log --no-decorate -n1 --oneline && opam update -u
RUN opam depext -i dune
WORKDIR /src
RUN opam depext -i ocamlformat=0.27.0
COPY --chown=1000:1000 . /src/
RUN opam exec -- dune build @fmt --ignore-promoted-rules || (echo "dune build @fmt failed"; exit 2)


END-OF-DOCKERFILE
docker build .
END-REPRO-BLOCK


2025-06-22 13:09.14: Using cache hint "ahrefs/ocannl-ocaml/opam:debian-12-ocaml-4.08@sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e-debian-12-4.08_opam-2.3-ocamlformat-0eea63ad71af2b1116c556023bedc6bf083e6125"
2025-06-22 13:09.14: Using OBuilder spec:
((from ocaml/opam:debian-12-ocaml-4.08@sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e)
(user (uid 1000) (gid 1000))
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "cd ~/opam-repository && (git cat-file -e 0eea63ad71af2b1116c556023bedc6bf083e6125 || git fetch origin master) && git reset -q --hard 0eea63ad71af2b1116c556023bedc6bf083e6125 && git log --no-decorate -n1 --oneline && opam update -u"))
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam depext -i dune"))
(workdir /src)
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam depext -i ocamlformat=0.27.0"))
(copy (src .) (dst /src/))
(run (shell "opam exec -- dune build @fmt --ignore-promoted-rules || (echo \"dune build @fmt failed\"; exit 2)"))
)


2025-06-22 13:09.14: Waiting for resource in pool OCluster
2025-06-22 13:09.14: Waiting for worker…
2025-06-22 13:09.16: Got resource from pool OCluster
Building on asteria.caelum.ci.dev
All commits already cached
HEAD is now at e05af9c9 Migrate to ppxlib 0.36: ppx_cd and cleanup


(from ocaml/opam:debian-12-ocaml-4.08@sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e)
Unable to find image 'ocaml/opam:debian-12-ocaml-4.08@sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e' locally
docker.io/ocaml/opam@sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e: Pulling from ocaml/opam
8a97734bcf6d: Pulling fs layer
8a97734bcf6d: Verifying Checksum
8a97734bcf6d: Download complete
8a97734bcf6d: Pull complete
Digest: sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e
Status: Downloaded newer image for ocaml/opam@sha256:cc4b148b1fa1916574df02fcec0956fedbec6798bedacd9bfd4417c1c098ce8e
2025-06-22 13:09.17 ---> using "4ea5038d254cfd14663698deb665a2dc4ce1e1383d544c063adebb02ed15ce16" from cache


/: (user (uid 1000) (gid 1000))


/: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "cd ~/opam-repository && (git cat-file -e 0eea63ad71af2b1116c556023bedc6bf083e6125 || git fetch origin master) && git reset -q --hard 0eea63ad71af2b1116c556023bedc6bf083e6125 && git log --no-decorate -n1 --oneline && opam update -u"))
0eea63ad71 Merge pull request #27946 from mtelvers/opam-publish-ocaml-version.4.0.1


<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised
default (at git+file:///home/opam/opam-repository):
[INFO] opam 2.1 and 2.2 include many performance and security improvements over 2.0; please consider upgrading (https://opam.ocaml.org/doc/Install.html)


Everything as up-to-date as possible (run with --verbose to show unavailable upgrades).
However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall the conflicting packages.
Nothing to do.
# Run eval $(opam env) to update the current shell environment
2025-06-22 13:10.09 ---> saved as "ed14c208b709d50e26e290f8f669e0b0b6a2456751ee5b87b29d71221f0a9fc1"


/: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam depext -i dune"))
# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=debian, os-family=debian
# No extra OS packages requirements found.
# All required OS packages found.
# Now letting opam install the packages
The following actions will be performed:
- install dune 3.19.1


<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[dune.3.19.1] found in cache


<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed dune.3.19.1
Done.
# Run eval $(opam env) to update the current shell environment
2025-06-22 13:10.50 ---> saved as "249f8284e2625ce869f4c794eb6ff1eab40d82e0af762bb312d97ad81bf8d4f1"


/: (workdir /src)


/src: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam depext -i ocamlformat=0.27.0"))
# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=debian, os-family=debian
# No extra OS packages requirements found.
# All required OS packages found.
# Now letting opam install the packages
The following actions will be performed:
- install sexplib0          v0.14.0  [required by base]
- install cmdliner          1.3.0    [required by ocamlformat]
- install menhirLib         20240715 [required by ocamlformat-lib]
- install menhirCST         20240715 [required by menhir]
- install ocamlbuild        0.16.1   [required by fpath, astring, uuseg]
- install dune-build-info   3.19.1   [required by ocamlformat-lib]
- install menhirSdk         20240715 [required by ocamlformat-lib]
- install either            1.0.0    [required by ocamlformat-lib]
- install ocaml-version     4.0.1    [required by ocamlformat-lib]
- install camlp-streams     5.0.1    [required by ocamlformat-lib]
- install csexp             1.5.2    [required by ocamlformat]
- install seq               base     [required by re]
- install fix               20250428 [required by ocamlformat-lib]
- install ocamlfind         1.9.8    [required by ocp-indent, astring, fpath, uuseg]
- install menhir            20240715 [required by ocamlformat-lib]
- install dune-configurator 3.19.1   [required by base]
- install re                1.11.0   [required by ocamlformat]
- install topkg             1.0.8    [required by fpath, astring, uuseg]
- install base-bytes        base     [required by ocp-indent]
- install base              v0.14.3  [required by ocamlformat-lib]
- install uutf              1.0.4    [required by ocamlformat-lib]
- install astring           0.8.5    [required by ocamlformat-lib]
- install ocp-indent        1.8.1    [required by ocamlformat-lib]
- install stdio             v0.14.0  [required by ocamlformat-lib]
- install uucp              15.0.0   [required by uuseg]
- install fpath             0.7.3    [required by ocamlformat-lib]
- install uuseg             15.0.0   [required by ocamlformat-lib]
- install ocamlformat-lib   0.27.0   [required by ocamlformat]
- install ocamlformat       0.27.0
===== 29 to install =====


<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[astring.0.8.5] found in cache
[base.v0.14.3] found in cache
[camlp-streams.5.0.1] found in cache
[cmdliner.1.3.0] found in cache
[csexp.1.5.2] found in cache
[dune-build-info.3.19.1] found in cache
[dune-configurator.3.19.1] found in cache
[either.1.0.0] found in cache
[fix.20250428] found in cache
[fpath.0.7.3] found in cache
[menhir.20240715] found in cache
[menhirCST.20240715] found in cache
[menhirLib.20240715] found in cache
[menhirSdk.20240715] found in cache
[ocaml-version.4.0.1] found in cache
[ocamlbuild.0.16.1] found in cache
[ocamlfind.1.9.8] found in cache
[ocamlformat.0.27.0] found in cache
[ocamlformat-lib.0.27.0] found in cache
[ocp-indent.1.8.1] found in cache
[re.1.11.0] found in cache
[sexplib0.v0.14.0] found in cache
[stdio.v0.14.0] found in cache
[topkg.1.0.8] found in cache
[uucp.15.0.0] found in cache
[uuseg.15.0.0] found in cache
[uutf.1.0.4] found in cache


<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed seq.base
-> installed camlp-streams.5.0.1
-> installed cmdliner.1.3.0
-> installed csexp.1.5.2
-> installed either.1.0.0
-> installed fix.20250428
-> installed menhirCST.20240715
-> installed menhirLib.20240715
-> installed menhirSdk.20240715
-> installed ocaml-version.4.0.1
-> installed sexplib0.v0.14.0
-> installed re.1.11.0
-> installed dune-build-info.3.19.1
-> installed ocamlfind.1.9.8
-> installed base-bytes.base
-> installed dune-configurator.3.19.1
-> installed ocamlbuild.0.16.1
-> installed ocp-indent.1.8.1
-> installed topkg.1.0.8
-> installed base.v0.14.3
-> installed astring.0.8.5
-> installed uutf.1.0.4
-> installed stdio.v0.14.0
-> installed menhir.20240715
-> installed fpath.0.7.3
-> installed uucp.15.0.0
-> installed uuseg.15.0.0
-> installed ocamlformat-lib.0.27.0
-> installed ocamlformat.0.27.0
Done.


<><> ocp-indent.1.8.1 installed successfully ><><><><><><><><><><><><><><><><><>
=> This package requires additional configuration for use in editors. Install package 'user-setup', or manually:


* for Emacs, add these lines to ~/.emacs:
(add-to-list 'load-path "/home/opam/.opam/4.08/share/emacs/site-lisp")
(require 'ocp-indent)


* for Vim, add this line to ~/.vimrc:
set rtp^="/home/opam/.opam/4.08/share/ocp-indent/vim"
# Run eval $(opam env) to update the current shell environment
2025-06-22 13:11.48 ---> saved as "7fd5d4ac1bb4f93065934b08bd6aad3989793fd62a884f257d9f7ac1e147ec1a"


/src: (copy (src .) (dst /src/))
2025-06-22 13:11.48 ---> saved as "2e1b86f28b8f7a8563c43da79c610d6b50b3d822bdec9fed81f1f7d74c00cfdd"


/src: (run (shell "opam exec -- dune build @fmt --ignore-promoted-rules || (echo \"dune build @fmt failed\"; exit 2)"))
File "arrayjit/bin/dune", line 6, characters 21-34:
6 |   (pps ppx_minidebug ppx_sexp_conv))
^^^^^^^^^^^^^
Error: Library "ppx_sexp_conv" not found.
-> required by _build/default/arrayjit/bin/read_config.exe
-> required by %{dep:../../arrayjit/bin/read_config.exe} at test/dune:25
-> required by _build/default/test/config/ocannl_backend.txt
-> required by %{read:config/ocannl_backend.txt} at test/dune:44
-> required by Computing directory contents of _build/default/test
File "arrayjit/bin/dune", line 6, characters 7-20:
6 |   (pps ppx_minidebug ppx_sexp_conv))
^^^^^^^^^^^^^
Error: Library "ppx_minidebug" not found.
-> required by _build/default/arrayjit/bin/.merlin-conf/exe-read_config
-> required by _build/default/arrayjit/bin/read_config.exe
-> required by %{dep:../../arrayjit/bin/read_config.exe} at test/dune:25
-> required by _build/default/test/config/ocannl_backend.txt
-> required by %{read:config/ocannl_backend.txt} at test/dune:44
-> required by Computing directory contents of _build/default/test
File "datasets/dataset_utils.mli", line 1, characters 0-0:
diff --git a/_build/default/datasets/dataset_utils.mli b/_build/default/datasets/.formatted/dataset_utils.mli
index ec71cb7..b952d3a 100644
--- a/_build/default/datasets/dataset_utils.mli
+++ b/_build/default/datasets/.formatted/dataset_utils.mli
@@ -14,8 +14,8 @@ val get_cache_dir : string -> string
val download_file : string -> string -> unit
(** Download a file from a URL to a destination path.


-    Creates parent directories as needed, downloads the file from [url], and
-    saves it to [dest_path].
+    Creates parent directories as needed, downloads the file from [url], and saves it to
+    [dest_path].


{2 Parameters}
- url: the source URL of the file.
@@ -37,17 +37,12 @@ val ensure_file : string -> string -> unit
- [Failure] on download or write error. *)


val ensure_extracted_archive :
-  url:string ->
-  archive_path:string ->
-  extract_dir:string ->
-  check_file:string ->
-  unit
+  url:string -> archive_path:string -> extract_dir:string -> check_file:string -> unit
(** Ensure an archive is downloaded, extracted, and a file exists.


-    Checks if [check_file] (relative to [extract_dir]) exists. If not, downloads
-    the archive from [url] to [archive_path], extracts it into [extract_dir],
-    and verifies [check_file] is present. Currently supports only .tar.gz
-    archives.
+    Checks if [check_file] (relative to [extract_dir]) exists. If not, downloads the archive from
+    [url] to [archive_path], extracts it into [extract_dir], and verifies [check_file] is present.
+    Currently supports only .tar.gz archives.


{2 Parameters}
- url: the source URL of the archive.
@@ -61,8 +56,8 @@ val ensure_extracted_archive :
val ensure_decompressed_gz : gz_path:string -> target_path:string -> bool
(** Ensure a gzip-compressed file is decompressed to a target path.


-    If [target_path] exists, does nothing and returns [true]. Otherwise, if
-    [gz_path] exists, decompresses it to [target_path].
+    If [target_path] exists, does nothing and returns [true]. Otherwise, if [gz_path] exists,
+    decompresses it to [target_path].


{2 Parameters}
- gz_path: the path to the .gz file to decompress.
@@ -78,8 +73,8 @@ val ensure_decompressed_gz : gz_path:string -> target_path:string -> bool
val parse_float_cell : context:(unit -> string) -> string -> float
(** Parse a CSV cell as a float.


-    Attempts to convert [value] to a float. On failure, raises [Failure] with a
-    descriptive message including [context ()].
+    Attempts to convert [value] to a float. On failure, raises [Failure] with a descriptive message
+    including [context ()].


{2 Parameters}
- context: a function returning context information for error messages.
@@ -94,8 +89,8 @@ val parse_float_cell : context:(unit -> string) -> string -> float
val parse_int_cell : context:(unit -> string) -> string -> int
(** Parse a CSV cell as an integer.


-    Attempts to convert [value] to an int. On failure, raises [Failure] with a
-    descriptive message including [context ()].
+    Attempts to convert [value] to an int. On failure, raises [Failure] with a descriptive message
+    including [context ()].


{2 Parameters}
- context: a function returning context information for error messages.
@@ -110,8 +105,8 @@ val parse_int_cell : context:(unit -> string) -> string -> int
val mkdir_p : string -> unit
(** Recursively create a directory and its parents.


-    Creates the directory at [path], along with any missing parent directories.
-    If [path] already exists as a directory, does nothing.
+    Creates the directory at [path], along with any missing parent directories. If [path] already
+    exists as a directory, does nothing.


{2 Parameters}
- path: the directory path to create.
File "datasets/cifar10.ml", line 1, characters 0-0:
diff --git a/_build/default/datasets/cifar10.ml b/_build/default/datasets/.formatted/cifar10.ml
index e5e3dac..803ac16 100644
--- a/_build/default/datasets/cifar10.ml
+++ b/_build/default/datasets/.formatted/cifar10.ml
@@ -28,15 +28,12 @@ let read_cifar_batch filename =
let num_bytes = String.length s in
let bytes_per_image = 3073 in
if num_bytes mod bytes_per_image <> 0 then
-    failwith
-      (Printf.sprintf "File %s has unexpected size %d" filename num_bytes);
+    failwith (Printf.sprintf "File %s has unexpected size %d" filename num_bytes);


let num_images = num_bytes / bytes_per_image in
Printf.printf "Found %d images in %s.\n%!" num_images filename;


-  let images =
-    Genarray.create int8_unsigned c_layout [| num_images; 32; 32; 3 |]
-  in
+  let images = Genarray.create int8_unsigned c_layout [| num_images; 32; 32; 3 |] in
let labels = Array1.create int8_unsigned c_layout num_images in


for i = 0 to num_images - 1 do
@@ -48,14 +45,11 @@ let read_cifar_batch filename =
for row = 0 to 31 do
for col = 0 to 31 do
let plane_idx = (row * 32) + col in
-        Genarray.set images [| i; row; col; 0 |]
-          (Char.code s.[r_offset + plane_idx]);
+        Genarray.set images [| i; row; col; 0 |] (Char.code s.[r_offset + plane_idx]);
(* Red *)
-        Genarray.set images [| i; row; col; 1 |]
-          (Char.code s.[g_offset + plane_idx]);
+        Genarray.set images [| i; row; col; 1 |] (Char.code s.[g_offset + plane_idx]);
(* Green *)
-        Genarray.set images [| i; row; col; 2 |]
-          (Char.code s.[b_offset + plane_idx])
+        Genarray.set images [| i; row; col; 2 |] (Char.code s.[b_offset + plane_idx])
(* Blue *)
done
done
@@ -73,9 +67,7 @@ let load () =


let total_train_images = 50000 in
(* Create the final training Genarray *)
-  let train_images =
-    Genarray.create int8_unsigned c_layout [| total_train_images; 32; 32; 3 |]
-  in
+  let train_images = Genarray.create int8_unsigned c_layout [| total_train_images; 32; 32; 3 |] in
let train_labels = Array1.create int8_unsigned c_layout total_train_images in


let current_offset = ref 0 in
@@ -83,20 +75,14 @@ let load () =
(fun (batch_images, batch_labels) ->
let batch_size = Array1.dim batch_labels in
let img_slice_dims = [| batch_size; 32; 32; 3 |] in
-      let img_slice =
-        Genarray.sub_left train_images !current_offset batch_size
-      in
+      let img_slice = Genarray.sub_left train_images !current_offset batch_size in
(* Ensure the slice has the expected dimensions before blitting *)
if Genarray.dims img_slice <> img_slice_dims then
failwith
(Printf.sprintf
-             "Internal error: train image slice dimension mismatch (expected \
-              %s, got %s)"
-             (String.concat "x"
-                (Array.to_list (Array.map string_of_int img_slice_dims)))
-             (String.concat "x"
-                (Array.to_list
-                   (Array.map string_of_int (Genarray.dims img_slice)))));
+             "Internal error: train image slice dimension mismatch (expected %s, got %s)"
+             (String.concat "x" (Array.to_list (Array.map string_of_int img_slice_dims)))
+             (String.concat "x" (Array.to_list (Array.map string_of_int (Genarray.dims img_slice)))));


let lbl_slice = Array1.sub train_labels !current_offset batch_size in
Genarray.blit batch_images img_slice;
File "arrayjit/test/test_numerical_types.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/test/test_numerical_types.ml b/_build/default/arrayjit/test/.formatted/test_numerical_types.ml
index 7a25434..92fcbca 100644
--- a/_build/default/arrayjit/test/test_numerical_types.ml
+++ b/_build/default/arrayjit/test/.formatted/test_numerical_types.ml
@@ -48,13 +48,15 @@ let test_padding () =
Stdio.printf "\n\nTesting padding functionality:\n";


(* Test padding with float32 array *)
-  let padding_config = [| { Ndarray.left = 1; right = 1 }; { left = 2; right = 1 } |] in (* left=1,right=1 for first dim; left=2,right=1 for second dim *)
+  let padding_config = [| { Ndarray.left = 1; right = 1 }; { left = 2; right = 1 } |] in
+  (* left=1,right=1 for first dim; left=2,right=1 for second dim *)
let padding_value = -999.0 in


-  let padded_dims = [| 4; 6 |] in (* (2+1+1) x (3+2+1) *)
-
+  let padded_dims = [| 4; 6 |] in
+  (* (2+1+1) x (3+2+1) *)
+
let arr =
-    Ndarray.create_array ~debug:"padded_test" Ops.single ~dims:padded_dims
+    Ndarray.create_array ~debug:"padded_test" Ops.single ~dims:padded_dims
~padding:(Some (padding_config, padding_value))
(Ops.Constant_fill { values = [| 1.0; 2.0; 3.0; 4.0; 5.0; 6.0 |]; strict = true })
in
@@ -65,12 +67,13 @@ let test_padding () =
for j = 0 to dims.(1) - 1 do
let idx = [| i; j |] in
let value = Ndarray.get_as_float arr idx in
-      Stdio.printf "%8.1f " value;
+      Stdio.printf "%8.1f " value
done;
Stdio.printf "\n"
done;
-
-  Stdio.printf "\nExpected: padding value (-999.0) in margins, data values (1.0-6.0) in center region\n"
+
+  Stdio.printf
+    "\nExpected: padding value (-999.0) in margins, data values (1.0-6.0) in center region\n"


let () =
test_bfloat16_conversions ();
File "datasets/mnist.ml", line 1, characters 0-0:
diff --git a/_build/default/datasets/mnist.ml b/_build/default/datasets/.formatted/mnist.ml
index 82516e3..21e5639 100644
--- a/_build/default/datasets/mnist.ml
+++ b/_build/default/datasets/.formatted/mnist.ml
@@ -19,14 +19,10 @@ module Config = struct
{
name = "MNIST";
cache_subdir = "mnist/";
-      train_images_url =
-        "https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz";
-      train_labels_url =
-        "https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz";
-      test_images_url =
-        "https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz";
-      test_labels_url =
-        "https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz";
+      train_images_url = "https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz";
+      train_labels_url = "https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz";
+      test_images_url = "https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz";
+      test_labels_url = "https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz";
image_magic_number = 2051;
label_magic_number = 2049;
}
@@ -79,8 +75,7 @@ let ensure_dataset config =
let path = dataset_dir ^ base_filename in


if not (Sys.file_exists path) then (
-        Printf.printf "File %s not found for %s dataset.\n%!" base_filename
-          config.name;
+        Printf.printf "File %s not found for %s dataset.\n%!" base_filename config.name;
(* Ensure the .gz file is downloaded *)
ensure_file url gz_path;
(* Ensure it's decompressed *)
@@ -89,25 +84,21 @@ let ensure_dataset config =
else Printf.printf "Found decompressed file %s.\n%!" path)
files_to_process


-let read_idx_file ~read_header ~create_array ~populate_array ~expected_magic
-    config filename =
+let read_idx_file ~read_header ~create_array ~populate_array ~expected_magic config filename =
Printf.printf "Reading %s file: %s\n%!" config.Config.name filename;
let ic = open_in_bin filename in
let s =
try really_input_string ic (in_channel_length ic)
with exn ->
close_in_noerr ic;
-      failwith
-        (Printf.sprintf "Error reading file %s: %s" filename
-           (Printexc.to_string exn))
+      failwith (Printf.sprintf "Error reading file %s: %s" filename (Printexc.to_string exn))
in
close_in ic;


let magic = read_int32_be s 0 in
if magic <> expected_magic then
failwith
-      (Printf.sprintf "Invalid magic number %d in %s (expected %d)" magic
-         filename expected_magic);
+      (Printf.sprintf "Invalid magic number %d in %s (expected %d)" magic filename expected_magic);


let dimensions, data_offset = read_header s in
let total_items, data_len =
@@ -119,17 +110,14 @@ let read_idx_file ~read_header ~create_array ~populate_array ~expected_magic
let expected_len = data_offset + data_len in
if String.length s <> expected_len then
failwith
-      (Printf.sprintf
-         "File %s has unexpected length: %d vs %d (header offset %d, data len \
-          %d)"
+      (Printf.sprintf "File %s has unexpected length: %d vs %d (header offset %d, data len %d)"
filename (String.length s) expected_len data_offset data_len);


let arr = create_array dimensions in
populate_array arr s data_offset total_items;
arr


-(* read_images and read_labels remain largely the same, just use the config
-   passed in *)
+(* read_images and read_labels remain largely the same, just use the config passed in *)
let read_images config filename =
let read_header s =
let num_images = read_int32_be s 4 in
@@ -137,9 +125,7 @@ let read_images config filename =
let num_cols = read_int32_be s 12 in
([| num_images; num_rows; num_cols |], 16)
in
-  let create_array dims =
-    Array3.create int8_unsigned c_layout dims.(0) dims.(1) dims.(2)
-  in
+  let create_array dims = Array3.create int8_unsigned c_layout dims.(0) dims.(1) dims.(2) in
let populate_array arr s offset _ =
let num_images = Array3.dim1 arr in
let num_rows = Array3.dim2 arr in
File "datasets/dataset_utils.ml", line 1, characters 0-0:
diff --git a/_build/default/datasets/dataset_utils.ml b/_build/default/datasets/.formatted/dataset_utils.ml
index 219b7e0..e629cb3 100644
--- a/_build/default/datasets/dataset_utils.ml
+++ b/_build/default/datasets/.formatted/dataset_utils.ml
@@ -5,9 +5,7 @@ let () = Curl.global_init Curl.CURLINIT_GLOBALALL
let mkdir_p path perm =
if path = "" || path = "." || path = Filename.dir_sep then ()
else
-    let components =
-      String.split_on_char Filename.dir_sep.[0] path |> List.filter (( <> ) "")
-    in
+    let components = String.split_on_char Filename.dir_sep.[0] path |> List.filter (( <> ) "") in
let is_absolute = path <> "" && path.[0] = Filename.dir_sep.[0] in
let initial_prefix = if is_absolute then Filename.dir_sep else "." in


@@ -20,50 +18,38 @@ let mkdir_p path perm =
in
(if Sys.file_exists next_path then (
if not (Sys.is_directory next_path) then
-                failwith
-                  (Printf.sprintf "mkdir_p: '%s' exists but is not a directory"
-                     next_path))
+                failwith (Printf.sprintf "mkdir_p: '%s' exists but is not a directory" next_path))
else
try Unix.mkdir next_path perm with
| Unix.Unix_error (Unix.EEXIST, _, _) ->
if not (Sys.is_directory next_path) then
failwith
-                      (Printf.sprintf
-                         "mkdir_p: '%s' appeared as non-directory file after \
-                          EEXIST"
+                      (Printf.sprintf "mkdir_p: '%s' appeared as non-directory file after EEXIST"
next_path)
| Unix.Unix_error (e, fn, arg) ->
failwith
-                    (Printf.sprintf
-                       "mkdir_p: Cannot create directory '%s': %s (%s %s)"
-                       next_path (Unix.error_message e) fn arg)
+                    (Printf.sprintf "mkdir_p: Cannot create directory '%s': %s (%s %s)" next_path
+                       (Unix.error_message e) fn arg)
| ex ->
failwith
-                    (Printf.sprintf
-                       "mkdir_p: Unexpected error creating directory '%s': %s"
+                    (Printf.sprintf "mkdir_p: Unexpected error creating directory '%s': %s"
next_path (Printexc.to_string ex)));
next_path)
initial_prefix components);
()


module Xdg = struct
-  let home =
-    try Sys.getenv "HOME"
-    with Not_found -> failwith "HOME environment variable not set."
-
+  let home = try Sys.getenv "HOME" with Not_found -> failwith "HOME environment variable not set."
let cache_base = home ^ "/.cache/ocaml-nx/datasets/"
end


let get_cache_dir dataset_name = Xdg.cache_base ^ dataset_name ^ "/"
-
-let mkdir_p dir =
-  try mkdir_p dir 0o755 with Unix.Unix_error (Unix.EEXIST, _, _) -> ()
+let mkdir_p dir = try mkdir_p dir 0o755 with Unix.Unix_error (Unix.EEXIST, _, _) -> ()


let download_file url dest_path =
let dest_dir = Filename.dirname dest_path in
mkdir_p dest_dir;
-  Printf.printf "Attempting to download %s to %s\n%!" (Filename.basename url)
-    dest_path;
+  Printf.printf "Attempting to download %s to %s\n%!" (Filename.basename url) dest_path;
let h = new Curl.handle in
h#set_url url;
(* Follow redirects *)
@@ -82,20 +68,15 @@ let download_file url dest_path =
String.length s);
h#perform;
let code = h#get_responsecode in
-      if code >= 200 && code < 300 then Ok ()
-      else Error (Printf.sprintf "HTTP Error: %d" code)
+      if code >= 200 && code < 300 then Ok () else Error (Printf.sprintf "HTTP Error: %d" code)
with
-    | Curl.CurlException (_code, _, msg) ->
-        Error (Printf.sprintf "Curl error: %s" msg)
-    | exn ->
-        Error (Printf.sprintf "Download exception: %s" (Printexc.to_string exn))
+    | Curl.CurlException (_code, _, msg) -> Error (Printf.sprintf "Curl error: %s" msg)
+    | exn -> Error (Printf.sprintf "Download exception: %s" (Printexc.to_string exn))
in
close_out oc;
h#cleanup;
match result with
-  | Ok () ->
-      Printf.printf "Downloaded %s successfully.\n%!"
-        (Filename.basename dest_path)
+  | Ok () -> Printf.printf "Downloaded %s successfully.\n%!" (Filename.basename dest_path)
| Error msg ->
(* Clean up potentially incomplete file *)
(try Sys.remove dest_path with Sys_error _ -> ());
@@ -116,26 +97,19 @@ let ensure_extracted_archive ~url ~archive_path ~extract_dir ~check_file =
(* Basic support for tar.gz *)
if Filename.check_suffix archive_path ".tar.gz" then (
let command =
-        Printf.sprintf "tar xzf %s -C %s"
-          (Filename.quote archive_path)
-          (Filename.quote extract_dir)
+        Printf.sprintf "tar xzf %s -C %s" (Filename.quote archive_path) (Filename.quote extract_dir)
in
Printf.printf "Executing: %s\n%!" command;
let exit_code = Unix.system command in
if exit_code <> Unix.WEXITED 0 then
-        failwith
-          (Printf.sprintf "Archive extraction command failed: '%s'" command)
+        failwith (Printf.sprintf "Archive extraction command failed: '%s'" command)
else Printf.printf "Extracted archive successfully.\n%!"
(* Verify extraction *))
-    else
-      failwith
-        (Printf.sprintf "Unsupported archive type for %s (only .tar.gz)"
-           archive_path);
+    else failwith (Printf.sprintf "Unsupported archive type for %s (only .tar.gz)" archive_path);


if not (Sys.file_exists check_file_full_path) then
failwith
-        (Printf.sprintf "Extraction failed, %s not found after extraction."
-           check_file_full_path))
+        (Printf.sprintf "Extraction failed, %s not found after extraction." check_file_full_path))
else Printf.printf "Found extracted file %s.\n%!" check_file_full_path


let ensure_decompressed_gz ~gz_path ~target_path =
@@ -159,8 +133,7 @@ let ensure_decompressed_gz ~gz_path ~target_path =
close_out oc;
Printf.printf "Decompressed to %s.\n%!" target_path;
true
-    with Gzip.Error msg ->
-      failwith (Printf.sprintf "Gzip error for %s: %s" gz_path msg))
+    with Gzip.Error msg -> failwith (Printf.sprintf "Gzip error for %s: %s" gz_path msg))
else (
Printf.printf "Compressed file %s not found.\n%!" gz_path;
false)
File "arrayjit/lib/assignments.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/assignments.ml b/_build/default/arrayjit/lib/.formatted/assignments.ml
index bd3908f..3e41a7e 100644
--- a/_build/default/arrayjit/lib/assignments.ml
+++ b/_build/default/arrayjit/lib/.formatted/assignments.ml
@@ -154,20 +154,20 @@ let%diagn2_sexp to_low_level code =
let projections = Lazy.force projections in
let basecase rev_iters =
(* Create a substitution from product iterators to loop iterators *)
-      let subst_map =
+      let subst_map =
let loop_iters = Array.of_list_rev rev_iters in
Array.mapi projections.product_iterators ~f:(fun i prod_iter ->
-          (prod_iter, Indexing.Iterator loop_iters.(i)))
+            (prod_iter, Indexing.Iterator loop_iters.(i)))
|> Array.to_list
|> Map.of_alist_exn (module Indexing.Symbol)
in
(* Substitute in projections *)
let subst_index = function
| Indexing.Fixed_idx _ as idx -> idx
-        | Indexing.Iterator s as idx ->
-            Option.value ~default:idx (Map.find subst_map s)
+        | Indexing.Iterator s as idx -> Option.value ~default:idx (Map.find subst_map s)
| Indexing.Affine { symbols; offset } ->
-            (* For affine indices, we don't substitute - they should already use the right symbols *)
+            (* For affine indices, we don't substitute - they should already use the right
+               symbols *)
Indexing.Affine { symbols; offset }
in
let lhs_idcs = Array.map projections.project_lhs ~f:subst_index in
File "arrayjit/lib/tnode.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/tnode.ml b/_build/default/arrayjit/lib/.formatted/tnode.ml
index 93c8f75..0a7293b 100644
--- a/_build/default/arrayjit/lib/tnode.ml
+++ b/_build/default/arrayjit/lib/.formatted/tnode.ml
@@ -105,7 +105,6 @@ let dims_without_padding tn =
Array.map2_exn dims padding ~f:(fun dim { left; right } -> dim - left - right)


let get_padding tn = Lazy.force tn.padding
-
let id { id; _ } = "n" ^ Int.to_string id
let label a = String.concat ~sep:"_" a.label
let is_alphanum_ = String.for_all ~f:(fun c -> Char.equal c '_' || Char.is_alphanum c)
@@ -540,8 +539,8 @@ let create ?default_prec ~id ~label ~dims ~padding init_op =
lazy
(if is_hosted_force tn 30 then
Some
-           (Nd.create_array ~debug (Lazy.force prec) ~dims:(Lazy.force dims) ~padding:(Lazy.force padding)
-              init_op)
+           (Nd.create_array ~debug (Lazy.force prec) ~dims:(Lazy.force dims)
+              ~padding:(Lazy.force padding) init_op)
else None)
and prec =
lazy
File "arrayjit/lib/ndarray.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/ndarray.ml b/_build/default/arrayjit/lib/.formatted/ndarray.ml
index e7c81cb..39b9190 100644
--- a/_build/default/arrayjit/lib/ndarray.ml
+++ b/_build/default/arrayjit/lib/.formatted/ndarray.ml
@@ -130,48 +130,48 @@ let indices_to_offset ~dims ~idcs =
Array.fold2_exn dims idcs ~init:0 ~f:(fun accu dim idx -> (accu * dim) + idx)


(** {2 *** Initialization ***} *)
-
-type axis_padding = { left : int; right : int }
-[@@deriving sexp, equal]
+
+type axis_padding = { left : int; right : int } [@@deriving sexp, equal]


let create_bigarray (type ocaml elt_t) (prec : (ocaml, elt_t) Ops.precision) ~dims ~padding
(init_op : Ops.init_op) : (ocaml, elt_t) bigarray =
Option.iter Utils.settings.fixed_state_for_init ~f:(fun seed -> Rand.Lib.init seed);
-
+
(* Handle padding: dims already includes padding, compute unpadded dimensions *)
-  let unpadded_dims, padding_info = match padding with
-    | None -> dims, None
+  let unpadded_dims, padding_info =
+    match padding with
+    | None -> (dims, None)
| Some (pad_config, pad_value) ->
-        let unpadded_dims = Array.map2_exn dims pad_config ~f:(fun dim { left; right } ->
-          dim - left - right) in
+        let unpadded_dims =
+          Array.map2_exn dims pad_config ~f:(fun dim { left; right } -> dim - left - right)
+        in
(unpadded_dims, Some (pad_config, pad_value))
in
-
+
let arr = create_bigarray_of_prec prec dims in
-
+
(* Fill with padding value if padding is specified *)
(match padding_info with
-   | None -> ()
-   | Some (_, pad_value) ->
-       (* Fill the entire array with padding value using precision-specific fill *)
-       (match prec with
-        | Ops.Byte -> A.fill arr (Char.of_int_exn @@ Int.of_float pad_value)
-        | Ops.Uint16 -> A.fill arr (Int.of_float pad_value)
-        | Ops.Int32 -> A.fill arr (Int32.of_float pad_value)
-        | Ops.Half -> A.fill arr pad_value
-        | Ops.Bfloat16 -> A.fill arr (float_to_bfloat16 pad_value)
-        | Ops.Fp8 -> A.fill arr (Char.of_int_exn @@ float_to_fp8 pad_value)
-        | Ops.Single -> A.fill arr pad_value
-        | Ops.Double -> A.fill arr pad_value));
-
+  | None -> ()
+  | Some (_, pad_value) -> (
+      (* Fill the entire array with padding value using precision-specific fill *)
+      match prec with
+      | Ops.Byte -> A.fill arr (Char.of_int_exn @@ Int.of_float pad_value)
+      | Ops.Uint16 -> A.fill arr (Int.of_float pad_value)
+      | Ops.Int32 -> A.fill arr (Int32.of_float pad_value)
+      | Ops.Half -> A.fill arr pad_value
+      | Ops.Bfloat16 -> A.fill arr (float_to_bfloat16 pad_value)
+      | Ops.Fp8 -> A.fill arr (Char.of_int_exn @@ float_to_fp8 pad_value)
+      | Ops.Single -> A.fill arr pad_value
+      | Ops.Double -> A.fill arr pad_value));
+
(* Helper function to convert unpadded indices to padded indices *)
let unpadded_to_padded_indices idcs =
match padding_info with
| None -> idcs
-    | Some (pad_config, _) ->
-        Array.map2_exn idcs pad_config ~f:(fun idx { left; _ } -> idx + left)
+    | Some (pad_config, _) -> Array.map2_exn idcs pad_config ~f:(fun idx { left; _ } -> idx + left)
in
-
+
(* For non-constant fill operations, we need to iterate over unpadded dimensions *)
let init_unpadded_region init_func =
let rec loop_dims idcs dim_idx =
@@ -186,7 +186,7 @@ let create_bigarray (type ocaml elt_t) (prec : (ocaml, elt_t) Ops.precision) ~di
in
loop_dims (Array.create ~len:(Array.length unpadded_dims) 0) 0
in
-
+
let constant_fill_f f values strict =
let len = Array.length values in
if strict then (
@@ -200,32 +200,32 @@ let create_bigarray (type ocaml elt_t) (prec : (ocaml, elt_t) Ops.precision) ~di
init_unpadded_region (fun idcs -> f values.(indices_to_offset ~dims:unpadded_dims ~idcs)))
else
init_unpadded_region (fun idcs ->
-        f values.(indices_to_offset ~dims:unpadded_dims ~idcs % len))
+          f values.(indices_to_offset ~dims:unpadded_dims ~idcs % len))
in
let constant_fill_float values strict = constant_fill_f Fn.id values strict in
-
+
(match (prec, init_op) with
| Ops.Byte, Constant_fill { values; strict } ->
ignore (constant_fill_f (Fn.compose Char.of_int_exn Int.of_float) values strict)
| Ops.Byte, Range_over_offsets ->
-      init_unpadded_region (fun idcs -> Char.of_int_exn @@ indices_to_offset ~dims:unpadded_dims ~idcs)
+      init_unpadded_region (fun idcs ->
+          Char.of_int_exn @@ indices_to_offset ~dims:unpadded_dims ~idcs)
| Ops.Byte, Standard_uniform -> init_unpadded_region (fun _ -> Rand.Lib.char ())
-  | Ops.Uint16, Constant_fill { values; strict } ->
+  | Ops.Uint16, Constant_fill { values; strict } ->
ignore (constant_fill_f Int.of_float values strict)
| Ops.Uint16, Range_over_offsets ->
init_unpadded_region (fun idcs -> indices_to_offset ~dims:unpadded_dims ~idcs)
| Ops.Uint16, Standard_uniform -> init_unpadded_region (fun _ -> Random.int 65536)
-  | Ops.Int32, Constant_fill { values; strict } ->
+  | Ops.Int32, Constant_fill { values; strict } ->
ignore (constant_fill_f Int32.of_float values strict)
| Ops.Int32, Range_over_offsets ->
-      init_unpadded_region (fun idcs -> Int32.of_int_exn @@ indices_to_offset ~dims:unpadded_dims ~idcs)
-  | Ops.Int32, Standard_uniform ->
-      init_unpadded_region (fun _ -> Random.int32 Int32.max_value)
+      init_unpadded_region (fun idcs ->
+          Int32.of_int_exn @@ indices_to_offset ~dims:unpadded_dims ~idcs)
+  | Ops.Int32, Standard_uniform -> init_unpadded_region (fun _ -> Random.int32 Int32.max_value)
| Ops.Half, Constant_fill { values; strict } -> ignore (constant_fill_float values strict)
| Ops.Half, Range_over_offsets ->
init_unpadded_region (fun idcs -> Float.of_int @@ indices_to_offset ~dims:unpadded_dims ~idcs)
-  | Ops.Half, Standard_uniform ->
-      init_unpadded_region (fun _ -> Rand.Lib.float_range 0.0 1.0)
+  | Ops.Half, Standard_uniform -> init_unpadded_region (fun _ -> Rand.Lib.float_range 0.0 1.0)
| Ops.Bfloat16, Constant_fill { values; strict } ->
ignore (constant_fill_f float_to_bfloat16 values strict)
| Ops.Bfloat16, Range_over_offsets ->
@@ -237,23 +237,25 @@ let create_bigarray (type ocaml elt_t) (prec : (ocaml, elt_t) Ops.precision) ~di
ignore (constant_fill_f (Fn.compose Char.of_int_exn float_to_fp8) values strict)
| Ops.Fp8, Range_over_offsets ->
init_unpadded_region (fun idcs ->
-          Char.of_int_exn @@ float_to_fp8 @@ Float.of_int @@ indices_to_offset ~dims:unpadded_dims ~idcs)
+          Char.of_int_exn @@ float_to_fp8 @@ Float.of_int
+          @@ indices_to_offset ~dims:unpadded_dims ~idcs)
| Ops.Fp8, Standard_uniform ->
-      init_unpadded_region (fun _ -> Char.of_int_exn @@ float_to_fp8 @@ Rand.Lib.float_range 0.0 1.0)
+      init_unpadded_region (fun _ ->
+          Char.of_int_exn @@ float_to_fp8 @@ Rand.Lib.float_range 0.0 1.0)
| Ops.Single, Constant_fill { values; strict } -> ignore (constant_fill_float values strict)
| Ops.Single, Range_over_offsets ->
init_unpadded_region (fun idcs -> Float.of_int @@ indices_to_offset ~dims:unpadded_dims ~idcs)
-  | Ops.Single, Standard_uniform ->
-      init_unpadded_region (fun _ -> Rand.Lib.float_range 0.0 1.0)
+  | Ops.Single, Standard_uniform -> init_unpadded_region (fun _ -> Rand.Lib.float_range 0.0 1.0)
| Ops.Double, Constant_fill { values; strict } -> ignore (constant_fill_float values strict)
| Ops.Double, Range_over_offsets ->
init_unpadded_region (fun idcs -> Float.of_int @@ indices_to_offset ~dims:unpadded_dims ~idcs)
-  | Ops.Double, Standard_uniform ->
-      init_unpadded_region (fun _ -> Rand.Lib.float_range 0.0 1.0)
+  | Ops.Double, Standard_uniform -> init_unpadded_region (fun _ -> Rand.Lib.float_range 0.0 1.0)
| _, File_mapped (filename, stored_prec) ->
(* For file mapping, we don't support padding yet - require no padding *)
if Option.is_some padding then
-        raise @@ Utils.User_error "Ndarray.create_bigarray: File_mapped initialization does not support padding";
+        raise
+        @@ Utils.User_error
+             "Ndarray.create_bigarray: File_mapped initialization does not support padding";
(* See: https://github.com/janestreet/torch/blob/master/src/torch/dataset_helper.ml#L3 *)
if not @@ Ops.equal_prec stored_prec (Ops.pack_prec prec) then
raise
@@ -389,8 +391,7 @@ let reset_bigarray (init_op : Ops.init_op) (type o b) (prec : (o, b) Ops.precisi
| Ops.Int32, Constant_fill { values; strict } -> constant_set_f Int32.of_float values strict
| Ops.Int32, Range_over_offsets ->
set_bigarray arr ~f:(fun idcs -> Int32.of_int_exn @@ indices_to_offset ~dims ~idcs)
-  | Ops.Int32, Standard_uniform ->
-      set_bigarray arr ~f:(fun _ -> Random.int32 Int32.max_value)
+  | Ops.Int32, Standard_uniform -> set_bigarray arr ~f:(fun _ -> Random.int32 Int32.max_value)
| Ops.Half, Constant_fill { values; strict } -> constant_set_float values strict
| Ops.Half, Range_over_offsets ->
set_bigarray arr ~f:(fun idcs -> Float.of_int @@ indices_to_offset ~dims ~idcs)
@@ -563,8 +564,8 @@ let hash_t nd = Nativeint.hash @@ to_native nd


let used_memory = Atomic.make 0


-let%track7_sexp create_array ~debug:(_debug : string) (prec : Ops.prec) ~(dims : int array)
-    ~padding init_op =
+let%track7_sexp create_array ~debug:(_debug : string) (prec : Ops.prec) ~(dims : int array) ~padding
+    init_op =
(* dims already includes padding if padding is specified *)
let size_in_bytes : int =
(if Array.length dims = 0 then 0 else Array.reduce_exn dims ~f:( * )) * Ops.prec_in_bytes prec
File "arrayjit/lib/gcc_backend.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/gcc_backend.ml b/_build/default/arrayjit/lib/.formatted/gcc_backend.ml
index 6bcb3b9..8d7a7ec 100644
--- a/_build/default/arrayjit/lib/gcc_backend.ml
+++ b/_build/default/arrayjit/lib/.formatted/gcc_backend.ml
@@ -233,10 +233,9 @@ let compile_main ~name ~log_functions ~env { ctx; nodes; get_ident; merge_node;
| Iterator s -> Map.find_exn env s
| Affine { symbols; offset } ->
List.fold symbols ~init:(RValue.int ctx c_index offset) ~f:(fun acc (coeff, s) ->
-              RValue.binary_op ctx Plus c_index acc
-                (RValue.binary_op ctx Mult c_index
-                  (RValue.int ctx c_index coeff)
-                  (Map.find_exn env s))))
+                RValue.binary_op ctx Plus c_index acc
+                  (RValue.binary_op ctx Mult c_index (RValue.int ctx c_index coeff)
+                     (Map.find_exn env s))))
with e ->
Stdlib.Format.eprintf
"exec_as_gccjit: missing index from@ %a@ among environment keys:@ %a\n%!" Sexp.pp_hum
@@ -359,10 +358,14 @@ let compile_main ~name ~log_functions ~env { ctx; nodes; get_ident; merge_node;
| Embed_index (Fixed_idx i) -> (Int.to_string i, [])
| Embed_index (Iterator s) -> (Indexing.symbol_ident s ^ "{=%d}", [ Map.find_exn env s ])
| Embed_index (Affine { symbols; offset }) ->
-        let terms = List.map symbols ~f:(fun (coeff, s) ->
-          if coeff = 1 then Indexing.symbol_ident s
-          else Int.to_string coeff ^ "*" ^ Indexing.symbol_ident s) in
-        let expr = String.concat ~sep:"+" (terms @ if offset = 0 then [] else [Int.to_string offset]) in
+        let terms =
+          List.map symbols ~f:(fun (coeff, s) ->
+              if coeff = 1 then Indexing.symbol_ident s
+              else Int.to_string coeff ^ "*" ^ Indexing.symbol_ident s)
+        in
+        let expr =
+          String.concat ~sep:"+" (terms @ if offset = 0 then [] else [ Int.to_string offset ])
+        in
(expr, [])
| Binop (Arg1, v1, _v2) -> loop v1
| Binop (Arg2, _v1, v2) -> loop v2
@@ -524,10 +527,9 @@ let compile_main ~name ~log_functions ~env { ctx; nodes; get_ident; merge_node;
raise e)
| Embed_index (Affine { symbols; offset }) ->
List.fold symbols ~init:(RValue.int ctx num_typ offset) ~f:(fun acc (coeff, s) ->
-          RValue.binary_op ctx Plus num_typ acc
-            (RValue.binary_op ctx Mult num_typ
-              (RValue.int ctx num_typ coeff)
-              (RValue.cast ctx (Map.find_exn env s) num_typ)))
+            RValue.binary_op ctx Plus num_typ acc
+              (RValue.binary_op ctx Mult num_typ (RValue.int ctx num_typ coeff)
+                 (RValue.cast ctx (Map.find_exn env s) num_typ)))
| Binop (Arg2, _, c2) -> loop c2
| Binop (Arg1, c1, _) -> loop c1
| Binop (op, c1, c2) -> loop_binop op ~num_typ prec ~v1:(loop c1) ~v2:(loop c2)
File "lib/ppx_cd.ml", line 1, characters 0-0:
diff --git a/_build/default/lib/ppx_cd.ml b/_build/default/lib/.formatted/ppx_cd.ml
index b13d91d..f9e626d 100644
--- a/_build/default/lib/ppx_cd.ml
+++ b/_build/default/lib/.formatted/ppx_cd.ml
@@ -779,8 +779,8 @@ let translate (expr : expression) : result =
vbs = no_vbs;
}
| [%expr [%e? expr1] **. [%e? { pexp_desc = Pexp_constant (Pconst_integer _); _ } as i]] ->
-        (* We need to hardcode these two patterns (for **. ) to prevent the numbers from
-           being converted to tensors. *)
+        (* We need to hardcode these two patterns (for **. ) to prevent the numbers from being
+           converted to tensors. *)
let res1 = loop ~proj_in_scope expr1 in
{
res1 with
File "arrayjit/lib/low_level.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/low_level.ml b/_build/default/arrayjit/lib/.formatted/low_level.ml
index 7e519f9..ea6ac75 100644
--- a/_build/default/arrayjit/lib/low_level.ml
+++ b/_build/default/arrayjit/lib/.formatted/low_level.ml
@@ -157,7 +157,7 @@ let visit_llc traced_store ~merge_node_id reverse_node_map ~max_visits llc =
| Iterator s -> Option.value ~default:(* static index *) 0 @@ Map.find env s
| Indexing.Affine { symbols; offset } ->
List.fold symbols ~init:offset ~f:(fun acc (coeff, s) ->
-            acc + coeff * (Option.value ~default:0 @@ Map.find env s)))
+              acc + (coeff * (Option.value ~default:0 @@ Map.find env s))))
in
let rec loop_proc env llc =
let loop = loop_proc env in
@@ -196,8 +196,8 @@ let visit_llc traced_store ~merge_node_id reverse_node_map ~max_visits llc =
assert (Tn.equal old_tn tn)
| Indexing.Affine { symbols; _ } ->
List.iter symbols ~f:(fun (_, s) ->
-                let old_tn = Hashtbl.find_or_add reverse_node_map s ~default:(fun () -> tn) in
-                assert (Tn.equal old_tn tn)))
+                  let old_tn = Hashtbl.find_or_add reverse_node_map s ~default:(fun () -> tn) in
+                  assert (Tn.equal old_tn tn)))
| Set_local (_, llv) -> loop_float env llv
| Comment _ -> ()
| Staged_compilation _ -> ()
@@ -279,11 +279,14 @@ let%diagn2_sexp check_and_store_virtual traced static_indices top_llc =
function
| Fixed_idx _ -> None
| Iterator s -> Option.some_if (not @@ Set.mem static_indices s) s
-               | Affine { symbols; _ } ->
+               | Affine { symbols; _ } -> (
(* For affine indices, collect all symbols that are not static *)
List.filter_map symbols ~f:(fun (_, s) ->
-                     Option.some_if (not @@ Set.mem static_indices s) s)
-                   |> function [] -> None | [s] -> Some s | _ -> failwith "check_idcs: multiple non-static symbols in affine index")
+                       Option.some_if (not @@ Set.mem static_indices s) s)
+                   |> function
+                   | [] -> None
+                   | [ s ] -> Some s
+                   | _ -> failwith "check_idcs: multiple non-static symbols in affine index"))
in
let num_syms =
Array.count indices ~f:(function Iterator s -> not @@ Set.mem static_indices s | _ -> false)
@@ -349,11 +352,13 @@ let%diagn2_sexp check_and_store_virtual traced static_indices top_llc =
raise @@ Non_virtual 10)
| Embed_index (Affine { symbols; _ }) ->
List.iter symbols ~f:(fun (_, s) ->
-          if not @@ Set.mem env_dom s then (
-            if not (Set.mem static_indices s) then
-              [%log2
-                "Inlining candidate has an escaping variable", (s : Indexing.symbol), (top_llc : t)];
-            raise @@ Non_virtual 10))
+            if not @@ Set.mem env_dom s then (
+              if not (Set.mem static_indices s) then
+                [%log2
+                  "Inlining candidate has an escaping variable",
+                  (s : Indexing.symbol),
+                  (top_llc : t)];
+              raise @@ Non_virtual 10))
| Ternop (_, llv1, llv2, llv3) ->
loop_float ~env_dom llv1;
loop_float ~env_dom llv2;
@@ -686,7 +691,7 @@ let simplify_llc llc =
| Get_global _ -> llv
| Embed_index (Fixed_idx i) -> Constant (Float.of_int i)
| Embed_index (Iterator _) -> llv
-    | Embed_index (Affine _) -> llv  (* Cannot simplify affine expressions to constants *)
+    | Embed_index (Affine _) -> llv (* Cannot simplify affine expressions to constants *)
| Binop (Arg1, llv1, _) -> loop_float llv1
| Binop (Arg2, _, llv2) -> loop_float llv2
| Binop (op, Constant c1, Constant c2) -> Constant (Ops.interpret_binop op c1 c2)
dune build @fmt failed
"/usr/bin/env" "bash" "-c" "opam exec -- dune build @fmt --ignore-promoted-rules || (echo "dune build @fmt failed"; exit 2)" failed with exit status 2
2025-06-22 13:11.51: Job failed: Failed: Build failed