Organisationsahrefsocannl85eaff ()(lint-fmt)

(lint-fmt)

Logs

Show full logs
2025-07-26 07:51.58: New job: test ahrefs/ocannl https://github.com/ahrefs/ocannl.git#refs/heads/master (85eaff98853cd8dd8f4f6be71649c038e52bd682) (linux-x86_64:(lint-fmt))
Base: ocaml/opam:debian-12-ocaml-4.08@sha256:4b3e5b2d1be26cada6c08f752ca0b48d3b0ba20fec23648d53395a83f1ae2517
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 85eaff98
cat > Dockerfile <<'END-OF-DOCKERFILE'
FROM ocaml/opam:debian-12-ocaml-4.08@sha256:4b3e5b2d1be26cada6c08f752ca0b48d3b0ba20fec23648d53395a83f1ae2517
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-07-26 07:51.58: Using cache hint "ahrefs/ocannl-ocaml/opam:debian-12-ocaml-4.08@sha256:4b3e5b2d1be26cada6c08f752ca0b48d3b0ba20fec23648d53395a83f1ae2517-debian-12-4.08_opam-2.3-ocamlformat-0eea63ad71af2b1116c556023bedc6bf083e6125"
2025-07-26 07:51.58: Using OBuilder spec:
((from ocaml/opam:debian-12-ocaml-4.08@sha256:4b3e5b2d1be26cada6c08f752ca0b48d3b0ba20fec23648d53395a83f1ae2517)
 (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-07-26 07:51.58: Waiting for resource in pool OCluster
2025-07-26 07:51.58: Waiting for worker…
2025-07-26 07:51.58: Got resource from pool OCluster
Building on toxis.caelum.ci.dev
HEAD is now at 4dcf8de7 Rename llv -> llsc
HEAD is now at 85eaff98 First pass on adding vector-returning operations, by Claude Opus Prompt: Separate Uint4x32_to_prec_uniform from the type unop in arrayjit/lib/ops.ml into a separate type vec_unop . In the Low_level module type t , add a constructor  Set_from_vec { tn : Tnode.t; idcs : Indexing.axis_index array; length: int; vec_unop : Ops.vec_unop; arg : scalar_t; mutable debug : string } . This constructor is an analogue of the Set constructor but for vector rather than scalar values. The length field is the length of the vector, and backends should set the consecutive cells of the buffer corresponding to tn , starting with position idcs . At present, given that we only have one vector operation, for simplicity we do not introduce a separate type vector_t , that's why the fields of a hypothetical vector_t Unop are inlined into Set_from_vec . In the Assignments module type t , add a constructor Set_vec_unop { op : Ops.vec_unop ; lhs : Tn.t ; rhs : buffer; projections : Indexing.projections Lazy.t } . Add handling for the new variants following the intended meaning. Add support for the separated out vector assignment and vector operation in the syntax extension file ppx_cd.ml . Reach out for clarifications, I'm here to help. Once we get the backend-generic code into a good shape, we will add support in the backend-specific code. We will start by converting the uint4x32_to_*_uniform functions in builtins.c , builtins_small.cu and builtins.msl to return vectors of results, for each function we will introduce a vector type holding the specific number of results that these functions should compute to make efficient use of the random bits from the argument uint4x32 value. Then, we will enhance code generation to support the vectorized assignment Set_from_vec by unrolling it into the `length` number of individual assignments.

(from ocaml/opam:debian-12-ocaml-4.08@sha256:4b3e5b2d1be26cada6c08f752ca0b48d3b0ba20fec23648d53395a83f1ae2517)
2025-07-26 07:51.59 ---> using "6cffc1a1a52caf2843bd473effea9756e568737c821ae9874d1cb7264a14fd20" 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-07-26 07:51.59 ---> using "302b09a07f3e63cf843954026241e2145dcd9d48aa46e6f73f5e6c2a8313c3c9" from cache

/: (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-07-26 07:51.59 ---> using "cea7a1b4577ed221adf5a742377b6f150ff7832adb27838f80bf4faa7e02e12f" from cache

/: (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 csexp.1.5.2
-> installed either.1.0.0
-> installed fix.20250428
-> installed cmdliner.1.3.0
-> installed menhirCST.20240715
-> installed menhirLib.20240715
-> installed menhirSdk.20240715
-> installed ocaml-version.4.0.1
-> installed re.1.11.0
-> installed sexplib0.v0.14.0
-> installed dune-build-info.3.19.1
-> installed dune-configurator.3.19.1
-> installed ocamlfind.1.9.8
-> installed base-bytes.base
-> installed ocp-indent.1.8.1
-> installed ocamlbuild.0.16.1
-> installed base.v0.14.3
-> installed topkg.1.0.8
-> installed stdio.v0.14.0
-> installed uutf.1.0.4
-> installed astring.0.8.5
-> installed fpath.0.7.3
-> installed menhir.20240715
-> 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-07-26 07:51.59 ---> using "77996898021cad247d81d8eceeba4066a697607f4a9fdc67bee5a3313579cd44" from cache

/src: (copy (src .) (dst /src/))
2025-07-26 07:51.59 ---> saved as "66d4b9e9706fd5b3aa35a433d5da8e93af4761f09e4cae07a9214f34e07ebc7a"

/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 30-43:
6 |   (pps ppx_here 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/operations/dune:17
-> required by _build/default/test/operations/config/ocannl_backend.txt
-> required by %{read:config/ocannl_backend.txt} at test/operations/dune:33
-> required by Computing directory contents of _build/default/test/operations
File "arrayjit/bin/dune", line 6, characters 7-15:
6 |   (pps ppx_here ppx_minidebug ppx_sexp_conv))
           ^^^^^^^^
Error: Library "ppx_here" 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/operations/dune:17
-> required by _build/default/test/operations/config/ocannl_backend.txt
-> required by %{read:config/ocannl_backend.txt} at test/operations/dune:33
-> required by Computing directory contents of _build/default/test/operations
File "arrayjit/lib/dune", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/dune b/_build/default/arrayjit/lib/.formatted/dune
index af3ed76..b4664ca 100644
--- a/_build/default/arrayjit/lib/dune
+++ b/_build/default/arrayjit/lib/.formatted/dune
@@ -90,7 +90,6 @@
    ppx_variants_conv
    ppx_minidebug)))
 
-
 (library
  (name backends)
  (public_name arrayjit.backends)
File "arrayjit/lib/low_level.mli", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/low_level.mli b/_build/default/arrayjit/lib/.formatted/low_level.mli
index 62c5e4c..68b540e 100644
--- a/_build/default/arrayjit/lib/low_level.mli
+++ b/_build/default/arrayjit/lib/.formatted/low_level.mli
@@ -24,8 +24,20 @@ type t =
   | Seq of t * t
   | For_loop of { index : Indexing.symbol; from_ : int; to_ : int; body : t; trace_it : bool }
   | Zero_out of Tnode.t
-  | Set of { tn : Tnode.t; idcs : Indexing.axis_index array; llsc : scalar_t; mutable debug : string }
-  | Set_from_vec of { tn : Tnode.t; idcs : Indexing.axis_index array; length : int; vec_unop : Ops.vec_unop; arg : scalar_t; mutable debug : string }
+  | Set of {
+      tn : Tnode.t;
+      idcs : Indexing.axis_index array;
+      llsc : scalar_t;
+      mutable debug : string;
+    }
+  | Set_from_vec of {
+      tn : Tnode.t;
+      idcs : Indexing.axis_index array;
+      length : int;
+      vec_unop : Ops.vec_unop;
+      arg : scalar_t;
+      mutable debug : string;
+    }
   | Set_local of scope_id * scalar_t
 [@@deriving sexp_of, equal]
 
File "bin/einsum_trivia.ml", line 1, characters 0-0:
diff --git a/_build/default/bin/einsum_trivia.ml b/_build/default/bin/.formatted/einsum_trivia.ml
index e71ad80..41db8f1 100644
--- a/_build/default/bin/einsum_trivia.ml
+++ b/_build/default/bin/.formatted/einsum_trivia.ml
@@ -25,11 +25,10 @@ let _suspended () =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   let hey = TDSL.range_of_shape ~batch_dims:[ 2 ] ~input_dims:[ 3 ] ~output_dims:[ 4 ] () in
   let%op _ho = hey ++ "b|i->o => o|b->i" in
-  
+
   let hey2 =
     TDSL.range_of_shape ~batch_dims:[ 2; 3 ] ~input_dims:[ 4; 5 ] ~output_dims:[ 6; 7 ] ()
   in
@@ -48,8 +47,7 @@ let () =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   let a = TDSL.range_of_shape ~batch_dims:[ 2 ] ~input_dims:[ 3 ] ~output_dims:[ 4 ] () in
   let b = TDSL.range_of_shape ~batch_dims:[ 2 ] ~input_dims:[ 4 ] ~output_dims:[ 5 ] () in
   let%op _ = a *+ "b|i->o; b|i->o => b|i->o" a in
File "bin/micrograd_demo_logging.ml", line 1, characters 0-0:
diff --git a/_build/default/bin/micrograd_demo_logging.ml b/_build/default/bin/.formatted/micrograd_demo_logging.ml
index 491ee09..26a32de 100644
--- a/_build/default/bin/micrograd_demo_logging.ml
+++ b/_build/default/bin/.formatted/micrograd_demo_logging.ml
@@ -33,8 +33,6 @@ let () =
 let _suspended () =
   Tensor.unsafe_reinitialize ();
   let module Backend = (val Backends.fresh_backend ()) in
-  
-  
   let%op c = "a" [ -4 ] + "b" [ 2 ] in
   let%op d = (a *. b) + (b **. 3) in
   let%op c = c + c + 1 in
File "arrayjit/lib/backend_impl.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/backend_impl.ml b/_build/default/arrayjit/lib/.formatted/backend_impl.ml
index 933a900..8ca2891 100644
--- a/_build/default/arrayjit/lib/backend_impl.ml
+++ b/_build/default/arrayjit/lib/.formatted/backend_impl.ml
@@ -50,9 +50,7 @@ module No_device_buffer_and_copying () :
 
   let%track7_sexp alloc_zero_init_array (prec : Ops.prec) ~(dims : int array) (() : unit) :
       buffer_ptr =
-    let size_in_bytes =
-      (Array.fold dims ~init:1 ~f:( * )) * Ops.prec_in_bytes prec
-    in
+    let size_in_bytes = Array.fold dims ~init:1 ~f:( * ) * Ops.prec_in_bytes prec in
     alloc_impl ~size_in_bytes
 
   let%track7_sexp alloc_buffer ?(old_buffer : buffer_ptr Backend_intf.buffer option)
File "bin/hello_world.ml", line 1, characters 0-0:
diff --git a/_build/default/bin/hello_world.ml b/_build/default/bin/.formatted/hello_world.ml
index 8dcf924..2973452 100644
--- a/_build/default/bin/hello_world.ml
+++ b/_build/default/bin/.formatted/hello_world.ml
@@ -10,8 +10,6 @@ module type Backend = Ir.Backend_intf.Backend
 
 let hello1 () =
   let module Backend = (val Backends.fresh_backend ()) in
-  
-  
   let open Operation.TDSL in
   (* Hey is inferred to be a matrix. *)
   let hey = range_of_shape ~batch_dims:[ 7 ] ~input_dims:[ 9; 10; 11 ] ~output_dims:[ 13; 14 ] () in
@@ -24,8 +22,6 @@ let hello1 () =
 
 let hello2 () =
   let module Backend = (val Backends.fresh_backend ()) in
-  
-  
   (* Hey is inferred to be a matrix. *)
   let%op y = ("hey" * 'q' 2.0) + 'p' 1.0 in
   (* Punning for ["hey"] above introduced the [hey] identifier. *)
@@ -36,8 +32,6 @@ let hello2 () =
 
 let hello3 () =
   let module Backend = (val Backends.fresh_backend ()) in
-  
-  
   (* Hey is inferred to be a matrix. *)
   let hey = TDSL.param "hey" in
   let zero_to_twenty = TDSL.range 20 in
@@ -63,8 +57,7 @@ let hello4 () =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   let ri = TDSL.range 3 in
   let%op ti = ri ++ "i=>i0" in
   (* Write position 2 of ti, otherwise shape inference concludes it's dim-1 and broadcasted. *)
@@ -95,8 +88,7 @@ let hello5 () =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   let hey = TDSL.range_of_shape ~batch_dims:[ 2 ] ~input_dims:[ 3 ] ~output_dims:[ 4 ] () in
   let%op ho = hey ++ "...|1->... => ...|..." in
   ignore (Train.forward_once backend ho);
@@ -112,8 +104,7 @@ let hello6 () =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   (* "Hey" is inferred to be a scalar. *)
   let%op y = 2 *. "hey" in
   ignore (Train.forward_once backend y);
File "arrayjit/lib/cc_backend.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/cc_backend.ml b/_build/default/arrayjit/lib/.formatted/cc_backend.ml
index 74fc462..12054eb 100644
--- a/_build/default/arrayjit/lib/cc_backend.ml
+++ b/_build/default/arrayjit/lib/.formatted/cc_backend.ml
@@ -13,7 +13,8 @@ open Backend_intf
 let name = "cc"
 
 (* Header declarations for arrayjit builtins *)
-let builtins_header = {|
+let builtins_header =
+  {|
 /* ArrayJIT builtins declarations */
 #include <stdint.h>
 
@@ -103,15 +104,15 @@ let%track7_sexp c_compile_and_load ~f_name =
   let libname = base_name ^ "_run_id_" ^ run_id ^ if Sys.win32 then ".dll" else ".so" in
   (try Stdlib.Sys.remove log_fname with _ -> ());
   (try Stdlib.Sys.remove libname with _ -> ());
-  let kernel_link_flags = 
+  let kernel_link_flags =
     match Sys.os_type with
-    | "Unix" -> 
+    | "Unix" ->
         if Stdlib.Sys.command "uname -s | grep -q Darwin" = 0 then
           "-bundle -undefined dynamic_lookup"
-        else
-          "-shared -fPIC"
+        else "-shared -fPIC"
     | "Win32" | "Cygwin" -> "-shared"
-    | _ -> "-shared -fPIC" in
+    | _ -> "-shared -fPIC"
+  in
   let cmdline : string =
     Printf.sprintf "%s %s -O%d -o %s %s >> %s 2>&1" (compiler_command ()) f_name
       (optimization_level ()) libname kernel_link_flags log_fname
File "bin/micrograd_demo.ml", line 1, characters 0-0:
diff --git a/_build/default/bin/micrograd_demo.ml b/_build/default/bin/.formatted/micrograd_demo.ml
index 1da5078..03fea8a 100644
--- a/_build/default/bin/micrograd_demo.ml
+++ b/_build/default/bin/.formatted/micrograd_demo.ml
@@ -68,9 +68,9 @@ let experiment seed ~no_batch_shape_inference ~use_builtin_weight_decay () =
   let module Backend = (val Backends.fresh_backend ~backend_name:"multicore_cc" ()) in
   let ctx = Train.init_params (module Backend) ~hosted:true IDX.empty scalar_loss in
   let routine = Train.to_routine (module Backend) ctx bindings (Asgns.sequence [ update; sgd ]) in
-  (* Stdio.print_endline "\n******** scalar_loss **********"; Train.printf_tree ~with_grad:false ~depth:9 scalar_loss; Stdio.print_endline "\n******** learning_rate
-     **********"; Train.printf_tree ~with_grad:false ~depth:9 learning_rate;
-     Stdio.printf "\n********\n%!"; *)
+  (* Stdio.print_endline "\n******** scalar_loss **********"; Train.printf_tree ~with_grad:false
+     ~depth:9 scalar_loss; Stdio.print_endline "\n******** learning_rate **********";
+     Train.printf_tree ~with_grad:false ~depth:9 learning_rate; Stdio.printf "\n********\n%!"; *)
   let open Operation.At in
   let epoch_loss = ref 0. in
   let step_ref = IDX.find_exn routine.bindings step_n in
File "bin/hello_world_op.ml", line 1, characters 0-0:
diff --git a/_build/default/bin/hello_world_op.ml b/_build/default/bin/.formatted/hello_world_op.ml
index 064c122..fc296a6 100644
--- a/_build/default/bin/hello_world_op.ml
+++ b/_build/default/bin/.formatted/hello_world_op.ml
@@ -23,8 +23,7 @@ let%track2_sexp _Pointwise_multiplication_dims_1 (() : unit) : unit =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   (* "Hey" is inferred to be a scalar. *)
   let%op ya = 2 *. "hey" 7.0 in
   ignore (Train.forward_once backend ya);
@@ -41,8 +40,7 @@ let%track2_sexp _Matrix_multiplication_dims_1x1 (() : unit) : unit =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   (* Hey is inferred to be a matrix because of matrix multiplication [*]. *)
   let%op yb = ("hey" 7.0 * 'q' 2.0) + 'p' 1.0 in
   ignore (Train.forward_once backend yb);
@@ -60,7 +58,7 @@ let%track2_sexp _Print_constant_tensor_too_early (() : unit) : unit =
   Tensor.print ~here:[%here] ~with_code:false ~with_grad:false `Inline a;
   Tensor.print ~here:[%here] ~with_code:false ~with_grad:false `Inline b;
   let%op c = a *. b in
-  
+
   ignore (Train.forward_once (module Backend) c);
   Train.printf ~here:[%here] c
 
@@ -75,8 +73,7 @@ let%track2_sexp _Print_constant_tensor (() : unit) : unit =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   let%op hey = [ (1, 2, 3); (4, 5, 6) ] in
   ignore (Train.forward_once backend hey);
   Train.printf ~here:[%here] ~with_code:false ~with_grad:false @@ hey;
@@ -171,8 +168,7 @@ let%track2_sexp _Matrix_multiplication_dims_2x3 (() : unit) : unit =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   (* Hey is inferred to be a matrix. *)
   let%op yc = ("hey" 7.0 * [ 2; 3 ]) + [ 4; 5; 6 ] in
   ignore (Train.forward_once backend yc);
@@ -190,8 +186,7 @@ let%track2_sexp _Big_matrix (() : unit) : unit =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   (* Hey is inferred to be a matrix. *)
   let hey = TDSL.param ~value:0.5 "hey" in
   let zero_to_twenty = TDSL.range 20 in
@@ -211,8 +206,7 @@ let%track2_sexp _Very_big_tensor (() : unit) : unit =
        and type event = Backend.event
        and type optimize_ctx = Backend.optimize_ctx)
   in
-  
-  
+
   let hey = TDSL.range_of_shape ~batch_dims:[ 6 ] ~input_dims:[ 7; 8 ] ~output_dims:[ 9 ] () in
   let%op ye = (hey * (1 + 1)) - 10 in
   ignore (Train.forward_once backend ye);
File "lib/operation.ml", line 1, characters 0-0:
diff --git a/_build/default/lib/operation.ml b/_build/default/lib/.formatted/operation.ml
index d5afdba..1590106 100644
--- a/_build/default/lib/operation.ml
+++ b/_build/default/lib/.formatted/operation.ml
@@ -273,8 +273,9 @@ let uint4x32_to_prec_uniform ?(label = []) =
     Tn.update_prec t1.Tensor.value Ir.Ops.uint4x32;
     Tensor.unop
       ~label:("uint4x32_to_prec_uniform" :: label)
-      (* A placeholder that will be replaced by the actual precision by Tensor.op. *)
-      ~transpose_op:(Uint4x32_to_prec (lazy (assert false))) ~op_asn ~grad_asn ?grad_spec t1
+        (* A placeholder that will be replaced by the actual precision by Tensor.op. *)
+      ~transpose_op:(Uint4x32_to_prec (lazy (assert false)))
+      ~op_asn ~grad_asn ?grad_spec t1
 
 let lt ?(label = []) =
   let module NTDSL = Initial_NTDSL in
File "arrayjit/lib/ops.ml", line 1, characters 0-0:
diff --git a/_build/default/arrayjit/lib/ops.ml b/_build/default/arrayjit/lib/.formatted/ops.ml
index e011711..0219869 100644
--- a/_build/default/arrayjit/lib/ops.ml
+++ b/_build/default/arrayjit/lib/.formatted/ops.ml
@@ -535,8 +535,7 @@ let unop_cd_syntax = function
   | Tanh_approx -> "tanh"
   | Not -> "not"
 
-let vec_unop_cd_syntax = function
-  | Uint4x32_to_prec_uniform -> "uint4x32_to_prec_uniform"
+let vec_unop_cd_syntax = function Uint4x32_to_prec_uniform -> "uint4x32_to_prec_uniform"
 
 let unop_c_syntax prec op =
   let fmax () =
@@ -680,7 +679,7 @@ external single_to_fp8 : float -> int = "arrayjit_single_to_fp8"
 external copy_with_padding_c :
   ('a, 'b, Bigarray.c_layout) Bigarray.Genarray.t ->
   ('a, 'b, Bigarray.c_layout) Bigarray.Genarray.t ->
-    axis_padding array ->
+  axis_padding array ->
   unit = "arrayjit_copy_with_padding"
 
 external threefry4x32 : int array -> int array -> int array = "arrayjit_threefry4x32_ocaml"
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 5fc3cd9..9252142 100644
--- a/_build/default/arrayjit/lib/assignments.ml
+++ b/_build/default/arrayjit/lib/.formatted/assignments.ml
@@ -167,19 +167,21 @@ let%diagn2_sexp to_low_level code =
   let open Indexing in
   let get buffer idcs =
     let tn = match buffer with Node tn -> tn | Merge_buffer tn -> tn in
-    let idcs = (match (idcs, Lazy.force tn.Tn.dims) with
-    | [||], [|1|] -> [| Fixed_idx 0 |]
-    | [| Fixed_idx 0 |], [||] -> idcs
-    | idcs, dims when Array.length idcs = Array.length dims -> idcs
-    | _ ->
-        [%log
-          "get a=",
-          (tn : Tn.t),
-          ":",
-          Tn.label tn,
-          (idcs : Indexing.axis_index array),
-          (Lazy.force tn.dims : int array)];
-        assert false) in
+    let idcs =
+      match (idcs, Lazy.force tn.Tn.dims) with
+      | [||], [| 1 |] -> [| Fixed_idx 0 |]
+      | [| Fixed_idx 0 |], [||] -> idcs
+      | idcs, dims when Array.length idcs = Array.length dims -> idcs
+      | _ ->
+          [%log
+            "get a=",
+            (tn : Tn.t),
+            ":",
+            Tn.label tn,
+            (idcs : Indexing.axis_index array),
+            (Lazy.force tn.dims : int array)];
+          assert false
+    in
     match buffer with
     | Node tn -> Low_level.Get (tn, idcs)
     | Merge_buffer tn ->
@@ -276,20 +278,22 @@ let%diagn2_sexp to_low_level code =
           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.Affine { symbols; offset } ->
-                Indexing.Affine { symbols; offset }
+            | Indexing.Affine { symbols; offset } -> Indexing.Affine { symbols; offset }
           in
           let lhs_idcs = Array.map projections.project_lhs ~f:subst_index in
           let rhs_idcs = Array.map projections.project_rhs.(0) ~f:subst_index in
           let open Low_level in
           let rhs_ll = get rhs rhs_idcs in
           (* For now, we know the only vec_unop is Uint4x32_to_prec_uniform *)
-          let length = match op with
+          let length =
+            match op with
             | Ops.Uint4x32_to_prec_uniform ->
                 (* TODO: Calculate length based on precision *)
-                16  (* Default for now, should be calculated from target precision *)
+                16
+            (* Default for now, should be calculated from target precision *)
           in
-          Set_from_vec { tn = lhs; idcs = lhs_idcs; length; vec_unop = op; arg = rhs_ll; debug = "" }
+          Set_from_vec
+            { tn = lhs; idcs = lhs_idcs; length; vec_unop = op; arg = rhs_ll; debug = "" }
         in
         let rec for_loop rev_iters = function
           | [] -> basecase rev_iters
@@ -382,8 +386,7 @@ let get_ident_within_code ?no_dots c =
         List.iter ~f:visit [ lhs; tn rhs1; tn rhs2 ]
     | Accum_unop { initialize_neutral = _; accum = _; op = _; lhs; rhs; projections = _ } ->
         List.iter ~f:visit [ lhs; tn rhs ]
-    | Set_vec_unop { op = _; lhs; rhs; projections = _ } ->
-        List.iter ~f:visit [ lhs; tn rhs ]
+    | Set_vec_unop { op = _; lhs; rhs; projections = _ } -> List.iter ~f:visit [ lhs; tn rhs ]
     | Fetch { array; fetch_op = _; dims = _ } -> visit array
   in
   loop c;
File "lib/tensor.ml", line 1, characters 0-0:
diff --git a/_build/default/lib/tensor.ml b/_build/default/lib/.formatted/tensor.ml
index 8f5509d..ec4c209 100644
--- a/_build/default/lib/tensor.ml
+++ b/_build/default/lib/.formatted/tensor.ml
@@ -224,7 +224,7 @@ let op ~(label : string list) ?(ternary_op = Shape.Pointwise_tern)
     | Some (Data init_data) -> Terminal (Data init_data)
   in
   let dims = lazy_to_dims shape in
-   let padding = lazy (Shape.to_padding shape) in
+  let padding = lazy (Shape.to_padding shape) in
   let v =
     match terminal_op with
     | Some (Shape.Data (Asgns.Reshape data)) ->
@@ -238,8 +238,7 @@ let op ~(label : string list) ?(ternary_op = Shape.Pointwise_tern)
   in
   let transpose_op =
     match transpose_op with
-    |  (Uint4x32_to_prec _) ->
-         (Shape.Uint4x32_to_prec v.Tn.prec)
+    | Uint4x32_to_prec _ -> Shape.Uint4x32_to_prec v.Tn.prec
     | _ -> transpose_op
   in
   let rec shape_logics = function
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 9dbaa61..359346a 100644
--- a/_build/default/arrayjit/lib/c_syntax.ml
+++ b/_build/default/arrayjit/lib/.formatted/c_syntax.ml
@@ -220,10 +220,7 @@ struct
             let p, _ = try Ops.unop_c_syntax prec op with Invalid_argument _ -> ("", "") in
             if String.is_suffix p ~suffix:"(" then functions := Set.add !functions (remove_paren p));
         List.iter
-          Ops.
-            [
-              Uint4x32_to_prec_uniform;
-            ]
+          Ops.[ Uint4x32_to_prec_uniform ]
           ~f:(fun op ->
             let p, _ = try Ops.vec_unop_c_syntax prec op with Invalid_argument _ -> ("", "") in
             if String.is_suffix p ~suffix:"(" then functions := Set.add !functions (remove_paren p)));
@@ -590,19 +587,23 @@ module C_syntax (B : C_syntax_config) = struct
         (* Generate the function call *)
         let func_name = string (Ops.vec_unop_c_syntax prec vec_unop |> fst) in
         (* Generate assignments for each output element *)
-        let assignments = 
+        let assignments =
           let open PPrint in
           let vec_var = string "vec_result" in
           let vec_typ = string (B.typ_of_prec prec ^ Int.to_string length) in
-          let vec_decl = vec_typ ^^ space ^^ vec_var ^^ string " = " ^^ func_name ^^ arg_doc ^^ semi in
-          let elem_assigns = 
+          let vec_decl =
+            vec_typ ^^ space ^^ vec_var ^^ string " = " ^^ func_name ^^ arg_doc ^^ semi
+          in
+          let elem_assigns =
             List.init length ~f:(fun i ->
-              let elem_idcs = Array.copy idcs in
-              (match elem_idcs.(Array.length elem_idcs - 1) with
-               | Fixed_idx idx -> elem_idcs.(Array.length elem_idcs - 1) <- Fixed_idx (idx + i)
-               | _ -> failwith "Set_from_vec: last index must be Fixed_idx");
-              let offset_doc = pp_array_offset (elem_idcs, dims) in
-              ident_doc ^^ brackets offset_doc ^^ string " = " ^^ vec_var ^^ string ("." ^ Printf.sprintf "s%d" i) ^^ semi)
+                let elem_idcs = Array.copy idcs in
+                (match elem_idcs.(Array.length elem_idcs - 1) with
+                | Fixed_idx idx -> elem_idcs.(Array.length elem_idcs - 1) <- Fixed_idx (idx + i)
+                | _ -> failwith "Set_from_vec: last index must be Fixed_idx");
+                let offset_doc = pp_array_offset (elem_idcs, dims) in
+                ident_doc ^^ brackets offset_doc ^^ string " = " ^^ vec_var
+                ^^ string ("." ^ Printf.sprintf "s%d" i)
+                ^^ semi)
           in
           vec_decl ^^ hardline ^^ separate hardline elem_assigns
         in
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 d339ce9..b7fddb3 100644
--- a/_build/default/arrayjit/lib/low_level.ml
+++ b/_build/default/arrayjit/lib/.formatted/low_level.ml
@@ -36,7 +36,14 @@ type t =
   | For_loop of { index : Indexing.symbol; from_ : int; to_ : int; body : t; trace_it : bool }
   | Zero_out of Tn.t
   | Set of { tn : Tn.t; idcs : Indexing.axis_index array; llsc : scalar_t; mutable debug : string }
-  | Set_from_vec of { tn : Tn.t; idcs : Indexing.axis_index array; length : int; vec_unop : Ops.vec_unop; arg : scalar_t; mutable debug : string }
+  | Set_from_vec of {
+      tn : Tn.t;
+      idcs : Indexing.axis_index array;
+      length : int;
+      vec_unop : Ops.vec_unop;
+      arg : scalar_t;
+      mutable debug : string;
+    }
   | Set_local of scope_id * scalar_t
 [@@deriving sexp_of, equal]
 
@@ -566,7 +573,8 @@ let inline_computation ~id computations_table traced static_indices call_args =
       | Set { tn; idcs; llsc; debug = _ } when Tn.equal tn traced.tn ->
           assert ([%equal: Indexing.axis_index array option] (Some idcs) def_args);
           Some (Set_local (id, loop_float env llsc))
-      | Set_from_vec { tn; idcs; length = _; vec_unop = _; arg = _; debug = _ } when Tn.equal tn traced.tn ->
+      | Set_from_vec { tn; idcs; length = _; vec_unop = _; arg = _; debug = _ }
+        when Tn.equal tn traced.tn ->
           assert ([%equal: Indexing.axis_index array option] (Some idcs) def_args);
           (* For vector operations, we cannot inline them as scalar operations *)
           raise @@ Non_virtual 14
@@ -649,7 +657,9 @@ let virtual_llc computations_table traced_store reverse_node_map static_indices
     | Set_from_vec { tn; idcs; length; vec_unop; arg; debug } ->
         let traced : traced_array = get_node traced_store tn in
         let next = if Tn.known_non_virtual traced.tn then process_for else Set.add process_for tn in
-        let result = Set_from_vec { tn; idcs; length; vec_unop; arg = loop_float ~process_for:next arg; debug } in
+        let result =
+          Set_from_vec { tn; idcs; length; vec_unop; arg = loop_float ~process_for:next arg; debug }
+        in
         if (not @@ Set.mem process_for tn) && (not @@ Tn.known_non_virtual traced.tn) then
           check_and_store_virtual computations_table traced static_indices result;
         result
@@ -735,7 +745,9 @@ let cleanup_virtual_llc reverse_node_map ~static_indices (llc : t) : t =
         else (
           assert (
             Array.for_all idcs ~f:(function Indexing.Iterator s -> Set.mem env_dom s | _ -> true));
-          Some (Set_from_vec { tn; idcs; length; vec_unop; arg = loop_float ~balanced ~env_dom arg; debug }))
+          Some
+            (Set_from_vec
+               { tn; idcs; length; vec_unop; arg = loop_float ~balanced ~env_dom arg; debug }))
     | Set_local (id, llsc) ->
         assert (not @@ Tn.known_non_virtual id.tn);
         Tn.update_memory_mode id.tn Virtual 16;
