Organisationsahrefsocannla32941 ()(lint-fmt)

(lint-fmt)

Link Copied
Code Copied

Logs

2025-11-23 20:58.26: New job: test ahrefs/ocannl https://github.com/ahrefs/ocannl.git#refs/heads/master (a3294172a0487fad80a7a1a09cd3f4a388f0b8f7) (linux-x86_64:(lint-fmt))
Base: ocaml/opam:debian-13-ocaml-4.08@sha256:e3cc4e8fe5c00f48c72a719e3551b1d8a51c2862349a0f7507e8aa29fdf72321
ocamlformat version: version 0.28.1 (from opam)


To reproduce locally:


git clone --recursive "https://github.com/ahrefs/ocannl.git" -b "master" && cd "ocannl" && git reset --hard a3294172
cat > Dockerfile <<'END-OF-DOCKERFILE'
FROM ocaml/opam:debian-13-ocaml-4.08@sha256:e3cc4e8fe5c00f48c72a719e3551b1d8a51c2862349a0f7507e8aa29fdf72321
USER 1000:1000
RUN cd ~/opam-repository && (git cat-file -e 6c1b38620288b5bf349067f089a7b1fc91185d94 || git fetch origin master) && git reset -q --hard 6c1b38620288b5bf349067f089a7b1fc91185d94 && git log --no-decorate -n1 --oneline && opam update -u
RUN opam depext -i dune
WORKDIR /src
RUN opam depext -i ocamlformat=0.28.1
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-11-23 20:58.26: Using cache hint "ahrefs/ocannl-ocaml/opam:debian-13-ocaml-4.08@sha256:e3cc4e8fe5c00f48c72a719e3551b1d8a51c2862349a0f7507e8aa29fdf72321-debian-13-4.08_opam-2.4-ocamlformat-6c1b38620288b5bf349067f089a7b1fc91185d94"
2025-11-23 20:58.26: Using OBuilder spec:
((from ocaml/opam:debian-13-ocaml-4.08@sha256:e3cc4e8fe5c00f48c72a719e3551b1d8a51c2862349a0f7507e8aa29fdf72321)
(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 6c1b38620288b5bf349067f089a7b1fc91185d94 || git fetch origin master) && git reset -q --hard 6c1b38620288b5bf349067f089a7b1fc91185d94 && 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.28.1"))
(copy (src .) (dst /src/))
(run (shell "opam exec -- dune build @fmt --ignore-promoted-rules || (echo \"dune build @fmt failed\"; exit 2)"))
)


2025-11-23 20:58.26: Waiting for resource in pool OCluster
2025-11-23 20:58.27: Waiting for worker…
2025-11-23 20:58.27: Got resource from pool OCluster
Building on bremusa.ocamllabs.io
HEAD is now at 81a2d5e1 New no-op shape inference spec `Defined_by_cd_logic`
HEAD is now at a3294172 Obsolete dependency


(from ocaml/opam:debian-13-ocaml-4.08@sha256:e3cc4e8fe5c00f48c72a719e3551b1d8a51c2862349a0f7507e8aa29fdf72321)
2025-11-23 20:58.45 ---> saved as "d458486dd7823c592e7ea9c88366c5f90e1939c3b51f3abbd6760272096f8a3e"


/: (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 6c1b38620288b5bf349067f089a7b1fc91185d94 || git fetch origin master) && git reset -q --hard 6c1b38620288b5bf349067f089a7b1fc91185d94 && git log --no-decorate -n1 --oneline && opam update -u"))
6c1b386202 Merge pull request #28774 from Julow/release-ocamlformat-0.28.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-11-23 20:59.44 ---> saved as "a7d3c7d9f6aff7dc059c465a33e7ef3fda4b4a1ee9c79bef8645b5cd4da72b96"


/: (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.20.2


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


<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed dune.3.20.2
Done.
# Run eval $(opam env) to update the current shell environment
2025-11-23 21:00.10 ---> saved as "b8799a0f87a66bd49a9341889a0027044c03db80ad17a5edb3adaf72f166d8fd"


/: (workdir /src)


/src: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam depext -i ocamlformat=0.28.1"))
# 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 ocamlbuild        0.16.1   [required by fpath, astring, uuseg]
- install either            1.0.0    [required by ocamlformat-lib]
- install menhirLib         20250912 [required by ocamlformat-lib]
- install csexp             1.5.2    [required by ocamlformat]
- install camlp-streams     5.0.1    [required by ocamlformat-lib]
- install seq               base     [required by re]
- install menhirSdk         20250912 [required by ocamlformat-lib]
- install fix               20250919 [required by ocamlformat-lib]
- install menhirCST         20250912 [required by menhir]
- install ocamlfind         1.9.8    [required by ocp-indent, astring, fpath, uuseg]
- install dune-build-info   3.20.2   [required by ocamlformat-lib]
- install cmdliner          2.0.0    [required by ocamlformat]
- install ocaml-version     4.0.3    [required by ocamlformat-lib]
- install dune-configurator 3.20.2   [required by base]
- install re                1.11.0   [required by ocamlformat]
- install menhir            20250912 [required by ocamlformat-lib]
- install topkg             1.1.1    [required by fpath, astring, uuseg]
- install ocp-indent        1.9.0    [required by ocamlformat-lib]
- 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 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.28.1   [required by ocamlformat]
- install ocamlformat       0.28.1
===== 28 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.2.0.0] found in cache
[csexp.1.5.2] found in cache
[dune-build-info.3.20.2] found in cache
[dune-configurator.3.20.2] found in cache
[either.1.0.0] found in cache
[fix.20250919] found in cache
[fpath.0.7.3] found in cache
[menhir.20250912] found in cache
[menhirCST.20250912] found in cache
[menhirLib.20250912] found in cache
[menhirSdk.20250912] found in cache
[ocaml-version.4.0.3] found in cache
[ocamlbuild.0.16.1] found in cache
[ocamlfind.1.9.8] found in cache
[ocamlformat.0.28.1] found in cache
[ocamlformat-lib.0.28.1] found in cache
[ocp-indent.1.9.0] 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.1.1] 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 csexp.1.5.2
-> installed either.1.0.0
-> installed fix.20250919
-> installed cmdliner.2.0.0
-> installed menhirCST.20250912
-> installed menhirLib.20250912
-> installed menhirSdk.20250912
-> installed ocaml-version.4.0.3
-> installed re.1.11.0
-> installed sexplib0.v0.14.0
-> installed dune-build-info.3.20.2
-> installed dune-configurator.3.20.2
-> installed ocamlfind.1.9.8
-> installed ocp-indent.1.9.0
-> installed ocamlbuild.0.16.1
-> installed base.v0.14.3
-> installed topkg.1.1.1
-> installed stdio.v0.14.0
-> installed uutf.1.0.4
-> installed astring.0.8.5
-> installed fpath.0.7.3
-> installed menhir.20250912
-> installed uucp.15.0.0
-> installed uuseg.15.0.0
-> installed ocamlformat-lib.0.28.1
-> installed ocamlformat.0.28.1
Done.


<><> ocp-indent.1.9.0 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-11-23 21:01.03 ---> saved as "7b71439e6ac9917292b28dc59ecc075d01d03dd2ef11c372809a6cf99e594a22"


/src: (copy (src .) (dst /src/))
2025-11-23 21:01.04 ---> saved as "791ca68874a4ecc49973e93c791325aa0b2ebc78980960db306f81425f96c3a5"


/src: (run (shell "opam exec -- dune build @fmt --ignore-promoted-rules || (echo \"dune build @fmt failed\"; exit 2)"))
File "einsum_parser/einsum_parser.ml", line 1, characters 0-0:
diff --git a/_build/default/einsum_parser/einsum_parser.ml b/_build/default/einsum_parser/.formatted/einsum_parser.ml
index 7820992..3ee7eff 100644
--- a/_build/default/einsum_parser/einsum_parser.ml
+++ b/_build/default/einsum_parser/.formatted/einsum_parser.ml
@@ -1,8 +1,7 @@
(** Entry point for the einsum parser library.


-    This module provides functions to parse einsum notation specifications
-    using a Menhir-based parser (instead of Angstrom).
-*)
+    This module provides functions to parse einsum notation specifications using a Menhir-based
+    parser (instead of Angstrom). *)


open Base


@@ -18,28 +17,24 @@ let is_multichar = Lexer.is_multichar
let axis_labels_of_spec spec =
let multichar = is_multichar spec in
let lexbuf = Lexing.from_string spec in
-  try
-    Parser.axis_labels_spec (Lexer.token multichar) lexbuf
-  with
-  | Lexer.Syntax_error msg ->
-      raise (Parse_error ("Lexer error: " ^ msg))
+  try Parser.axis_labels_spec (Lexer.token multichar) lexbuf with
+  | Lexer.Syntax_error msg -> raise (Parse_error ("Lexer error: " ^ msg))
| Parser.Error ->
let pos = lexbuf.Lexing.lex_curr_p in
let line = pos.Lexing.pos_lnum in
let col = pos.Lexing.pos_cnum - pos.Lexing.pos_bol in
-      raise (Parse_error (Printf.sprintf "Parse error at line %d, column %d in spec: %s" line col spec))
+      raise
+        (Parse_error (Printf.sprintf "Parse error at line %d, column %d in spec: %s" line col spec))


