Organisationsahrefsocannl750485 ()(lint-fmt)

(lint-fmt)

Link Copied
Code Copied

Logs

2025-12-26 21:08.16: New job: test ahrefs/ocannl https://github.com/ahrefs/ocannl.git#refs/heads/master (750485c6a584dc6fbaffe6bdb59bfc35eb2c5388) (linux-x86_64:(lint-fmt))
Base: ocaml/opam:debian-13-ocaml-4.08@sha256:6fadef23b5069dc945f3a454c49421fd09e8c17aa57d3f9ad27d3879fce6aa44
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 750485c6
cat > Dockerfile <<'END-OF-DOCKERFILE'
FROM ocaml/opam:debian-13-ocaml-4.08@sha256:6fadef23b5069dc945f3a454c49421fd09e8c17aa57d3f9ad27d3879fce6aa44
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-12-26 21:08.16: Using cache hint "ahrefs/ocannl-ocaml/opam:debian-13-ocaml-4.08@sha256:6fadef23b5069dc945f3a454c49421fd09e8c17aa57d3f9ad27d3879fce6aa44-debian-13-4.08_opam-2.4-ocamlformat-6c1b38620288b5bf349067f089a7b1fc91185d94"
2025-12-26 21:08.16: Using OBuilder spec:
((from ocaml/opam:debian-13-ocaml-4.08@sha256:6fadef23b5069dc945f3a454c49421fd09e8c17aa57d3f9ad27d3879fce6aa44)
(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-12-26 21:08.16: Waiting for resource in pool OCluster
2025-12-26 21:08.16: Waiting for worker…
2025-12-26 21:08.17: Got resource from pool OCluster
Building on laodoke.caelum.ci.dev
All commits already cached
HEAD is now at 750485c6 Compute invalid_vars for Block in shape inference


(from ocaml/opam:debian-13-ocaml-4.08@sha256:6fadef23b5069dc945f3a454c49421fd09e8c17aa57d3f9ad27d3879fce6aa44)
2025-12-26 21:08.19 ---> using "c557567380599a9d74e9cba757661af503505628fe0a86c2e1639761275a17b1" 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 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-12-26 21:08.19 ---> using "1258adf89d25757b915a8f4f5f0ba0eb7df8555636ae304d68c749c221ea21e4" 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.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-12-26 21:08.19 ---> using "cf5c80eb98554726a678ce73db8f3dbc8a3b1c7af6d5a2f454d5ed3097401b40" from cache


/: (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 cmdliner          2.1.0    [required by ocamlformat]
- 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 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.1.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 menhirCST.20250912
-> installed menhirLib.20250912
-> installed menhirSdk.20250912
-> installed cmdliner.2.1.0
-> 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-12-26 21:08.19 ---> using "f13c932b5025e0eacc8744367d69770e9cfb3357c0e6c9295b596339590e56ac" from cache


/src: (copy (src .) (dst /src/))
2025-12-26 21:08.20 ---> saved as "3d48a21b16fde6c0b9d8be15e4d733f8cabd6dec9625474c006dae2d79f857a6"


/src: (run (shell "opam exec -- dune build @fmt --ignore-promoted-rules || (echo \"dune build @fmt failed\"; exit 2)"))
Warning: Invalid documentation comment:
File "tensor/einsum_types.ml", line 39, 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 02eb894..d18184d 100644
--- a/_build/default/tensor/shape.ml
+++ b/_build/default/tensor/.formatted/shape.ml
@@ -269,7 +269,8 @@ let einsum_slot_spec_to_dims_bio ~original_spec ~sh_id ~row_var_env ~dim_var_env
let dims =
List.map labels ~f:(fun label ->
Row.Var
-                (Hashtbl.find_or_add dim_var_env label ~default:(fun () -> Row.get_var ~name:label ())))
+                (Hashtbl.find_or_add dim_var_env label ~default:(fun () ->
+                     Row.get_var ~name:label ())))
in
Row.Concat dims
in
@@ -284,11 +285,10 @@ let add_var_used_in_spec_or_compose row =
let add_var_used_in_pointwise row =
match row with Row.Row_var { v; _ } -> Row.add_used_in_pointwise v | _ -> ()


-(* For Block specs, compute invalid_vars: variables that are allowed to be 0.
-   A variable v is invalid if:
-   1. v appears in a component of a Concat dimension on one side
-   2. The "complement" of that component (union of vars from other components of same Concat)
-      has non-empty intersection with ALL components of at least one axis on the other side *)
+(* For Block specs, compute invalid_vars: variables that are allowed to be 0. A variable v is
+   invalid if: 1. v appears in a component of a Concat dimension on one side 2. The "complement" of
+   that component (union of vars from other components of same Concat) has non-empty intersection
+   with ALL components of at least one axis on the other side *)
let compute_block_invalid_vars ~(this_side_rows : Row.t list) ~(other_side_rows : Row.t list) :
Row.dim_var_set =
(* Extract all dims from rows (including beg_dims from bcast) *)
@@ -299,9 +299,8 @@ let compute_block_invalid_vars ~(this_side_rows : Row.t list) ~(other_side_rows
in
row.dims @ dims_from_bcast)
in
-  (* Get component var sets for each axis on the other side.
-     For non-Concat dims, there's one component with all vars of that dim.
-     For Concat dims, each element is a separate component. *)
+  (* Get component var sets for each axis on the other side. For non-Concat dims, there's one
+     component with all vars of that dim. For Concat dims, each element is a separate component. *)
let axis_components_of_dim (dim : Row.dim) : Row.dim_var_set list =
match dim with
| Row.Concat dims -> List.map dims ~f:Row.vars_of_dim
@@ -310,8 +309,8 @@ let compute_block_invalid_vars ~(this_side_rows : Row.t list) ~(other_side_rows
let other_side_axes : Row.dim_var_set list list =
List.map (dims_of_rows other_side_rows) ~f:axis_components_of_dim
in
-  (* For each Concat on this side, find invalid vars.
-     Non-Concat dims cannot contribute invalid vars since their complement is empty. *)
+  (* For each Concat on this side, find invalid vars. Non-Concat dims cannot contribute invalid vars
+     since their complement is empty. *)
let this_side_dims = dims_of_rows this_side_rows in
List.fold this_side_dims ~init:Row.dim_var_set_empty ~f:(fun acc dim ->
match dim with
@@ -322,7 +321,8 @@ let compute_block_invalid_vars ~(this_side_rows : Row.t list) ~(other_side_rows
in
List.fold component_var_sets ~init:acc ~f:(fun acc2 component_vars ->
let complement = Set.diff all_concat_vars component_vars in
-              (* Check if complement intersects with all components of at least one other-side axis *)
+              (* Check if complement intersects with all components of at least one other-side
+                 axis *)
let complement_covers_some_axis =
List.exists other_side_axes ~f:(fun axis_components ->
List.for_all axis_components ~f:(fun axis_comp_vars ->
@@ -1292,8 +1292,8 @@ let%debug4_sexp get_inequalities ?(for_projections = false)
let rhs_results =
List.mapi (List.zip_exn ls_rhses rhses) ~f:(fun i (ls_rhs, sh) ->
let extras, proj_env, (b, inp, o) =
-              einsum_slot_spec_to_dims_bio ~original_spec:spec ~sh_id:sh.id ~row_var_env ~dim_var_env
-                ls_rhs
+              einsum_slot_spec_to_dims_bio ~original_spec:spec ~sh_id:sh.id ~row_var_env
+                ~dim_var_env ls_rhs
in
(i, sh, extras, proj_env, b, inp, o))
in
@@ -1335,7 +1335,8 @@ let%debug4_sexp get_inequalities ?(for_projections = false)
Rows_constr
{
r = [ Row.get_row_for_var Row.empty_provenance var ];
-                            constr = Total_elems { numerator = Num_elems solved_dim; divided_by = [] };
+                            constr =
+                              Total_elems { numerator = Num_elems solved_dim; divided_by = [] };
origin =
[
{
@@ -1412,16 +1413,20 @@ let%debug4_sexp get_inequalities ?(for_projections = false)
};
])
in
-      (* Compute invalid_vars: variables that are allowed to be 0 (dimension 0 is invalid).
-         A variable is invalid if it's in a Concat component whose complement covers an axis
-         on the other side. We check both directions: RHS->LHS and LHS->RHS. *)
+      (* Compute invalid_vars: variables that are allowed to be 0 (dimension 0 is invalid). A
+         variable is invalid if it's in a Concat component whose complement covers an axis on the
+         other side. We check both directions: RHS->LHS and LHS->RHS. *)
let rhs_rows =
List.concat_map rhs_results ~f:(fun (_, _, _, _, b_rhs, i_rhs, o_rhs) ->
[ b_rhs; i_rhs; o_rhs ])
in
let lhs_rows = [ b_lhs; i_lhs; o_lhs ] in
-      let invalid_from_rhs = compute_block_invalid_vars ~this_side_rows:rhs_rows ~other_side_rows:lhs_rows in
-      let invalid_from_lhs = compute_block_invalid_vars ~this_side_rows:lhs_rows ~other_side_rows:rhs_rows in
+      let invalid_from_rhs =
+        compute_block_invalid_vars ~this_side_rows:rhs_rows ~other_side_rows:lhs_rows
+      in
+      let invalid_from_lhs =
+        compute_block_invalid_vars ~this_side_rows:lhs_rows ~other_side_rows:rhs_rows
+      in
let invalid_vars = Set.union invalid_from_rhs invalid_from_lhs in
( proj_env,
invalid_vars,
@@ -1797,8 +1802,8 @@ let%debug4_sexp derive_projections (update_step : update_step) : unit =
(* We will not use the old inferred padding so that we can derive precisely the padding
contributed by this step. *)
let _debug_update_step : update_step = update_step in
-  let (proj_axis_env, invalid_vars, ineqs) :
-      proj_axis_env * Row.dim_var_set * Row.constraint_ list =
+  let (proj_axis_env, invalid_vars, ineqs) : proj_axis_env * Row.dim_var_set * Row.constraint_ list
+      =
get_inequalities ~for_projections:true update_step
in
(* We need to solve the equations/inequalities one last time because of fresh row variables
@@ -2269,7 +2274,8 @@ let shape_spec_to_dims_bio labels =
let dims =
List.map labels ~f:(fun label ->
Row.Var
-                (Hashtbl.find_or_add dim_var_env label ~default:(fun () -> Row.get_var ~name:label ())))
+                (Hashtbl.find_or_add dim_var_env label ~default:(fun () ->
+                     Row.get_var ~name:label ())))
in
Row.Concat dims
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 d207b79..79cdef6 100644
--- a/_build/default/arrayjit/lib/low_level.ml
+++ b/_build/default/arrayjit/lib/.formatted/low_level.ml
@@ -269,7 +269,8 @@ let visit_llc traced_store ~merge_node_id reverse_node_map ~max_visits llc =
| Indexing.Concat _syms ->
(* Concat should be eliminated during lowering before we get here *)
invalid_arg
-            "BUG: Concat index encountered during virtualization - should have been eliminated during lowering")
+            "BUG: Concat index encountered during virtualization - should have been eliminated \
+             during lowering")
in
let rec loop_proc ~first_visit env llc =
let loop = loop_proc ~first_visit env in
File "tensor/row.ml", line 1, characters 0-0:
diff --git a/_build/default/tensor/row.ml b/_build/default/tensor/.formatted/row.ml
index a22bd7d..ced9228 100644
--- a/_build/default/tensor/row.ml
+++ b/_build/default/tensor/.formatted/row.ml
@@ -2423,9 +2423,11 @@ let%track5_sexp solve_dim_ineq ~(stage : stage) origin ~(cur : dim) ~(subr : dim
(* Element-wise unification of concatenated dimensions *)
let eqs = List.map2_exn dims1 dims2 ~f:(fun d1 d2 -> Dim_eq { d1; d2; origin }) in
(eqs, env)
-  | _, Concat dims when List.count dims ~f:(function Var v -> Set.mem env.invalid_vars v | _ -> false) >= List.length dims - 1 ->
-      (* Concat in subr position with all-but-one (or all) components being invalid vars:
-         preserve inequality so the solver can infer the variables *)
+  | _, Concat dims
+    when List.count dims ~f:(function Var v -> Set.mem env.invalid_vars v | _ -> false)
+         >= List.length dims - 1 ->
+      (* Concat in subr position with all-but-one (or all) components being invalid vars: preserve
+         inequality so the solver can infer the variables *)
([ Dim_ineq { cur; subr; from_ = Sexp.List []; origin } ], env)
| Concat _, _ | _, Concat _ ->
(* Defer to dimension equality for concat with non-concat *)
@@ -2940,13 +2942,13 @@ let%debug5_sexp rec close_dim_terminal ~(stage : stage) ~is_param origin env (di
(* The input dimension itself cannot be dim-1, and the over dimension doesn't become
transitively terminal. *)
[]
-  | Concat dims ->
-      (* For concatenation, filter out dimension-0 components and if one remains, close it.
-         TODO: Consider guessing invalid_vars components to 0 at stage 6, but wait until needed. *)
+  | Concat dims -> (
+      (* For concatenation, filter out dimension-0 components and if one remains, close it. TODO:
+         Consider guessing invalid_vars components to 0 at stage 6, but wait until needed. *)
let non_zero_dims = List.filter dims ~f:(function Dim { d = 0; _ } -> false | _ -> true) in
-      (match non_zero_dims with
-       | [ single ] -> close_dim_terminal ~stage ~is_param origin env single
-       | _ -> [])
+      match non_zero_dims with
+      | [ single ] -> close_dim_terminal ~stage ~is_param origin env single
+      | _ -> [])


let last_dim_is dims p = match List.last dims with Some (Dim { d; _ }) -> p d | _ -> false


@@ -3213,8 +3215,7 @@ let%track5_sexp close_row_terminal ~(stage : stage) ~is_param origin env


let%debug5_sexp eliminate_dim_entry stage origin env v ~lub constr =
let guess_dim () =
-    if Set.mem env.invalid_vars v then get_dim ~d:0 ~proj_id:56 ()
-    else get_dim ~d:1 ~proj_id:59 ()
+    if Set.mem env.invalid_vars v then get_dim ~d:0 ~proj_id:56 () else get_dim ~d:1 ~proj_id:59 ()
in
match (lub, constr) with
| Some (Dim { d; _ } as lub), At_least_dim d2 when d2 > d ->
@@ -3231,8 +3232,7 @@ let%debug5_sexp eliminate_dim_entry stage origin env v ~lub constr =
Some (Dim_eq { d1 = Var v; d2 = lub; origin })
| None, At_least_dim d when is_stage7 stage ->
Some (Dim_eq { d1 = Var v; d2 = get_dim ~d ~proj_id:58 (); origin })
-  | None, _ when is_stage7 stage ->
-      Some (Dim_eq { d1 = Var v; d2 = guess_dim (); origin })
+  | None, _ when is_stage7 stage -> Some (Dim_eq { d1 = Var v; d2 = guess_dim (); origin })
| _ -> None


let%track5_sexp process_shape_row ~(stage : stage) origin env ({ dims; bcast; prov } as r : row) :
@@ -3244,12 +3244,12 @@ let%track5_sexp process_shape_row ~(stage : stage) origin env ({ dims; bcast; pr
| Affine { over; conv = Some { kernel; _ }; _ } ->
finalize_upper_lower_bound over @ finalize_upper_lower_bound kernel
| Concat dims -> List.concat_map dims ~f:finalize_upper_lower_bound
-    | Var v ->
+    | Var v -> (
let guess_dim () =
if Set.mem env.invalid_vars v then get_dim ~d:0 ~proj_id:61 ()
else get_dim ~d:1 ~proj_id:62 ()
in
-        (match find_dim env.dim_env v with
+        match find_dim env.dim_env v with
| Some (Bounds_dim { is_in_param = true; _ }) when final ->
raise
@@ Shape_error
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-12-26 21:08.23: Job failed: Failed: Build failed