@@ -867,12 +879,14 @@ let simplify_llc llc =
     | 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)
-    | Binop (Add, llsc, Constant 0.) | Binop (Sub, llsc, Constant 0.) | Binop (Add, Constant 0., llsc)
-      ->
+    | Binop (Add, llsc, Constant 0.)
+    | Binop (Sub, llsc, Constant 0.)
+    | Binop (Add, Constant 0., llsc) ->
         loop_float llsc
     | Binop (Sub, Constant 0., llsc) -> loop_float @@ Binop (Mul, Constant (-1.), llsc)
-    | Binop (Mul, llsc, Constant 1.) | Binop (Div, llsc, Constant 1.) | Binop (Mul, Constant 1., llsc)
-      ->
+    | Binop (Mul, llsc, Constant 1.)
+    | Binop (Div, llsc, Constant 1.)
+    | Binop (Mul, Constant 1., llsc) ->
         loop_float llsc
     | Binop (Mul, _, Constant 0.) | Binop (Div, Constant 0., _) | Binop (Mul, Constant 0., _) ->
         Constant 0.
@@ -1136,8 +1150,8 @@ let to_doc_cstyle ?name ?static_indices () llc =
             ^^ brackets (pp_indices p.idcs)
             ^^ string " := "
             ^^ string (Ops.vec_unop_cd_syntax p.vec_unop)