(* Parse einsum specification *)
let einsum_of_spec spec =
let multichar = is_multichar spec in
let lexbuf = Lexing.from_string spec in
-  try
-    Parser.einsum_spec (Lexer.token multichar) lexbuf
-  with
-  | Lexer.Syntax_error msg ->
-      raise (Parse_error ("Lexer error: " ^ msg))
+  try Parser.einsum_spec (Lexer.token multichar) lexbuf with
+  | Lexer.Syntax_error msg -> raise (Parse_error ("Lexer error: " ^ msg))
| Parser.Error ->
let pos = lexbuf.Lexing.lex_curr_p in
let line = pos.Lexing.pos_lnum in
let col = pos.Lexing.pos_cnum - pos.Lexing.pos_bol in
-      raise (Parse_error (Printf.sprintf "Parse error at line %d, column %d in spec: %s" line col spec))
+      raise
+        (Parse_error (Printf.sprintf "Parse error at line %d, column %d in spec: %s" line col spec))
File "einsum_parser/einsum_types.ml", line 1, characters 0-0:
diff --git a/_build/default/einsum_parser/einsum_types.ml b/_build/default/einsum_parser/.formatted/einsum_types.ml
index 20634eb..2753b9e 100644
--- a/_build/default/einsum_parser/einsum_types.ml
+++ b/_build/default/einsum_parser/.formatted/einsum_types.ml
@@ -11,17 +11,14 @@ type axis_spec =


type axis_key_kind = [ `Batch | `Input | `Output ] [@@deriving equal, compare, sexp]


-type axis_key = {
-  in_axes : axis_key_kind;
-  pos : int;
-  from_end : bool;
-}
+type axis_key = { in_axes : axis_key_kind; pos : int; from_end : bool }
[@@deriving equal, compare, sexp]


module AxisKey = struct
module T = struct
type t = axis_key [@@deriving equal, compare, sexp]
end
+
include T
include Comparator.Make (T)
end
File "einsum_parser/einsum_parser.mli", line 1, characters 0-0:
diff --git a/_build/default/einsum_parser/einsum_parser.mli b/_build/default/einsum_parser/.formatted/einsum_parser.mli
index 37c1317..11e907b 100644
--- a/_build/default/einsum_parser/einsum_parser.mli
+++ b/_build/default/einsum_parser/.formatted/einsum_parser.mli
@@ -1,36 +1,33 @@
(** Entry point for the einsum parser library.


-    This module provides functions to parse einsum notation specifications
-    using a Menhir-based parser.
-*)
+    This module provides functions to parse einsum notation specifications using a Menhir-based
+    parser. *)


open Base


(* Re-export types from Einsum_types *)
include module type of Einsum_types


-(** Exception raised when parsing fails. *)
exception Parse_error of string
+(** Exception raised when parsing fails. *)


-(** Determine if a spec uses multichar mode.
-    Multichar mode is triggered by presence of: ',', '*', '+', '^', '&' *)
val is_multichar : string -> bool
+(** Determine if a spec uses multichar mode. Multichar mode is triggered by presence of: ',', '*',
+    '+', '^', '&' *)


+val axis_labels_of_spec : string -> parsed_axis_labels
(** Parse an axis labels specification.


Examples:
- "abc" (single-char mode)
- "a, b, c" (multichar mode, triggered by comma)
- "batch|input->output"
-    - "...a..b"
-*)
-val axis_labels_of_spec : string -> parsed_axis_labels
+    - "...a..b" *)


+val einsum_of_spec : string -> parsed_axis_labels * parsed_axis_labels option * parsed_axis_labels
(** Parse an einsum specification.


Examples:
- "ij;jk=>ik" (matrix multiplication)
- "ij=>ji" (transpose/permute)
-    - "i,j->2*i+j" (convolution)
-*)
-val einsum_of_spec : string -> parsed_axis_labels * parsed_axis_labels option * parsed_axis_labels
+    - "i,j->2*i+j" (convolution) *)
File "tensor/ppx_extend_dsls.ml", line 1, characters 0-0:
diff --git a/_build/default/tensor/ppx_extend_dsls.ml b/_build/default/tensor/.formatted/ppx_extend_dsls.ml
index e30e785..352c5b7 100644
--- a/_build/default/tensor/ppx_extend_dsls.ml
+++ b/_build/default/tensor/.formatted/ppx_extend_dsls.ml
@@ -50,19 +50,19 @@ let str_expander ~loc:pstr_loc ~path:_ str_items =
let item_bindings, op_item_bindings =
List.unzip
@@ List.concat_map str_items ~f:(function
-           | { pstr_desc = Pstr_value (Nonrecursive, bindings); pstr_loc = loc; _ } ->
-               List.map bindings ~f:(fun binding ->
-                   let params, binding = transform_dsl_binding ~loc ~dsl_name binding in
-                   let op_binding = transform_op_binding params binding in
-                   (binding, op_binding))
-           | { pstr_loc = loc; _ } ->
-               let pat = Ast_helper.Pat.var ~loc { txt = "syntax_error"; loc } in
-               let v =
-                 Ast_builder.Default.pexp_extension ~loc
-                 @@ Location.error_extensionf ~loc
-                      "ppx_extend_dsls: currently only non-recursive value bindings are supported"
-               in
-               [ (Ast_helper.Vb.mk ~loc pat v, Ast_helper.Vb.mk ~loc pat v) ])
+        | { pstr_desc = Pstr_value (Nonrecursive, bindings); pstr_loc = loc; _ } ->
+            List.map bindings ~f:(fun binding ->
+                let params, binding = transform_dsl_binding ~loc ~dsl_name binding in
+                let op_binding = transform_op_binding params binding in
+                (binding, op_binding))
+        | { pstr_loc = loc; _ } ->
+            let pat = Ast_helper.Pat.var ~loc { txt = "syntax_error"; loc } in
+            let v =
+              Ast_builder.Default.pexp_extension ~loc
+              @@ Location.error_extensionf ~loc
+                   "ppx_extend_dsls: currently only non-recursive value bindings are supported"
+            in
+            [ (Ast_helper.Vb.mk ~loc pat v, Ast_helper.Vb.mk ~loc pat v) ])
in
let item = { pstr_desc = Pstr_value (Nonrecursive, item_bindings); pstr_loc } in
let op_item = { pstr_desc = Pstr_value (Nonrecursive, op_item_bindings); pstr_loc } in
File "tensor/row.mli", line 1, characters 0-0:
diff --git a/_build/default/tensor/row.mli b/_build/default/tensor/.formatted/row.mli
index 6a17654..f91f058 100644
--- a/_build/default/tensor/row.mli
+++ b/_build/default/tensor/.formatted/row.mli
@@ -128,12 +128,7 @@ type row_entry =
type constraint_ =
| Dim_eq of { d1 : dim; d2 : dim; origin : constraint_origin list }
| Row_eq of { r1 : t; r2 : t; origin : constraint_origin list }
-  | Dim_ineq of {
-      cur : dim;
-      subr : dim;
-      from_ : Sexp.t;
-      origin : constraint_origin list;
-    }
+  | Dim_ineq of { cur : dim; subr : dim; from_ : Sexp.t; origin : constraint_origin list }
| Row_ineq of { cur : t; subr : t; origin : constraint_origin list }
| Dim_constr of { d : dim; constr : dim_constraint; origin : constraint_origin list }
| Rows_constr of { r : t list; constr : row_constraint; origin : constraint_origin list }
File "arrayjit/test/tree_map_test.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/test/tree_map_test.ml b/_build/default/arrayjit/test/.formatted/tree_map_test.ml
index 5f9acfa..3939c56 100644
--- a/_build/default/arrayjit/test/tree_map_test.ml
+++ b/_build/default/arrayjit/test/.formatted/tree_map_test.ml
@@ -5,7 +5,6 @@ open Utils
(* Demo of Tree_map with tree-preserving sexp output *)
let () =
let open Tree_map in
-
(* Create a tree by inserting values *)
let tree =
empty
@@ -23,8 +22,10 @@ let () =
printf "%s\n\n" (Sexp.to_string_hum (sexp_of_t Int.sexp_of_t String.sexp_of_t tree));


(* Test lookups *)
-  printf "Finding key 4: %s\n" (Option.value ~default:"not found" (find ~compare:Int.compare ~key:4 tree));
-  printf "Finding key 10: %s\n" (Option.value ~default:"not found" (find ~compare:Int.compare ~key:10 tree));
+  printf "Finding key 4: %s\n"
+    (Option.value ~default:"not found" (find ~compare:Int.compare ~key:4 tree));
+  printf "Finding key 10: %s\n"
+    (Option.value ~default:"not found" (find ~compare:Int.compare ~key:10 tree));


(* Print as association list *)
printf "\nAs alist (in-order): ";
File "arrayjit/lib/context.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/context.ml b/_build/default/arrayjit/lib/.formatted/context.ml
index 9752637..d1edcba 100644
--- a/_build/default/arrayjit/lib/context.ml
+++ b/_build/default/arrayjit/lib/.formatted/context.ml
@@ -24,7 +24,7 @@ type backend_wrapper =
-> backend_wrapper


type t = {
-  backend_wrapper : (backend_wrapper [@sexp.opaque]);
+  backend_wrapper : (backend_wrapper[@sexp.opaque]);
device_id : int;
backend_name : string;
initialized_nodes : Set.M(Tn).t; (* Track which nodes have been initialized *)
File "test/operations/test_einsum_parser.ml", line 1, characters 0-0:
diff --git a/_build/default/test/operations/test_einsum_parser.ml b/_build/default/test/operations/.formatted/test_einsum_parser.ml
index 8169f5c..23ce388 100644
--- a/_build/default/test/operations/test_einsum_parser.ml
+++ b/_build/default/test/operations/.formatted/test_einsum_parser.ml
@@ -12,17 +12,15 @@ let test_single_char () =
(* Test 2: With batch and input *)
let spec2 = "b|i->o" in
let labels2 = Einsum_parser.axis_labels_of_spec spec2 in
-  printf "  'b|i->o' -> batch:%d input:%d output:%d\n"
-    labels2.given_batch labels2.given_input labels2.given_output;
+  printf "  'b|i->o' -> batch:%d input:%d output:%d\n" labels2.given_batch labels2.given_input
+    labels2.given_output;


(* Test 3: Einsum spec *)
let spec3 = "ij;jk=>ik" in
-  let (l1, l2_opt, l3) = Einsum_parser.einsum_of_spec spec3 in
+  let l1, l2_opt, l3 = Einsum_parser.einsum_of_spec spec3 in
let l2 = Option.value_exn l2_opt in
-  printf "  'ij;jk=>ik' -> (%d,%d);(%d,%d)=>(%d,%d)\n"
-    l1.given_input l1.given_output
-    l2.given_input l2.given_output
-    l3.given_input l3.given_output;
+  printf "  'ij;jk=>ik' -> (%d,%d);(%d,%d)=>(%d,%d)\n" l1.given_input l1.given_output l2.given_input
+    l2.given_output l3.given_input l3.given_output;


printf "\n"


File "test/operations/test_where_simple.ml", line 1, characters 0-0:
diff --git a/_build/default/test/operations/test_where_simple.ml b/_build/default/test/operations/.formatted/test_where_simple.ml
index 3a1f08c..9940f2a 100644
--- a/_build/default/test/operations/test_where_simple.ml
+++ b/_build/default/test/operations/.formatted/test_where_simple.ml
@@ -7,7 +7,7 @@ let () =
Tensor.unsafe_reinitialize ();
let ctx = Context.auto () in
(* Simple test: where(true, x, y) should have gradient flow to x only *)
-  let x = Tensor.number  ~grad_spec:Require_grad 2.0 in
+  let x = Tensor.number ~grad_spec:Require_grad 2.0 in
let y = Tensor.number ~grad_spec:Require_grad 3.0 in
let cond = Tensor.number 1.0 in
(* true *)
File "lib/train.ml", line 1, characters 0-0:
diff --git a/_build/default/lib/train.ml b/_build/default/lib/.formatted/train.ml
index 1b0d474..aa856f0 100644
--- a/_build/default/lib/train.ml
+++ b/_build/default/lib/.formatted/train.ml
@@ -183,7 +183,8 @@ let every_non_literal_on_host =


module Lazy = Utils.Lazy


-let%track7_sexp to_routine (ctx : Context.t) ?(output_cd_file = false) ?(hosted = true) bindings comp =
+let%track7_sexp to_routine (ctx : Context.t) ?(output_cd_file = false) ?(hosted = true) bindings
+    comp =
if output_cd_file then (
let name = Asgns.get_name_exn comp.Asgns.asgns in
if not Utils.settings.output_debug_files_in_build_directory then
File "arrayjit/lib/datatypes.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/datatypes.ml b/_build/default/arrayjit/lib/.formatted/datatypes.ml
index 35404a7..d1a76ca 100644
--- a/_build/default/arrayjit/lib/datatypes.ml
+++ b/_build/default/arrayjit/lib/.formatted/datatypes.ml
@@ -39,8 +39,8 @@ let tl_exn = function
| Empty -> raise @@ Not_found_s (Sexp.Atom "mutable_list.tl_exn")
| Cons { tl; _ } -> tl


-(** A dynamic array of weak references. *)
type 'a weak_dynarray = 'a Stdlib.Weak.t ref
+(** A dynamic array of weak references. *)


let weak_create () : 'a weak_dynarray = ref @@ Stdlib.Weak.create 0


@@ -67,12 +67,12 @@ let weak_iter (arr : 'a weak_dynarray) ~f =
Option.iter (W.get !arr i) ~f
done


-(** A lazy value that can be safely forced and compared by unique ID. *)
type 'a safe_lazy = {
mutable value : [ `Callback of unit -> 'a | `Value of 'a ];
unique_id : string;
}
[@@deriving sexp_of]
+(** A lazy value that can be safely forced and compared by unique ID. *)


