Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 07704cb8 by Sylvain Henry at 2026-11-05T04:13:16-05:00 ghc-internal: avoid unnecessary allocations in bignum division (#27231) Avoid unnecessary allocations in bignum division in the Haskell (native) backend. The long-division loop used to allocate a fresh BigNat for the partial product on every iteration, plus one more per quotient-digit correction; it now subtracts the partial product in place and materializes nothing. The quotient-digit estimate is also refined against the second-highest divisor word, so the add-back correction runs at most once per iteration. bignat_quotrem_normalized now requires a divisor of at least 2 words, so bignat_quotrem dispatches 1-word divisors to bignat_quotrem_word. See Note [Knuth division loop] and Note [Fused multiply-subtract for long division] in GHC.Internal.Bignum.Backend.Native. Measured on the new T27231 perf test (10000 native-backend 8192/2048-bit Integer quotRem calls): bytes allocated drops from 305 MB to 52 MB (-83%). Improvement on CI (x86-64-linux-deb13-int_native): space_leak_001(normal) run/alloc 12,492,185,536 9,073,055,928 -27.4% GOOD Metric Decrease: space_leak_001 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 13d575b6 by mangoiv at 2026-11-05T04:13:17-05:00 ci: build and test stage Split up CI in a build and test stage: 1. in the build stage, just produce a bindist as well as running the stage1 tests 2. in the test stage, install the bindist, then run the testsuite with out of tree args - - - - - b7d7db8d by mangoiv at 2026-11-05T04:13:17-05:00 ci: reorder packaging and testing stages - - - - - 4bdd2b1a by mangoiv at 2026-11-05T04:13:17-05:00 ci: out of tree compiler does not imply no hadrian being available - - - - - 83b81382 by mangoiv at 2026-11-05T04:13:17-05:00 ci: don't do msys deps check on stage1 compiler - - - - - b2a776cf by mangoiv at 2026-11-05T04:13:17-05:00 testsuite: allow metric decreases on windows Metric Decrease: LinkableUsage01 MultiLayerModulesTH_OneShot T10547 T12234 T12425 T13035 T13253-spj T13820 T18140 T18730 T18923 T9198 TcPlugin_RewritePerf mhu-perf - - - - - fa881c73 by mangoiv at 2026-11-05T04:13:18-05:00 ci: stop using ellipses in testsuite output and output env before invoking hadrian - - - - - 45287585 by fendor at 2026-11-05T04:13:19-05:00 Add `-dep-json` flag to `ghc -M` Add an optional flag to `ghc -M` that allows to write the dependency information in JSON Lines format. The JSON Lines format enables us to stream the output of the dependency generation to a consumer. The output of `-dep-json` is streamed to a temporary file and then copied to the final destination to avoid partial writes. Each line contains one of two possible json objects: 1. A Home Unit Dependency * Contains the name of the home module, its unit, where it is located, whether a preprocessor is used, and all of its imports. Importantly, the imports include `-XExplicitLevelImports` information. * If requested via `-include-pkg-deps`, includes imports of external units, e.g. modules from `base`. * If requested via `-include-cpp-deps`, files included via CPP. 2. External Unit Dependency * Only if `-include-pkg-deps` is given * Contains unit-id, its package name and package id. --- This PR refactors the Makefile generation to use phases appropriately. We introduce an intermediate data structure that is generated based on the module graph nodes, and only then generate the Makefile rules. This allows the dep-json and dep-makefile generation to use the same dependency processing. - - - - - bd8e021d by fendor at 2026-11-05T04:13:19-05:00 Add multiple home unit support to `ghc -M` Allows to process the module graph of multiple home units at once using the same syntax as `--make` and `--interactive`: ghc -M -unit @unitA -unit @unitB The semantics are identical to `--make` and `--interactive`. Each home unit can declare individually to use `-include-cpp-deps` and `-include-pkg-deps`. However, there can only be one output file, and `-dep-json` and `-dep-makefile` can only be provided at the top of the cli invocation. We introduce a new GHC API `doMkDepend` that allows to use multiple home units conveniently. The output of `-dep-json` and `-dep-makefile` does not change, since we were careful to choose a format that supports multiple home units from the start. Single home units are still accepted like before with no changes. - - - - - 72c30f84 by fendor at 2026-11-05T04:13:19-05:00 Deprecate `doMkDependHS` in favour of `doMkDepend` - - - - - 102e3ce6 by ARATA Mizuki at 2026-11-05T04:13:26-05:00 testsuite: Mark T367_letnoescape fragile for the optllvm way It was marked broken, but it is now unexpectedly passing on aarch64-linux-deb13-validate+llvm. Marking it fragile for now. See #7292 - - - - - a2a9b0a6 by Sylvain Henry at 2026-11-05T04:13:34-05:00 rts: heap census counts every small pinned object Blocks of small pinned objects carry BF_LARGE as well as BF_PINNED but hold many objects. heapCensusChain treated every BF_LARGE block whose first object is an ARR_WORDS as holding that single object, a workaround for the slop left by shrinkMutableByteArray# (#11627). So every heap profile mode under-reported pinned byte arrays, i.e. ByteString payloads. Shrinking now writes a slop marker that skipSlop understands (#19048, #27585), so the block walk is safe for large and pinned blocks alike. The block that a capability fills with small pinned objects stays attached to the capability until it is full (see allocatePinned), so it is on no generation list and the census never saw its objects. heapCensus now walks cap->pinned_object_block too. A pinned block is kept or freed as a whole (#28005), so dead pinned objects are counted until their block is freed. T7275 gains one sample in which its dead small arrays still show. The user guide and changelog document this. Fixes #28000 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 654e8143 by Sylvain Henry at 2026-11-05T04:13:40-05:00 rts: fix GC CPU time accounting with idle GC threads (#26169) stat_endGC summed gc_end_cpu - gc_start_cpu over every GC thread, but only the threads that take part in a collection set these fields, and new_gc_thread did not initialise them. With -qn below the capability count, the first collection after setNumCapabilities added garbage to the GC CPU time. Let each participating thread add its own CPU time to an accumulator in stat_endGCWorker, and let stat_endGC take the total. This removes the loop over gc_threads, the reset from #21082 and the gc_end_cpu field. Also drop the unused gc_end_elapsed field. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 1c8a3243 by Rodrigo Mesquita at 2026-11-05T04:13:42-05:00 interp: Make resumeExec and ExecBreak use `Resume` directly Previously, `Resume` contexts were just put directly in the global interactive environment state, so they were only accessible through it. However, in the context of multi-threaded debugging, in that many threads may hit breakpoints, it no longer suffices to have a global linear list of breakpoints hit. We need a per-breakpoint Resume context and need to be able to wield it directly rather than going through a global context. The driving changes of this commit are: - Put the Resume data in ExecBreak - Make resumeExec receive a Resume as an argument This also simplifies the interpreter in that we no longer necessarily rely on the global interactive state to resume a thread. We can do it directly from the ExecBreak. The interactive context still maintains a stack of resumes, but `resumeExec` can no longer pop the resume it resumes off of the breakpoints stack, since it is no longer guaranteed to be resuming the first in that list. Hence, callers of `resumeExec` must update ic_resume on their own. Fixes #28058 - - - - - a503440b by Rodrigo Mesquita at 2026-11-05T04:13:43-05:00 Per-thread break-on exception (TSO_STOP_ON_EXCEPTION) The `-fbreak-on-exception` flag allows the interactive interpreter to stop when a synchronous exception is raised. However, this is a global toggle backed by a global variable in the RTS (rts_stop_on_exception) which is not compatible with a multi-threaded debugger where we may want to stop if some threads raise a synchronous exception but not other. This commit makes -break-on-exception similar to step-next and step-out where there is a per-thread toggle on each TSO (TSO_STOP_ON_EXCEPTION), and that break-on-exception set in EvalOpts when resuming a statement only affect the thread being resumed. Fixes #28068 - - - - - 0e32c01e by Andrea Vezzosi at 2026-11-05T04:13:44-05:00 driver: Don't let -dynamic unset -fsplit-sections `addWay' WayDyn` used to unset Opt_SplitSections, so -fsplit-sections was ignored if it came before -dynamic, but worked if it came after. The -fsplit-sections -dynamic combination has legitimate uses, e.g. an executable can be linked dynamically against libraries and still have dead code from its own sources to eliminate. Or the same objects could be used for both static archives and shared objects. The removal of Opt_SplitSections was also motivated by problems on Darwin. It is now done in `makeDynFlagsConsistent` instead, see Note [Split sections are not supported on Mach-O]. For consistency, we also keep Opt_SplitSections when `dynamicNow` is activated. There is a cost of larger .dyn_o (but not .so) files and slower link times (esp. with ld.bfd), but does not seem significant enough to warrant special casing. Fixes #28061 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - 513b3e6f by Alan Zimmerman at 2026-11-05T04:13:45-05:00 EPA: Use AnnList in AnnClassDecl Capture parser layout - - - - - 63b86048 by sheaf at 2026-11-05T04:14:06-05:00 Avoid panic in 'solveImplicationsUsingUnsatGiven' Commit 52a4d1da refactored this code to use 'setWantedDict' which panics for equality constraints. This commit fixes that by explicitly handling HoleDest. Fixes #28081 - - - - - 151 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/common.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + changelog.d/26169.md - + changelog.d/28081 - + changelog.d/bignum-quotrem-no-alloc - + changelog.d/fix-heap-census-pinned-blocks.md - + changelog.d/ghc-api-exec-break-resume - + changelog.d/make-depends-deprecate-doMkDependHS - + changelog.d/make-depends-json - + changelog.d/make-depends-multiple-home-units - + changelog.d/split-sections-dynamic - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Driver/Session/Units.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Parser.y - compiler/GHC/Platform/Ways.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/Runtime/Eval/Types.hs - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Utils/Json.hs - + docs/users_guide/make-depends-json-schema-1_0.json - docs/users_guide/phases.rst - docs/users_guide/profiling.rst - docs/users_guide/separate_compilation.rst - ghc/GHCi/UI.hs - ghc/GHCi/UI/Monad.hs - ghc/Main.hs - hadrian/doc/cross-compile.md - hadrian/src/Base.hs - hadrian/src/Builder.hs - hadrian/src/Context.hs - hadrian/src/Flavour.hs - hadrian/src/Hadrian/Haskell/Hash.hs - hadrian/src/Hadrian/Package.hs - hadrian/src/Oracles/Flag.hs - hadrian/src/Oracles/Setting.hs - hadrian/src/Oracles/TestSettings.hs - hadrian/src/Packages.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Program.hs - hadrian/src/Rules/Test.hs - hadrian/src/Settings/Builders/DeriveConstants.hs - hadrian/src/Settings/Builders/RunTest.hs - hadrian/src/Settings/Packages.hs - libraries/ghc-heap/GHC/Exts/Heap/FFIClosures_ProfilingDisabled.hsc - libraries/ghc-heap/GHC/Exts/Heap/FFIClosures_ProfilingEnabled.hsc - libraries/ghc-heap/tests/parse_tso_flags.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/Native.hs - libraries/ghc-internal/src/GHC/Internal/Heap/Closures.hs - libraries/ghci/GHCi/Debugger.hs - libraries/ghci/GHCi/Run.hs - rts/Exception.cmm - rts/Interpreter.c - rts/Interpreter.h - rts/ProfHeap.c - rts/RtsSymbols.c - rts/Stats.c - rts/Stats.h - rts/include/rts/Constants.h - rts/include/stg/MiscClosures.h - rts/sm/GC.c - rts/sm/GCThread.h - testsuite/driver/testglobals.py - testsuite/driver/testlib.py - testsuite/tests/codeGen/should_gen_asm/all.T - + testsuite/tests/codeGen/should_gen_asm/split-sections-dynamic1.asm - + testsuite/tests/codeGen/should_gen_asm/split-sections-dynamic1.hs - + testsuite/tests/codeGen/should_gen_asm/split-sections-dynamic2.asm - + testsuite/tests/codeGen/should_gen_asm/split-sections-dynamic2.hs - testsuite/tests/concurrent/should_run/all.T - + testsuite/tests/driver/mkdepend/Makefile - + testsuite/tests/driver/mkdepend/README.md - + testsuite/tests/driver/mkdepend/T24384/A.hs - + testsuite/tests/driver/mkdepend/T24384/C.hs - + testsuite/tests/driver/mkdepend/T24384/C.hs-boot - + testsuite/tests/driver/mkdepend/T24384/D.hs - + testsuite/tests/driver/mkdepend/T24384/E.hs - + testsuite/tests/driver/mkdepend/T24384/dep-internal/DepInternal.hs - + testsuite/tests/driver/mkdepend/T24384/dep-internal/dep-internal.pkg - + testsuite/tests/driver/mkdepend/T24384/dep-public/DepPublic.hs - + testsuite/tests/driver/mkdepend/T24384/dep-public/dep-public.pkg - + testsuite/tests/driver/mkdepend/T24384/dep/Dep.hs - + testsuite/tests/driver/mkdepend/T24384/dep/dep.pkg - + testsuite/tests/driver/mkdepend/T24384/foo.h - + testsuite/tests/driver/mkdepend/T24384/lib/B.hs - + testsuite/tests/driver/mkdepend/T24384/lib/B.hs-boot - + testsuite/tests/driver/mkdepend/T24384/preproc.sh - + testsuite/tests/driver/mkdepend/T24384a.stdout - + testsuite/tests/driver/mkdepend/T24384b.stdout - + testsuite/tests/driver/mkdepend/T24384c.stdout - + testsuite/tests/driver/mkdepend/all.T - + testsuite/tests/driver/mkdepend/format_json.sh - + testsuite/tests/driver/mkdepend/format_makefile.sh - + testsuite/tests/driver/mkdepend/mhu01/a/A/Base.hs - + testsuite/tests/driver/mkdepend/mhu01/a/A/Base.hs-boot - + testsuite/tests/driver/mkdepend/mhu01/a/A/TH.hs - + testsuite/tests/driver/mkdepend/mhu01/a/Util.hs - + testsuite/tests/driver/mkdepend/mhu01/b/B/Normal.hs - + testsuite/tests/driver/mkdepend/mhu01/b/B/Splice.hs - + testsuite/tests/driver/mkdepend/mhu01/b/Util.hs - + testsuite/tests/driver/mkdepend/mhu01/c/C.hs - + testsuite/tests/driver/mkdepend/mhu01/unitA - + testsuite/tests/driver/mkdepend/mhu01/unitB - + testsuite/tests/driver/mkdepend/mhu01/unitC - + testsuite/tests/driver/mkdepend/mhu02/A.hs - + testsuite/tests/driver/mkdepend/mhu02/B.hs - + testsuite/tests/driver/mkdepend/mhu02/pp.sh - + testsuite/tests/driver/mkdepend/mhu02/unitA - + testsuite/tests/driver/mkdepend/mhu02/unitB - + testsuite/tests/driver/mkdepend/mhu03/pkg/A.hs - + testsuite/tests/driver/mkdepend/mhu03/pkg/pp.sh - + testsuite/tests/driver/mkdepend/mhu03/unitA - + testsuite/tests/driver/mkdepend/mkdepend01.dep-json - + testsuite/tests/driver/mkdepend/mkdepend01.dep-makefile - + testsuite/tests/driver/mkdepend/mkdepend01/A.hs - + testsuite/tests/driver/mkdepend/mkdepend_mhu01.dep-json - + testsuite/tests/driver/mkdepend/mkdepend_mhu01.dep-makefile - + testsuite/tests/driver/mkdepend/mkdepend_mhu02.dep-json - + testsuite/tests/driver/mkdepend/mkdepend_mhu03.dep-json - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - testsuite/tests/llvm/should_compile/all.T - + testsuite/tests/llvm/should_compile/split-sections-darwin.hs - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/T20452.stderr - testsuite/tests/perf/compiler/large-project/all.T - + testsuite/tests/perf/compiler/large-project/large-project-mhu.sh - + testsuite/tests/perf/should_run/T27231.hs - + testsuite/tests/perf/should_run/T27231.stdout - testsuite/tests/perf/should_run/all.T - testsuite/tests/printer/Test24533.stdout - testsuite/tests/profiling/should_run/T7275.stdout - testsuite/tests/rts/Makefile - + testsuite/tests/rts/T26169.hs - testsuite/tests/rts/all.T - + testsuite/tests/rts/census_pinned.hs - + testsuite/tests/rts/census_pinned.stdout-ws-32 - + testsuite/tests/rts/census_pinned.stdout-ws-64 - + testsuite/tests/rts/census_pinned.stdout-ws-64-mingw32 - + testsuite/tests/unsatisfiable/T28081.hs - testsuite/tests/unsatisfiable/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/711442278e8e36d2cae2c1f0af5db3b... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/711442278e8e36d2cae2c1f0af5db3b... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help