-            ^^ string "(" ^^ doc_of_float (Ops.uint4x32) p.arg ^^ string ", "
-            ^^ int p.length ^^ string ");")
+            ^^ string "(" ^^ doc_of_float Ops.uint4x32 p.arg ^^ string ", " ^^ int p.length
+            ^^ string ");")
         in
         if not (String.is_empty p.debug) then (
           let b = Buffer.create 100 in
@@ -1221,8 +1235,7 @@ let to_doc ?name ?static_indices () llc =
             ^^ brackets (pp_indices p.idcs)
             ^^ string " := "
             ^^ string (Ops.vec_unop_cd_syntax p.vec_unop)
-            ^^ string "(" ^^ doc_of_float p.arg ^^ string ", "
-            ^^ int p.length ^^ string ");")
+            ^^ string "(" ^^ doc_of_float p.arg ^^ string ", " ^^ int p.length ^^ string ");")
         in
         let b = Buffer.create 100 in
         PPrint.ToBuffer.pretty 0.7 100 b result;
@@ -1230,7 +1243,8 @@ let to_doc ?name ?static_indices () llc =
         result
     | Comment message -> string ("/* " ^ message ^ " */")
     | Staged_compilation callback -> callback ()
-    | Set_local (id, llsc) -> group (doc_local id ^^ string " := " ^^ doc_of_float llsc ^^ string ";")
+    | Set_local (id, llsc) ->
+        group (doc_local id ^^ string " := " ^^ doc_of_float llsc ^^ string ";")
   and doc_of_float value =
     match value with
     | Local_scope { id; body; _ } ->
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 99865ab..eae3903 100644
--- a/_build/default/lib/ppx_cd.ml
+++ b/_build/default/lib/.formatted/ppx_cd.ml
@@ -629,7 +629,7 @@ let translate (expr : expression) : result =
     in
     let process_vec_unop ~lhs ~vec_un_op ~rhs ?projections ~proj_in_scope () =
       (* Vector unary operations do not have accumulation, they directly set values *)