let safe_lazy unique_id f = { value = `Callback f; unique_id }


@@ -123,37 +123,42 @@ let sexp_of_safe_lazy sexp_of_elem gated =
Sexp.List [ Sexp.Atom "value"; status ];
]


-(** A persistent map implemented as a balanced binary tree.
-    The sexp_of function preserves and displays the tree structure. *)
+(** A persistent map implemented as a balanced binary tree. The sexp_of function preserves and
+    displays the tree structure. *)
module Tree_map = struct
type ('k, 'v) t =
| Empty
-    | Node of {
-        key : 'k;
-        value : 'v;
-        left : ('k, 'v) t;
-        right : ('k, 'v) t;
-        height : int;
-      }
+    | Node of { key : 'k; value : 'v; left : ('k, 'v) t; right : ('k, 'v) t; height : int }


let empty = Empty
-
let height = function Empty -> 0 | Node { height; _ } -> height


let create key value left right =
Node { key; value; left; right; height = 1 + max (height left) (height right) }


-  let balance_factor = function
-    | Empty -> 0
-    | Node { left; right; _ } -> height left - height right
+  let balance_factor = function Empty -> 0 | Node { left; right; _ } -> height left - height right


let rotate_right = function
-    | Node { key; value; left = Node { key = lkey; value = lvalue; left = ll; right = lr; _ }; right; _ } ->
+    | Node
+        {
+          key;
+          value;
+          left = Node { key = lkey; value = lvalue; left = ll; right = lr; _ };
+          right;
+          _;
+        } ->
create lkey lvalue ll (create key value lr right)
| t -> t


let rotate_left = function
-    | Node { key; value; left; right = Node { key = rkey; value = rvalue; left = rl; right = rr; _ }; _ } ->
+    | Node
+        {
+          key;
+          value;
+          left;
+          right = Node { key = rkey; value = rvalue; left = rl; right = rr; _ };
+          _;
+        } ->
create rkey rvalue (create key value left rl) rr
| t -> t


@@ -162,18 +167,22 @@ module Tree_map = struct
| bf when bf > 1 -> (
match t with
| Node { left; _ } when balance_factor left < 0 ->
-            rotate_right (create (match t with Node n -> n.key | _ -> assert false)
-                           (match t with Node n -> n.value | _ -> assert false)
-                           (rotate_left left)
-                           (match t with Node n -> n.right | _ -> assert false))
+            rotate_right
+              (create
+                 (match t with Node n -> n.key | _ -> assert false)
+                 (match t with Node n -> n.value | _ -> assert false)
+                 (rotate_left left)
+                 (match t with Node n -> n.right | _ -> assert false))
| _ -> rotate_right t)
| bf when bf < -1 -> (
match t with
| Node { right; _ } when balance_factor right > 0 ->
-            rotate_left (create (match t with Node n -> n.key | _ -> assert false)
-                          (match t with Node n -> n.value | _ -> assert false)
-                          (match t with Node n -> n.left | _ -> assert false)
-                          (rotate_right right))
+            rotate_left
+              (create
+                 (match t with Node n -> n.key | _ -> assert false)
+                 (match t with Node n -> n.value | _ -> assert false)
+                 (match t with Node n -> n.left | _ -> assert false)
+                 (rotate_right right))
| _ -> rotate_left t)
| _ -> t


@@ -200,7 +209,9 @@ module Tree_map = struct
| Empty -> false
| Node n ->
let c = compare key n.key in
-        if c = 0 then true else if c < 0 then mem ~compare ~key n.left else mem ~compare ~key n.right
+        if c = 0 then true
+        else if c < 0 then mem ~compare ~key n.left
+        else mem ~compare ~key n.right


let rec fold t ~init ~f =
match t with
@@ -221,14 +232,12 @@ module Tree_map = struct
let rec map t ~f =
match t with
| Empty -> Empty
-    | Node n ->
-        create n.key (f n.value) (map n.left ~f) (map n.right ~f)
+    | Node n -> create n.key (f n.value) (map n.left ~f) (map n.right ~f)


let rec mapi t ~f =
match t with
| Empty -> Empty
-    | Node n ->
-        create n.key (f ~key:n.key ~data:n.value) (mapi n.left ~f) (mapi n.right ~f)
+    | Node n -> create n.key (f ~key:n.key ~data:n.value) (mapi n.left ~f) (mapi n.right ~f)


let to_alist t = List.rev (fold t ~init:[] ~f:(fun ~key ~data acc -> (key, data) :: acc))


File "tensor/ppx_shared.ml", line 1, characters 0-0:
diff --git a/_build/default/tensor/ppx_shared.ml b/_build/default/tensor/.formatted/ppx_shared.ml
index 8c26a58..33ae188 100644
--- a/_build/default/tensor/ppx_shared.ml
+++ b/_build/default/tensor/.formatted/ppx_shared.ml
@@ -298,8 +298,8 @@ let expr_expander_with_punning translate ~loc ~path:_ payload =
let vbss, bindings =
List.unzip
@@ List.map bindings ~f:(fun vb ->
-               let vbs, v = translate ?ident_label:(Some vb.pvb_pat) vb.pvb_expr in
-               (vbs, { vb with pvb_expr = v }))
+            let vbs, v = translate ?ident_label:(Some vb.pvb_pat) vb.pvb_expr in
+            (vbs, { vb with pvb_expr = v }))
in
let expr = { payload with pexp_desc = Pexp_let (recflag, bindings, body) } in
let_opt ~loc (reduce_vbss vbss) expr
File "arrayjit/lib/indexing.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/indexing.ml b/_build/default/arrayjit/lib/.formatted/indexing.ml
index e4c9e9b..89414e4 100644
--- a/_build/default/arrayjit/lib/indexing.ml
+++ b/_build/default/arrayjit/lib/.formatted/indexing.ml
@@ -291,15 +291,15 @@ let identity_projections ?debug_info ?derived_for ~lhs_dims () =
let reflect_projection ~(dims : int array) ~(projection : axis_index array) =
Array.zip_exn dims projection
|> Array.fold_right ~init:(1, [], 0) ~f:(fun (dim, idx) (stride, symbols, offset) ->
-         match idx with
-         | Fixed_idx fixed_offset -> (stride * dim, symbols, offset + (fixed_offset * stride))
-         | Iterator sym -> (stride * dim, (stride, sym) :: symbols, offset)
-         | Affine { symbols = affine_symbols; offset = affine_offset } ->
-             let new_symbols =
-               List.map affine_symbols ~f:(fun (coeff, sym) -> (coeff * stride, sym))
-             in
-             (stride * dim, new_symbols @ symbols, offset + (affine_offset * stride))
-         | Sub_axis -> (stride * dim, symbols, offset))
+      match idx with
+      | Fixed_idx fixed_offset -> (stride * dim, symbols, offset + (fixed_offset * stride))
+      | Iterator sym -> (stride * dim, (stride, sym) :: symbols, offset)
+      | Affine { symbols = affine_symbols; offset = affine_offset } ->
+          let new_symbols =
+            List.map affine_symbols ~f:(fun (coeff, sym) -> (coeff * stride, sym))
+          in
+          (stride * dim, new_symbols @ symbols, offset + (affine_offset * stride))
+      | Sub_axis -> (stride * dim, symbols, offset))
|> fun (_, symbols, offset) -> Affine { symbols; offset }


type variable_ref = { ref_label : string; mutable solved_dim : int option }
File "test/operations/primitive_ops.ml", line 1, characters 0-0:
diff --git a/_build/default/test/operations/primitive_ops.ml b/_build/default/test/operations/.formatted/primitive_ops.ml
index ccf0ebb..e3b3174 100644
--- a/_build/default/test/operations/primitive_ops.ml
+++ b/_build/default/test/operations/.formatted/primitive_ops.ml
@@ -31,9 +31,9 @@ let plot_unop ?(x_min = -5.) ?(x_max = 5.) ~f () =
let ys, dys =
Array.unzip
@@ Array.mapi xs ~f:(fun i _ ->
-           step_ref := i;
-           Train.run ctx fx_routine;
-           (fx.@[0], x.@%[0]))
+        step_ref := i;
+        Train.run ctx fx_routine;
+        (fx.@[0], x.@%[0]))
in
(* It is fine to loop around the data: it's "next epoch". We redo the work though. *)
PrintBox_utils.plot ~x_label:"x" ~y_label:"f(x)"
File "test/operations/test_random_histograms.ml", line 1, characters 0-0:
diff --git a/_build/default/test/operations/test_random_histograms.ml b/_build/default/test/operations/.formatted/test_random_histograms.ml
index 7d0e22d..558b282 100644
--- a/_build/default/test/operations/test_random_histograms.ml
+++ b/_build/default/test/operations/.formatted/test_random_histograms.ml
@@ -18,16 +18,15 @@ let print_histogram bins ~title ~max_width =
let max_count = Array.max_elt bins ~compare:Int.compare |> Option.value ~default:0 in
let total = Array.fold bins ~init:0 ~f:( + ) in
Array.iteri bins ~f:(fun i count ->
-      let bar_width = (count * max_width) / max_count in
+      let bar_width = count * max_width / max_count in
let bar = String.make bar_width '#' in
-      let percentage = (Float.of_int count /. Float.of_int total) *. 100.0 in
+      let percentage = Float.of_int count /. Float.of_int total *. 100.0 in
printf "Bin %2d: %s %4d (%.1f%%)\n" i bar count percentage)


let test_uniform_at_histogram () =
Tensor.unsafe_reinitialize ();
let ctx = Context.auto () in
let module O = TDSL.O in
-
(* Generate a large batch of random numbers using uniform_at *)
(* Note: uniform_at produces 4 values per counter input (from uint4x32) *)
let num_counters = 2500 in
@@ -42,8 +41,8 @@ let test_uniform_at_histogram () =
ignore (Ocannl.Train.forward_once ctx uniform_values);
let result = Ir.Tnode.get_values uniform_values.value in


-  printf "Generated %d values from %d counters (%.1fx expansion)\n"
-    (Array.length result) num_counters
+  printf "Generated %d values from %d counters (%.1fx expansion)\n" (Array.length result)
+    num_counters
(Float.of_int (Array.length result) /. Float.of_int num_counters);


(* Create and print histogram *)
@@ -52,10 +51,9 @@ let test_uniform_at_histogram () =
print_histogram bins ~title:"Uniform Distribution [0, 1) Histogram" ~max_width:40;


(* Statistical tests *)
-  let mean = Array.fold result ~init:0.0 ~f:(+.) /. Float.of_int (Array.length result) in
+  let mean = Array.fold result ~init:0.0 ~f:( +. ) /. Float.of_int (Array.length result) in
let variance =
-    Array.fold result ~init:0.0 ~f:(fun acc x ->
-        acc +. ((x -. mean) *. (x -. mean)))
+    Array.fold result ~init:0.0 ~f:(fun acc x -> acc +. ((x -. mean) *. (x -. mean)))
/. Float.of_int (Array.length result)
in
let std_dev = Float.sqrt variance in
@@ -73,8 +71,8 @@ let test_uniform_at_histogram () =
let diff = Float.of_int observed -. expected_per_bin in
acc +. (diff *. diff /. expected_per_bin))
in
-  printf "  Chi-square statistic: %.2f (df=%d, critical value at 0.05: ~%.2f)\n"
-    chi_square (num_bins - 1) 30.14;
+  printf "  Chi-square statistic: %.2f (df=%d, critical value at 0.05: ~%.2f)\n" chi_square
+    (num_bins - 1) 30.14;


(* Check if all values are in range *)
let all_in_range = Array.for_all result ~f:(fun x -> Float.(x >= 0.0 && x < 1.0)) in
@@ -84,7 +82,6 @@ let test_normal_at_histogram () =
Tensor.unsafe_reinitialize ();
let ctx = Context.auto () in
let module O = TDSL.O in
-
(* Generate a large batch of random numbers using normal_at *)
(* Note: normal_at also produces 4 values per counter input *)
let num_counters = 2500 in
@@ -100,10 +97,9 @@ let test_normal_at_histogram () =
let result = Ir.Tnode.get_values normal_values.value in


(* Calculate statistics *)
-  let mean = Array.fold result ~init:0.0 ~f:(+.) /. Float.of_int (Array.length result) in
+  let mean = Array.fold result ~init:0.0 ~f:( +. ) /. Float.of_int (Array.length result) in
let variance =
-    Array.fold result ~init:0.0 ~f:(fun acc x ->
-        acc +. ((x -. mean) *. (x -. mean)))
+    Array.fold result ~init:0.0 ~f:(fun acc x -> acc +. ((x -. mean) *. (x -. mean)))
/. Float.of_int (Array.length result)
in
let std_dev = Float.sqrt variance in
@@ -124,15 +120,9 @@ let test_normal_at_histogram () =
printf "  Max: %.4f\n" max_val;


(* Check what percentage falls within standard deviations *)
-  let within_1_std =
-    Array.count result ~f:(fun x -> Float.(abs x <= 1.0))
-  in
-  let within_2_std =
-    Array.count result ~f:(fun x -> Float.(abs x <= 2.0))
-  in
-  let within_3_std =
-    Array.count result ~f:(fun x -> Float.(abs x <= 3.0))
-  in
+  let within_1_std = Array.count result ~f:(fun x -> Float.(abs x <= 1.0)) in
+  let within_2_std = Array.count result ~f:(fun x -> Float.(abs x <= 2.0)) in
+  let within_3_std = Array.count result ~f:(fun x -> Float.(abs x <= 3.0)) in


printf "  Within 1 std dev: %.1f%% (expected: ~68.3%%)\n"
(Float.of_int within_1_std /. Float.of_int (Array.length result) *. 100.0);
@@ -143,20 +133,23 @@ let test_normal_at_histogram () =


(* Normality test using skewness and kurtosis *)
let skewness =
-    let sum_cubed = Array.fold result ~init:0.0 ~f:(fun acc x ->
-        let diff = x -. mean in
-        acc +. (diff *. diff *. diff))
+    let sum_cubed =
+      Array.fold result ~init:0.0 ~f:(fun acc x ->
+          let diff = x -. mean in
+          acc +. (diff *. diff *. diff))
in
sum_cubed /. (Float.of_int (Array.length result) *. std_dev *. std_dev *. std_dev)
in


let kurtosis =
-    let sum_fourth = Array.fold result ~init:0.0 ~f:(fun acc x ->
-        let diff = x -. mean in
-        let diff2 = diff *. diff in
-        acc +. (diff2 *. diff2))
+    let sum_fourth =
+      Array.fold result ~init:0.0 ~f:(fun acc x ->
+          let diff = x -. mean in
+          let diff2 = diff *. diff in
+          acc +. (diff2 *. diff2))
in
-    (sum_fourth /. (Float.of_int (Array.length result) *. std_dev *. std_dev *. std_dev *. std_dev)) -. 3.0
+    (sum_fourth /. (Float.of_int (Array.length result) *. std_dev *. std_dev *. std_dev *. std_dev))
+    -. 3.0
in


printf "  Skewness: %.4f (expected: ~0.0)\n" skewness;
@@ -166,7 +159,6 @@ let test_batched_generation_consistency () =
Tensor.unsafe_reinitialize ();
let ctx = Context.auto () in
let module O = TDSL.O in
-
(* Test that batched generation gives consistent results *)
let batch_size = 100 in
let num_batches = 10 in
@@ -205,9 +197,8 @@ let test_batched_generation_consistency () =
Array.sort sorted ~compare:Float.compare;
let unique = ref 1 in
for i = 1 to Array.length sorted - 1 do
-      let diff = Float.abs (sorted.(i) -. sorted.(i-1)) in
-      if Float.(diff > 1e-7) then
-        unique := !unique + 1
+      let diff = Float.abs (sorted.(i) -. sorted.(i - 1)) in
+      if Float.(diff > 1e-7) then unique := !unique + 1
done;
!unique
in
@@ -217,11 +208,9 @@ let test_batched_generation_consistency () =
let unique_normal = count_unique !all_normal_values in


printf "Generated %d values in %d batches of %d\n" total_values num_batches batch_size;
-  printf "Uniform values: %d unique out of %d (%.1f%%)\n"
-    unique_uniform total_values
+  printf "Uniform values: %d unique out of %d (%.1f%%)\n" unique_uniform total_values
(Float.of_int unique_uniform /. Float.of_int total_values *. 100.0);
-  printf "Normal values: %d unique out of %d (%.1f%%)\n"
-    unique_normal total_values
+  printf "Normal values: %d unique out of %d (%.1f%%)\n" unique_normal total_values
(Float.of_int unique_normal /. Float.of_int total_values *. 100.0);


(* Verify batch consistency of statistical properties *)
@@ -234,40 +223,44 @@ let test_batched_generation_consistency () =
let normal_batch = Array.sub !all_normal_values ~pos:start_idx ~len:batch_size in


batch_means_uniform.(batch) <-
-      Array.fold uniform_batch ~init:0.0 ~f:(+.) /. Float.of_int batch_size;
+      Array.fold uniform_batch ~init:0.0 ~f:( +. ) /. Float.of_int batch_size;
batch_means_normal.(batch) <-
-      Array.fold normal_batch ~init:0.0 ~f:(+.) /. Float.of_int batch_size
+      Array.fold normal_batch ~init:0.0 ~f:( +. ) /. Float.of_int batch_size
done;


let mean_of_means_uniform =
-    Array.fold batch_means_uniform ~init:0.0 ~f:(+.) /. Float.of_int num_batches
+    Array.fold batch_means_uniform ~init:0.0 ~f:( +. ) /. Float.of_int num_batches
in
let mean_of_means_normal =
-    Array.fold batch_means_normal ~init:0.0 ~f:(+.) /. Float.of_int num_batches
+    Array.fold batch_means_normal ~init:0.0 ~f:( +. ) /. Float.of_int num_batches
in


let std_of_means_uniform =
-    let diff_sum = Array.fold batch_means_uniform ~init:0.0 ~f:(fun acc x ->
-        let diff = x -. mean_of_means_uniform in
-        acc +. (diff *. diff)) in
+    let diff_sum =
+      Array.fold batch_means_uniform ~init:0.0 ~f:(fun acc x ->
+          let diff = x -. mean_of_means_uniform in
+          acc +. (diff *. diff))
+    in
Float.sqrt (diff_sum /. Float.of_int num_batches)
in
let std_of_means_normal =
-    let diff_sum = Array.fold batch_means_normal ~init:0.0 ~f:(fun acc x ->
-        let diff = x -. mean_of_means_normal in
-        acc +. (diff *. diff)) in
+    let diff_sum =
+      Array.fold batch_means_normal ~init:0.0 ~f:(fun acc x ->
+          let diff = x -. mean_of_means_normal in
+          acc +. (diff *. diff))
+    in
Float.sqrt (diff_sum /. Float.of_int num_batches)
in


printf "\nBatch means consistency:\n";
-  printf "  Uniform: mean of batch means = %.4f, std = %.4f\n"
-    mean_of_means_uniform std_of_means_uniform;
-  printf "  Normal: mean of batch means = %.4f, std = %.4f\n"
-    mean_of_means_normal std_of_means_normal
+  printf "  Uniform: mean of batch means = %.4f, std = %.4f\n" mean_of_means_uniform
+    std_of_means_uniform;
+  printf "  Normal: mean of batch means = %.4f, std = %.4f\n" mean_of_means_normal
+    std_of_means_normal


let () =
test_uniform_at_histogram ();
printf "\n";
test_normal_at_histogram ();
printf "\n";
-  test_batched_generation_consistency ()
\ No newline at end of file
+  test_batched_generation_consistency ()
File "tensor/ppx_op.ml", line 1, characters 0-0:
diff --git a/_build/default/tensor/ppx_op.ml b/_build/default/tensor/.formatted/ppx_op.ml
index 2873eda..df32d9c 100644
--- a/_build/default/tensor/ppx_op.ml
+++ b/_build/default/tensor/.formatted/ppx_op.ml
@@ -367,14 +367,14 @@ let rec translate ~no_grads_for_inline_defs ~num_configs ~is_toplevel ~opt_label
let vbs_args, processed_args =
List.unzip
@@ List.mapi args ~f:(fun i (arg_label, arg_expr) ->
-               match unit_position with
-               | Some unit_pos when i < unit_pos ->
-                   (* Before unit: preserve as OCaml expression *)
-                   (no_vbs, (arg_label, arg_expr))
-               | _ ->
-                   (* After unit or no unit: transform *)
-                   let vbs, e = loop arg_expr in
-                   (vbs, (arg_label, e)))
+            match unit_position with
+            | Some unit_pos when i < unit_pos ->
+                (* Before unit: preserve as OCaml expression *)
+                (no_vbs, (arg_label, arg_expr))
+            | _ ->
+                (* After unit or no unit: transform *)
+                let vbs, e = loop arg_expr in
+                (vbs, (arg_label, e)))
in
let all_vbs = reduce_vbss (vbs_fn :: vbs_args) in
(all_vbs, Ast_builder.Default.pexp_apply ~loc e_fn processed_args)
@@ -422,10 +422,10 @@ let rec translate ~no_grads_for_inline_defs ~num_configs ~is_toplevel ~opt_label
let labels =
Option.to_list label
@ List.filter_map args ~f:(function
-                | { pparam_desc = Pparam_val (_, _, pat); _ } ->
-                    let loc = pat.ppat_loc in
-                    Some [%expr [%e pat2expr pat].Tensor.value.Ir.Tnode.label]
-                | _ -> None)
+              | { pparam_desc = Pparam_val (_, _, pat); _ } ->
+                  let loc = pat.ppat_loc in
+                  Some [%expr [%e pat2expr pat].Tensor.value.Ir.Tnode.label]
+              | _ -> None)
in
let label_locs = List.map labels ~f:(fun label -> label.pexp_loc) in
let label_starts = List.map label_locs ~f:(fun l -> l.loc_start) in
@@ -453,8 +453,8 @@ let rec translate ~no_grads_for_inline_defs ~num_configs ~is_toplevel ~opt_label
let vbs, cases =
List.unzip
@@ List.map cases ~f:(fun ({ pc_rhs; _ } as c) ->
-                         let vbs, pc_rhs = loop ~label pc_rhs in
-                         (vbs, { c with pc_rhs }))
+                      let vbs, pc_rhs = loop ~label pc_rhs in
+                      (vbs, { c with pc_rhs }))
in
( List.fold vbs
~init:(Map.empty (module String))
@@ -472,8 +472,8 @@ let rec translate ~no_grads_for_inline_defs ~num_configs ~is_toplevel ~opt_label
let vbs, cases =
List.unzip
@@ List.map cases ~f:(fun ({ pc_rhs; _ } as c) ->
-                     let vbs, pc_rhs = loop ?label pc_rhs in
-                     (vbs, { c with pc_rhs }))
+                  let vbs, pc_rhs = loop ?label pc_rhs in
+                  (vbs, { c with pc_rhs }))
in
( List.fold vbs
~init:(Map.empty (module String))
@@ -531,18 +531,18 @@ let rec translate ~no_grads_for_inline_defs ~num_configs ~is_toplevel ~opt_label
let vbss, cases =
List.unzip
@@ List.map cases ~f:(fun ({ pc_rhs; _ } as c) ->
-               let vbs, pc_rhs = loop ?label pc_rhs in
-               (vbs, { c with pc_rhs }))
+            let vbs, pc_rhs = loop ?label pc_rhs in
+            (vbs, { c with pc_rhs }))
in
(reduce_vbss vbss, { expr with pexp_desc = Pexp_match (expr1, cases) })
| { pexp_desc = Pexp_let (recflag, bindings, body); _ } ->
let vbss1, bindings =
List.unzip
@@ List.map bindings ~f:(fun binding ->
-               let vbs, pvb_expr =
-                 loop ~label:[%expr [ [%e pat2string binding.pvb_pat] ]] binding.pvb_expr
-               in
-               (vbs, { binding with pvb_expr }))
+            let vbs, pvb_expr =
+              loop ~label:[%expr [ [%e pat2string binding.pvb_pat] ]] binding.pvb_expr
+            in
+            (vbs, { binding with pvb_expr }))
in
let vbs2, body = loop ?label body in
(reduce_vbss (vbss1 @ [ vbs2 ]), { expr with pexp_desc = Pexp_let (recflag, bindings, body) })
File "test/operations/zero2hero_1of7.ml", line 1, characters 0-0:
diff --git a/_build/default/test/operations/zero2hero_1of7.ml b/_build/default/test/operations/.formatted/zero2hero_1of7.ml
index f68634c..d2bc5e2 100644
--- a/_build/default/test/operations/zero2hero_1of7.ml
+++ b/_build/default/test/operations/.formatted/zero2hero_1of7.ml
@@ -175,9 +175,9 @@ let%expect_test "Graph drawing fetch" =
let ys, dys =
Array.unzip
@@ Array.mapi xs ~f:(fun i _ ->
-           step_ref := i;
-           Train.run ctx fx_routine;
-           (fx.@[0], x.@%[0]))
+        step_ref := i;
+        Train.run ctx fx_routine;
+        (fx.@[0], x.@%[0]))
in
(* It is fine to loop around the data: it's "next epoch". We redo the work though. *)
let plot_box =
File "arrayjit/lib/backends.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/backends.ml b/_build/default/arrayjit/lib/.formatted/backends.ml
index 166603a..b013e06 100644
--- a/_build/default/arrayjit/lib/backends.ml
+++ b/_build/default/arrayjit/lib/.formatted/backends.ml
@@ -32,7 +32,7 @@ module Add_buffer_retrieval_and_syncing (Backend : No_buffer_retrieval_or_syncin
(Fn.compose (List.filter ~f:(fun (_, e) -> not (Backend.is_done e)))
@@ Option.value ~default:[])
|> List.iter ~f:(fun (work_stream, e) ->
-           if not (equal_stream work_stream s) then Backend.will_wait_for ctx e)
+        if not (equal_stream work_stream s) then Backend.will_wait_for ctx e)


let wait_for_ready ~dst ~src tn =
let s = src.stream in
@@ -40,7 +40,7 @@ module Add_buffer_retrieval_and_syncing (Backend : No_buffer_retrieval_or_syncin
(* TODO: maybe it's worthwhile to clean up s.updating_for every now and then. *)
Hashtbl.find s.updating_for tn
|> Option.iter ~f:(fun upd_e ->
-           if not (equal_stream s d || Backend.is_done upd_e) then Backend.will_wait_for dst upd_e)
+        if not (equal_stream s d || Backend.is_done upd_e) then Backend.will_wait_for dst upd_e)


let%track3_sexp to_host (ctx : Backend.context) (tn : Tn.t) =
match (tn, Map.find ctx.ctx_arrays tn) with
@@ -269,13 +269,13 @@ let lower_batch_assignments optim_ctx ?names ?occupancy bindings asgns_l =
let occupancy = Option.value occupancy ~default:(fun ~name:_ ~src_n:_ -> true) in
Array.unzip
@@ Array.mapi names ~f:(fun src_n name ->
-         let asgns = asgns_l.(src_n) in
-         if occupancy ~name ~src_n then
-           ( Some name,
-             Some
-               (Assignments.lower optim_ctx ~unoptim_ll_source ~ll_source ~cd_source ~name bound
-                  asgns) )
-         else (None, None))
+      let asgns = asgns_l.(src_n) in
+      if occupancy ~name ~src_n then
+        ( Some name,
+          Some
+            (Assignments.lower optim_ctx ~unoptim_ll_source ~ll_source ~cd_source ~name bound asgns)
+        )
+      else (None, None))


let%debug3_sexp verify_prior_context ~use_host_memory ~ctx_arrays ~from_prior_context : unit =
Set.iter from_prior_context ~f:(fun tn ->
@@ -659,8 +659,7 @@ let%track5_sexp fresh_backend ?backend_name ?(config = For_parallel_copying) ()
: Backend)
| "sync_cc" ->
(module Make_device_backend_from_lowered (Schedulers.Sync) (Cc_backend) (Config) : Backend)
-  | "cuda" ->
-      (module Raise_backend ((Cuda_backend_impl.Fresh (Config) : Lowered_backend)) : Backend)
+  | "cuda" -> (module Raise_backend (Cuda_backend_impl.Fresh (Config) : Lowered_backend) : Backend)
| "metal" ->
-      (module Raise_backend ((Metal_backend_impl.Fresh (Config) : Lowered_backend)) : Backend)
+      (module Raise_backend (Metal_backend_impl.Fresh (Config) : Lowered_backend) : Backend)
| backend -> invalid_arg [%string "Backends.fresh_backend: unknown backend %{backend}"]
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 9061870..fdce12a 100644
--- a/_build/default/arrayjit/lib/tnode.ml
+++ b/_build/default/arrayjit/lib/.formatted/tnode.ml
@@ -165,22 +165,22 @@ let debug_memory_mode = function
| None -> "unknown"
| Some (mem, prov) ->
(match mem with
-      | Effectively_constant -> "Const"
-      | Virtual -> "Virt"
-      | Never_virtual -> "Non-virt"
-      | Local -> "Local"
-      | Device_only -> "Dev"
-      | Materialized -> "Material"
-      | On_device Unset -> "On-dev"
-      | On_device Shared_cross_streams -> "Dev-shared"
-      | On_device Per_stream -> "Dev-stream"
-      | Hosted Constant -> "Host-const"
-      | Hosted Nonconstant -> "Host-non-const"
-      | Hosted Unset_hosted -> "Host-unset"
-      | Hosted Volatile -> "Hosted"
-      | Hosted (Changed_on_devices Unset) -> "Host&dev"
-      | Hosted (Changed_on_devices Per_stream) -> "Host&stream"
-      | Hosted (Changed_on_devices Shared_cross_streams) -> "Host&shared")
+        | Effectively_constant -> "Const"
+        | Virtual -> "Virt"
+        | Never_virtual -> "Non-virt"
+        | Local -> "Local"
+        | Device_only -> "Dev"
+        | Materialized -> "Material"
+        | On_device Unset -> "On-dev"
+        | On_device Shared_cross_streams -> "Dev-shared"
+        | On_device Per_stream -> "Dev-stream"
+        | Hosted Constant -> "Host-const"
+        | Hosted Nonconstant -> "Host-non-const"
+        | Hosted Unset_hosted -> "Host-unset"
+        | Hosted Volatile -> "Hosted"
+        | Hosted (Changed_on_devices Unset) -> "Host&dev"
+        | Hosted (Changed_on_devices Per_stream) -> "Host&stream"
+        | Hosted (Changed_on_devices Shared_cross_streams) -> "Host&shared")
^ "/" ^ Int.to_string prov


let log_debug_info ~from_log_level tn =
File "tensor/tensor.ml", line 1, characters 0-0:
diff --git a/_build/default/tensor/tensor.ml b/_build/default/tensor/.formatted/tensor.ml
index 99ed2ee..93fda42 100644
--- a/_build/default/tensor/tensor.ml
+++ b/_build/default/tensor/.formatted/tensor.ml
@@ -119,9 +119,9 @@ let%debug7_sexp rec init_params ?skip (t : t) : Asgns.comp =
let params : t list =
Set.to_list t.params
|> (match skip with
-       | None -> Fn.id
-       | Some skip -> List.filter ~f:(fun p -> not (Map.mem skip p.value)))
-       (* Compare to ordered_ts in op -- we need to sort to avoid computed-after-use bugs! *)
+      | None -> Fn.id
+      | Some skip -> List.filter ~f:(fun p -> not (Map.mem skip p.value)))
+      (* Compare to ordered_ts in op -- we need to sort to avoid computed-after-use bugs! *)
|> List.sort ~compare:(fun p1 p2 -> Int.ascending p1.id p2.id)
in
let asgns =
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 efff2f6..ac068a2 100644
--- a/_build/default/arrayjit/lib/ndarray.ml
+++ b/_build/default/arrayjit/lib/.formatted/ndarray.ml
@@ -691,22 +691,21 @@ let render_array ?(brief = false) ?(prefix = "") ?(entries_per_axis = 4) ?(label
let outer_grid v =
(if brief then Fn.id else B.frame ~stretch:false)
@@ B.init_grid ~bars:true ~line:nlines ~col:ncols (fun ~line ~col ->
-             if (not brief) && line = 0 && col = 0 then
-               B.lines @@ List.filter ~f:(Fn.non String.is_empty) @@ [ tag ~pos:v label0 ind0 ]
-             else if (not brief) && line = 0 then
-               B.lines
-               @@ List.filter ~f:(Fn.non String.is_empty)
-               @@ [ tag ~pos:(col - 1) label2 ind2; tag label4 ind4 ]
-             else if (not brief) && col = 0 then
-               B.lines
-               @@ List.filter ~f:(Fn.non String.is_empty)
-               @@ [ tag ~pos:(line - 1) label1 ind1; tag label3 ind3 ]
-             else
-               let nline = if brief then line else line - 1 in
-               let ncol = if brief then col else col - 1 in
-               if elide_for ncol ~ind:ind2 || elide_for nline ~ind:ind1 then
-                 B.hpad 1 @@ B.line "..."
-               else inner_grid v nline ncol)
+          if (not brief) && line = 0 && col = 0 then
+            B.lines @@ List.filter ~f:(Fn.non String.is_empty) @@ [ tag ~pos:v label0 ind0 ]
+          else if (not brief) && line = 0 then
+            B.lines
+            @@ List.filter ~f:(Fn.non String.is_empty)
+            @@ [ tag ~pos:(col - 1) label2 ind2; tag label4 ind4 ]
+          else if (not brief) && col = 0 then
+            B.lines
+            @@ List.filter ~f:(Fn.non String.is_empty)
+            @@ [ tag ~pos:(line - 1) label1 ind1; tag label3 ind3 ]
+          else
+            let nline = if brief then line else line - 1 in
+            let ncol = if brief then col else col - 1 in
+            if elide_for ncol ~ind:ind2 || elide_for nline ~ind:ind1 then B.hpad 1 @@ B.line "..."
+            else inner_grid v nline ncol)
in
let screens =
B.init_grid ~bars:true ~line:size0 ~col:1 (fun ~line ~col:_ ->
File "arrayjit/lib/utils.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/utils.ml b/_build/default/arrayjit/lib/.formatted/utils.ml
index a170906..d2a97b7 100644
--- a/_build/default/arrayjit/lib/utils.ml
+++ b/_build/default/arrayjit/lib/.formatted/utils.ml
@@ -119,25 +119,25 @@ let config_file_args =
let result =
config_lines
|> List.filter ~f:(fun l ->
-               not (String.is_prefix ~prefix:"~~" l || String.is_prefix ~prefix:"#" l))
+            not (String.is_prefix ~prefix:"~~" l || String.is_prefix ~prefix:"#" l))
|> List.map ~f:(String.split ~on:'=')
|> List.filter_map ~f:(function
-             | [] -> None
-             | [ s ] when String.is_empty s -> None
-             | key :: [ v ] ->
-                 let key =
-                   String.(
-                     lowercase @@ strip ~drop:(fun c -> equal_char '-' c || equal_char ' ' c) key)
-                 in
-                 let key =
-                   if String.is_prefix key ~prefix:"ocannl" then
-                     String.drop_prefix key 6 |> String.strip ~drop:(equal_char '_')
-                   else key
-                 in
-                 str_nonempty ~f:(pair key) v
-             | l ->
-                 failwith @@ "OCANNL: invalid syntax in the config file " ^ fname
-                 ^ ", should have a single '=' on each non-empty line, found: " ^ String.concat l)
+          | [] -> None
+          | [ s ] when String.is_empty s -> None
+          | key :: [ v ] ->
+              let key =
+                String.(
+                  lowercase @@ strip ~drop:(fun c -> equal_char '-' c || equal_char ' ' c) key)
+              in
+              let key =
+                if String.is_prefix key ~prefix:"ocannl" then
+                  String.drop_prefix key 6 |> String.strip ~drop:(equal_char '_')
+                else key
+              in
+              str_nonempty ~f:(pair key) v
+          | l ->
+              failwith @@ "OCANNL: invalid syntax in the config file " ^ fname
+              ^ ", should have a single '=' on each non-empty line, found: " ^ String.concat l)
|> Hashtbl.of_alist (module String)
|> function
| `Ok h -> h
@@ -379,11 +379,11 @@ let get_local_debug_runtime =
else
String.split pairs_str ~on:';'
|> List.filter_map ~f:(fun pair_str ->
-             match String.split pair_str ~on:',' with
-             | [ id1; id2 ] ->
-                 Option.try_with (fun () ->
-                     (Int.of_string (String.strip id1), Int.of_string (String.strip id2)))
-             | _ -> None)
+          match String.split pair_str ~on:',' with
+          | [ id1; id2 ] ->
+              Option.try_with (fun () ->
+                  (Int.of_string (String.strip id1), Int.of_string (String.strip id2)))
+          | _ -> None)
in
let truncate_children =
let arg = get_global_arg ~default:"" ~arg_name:"debug_log_truncate_children" in
File "arrayjit/lib/c_syntax.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/c_syntax.ml b/_build/default/arrayjit/lib/.formatted/c_syntax.ml
index cfb97ba..0a6b758 100644
--- a/_build/default/arrayjit/lib/c_syntax.ml
+++ b/_build/default/arrayjit/lib/.formatted/c_syntax.ml
@@ -759,19 +759,19 @@ module C_syntax (B : C_syntax_config) = struct
let params : (string * param_source) list =
List.rev
@@ Hashtbl.fold traced_store ~init:[] ~f:(fun ~key:tn ~data:_ params ->
-             let backend_info, is_param =
-               if Tn.is_virtual_force tn 334 then ("Virt", false)
-               else if in_ctx tn then ("Ctx", true)
-               else if Tn.is_materialized_force tn 335 then ("Global", true)
-               else if Tn.known_not_materialized tn then ("Local", false)
-               else assert false
-             in
-             let backend_info = Sexp.Atom backend_info in
-             if not @@ Utils.sexp_mem ~elem:backend_info tn.backend_info then
-               tn.backend_info <- Utils.sexp_append ~elem:backend_info tn.backend_info;
-             if is_param then
-               (B.typ_of_prec (Lazy.force tn.Tn.prec) ^ " *" ^ get_ident tn, Param_ptr tn) :: params
-             else params)
+          let backend_info, is_param =
+            if Tn.is_virtual_force tn 334 then ("Virt", false)
+            else if in_ctx tn then ("Ctx", true)
+            else if Tn.is_materialized_force tn 335 then ("Global", true)
+            else if Tn.known_not_materialized tn then ("Local", false)
+            else assert false
+          in
+          let backend_info = Sexp.Atom backend_info in
+          if not @@ Utils.sexp_mem ~elem:backend_info tn.backend_info then
+            tn.backend_info <- Utils.sexp_append ~elem:backend_info tn.backend_info;
+          if is_param then
+            (B.typ_of_prec (Lazy.force tn.Tn.prec) ^ " *" ^ get_ident tn, Param_ptr tn) :: params
+          else params)
in
let idx_params =
List.map idx_params ~f:(fun s ->
@@ -788,7 +788,7 @@ module C_syntax (B : C_syntax_config) = struct
Option.(
to_list
@@ map merge_node ~f:(fun tn ->
-               ("const " ^ B.typ_of_prec (Lazy.force tn.prec) ^ " *merge_buffer", Merge_buffer)))
+            ("const " ^ B.typ_of_prec (Lazy.force tn.prec) ^ " *merge_buffer", Merge_buffer)))
in
let all_params = log_file_param @ merge_param @ idx_params @ params in
let sorted_params =
Warning: Invalid documentation comment:
File "tensor/shape.ml", line 24, characters 0-0:
End of text is not allowed in '[...]' (code).
File "tensor/shape.ml", line 1, characters 0-0:
diff --git a/_build/default/tensor/shape.ml b/_build/default/tensor/.formatted/shape.ml
index 03aaad5..47d3f90 100644
--- a/_build/default/tensor/shape.ml
+++ b/_build/default/tensor/.formatted/shape.ml
@@ -124,8 +124,8 @@ type terminal_type = Data of Ir.Assignments.init_data | Fetch of Ir.Assignments.
type ternary_type = Pointwise_tern | Compose_accumulate | Defined_by_cd_logic
[@@deriving sexp, equal]


