[m-rev.] for post-commit review: improve debug code in polymorphism_type_class_info.m
Peter Wang
novalazy at gmail.com
Fri Sep 11 10:55:58 AEST 2026
On Thu, 10 Sep 2026 12:30:36 +0200 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> This helped me to track down the source of one of the problems
> in the tci_liveness_abort test case: the creation of a stray base typeclass
> info. As the attached trace output file (for a cutdown version of that
> test case) shows,
>
> - we generate the same value as the base typeclass info for both
> foo(list(T)) and foo(list(list(T))), but
>
> - we do not reuse the variable holding the first base typeclass info
> when we need the second, because we look for them in different
> "slots" in the typeclass info map.
>
> This diff makes no algorithmic changes in non-debug code; that is
> for later diffs.
>
> For review by anyone.
> diff --git a/compiler/const_struct.m b/compiler/const_struct.m
> index ba56d51ae..e89b2ad1a 100644
> --- a/compiler/const_struct.m
> +++ b/compiler/const_struct.m
> @@ -70,7 +70,18 @@
> % The constraint.
> prog_constraint,
>
> - % The already seen constraints.
> + % The already seen constraints, in reverse order (meaming
typo: meaning
> diff --git a/compiler/polymorphism.m b/compiler/polymorphism.m
> index c328cae66..ba48708d4 100644
> --- a/compiler/polymorphism.m
> +++ b/compiler/polymorphism.m
> @@ -271,7 +271,7 @@ polymorphism_process_generated_pred(PredId, !ModuleInfo) :-
> polymorphism_process_pred(PredId, SafeToContinue, !Specs, !ModuleInfo) :-
> trace [compiletime(flag("debug_poly_caches")), io(!IO)] (
> % Replace 99999 with the id of the predicate you want to debug.
> - ( if pred_id_to_int(PredId) = 99999 then
> + ( if pred_id_to_int(PredId) = 0 then
> poly_info_set_selected_pred(is_selected_pred, !IO)
> else
> true
I assume you didn't mean to commit this.
Peter
More information about the reviews
mailing list