-      let _, op = 
+      let _, op =
         loc
         |> Option.value_or_thunk (Hashtbl.find vec_unary_ops vec_un_op) ~default:(fun () loc ->
                ( [%expr Shape.Pointwise_un],
@@ -673,12 +673,7 @@ let translate (expr : expression) : result =
           Option.value ~default:Ir.Assignments.Noop
           @@ Option.map2 [%e setup_l.array_opt] [%e setup_r.array_opt] ~f:(fun lhs rhs ->
                  Ir.Assignments.Set_vec_unop
-                   {
-                     lhs;
-                     op = [%e op];
-                     rhs;
-                     projections = [%e projections];
-                   })]
+                   { lhs; op = [%e op]; rhs; projections = [%e projections] })]
       in
       assignment ~punned ~lhs:setup_l ~rhses:[ setup_r ] body
     in
@@ -1166,16 +1161,13 @@ let translate (expr : expression) : result =
         process_assign_unop ~accu_op ~lhs ~un_op:"id" ~rhs ~proj_in_scope ()
     | [%expr
         [%e? lhs]
-        :=
-        ([%e? { pexp_desc = Pexp_ident { txt = Lident vec_un_op; _ }; _ }]
-           [%e? rhs]
-           ~projections:[%e? projections])]
+        := [%e? { pexp_desc = Pexp_ident { txt = Lident vec_un_op; _ }; _ }]
+             [%e? rhs]
+             ~projections:[%e? projections]]
       when Hashtbl.mem vec_unary_ops vec_un_op ->
         process_vec_unop ~lhs ~vec_un_op ~rhs ~projections ~proj_in_scope:true ()
     | [%expr
-        [%e? lhs]
-        :=
-        ([%e? { pexp_desc = Pexp_ident { txt = Lident vec_un_op; _ }; _ }] [%e? rhs])]
+        [%e? lhs] := [%e? { pexp_desc = Pexp_ident { txt = Lident vec_un_op; _ }; _ }] [%e? rhs]]
       when Hashtbl.mem vec_unary_ops vec_un_op && proj_in_scope ->
         process_vec_unop ~lhs ~vec_un_op ~rhs ~proj_in_scope ()
     | [%expr
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-07-26 07:52.00: Job failed: Failed: Build failed