-(** Convert einsum_parser types to shape.ml types.
-    The types are structurally identical, but shape.ml has additional derivations. *)
+(** Convert einsum_parser types to shape.ml types. The types are structurally identical, but
+    shape.ml has additional derivations. *)
let convert_axis_spec : Einsum_parser.axis_spec -> axis_spec = function
| Label s -> Label s
| Fixed_index i -> Fixed_index i
@@ -137,7 +137,9 @@ let convert_axis_key (key : Einsum_parser.axis_key) : AxisKey.t =


let convert_parsed_axis_labels (parsed : Einsum_parser.parsed_axis_labels) : parsed_axis_labels =
let labels =
-    Map.fold parsed.labels ~init:(Map.empty (module AxisKey)) ~f:(fun ~key ~data acc ->
+    Map.fold parsed.labels
+      ~init:(Map.empty (module AxisKey))
+      ~f:(fun ~key ~data acc ->
Map.set acc ~key:(convert_axis_key key) ~data:(convert_axis_spec data))
in
{
@@ -156,7 +158,8 @@ let convert_parsed_axis_labels (parsed : Einsum_parser.parsed_axis_labels) : par
let axis_labels_of_spec spec =
try convert_parsed_axis_labels (Einsum_parser.axis_labels_of_spec spec)
with Einsum_parser.Parse_error msg ->
-    raise @@ Utils.User_error ("Shape.axis_labels_of_spec: while parsing: " ^ spec ^ " error: " ^ msg)
+    raise
+    @@ Utils.User_error ("Shape.axis_labels_of_spec: while parsing: " ^ spec ^ " error: " ^ msg)


let einsum_of_spec spec =
try
File "arrayjit/lib/cuda_backend.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/cuda_backend.ml b/_build/default/arrayjit/lib/.formatted/cuda_backend.ml
index 79d1754..d083ec6 100644
--- a/_build/default/arrayjit/lib/cuda_backend.ml
+++ b/_build/default/arrayjit/lib/.formatted/cuda_backend.ml
@@ -1014,10 +1014,10 @@ end) : Ir.Backend_impl.Lowered_backend = struct
Array.mapi code_batch.params_and_names ~f:(fun i pns ->
Option.value ~default:None
@@ Option.map2 pns ctx_arrays.(i) ~f:(fun (params, name) ctx_arrays ->
-                 let task =
-                   link_proc ~prior_context ~name ~params ~ctx_arrays lowered_bindings run_module
-                 in
-                 Some task))
+              let task =
+                link_proc ~prior_context ~name ~params ~ctx_arrays lowered_bindings run_module
+              in
+              Some task))
in
(lowered_bindings, procs)


