From 1450d944c3a606112325a514637d346114774795 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Wed, 23 Jul 2025 17:32:53 -0400 Subject: [PATCH 1/2] Set max methods to 1 (mostly disable world splitting) --- Compiler/src/Compiler.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compiler/src/Compiler.jl b/Compiler/src/Compiler.jl index e1c167e57ed08..b8a1742f4d740 100644 --- a/Compiler/src/Compiler.jl +++ b/Compiler/src/Compiler.jl @@ -137,7 +137,7 @@ baremodule BuildSettings using Core: ARGS, include, Int, === using ..Compiler: >, getindex, length -global MAX_METHODS::Int = 3 +global MAX_METHODS::Int = 1 if length(ARGS) > 2 && ARGS[2] === "--buildsettings" include(BuildSettings, ARGS[3]) From efa4faf9a4ab37008979c5186bf5a6af6a941850 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Thu, 24 Jul 2025 19:02:07 -0400 Subject: [PATCH 2/2] Also disable word splitting when the matches are not fully covered (regardless of number of methods) [Using Claude] --- Compiler/src/abstractinterpretation.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Compiler/src/abstractinterpretation.jl b/Compiler/src/abstractinterpretation.jl index 100cdd97e511a..a3bd7c94bd055 100644 --- a/Compiler/src/abstractinterpretation.jl +++ b/Compiler/src/abstractinterpretation.jl @@ -123,6 +123,12 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(fun return Future(CallMeta(Any, Any, Effects(), NoCallInfo())) end + # Disable inference when not fully covered (similar to union split limit) + if !fully_covering(matches) + add_remark!(interp, sv, "Inference disabled for method without full coverage") + return Future(CallMeta(Any, Any, Effects(), NoCallInfo())) + end + (; valid_worlds, applicable) = matches update_valid_age!(sv, valid_worlds) # need to record the negative world now, since even if we don't generate any useful information, inlining might want to add an invoke edge and it won't have this information anymore if bail_out_toplevel_call(interp, sv)