Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8a91d96
Resolve identifier occurrences through shapes for precise attribution
JonoPrest Sep 3, 2026
2bfc7c6
Move shared-signature case to version-gated regression test
JonoPrest Sep 3, 2026
fead8d2
Address review: shape-resolve functor arguments, key occurrences prec…
JonoPrest Sep 3, 2026
a23dd85
Address review: scope unit cache, fix mixed-reference suppression, cr…
JonoPrest Sep 3, 2026
088c695
Address review: constrained arguments, inline functors, unit selectio…
JonoPrest Sep 3, 2026
79af145
Address review: cache key digest, conservative crediting, constrained…
JonoPrest Sep 3, 2026
fad9d64
Address review: partial applications and let-module functors
JonoPrest Sep 3, 2026
516e81f
Fix let-module functor keys on OCaml 5.3 and 5.4
JonoPrest Sep 3, 2026
130f971
Address review: parameter aliases and recursive functors
JonoPrest Sep 3, 2026
ed26678
Address review: fall back conservatively on ppx key collisions
JonoPrest Sep 3, 2026
5a5e872
Address review: indistinguishable units and occurrences resolve nothing
JonoPrest Sep 3, 2026
b20f8f6
Address review: module type aliases, forwarded parameters, include of…
JonoPrest Sep 3, 2026
dea7538
Address review: collect nested module type ranges
JonoPrest Sep 3, 2026
c934d7b
Address review: functor aliases, local module type roots, identity ma…
JonoPrest Sep 3, 2026
bc4c375
Address review: nested module types, Sig_modtype, alias cycles; fix c…
JonoPrest Sep 3, 2026
cab3cc0
Address review: forwarding cycles, cross-file aliases, functor-body s…
JonoPrest Sep 3, 2026
3042528
Address review: partial applications held locally or bound in other u…
JonoPrest Sep 3, 2026
dae35e2
Address review: with-constrained module types, alias cycle detection
JonoPrest Sep 3, 2026
17f2704
Address review: structural path resolution, recursive aliases
JonoPrest Sep 3, 2026
53687b3
Address review: with module type constraints, recursive parameter ali…
JonoPrest Sep 3, 2026
a8b4936
Address review: module type of, included members in structural lookup
JonoPrest Sep 3, 2026
b960ab2
Address review: resolve included members with the defining unit's res…
JonoPrest Sep 3, 2026
c90ede4
Address review: forward aliases in recursive groups
JonoPrest Sep 3, 2026
53aa967
Address review: keep the resolver of an included member
JonoPrest Sep 3, 2026
2a3e486
Address review: module types rooted at functor applications
JonoPrest Sep 3, 2026
120f50f
Address review: module types rooted at functor parameters and applica…
JonoPrest Sep 3, 2026
fcec04e
Address review: aliased result members, parameter alias cycles, full …
JonoPrest Sep 3, 2026
89275b0
Address review: recurse through submodules in the shape fallback
JonoPrest Sep 3, 2026
62f4ead
Address review: forward parameter aliases in recursive groups
JonoPrest Sep 3, 2026
4b5d3cb
Register let-module parameter aliases before their body is visited (O…
JonoPrest Sep 3, 2026
722a961
Address review: colliding functor keys credit all applications; exact…
JonoPrest Sep 3, 2026
43683e8
Normalize path segments in the source-file comparison
JonoPrest Sep 3, 2026
5c7069e
Address review: copies of a compiled unit are one unit; both path sep…
JonoPrest Sep 3, 2026
08c98e6
Address review: fall back to a constrained argument's concrete type
JonoPrest Sep 3, 2026
027aa9e
Address review: module type ranges in applications and parameter types
JonoPrest Sep 3, 2026
68ae253
Address review: constraint-wrapped right-hand sides when deriving fun…
JonoPrest Sep 3, 2026
9cc6c3f
Address review: unit applications in chains, shapes of applied arguments
JonoPrest Sep 4, 2026
cce0e60
Address review: higher-order functors, first-class modules, unmatched…
JonoPrest Sep 4, 2026
657bdf1
Track escaping nested functors and avoid duplicate optional calls
JonoPrest Sep 17, 2026
9213d8d
Skip applied long identifiers without emitting fatal diagnostics
JonoPrest Sep 17, 2026
043ea7b
Merge updated functor-fix base and preserve duplicate-unit regressions
JonoPrest Sep 17, 2026
1ec9506
Follow escaped module aliases across arbitrary chains and compilation…
JonoPrest Sep 17, 2026
d3ceacc
Retain implementation shapes when matching interface digests
JonoPrest Sep 17, 2026
06b6082
Preserve references through late and escaping functor applications
JonoPrest Sep 17, 2026
e77c9f3
Keep derived functor applications in their enclosing contexts
JonoPrest Sep 17, 2026
96d3213
Preserve unpacked functor calls and deduplicate native scans
JonoPrest Sep 17, 2026
28cbf6e
Match imported unit digests before choosing sibling artifacts
JonoPrest Sep 17, 2026
281442e
Preserve unpacked exports and partial functor contexts
JonoPrest Sep 17, 2026
423fadf
Escape unpacked exports only when their applications need fallback
JonoPrest Sep 17, 2026
6e6feaf
Preserve escaped coercions and distinct compilation contexts
JonoPrest Sep 17, 2026
6d9b954
Fix compilation identity and chained functor attribution
JonoPrest Sep 17, 2026
856bdab
Preserve scoped argument lookups and dependency implementation identity
JonoPrest Sep 17, 2026
7276e07
Preserve split interface and implementation artifact pairs
JonoPrest Sep 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/regression/compilation_context/First.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let g ?(opened = 0) () = opened
11 changes: 11 additions & 0 deletions examples/regression/compilation_context/Native_provider.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module type S = sig
val g : ?native:int -> unit -> int
end

module Arg : S = struct
let g ?(native = 0) () = native
end

module Make (M : S) = struct
let run () = M.g ~native:1 ()
end
3 changes: 3 additions & 0 deletions examples/regression/compilation_context/Native_use.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module A = Native_provider.Make (Native_provider.Arg)

let () = ignore (A.run ())
10 changes: 10 additions & 0 deletions examples/regression/compilation_context/Nested_alias.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module type S = sig
module N : sig
val f : unit -> int
end
end

module rec A : S = B
and B : S = A

module C = A.N
2 changes: 2 additions & 0 deletions examples/regression/compilation_context/Opened.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let run () = ignore (g ~opened:1 ())
let () = run ()
7 changes: 7 additions & 0 deletions examples/regression/compilation_context/Provider.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module type S = sig
val g : ?context:int -> unit -> int
end

module Op (M : S) : sig
val run : unit -> int
end
1 change: 1 addition & 0 deletions examples/regression/compilation_context/Relay.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Apply (M : Shared.S) = Shared.Apply (M)
6 changes: 6 additions & 0 deletions examples/regression/compilation_context/Safe_alias.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module type S = sig
val f : unit -> int
end

module rec A : S = B
and B : S = A
1 change: 1 addition & 0 deletions examples/regression/compilation_context/Second.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let g ?(opened = 0) () = opened + 1
19 changes: 19 additions & 0 deletions examples/regression/compilation_context/Shared.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module type S = sig
val g : ?context:int -> unit -> int
end

module Apply (M : S) = Provider.Op (M)
module Curried (Ignored : S) (M : S) = Provider.Op (M)

module Seed = struct
let g ?(context = 0) () = context
end

module Half = Curried (Seed)
module Alias = Half

module type FT = functor (M : S) -> sig
val run : unit -> int
end

let packed = (module Alias : FT)
11 changes: 11 additions & 0 deletions examples/regression/compilation_context/Split.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module type S = sig
val g : ?split:int -> unit -> int
end

module Used (_ : sig end) : S = struct
let g ?(split = 0) () = split
end

module Unused (_ : sig end) : S = struct
let g ?(split = 0) () = split + 1
end
6 changes: 6 additions & 0 deletions examples/regression/compilation_context/Split.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module type S = sig
val g : ?split:int -> unit -> int
end

module Used (_ : sig end) : S
module Unused (_ : sig end) : S
4 changes: 4 additions & 0 deletions examples/regression/compilation_context/Split_use.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Chosen = Split.Used (struct end)
module Unchosen = Split.Unused (struct end)

let () = ignore (Chosen.g ~split:1 ())
7 changes: 7 additions & 0 deletions examples/regression/compilation_context/a/Provider.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module type S = sig
val g : ?context:int -> unit -> int
end

module Op (M : S) = struct
let run () = M.g ~context:1 ()
end
31 changes: 31 additions & 0 deletions examples/regression/compilation_context/a/Use_a.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module Arg : Shared.S = struct
let g ?(context = 0) () = context
end

module Applied = Shared.Apply (Arg)

module Relayed_arg : Shared.S = struct
let g ?(context = 0) () = context
end

module Relayed = Relay.Apply (Relayed_arg)

let () = ignore (Relayed.run ())
let () = ignore (Applied.run ())

module Partial_arg : Shared.S = struct
let g ?(context = 0) () = context
end

module Partial = Shared.Alias (Partial_arg)

module Packed_arg : Shared.S = struct
let g ?(context = 0) () = context
end

module Unpacked = (val Shared.packed : Shared.FT)
module Packed = Unpacked (Packed_arg)

let () =
ignore (Partial.run ());
ignore (Packed.run ())
7 changes: 7 additions & 0 deletions examples/regression/compilation_context/b/Provider.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module type S = sig
val g : ?context:int -> unit -> int
end

module Op (M : S) = struct
let run () = M.g ()
end
31 changes: 31 additions & 0 deletions examples/regression/compilation_context/b/Use_b.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module Arg : Shared.S = struct
let g ?(context = 0) () = context
end

module Applied = Shared.Apply (Arg)

module Relayed_arg : Shared.S = struct
let g ?(context = 0) () = context
end

module Relayed = Relay.Apply (Relayed_arg)

let () = ignore (Relayed.run ())
let () = ignore (Applied.run ())

module Partial_arg : Shared.S = struct
let g ?(context = 0) () = context
end

module Partial = Shared.Alias (Partial_arg)

module Packed_arg : Shared.S = struct
let g ?(context = 0) () = context
end

module Unpacked = (val Shared.packed : Shared.FT)
module Packed = Unpacked (Packed_arg)

let () =
ignore (Partial.run ());
ignore (Packed.run ())
4 changes: 4 additions & 0 deletions examples/regression/digest_a/Collision.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module type S = sig val g : ?x:int -> unit -> int end
module Chosen_impl = struct let g ?(x = 0) () = x end
module Target : S = Chosen_impl
let marker_a = ()
6 changes: 6 additions & 0 deletions examples/regression/digest_a/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(library
(name digest_a)
(wrapped false)
(modes byte)
(modules Collision)
(flags :standard -w -27-32-34-37-39 -bin-annot))
4 changes: 4 additions & 0 deletions examples/regression/digest_b/Collision.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module type S = sig val g : ?x:int -> unit -> int end
module Unrelated_impl = struct let g ?(x = 0) () = x end
module Target : S = Unrelated_impl
let marker_b = ()
6 changes: 6 additions & 0 deletions examples/regression/digest_b/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(library
(name digest_b)
(wrapped false)
(modes byte)
(modules Collision)
(flags :standard -w -27-32-34-37-39 -bin-annot))
1 change: 1 addition & 0 deletions examples/regression/digest_use/Use_collision.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = ignore (Collision.Target.g ~x:1 ())
7 changes: 7 additions & 0 deletions examples/regression/digest_use/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name digest_use)
(wrapped false)
(modes byte)
(libraries digest_a)
(modules Use_collision)
(flags :standard -w -27-32-34-37-39 -bin-annot))
11 changes: 11 additions & 0 deletions examples/regression/dup_a/Dup_shape.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module A_chosen : Dup_sig.S with type t = int = struct
type t = int
let f x = x
let g x = x
end