File "tensor/ppx_cd.ml", line 1, characters 0-0:
diff --git a/_build/default/tensor/ppx_cd.ml b/_build/default/tensor/.formatted/ppx_cd.ml
index f366b08..a8ea01d 100644
--- a/_build/default/tensor/ppx_cd.ml
+++ b/_build/default/tensor/.formatted/ppx_cd.ml
@@ -421,8 +421,8 @@ let handle_cases ~bad_pun_hints ~proj_in_scope transl cases =
let fields, transformed_cases =
List.unzip
@@ List.map cases ~f:(fun ({ pc_rhs; _ } as c) ->
-           let res = transl ~bad_pun_hints ~proj_in_scope pc_rhs in
-           ((res.vbs, res.typ, res.slot), { c with pc_rhs = res.expr }))
+        let res = transl ~bad_pun_hints ~proj_in_scope pc_rhs in
+        ((res.vbs, res.typ, res.slot), { c with pc_rhs = res.expr }))
in
let vbss, typs, slots = List.unzip3 fields in
(* TODO: make the inference of typ and slot more strict by detecting mismatches. *)
@@ -450,55 +450,55 @@ let translate ?ident_label (expr : expression) : result =
let assignment_op accu_op =
loc
|> Option.value_or_thunk (Hashtbl.find assignment_ops accu_op) ~default:(fun () _loc ->
-             ( false,
-               Ast_builder.Default.pexp_extension ~loc
-               @@ Location.error_extensionf ~loc
-                    "ppx_ocannl %%cd: expected an assignment operator, one of: %s %s"
-                    "=+ (Add), =- (Sub), =* (Mul),=/ (Div), =** (ToPowOf), =?/ (Relu_gate), =?^ \
-                     (Satur01_gate), =|| (Or),  =&& (And), =@^ (Max), =@- (Min), =^^^^ \
-                     (threefry4x32), =: (Arg2), =:+, =:-,"
-                    " =:*, =:/, =:**, =:?/, =:?^, =:||, =:&&, =:@^, =:@-, =:^^^^ (same with \
-                     initializing the tensor to the neutral value before the start of the \
-                     calculation)" ))
+          ( false,
+            Ast_builder.Default.pexp_extension ~loc
+            @@ Location.error_extensionf ~loc
+                 "ppx_ocannl %%cd: expected an assignment operator, one of: %s %s"
+                 "=+ (Add), =- (Sub), =* (Mul),=/ (Div), =** (ToPowOf), =?/ (Relu_gate), =?^ \
+                  (Satur01_gate), =|| (Or),  =&& (And), =@^ (Max), =@- (Min), =^^^^ \
+                  (threefry4x32), =: (Arg2), =:+, =:-,"
+                 " =:*, =:/, =:**, =:?/, =:?^, =:||, =:&&, =:@^, =:@-, =:^^^^ (same with \
+                  initializing the tensor to the neutral value before the start of the \
+                  calculation)" ))
in
let unary_op un_op =
loc
|> Option.value_or_thunk (Hashtbl.find unary_ops un_op) ~default:(fun () loc ->
-             ( [%expr Shape.Pointwise_un],
-               Ast_builder.Default.pexp_extension ~loc
-               @@ Location.error_extensionf ~loc
-                    "ppx_ocannl %%cd: expected a unary operator, one of: %s"
-                    "id, relu, sat01, exp, log, exp2, log2, sin, cos, sqrt, recip, recip_sqrt, \
-                     neg, tanh, uint4x32_to_prec_uniform1" ))
+          ( [%expr Shape.Pointwise_un],
+            Ast_builder.Default.pexp_extension ~loc
+            @@ Location.error_extensionf ~loc
+                 "ppx_ocannl %%cd: expected a unary operator, one of: %s"
+                 "id, relu, sat01, exp, log, exp2, log2, sin, cos, sqrt, recip, recip_sqrt, neg, \
+                  tanh, uint4x32_to_prec_uniform1" ))
in
let vec_unary_op vec_un_op =
loc
|> Option.value_or_thunk (Hashtbl.find vec_unary_ops vec_un_op) ~default:(fun () loc ->
-             ( [%expr Shape.Uint4x32_to_prec_uniform],
-               Ast_builder.Default.pexp_extension ~loc
-               @@ Location.error_extensionf ~loc
-                    "ppx_ocannl %%cd: expected a vector unary operator, one of: \
-                     uint4x32_to_prec_uniform; found: %s"
-                    vec_un_op ))
+          ( [%expr Shape.Uint4x32_to_prec_uniform],
+            Ast_builder.Default.pexp_extension ~loc
+            @@ Location.error_extensionf ~loc
+                 "ppx_ocannl %%cd: expected a vector unary operator, one of: \
+                  uint4x32_to_prec_uniform; found: %s"
+                 vec_un_op ))
in
let binary_op bin_op =
loc
|> Option.value_or_thunk (Hashtbl.find binary_ops bin_op) ~default:(fun () _loc ->
-             ( [%expr Shape.Pointwise_bin],
-               Ast_builder.Default.pexp_extension ~loc
-               @@ Location.error_extensionf ~loc
-                    "ppx_ocannl %%cd: expected a binary operator, one of: %s"
-                    "+ (Add), - (Sub), * (Mul), / (Div), **(ToPowOf), -?/ (Relu_gate), -?^ \
-                     (Satur01_gate), -/> (Arg2), <  (Cmplt), = (Cmpeq), <> (Cmpne), || (Or), && \
-                     (And), % (Mod), @^(Max), @- (Min), ^^^^ (threefry4x32)" ))
+          ( [%expr Shape.Pointwise_bin],
+            Ast_builder.Default.pexp_extension ~loc
+            @@ Location.error_extensionf ~loc
+                 "ppx_ocannl %%cd: expected a binary operator, one of: %s"
+                 "+ (Add), - (Sub), * (Mul), / (Div), **(ToPowOf), -?/ (Relu_gate), -?^ \
+                  (Satur01_gate), -/> (Arg2), <  (Cmplt), = (Cmpeq), <> (Cmpne), || (Or), && \
+                  (And), % (Mod), @^(Max), @- (Min), ^^^^ (threefry4x32)" ))
in
let ternary_op tern_op =
loc
|> Option.value_or_thunk (Hashtbl.find ternary_ops tern_op) ~default:(fun () _loc ->
-             ( [%expr Shape.Pointwise_tern],
-               Ast_builder.Default.pexp_extension ~loc
-               @@ Location.error_extensionf ~loc
-                    "ppx_ocannl %%cd: expected a ternary operator, one of: where, fma" ))
+          ( [%expr Shape.Pointwise_tern],
+            Ast_builder.Default.pexp_extension ~loc
+            @@ Location.error_extensionf ~loc
+                 "ppx_ocannl %%cd: expected a ternary operator, one of: where, fma" ))
in
(* TODO: collapse these (code reuse) *)
let process_assign_ternop ~accu_op ~lhs ~tern_op ~rhs1 ~rhs2 ~rhs3 ?projections ~proj_in_scope
@@ -926,11 +926,11 @@ let translate ?ident_label (expr : expression) : result =
| { pexp_desc = Pexp_array _; _ }
| { pexp_desc = Pexp_construct ({ txt = Lident "::"; _ }, _); _ } ->
{ default_result with expr = ndarray_op ~ndarray_fn:[%expr NTDSL.ndarray] expr }
-    | { pexp_desc = Pexp_ident { txt = Lident ("lhs"); _ }; _ } ->
+    | { pexp_desc = Pexp_ident { txt = Lident "lhs"; _ }; _ } ->
{ default_result with typ = Array; slot = LHS }
-        | { pexp_desc = Pexp_ident { txt = Lident ("v"); _ }; _ } ->
-          { default_result with typ = Array; slot = LHS; expr = [%expr t.Tensor.value] }
-      | { pexp_desc = Pexp_ident { txt = Lident "g"; _ }; _ } ->
+    | { pexp_desc = Pexp_ident { txt = Lident "v"; _ }; _ } ->
+        { default_result with typ = Array; slot = LHS; expr = [%expr t.Tensor.value] }
+    | { pexp_desc = Pexp_ident { txt = Lident "g"; _ }; _ } ->
{ default_result with typ = Array; slot = LHS }
| { pexp_desc = Pexp_ident { txt = Lident "rhs1"; _ }; _ } ->
{ default_result with typ = Array; slot = RHS1 }
@@ -1308,10 +1308,10 @@ let translate ?ident_label (expr : expression) : result =
let elements =
expr :: List.map ~f:snd exprs
|> List.map ~f:(function
-               | { pexp_desc = Pexp_constant (Pconst_string _); _ } as s -> s
-               | [%expr [%e? t].value] -> [%expr Ir.Tnode.debug_name [%e t].value]
-               | [%expr [%e? t].grad] -> [%expr Ir.Tnode.debug_name [%e t].value ^ ".grad"]
-               | t -> [%expr Ir.Tnode.debug_name [%e t].value])
+            | { pexp_desc = Pexp_constant (Pconst_string _); _ } as s -> s
+            | [%expr [%e? t].value] -> [%expr Ir.Tnode.debug_name [%e t].value]
+            | [%expr [%e? t].grad] -> [%expr Ir.Tnode.debug_name [%e t].value ^ ".grad"]
+            | t -> [%expr Ir.Tnode.debug_name [%e t].value])
in
let res2 = loop ~proj_in_scope expr2 in
let block =
@@ -1593,18 +1593,18 @@ let translate ?ident_label (expr : expression) : result =
let proj_in_scope =
proj_in_scope
|| List.exists args ~f:(function
-               | { pparam_desc = Pparam_val ((Labelled s | Optional s), _, _); _ }
-                 when String.equal s "projections" ->
-                   true
-               | _ -> false)
+            | { pparam_desc = Pparam_val ((Labelled s | Optional s), _, _); _ }
+              when String.equal s "projections" ->
+                true
+            | _ -> false)
in
let bad_pun_hints =
Set.union_list (module String)
@@ bad_pun_hints
:: List.map args ~f:(fun arg ->
-                    match arg.pparam_desc with
-                    | Pparam_val (_, _, pat) -> collect_pat_idents pat
-                    | _ -> Set.empty (module String))
+                 match arg.pparam_desc with
+                 | Pparam_val (_, _, pat) -> collect_pat_idents pat
+                 | _ -> Set.empty (module String))
in
let result =
match body with
Warning: Invalid documentation comment:
File "tensor/row.ml", line 817, characters 39-49:
'{ var; _ }': bad markup.
Suggestion: did you mean '{! var; _ }' or '[ var; _ ]'?
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 4e2ca58..41da273 100644
--- a/_build/default/arrayjit/lib/low_level.ml
+++ b/_build/default/arrayjit/lib/.formatted/low_level.ml
@@ -372,7 +372,7 @@ let visit_llc traced_store ~merge_node_id reverse_node_map ~max_visits llc =
if
(not virtualize_settings.inline_complex_computations)
|| Option.value_map access_pos ~default:true ~f:(fun pos ->
-                 not ([%equal: int array] pos at_pos))
+              not ([%equal: int array] pos at_pos))
then
Hashtbl.update traced.accesses at_pos
~f:(visit ~is_assigned:(traced.zeroed_out || Hash_set.mem traced.assignments at_pos))
@@ -712,11 +712,11 @@ let%track7_sexp inline_computation ~id
let computations =
Hashtbl.find computations_table traced.tn
|> Option.value_or_thunk ~default:(fun () ->
-             raise
-             @@ Utils.User_error
-                  [%string
-                    "Stale optimize_ctx: No computations found for #%{traced.tn.Tn.id#Int}: \
-                     %{Tn.debug_name traced.tn}"])
+          raise
+          @@ Utils.User_error
+               [%string
+                 "Stale optimize_ctx: No computations found for #%{traced.tn.Tn.id#Int}: \
+                  %{Tn.debug_name traced.tn}"])
in
let body = List.rev_filter_map ~f:loop_proc computations in
if List.is_empty body then raise @@ Non_virtual 14 else Some (unflat_lines body)
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-11-23 21:01.05: Job failed: Failed: Build failed