module A_unused : Dup_sig.S with type t = int = struct
type t = int
let f x = x
let g x = x
end
2 changes: 2 additions & 0 deletions examples/regression/dup_a/Dup_shape.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module A_chosen : Dup_sig.S with type t = int
module A_unused : Dup_sig.S with type t = int
2 changes: 1 addition & 1 deletion examples/regression/dup_a/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name dup_a)
(wrapped false)
(modes byte)
(modules Dup_sig Dup_a_impl Dup_a_use)
(modules Dup_sig Dup_shape Dup_a_impl Dup_a_use)
(flags :standard -w -27-32-34-37-39 -bin-annot))
6 changes: 6 additions & 0 deletions examples/regression/dup_b/Dup_shape.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module B_unused : Dup_sig.S with type t = int = struct
type t = int
let f x = x
let g x = x
let h x = x
end
1 change: 1 addition & 0 deletions examples/regression/dup_b/Dup_shape.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module B_unused : Dup_sig.S with type t = int
2 changes: 1 addition & 1 deletion examples/regression/dup_b/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name dup_b)
(wrapped false)
(modes byte)
(modules Dup_sig Dup_b_impl Dup_b_use)
(modules Dup_sig Dup_shape Dup_b_impl Dup_b_use)
(flags :standard -w -27-32-34-37-39 -bin-annot))
3 changes: 3 additions & 0 deletions examples/regression/dup_shape_use/Dup_shape_use.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(* The consumer has no sibling Dup_shape: the importer digest must choose
dup_a and retain its implementation shape as well as its interface. *)
let () = ignore (Dup_shape.A_chosen.f 1)
7 changes: 7 additions & 0 deletions examples/regression/dup_shape_use/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name dup_shape_use)
(wrapped false)
(modes byte)
(libraries dup_a)
(modules Dup_shape_use)
(flags :standard -w -27-32-34-37-39 -bin-annot))
4 changes: 4 additions & 0 deletions examples/regression/duplicate_context/Shared.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(* Both builds have the same source and inferred interface, but resolve
Provider.g against different imported interfaces. *)
let run () = ignore (Provider.g ~x:1 ())
let () = run ()
1 change: 1 addition & 0 deletions examples/regression/duplicate_context/a/Provider.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let g ?(x = 0) () = x
1 change: 1 addition & 0 deletions examples/regression/duplicate_context/b/Provider.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let g ?(x = 0) () = string_of_int x
2 changes: 2 additions & 0 deletions examples/regression/duplicate_native/Duplicate_native.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let g ?(x = 0) () = x
let () = ignore (g ~x:1 ())
106 changes: 106 additions & 0 deletions examples/regression/src/Attribution_sweep.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
module Repacked = struct
module type S = sig val g : ?repacked:int -> unit -> int end
module type FT = functor (M : S) -> sig val run : unit -> int end
module Make (M : S) = struct let run () = M.g ~repacked:1 () end
let first = (module Make : FT)
module First = (val first : FT)
let second = (module First : FT)
module Second = (val second : FT)
let third = (module Second : FT)
module Third = (val third : FT)
module Repacked_arg : S = struct let g ?(repacked = 0) () = repacked end
module Repacked_unused : S = struct let g ?(repacked = 0) () = repacked end
module Applied = Third (Repacked_arg)
let run () = ignore (Applied.run ()); ignore (Repacked_unused.g ())
end

module Projected = struct
module type S = sig val g : ?projected:int -> unit -> int end
module type FT = functor (M : S) -> sig val run : unit -> int end
module type Holder_t = sig module Inner : FT end
module Use (H : Holder_t) (M : S) = struct
module Applied = H.Inner (M)
let run = Applied.run
end
module Forward (H : Holder_t) (M : S) = Use (H) (M)
module Holder = struct
module Inner (M : S) = struct let run () = M.g ~projected:1 () end
end
module Projected_arg : S = struct let g ?(projected = 0) () = projected end
module Projected_unused : S = struct let g ?(projected = 0) () = projected end
module Applied = Forward (Holder) (Projected_arg)
let run () = ignore (Applied.run ()); ignore (Projected_unused.g ())
end

module Opaque_holder = struct
module type S = sig val g : ?opaque:int -> unit -> int end
module type FT = functor (M : S) -> sig val run : unit -> int end
module type Holder_t = sig module Inner : FT end
module Use (H : Holder_t) (M : S) = struct
module Applied = H.Inner (M)
let run = Applied.run
end
module Holder = struct
module Inner (M : S) = struct let run () = M.g ~opaque:1 () end
end
let packed = (module Holder : Holder_t)
module Opaque_arg : S = struct let g ?(opaque = 0) () = opaque end
module Applied = Use ((val packed : Holder_t)) (Opaque_arg)
module type Other = sig val h : ?untouched:int -> unit -> int end
module Never_applied (M : Other) = struct let run () = M.h ~untouched:1 () end
module Opaque_unrelated : Other = struct let h ?(untouched = 0) () = untouched end
let run () = ignore (Applied.run ()); ignore (Opaque_unrelated.h ())
end

module Partial_context = struct
module type S = sig val g : ?partial:int -> unit -> int end
module type FT = functor (M : S) -> sig val run : unit -> int end
module Supplied (M : S) = struct let run () = M.g ~partial:1 () end
module Omitted (M : S) = struct let run () = M.g () end
module Outer (F : FT) (M : S) = F (M)
module Partial_supplied_arg : S = struct let g ?(partial = 0) () = partial end
module Partial_omitted_arg : S = struct let g ?(partial = 0) () = partial end
module Supply = Outer (Supplied)
module Omit = Outer (Omitted)
module Applied_supply = Supply (Partial_supplied_arg)
module Applied_omit = Omit (Partial_omitted_arg)
module Invoke (F : FT) (M : S) = F (M)
module Passed_supplied_arg : S = struct let g ?(partial = 0) () = partial end
module Passed_omitted_arg : S = struct let g ?(partial = 0) () = partial end
module Passed_supply = Invoke (Supply) (Passed_supplied_arg)
module Passed_omit = Invoke (Omit) (Passed_omitted_arg)
let packed = (module Supply : FT)
module Repacked = (val packed : FT)
module Packed_partial_arg : S = struct let g ?(partial = 0) () = partial end
module Packed_supply = Repacked (Packed_partial_arg)
module With_unit (F : FT) () (M : S) = F (M)
module Unit_prefix = With_unit (Supplied)
module Unit_middle = Unit_prefix ()
module Unit_partial_arg : S = struct let g ?(partial = 0) () = partial end
module Unit_supply = Unit_middle (Unit_partial_arg)
module type Higher = functor (F : FT) -> FT
module Forward_partial (F : Higher) (G : FT) (M : S) = struct
module Half = F (G)
module Applied = Invoke (Half) (M)
let run = Applied.run
end
module Forwarded_supplied_arg : S = struct let g ?(partial = 0) () = partial end
module Forwarded_omitted_arg : S = struct let g ?(partial = 0) () = partial end
module Forwarded_supply = Forward_partial (Outer) (Supplied) (Forwarded_supplied_arg)
module Forwarded_omit = Forward_partial (Outer) (Omitted) (Forwarded_omitted_arg)
let run () =
ignore (Applied_supply.run ());
ignore (Applied_omit.run ());
ignore (Passed_supply.run ());
ignore (Passed_omit.run ());
ignore (Packed_supply.run ());
ignore (Unit_supply.run ());
ignore (Forwarded_supply.run ());
ignore (Forwarded_omit.run ())
end

let run () =
Repacked.run ();
Projected.run ();
Opaque_holder.run ();
Partial_context.run ()
Loading
Loading