[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 8 commits: Allow rewriting in RuntimeReps for newtype ConPats
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: c77d88fc by sheaf at 2026-08-13T10:15:22-04:00 Allow rewriting in RuntimeReps for newtype ConPats This commit implements PHASE 2 of the FixedRuntimeRep plan described in Note [The Concrete mechanism] in GHC.Tc.Utils.Concrete for newtype constructor patterns. In short, GHC now accepts programs of the form f (MkN x) = ... in which the argument 'x' of the newtype constructor pattern 'MkN x' has a representation that is not syntactically concrete, e.g. it can be 'Id IntRep' reducing to 'IntRep'. See T20363{,b,c} for examples. There are two main parts to the implementation: 1. Typechecking, in GHC.Tc.Gen.Pat.tcDataConPat. See Note [Typechecking newtype constructor patterns] in GHC.Tc.Gen.Pat. 2. Desugaring. We restructure the code for desugaring pattern matches by allowing the scrutinised match variable to be casted. This allows us to accumulate coercions and avoids creating binders at intermediate types tha don't have a fixed RuntimeRep. See the revamped Note [Match Ids] in GHC.HsToCore.Monad. Fixes #20363 ------------------------- Metric Increase: InstanceMatching ------------------------- - - - - - 6ba9dd41 by Wolfgang Jeltsch at 2026-08-13T10:16:07-04:00 Improve the documentation of `--show-iface` This change in particular gets rid of the claim that `--show-iface` writes *the* contents of the interface file in question. It doesn’t do that; it only writes those parts that are likely of interest to a human reader. - - - - - 4bd193fa by Sylvain Henry at 2026-08-13T10:17:00-04:00 RTS: fix LDV profiler's slop skipping (#27585) processHeapForDead was the one heap scanner not updated for the slop marker encoding introduced in #19048. It still assumed slop is zeroed: while (p < bd->free && !*p) p++; // skip slop so it stopped at the (StgWord)(-1) sentinel and passed it to processHeapClosureForDead. IS_FORWARDING_PTR(-1) holds, hence a garbage size was read out of LDVW and the scan ran off the block, tripping ASSERT(p == bd->free) on a debug RTS and silently corrupting the census otherwise. The loop was hand-copied in four places, so factor it out into skipSlop in ClosureMacros.h and use it in ProfHeap.c, Sanity.c, Printer.c and LdvProfile.c. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - 1446bb03 by Zubin Duggal at 2026-08-13T10:17:48-04:00 hadrian: Fix links to remaining doc sites to not use the package hash for haddock links In 07267f79d91169f474cacc8bcd38d76a6e97887d we changed hadrian to not include the package hash in the haddock directory. This patch takes care of a few remaining links that were missed in that patch Fixes #27671 - - - - - 257c3ed7 by Simon Jakobi at 2026-08-13T10:18:29-04:00 Testsuite: widen InstanceMatching acceptance window to 5% (#27673) ...in order to unblock CI. Assisted-by: Claude Fable 5 - - - - - 7abd196b by Vladislav Zavialov at 2026-08-13T15:34:54-04:00 Increase test coverage of diagnostics, batch 2 Add test cases for the previously untested diagnostics: [GHC-26133] TcRnForeignImportPrimSafeAnn [GHC-68444] SumAltArityExceeded [GHC-63966] IllegalSumAlt [GHC-23882] IllegalDeclaration [GHC-60220] InvalidCCallImpent [GHC-18816] RecGadtNoCons [GHC-38140] GadtNoCons [GHC-37056] InvalidTypeInstanceHeader [GHC-78486] InvalidTyFamInstLHS [GHC-39639] DefaultDataInstDecl [GHC-78822] AssocDefaultNotAssoc [GHC-43510] NotSimpleUnliftedType [GHC-41843] IOResultExpected [GHC-07641] AtLeastOneArgExpected [GHC-52886] InvalidTopDecl Remove unused error constructors: [GHC-92057] ImportLookupAmbiguous - - - - - 41db643e by Simon Jakobi at 2026-08-13T15:34:55-04:00 testsuite: Drop peak_megabytes_allocated from LinkableUsage tests LinkableUsage01/02 collected all metrics with a 2% tolerance. For peak_megabytes_allocated, whose granularity is 1 MB, that window is under 0.7 MB at this test's ~34 MB peak, so any 1 MB step failed the test (#27613, #27489). Drop that metric: max_bytes_used guards the Linkable-retention property with byte granularity, at a tolerance that still comfortably exceeds the noise observed in CI. Assisted-by: Claude Fable 5 - - - - - e98231d7 by Simon Jakobi at 2026-08-13T15:34:55-04:00 testsuite: Don't truncate fractional baselines when computing bounds RelativeMetricAcceptanceWindow.get_bounds truncated the baseline with int() before applying the tolerance. Baselines can be fractional (they are averaged over several measurements), so this skewed the acceptance window downwards: in #27613, a baseline of 33.67 at 2% tolerance yielded bounds (32, 34) instead of (32, 35), rejecting a measurement that was within tolerance. Assisted-by: Claude Fable 5 - - - - - 87 changed files: - + changelog.d/T20363 - changelog.d/fix-heap-census-large-arrays-19048 - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Match.hs - compiler/GHC/HsToCore/Match.hs-boot - compiler/GHC/HsToCore/Match/Constructor.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Tc/Utils/Concrete.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Id/Make.hs - docs/index.html.in - docs/users_guide/ghc_config.py.in - docs/users_guide/separate_compilation.rst - docs/users_guide/using.rst - hadrian/src/Rules/Generate.hs - rts/LdvProfile.c - rts/PrimOps.cmm - rts/Printer.c - rts/ProfHeap.c - rts/include/rts/storage/ClosureMacros.h - rts/sm/Sanity.c - rts/sm/Storage.c - testsuite/driver/perf_notes.py - testsuite/tests/bytecode/TLinkable/all.T - testsuite/tests/corelint/T21115b.stderr - testsuite/tests/diagnostic-codes/codes.stdout - testsuite/tests/dmdanal/should_compile/T23398.stderr - testsuite/tests/ffi/should_fail/all.T - + testsuite/tests/ffi/should_fail/ccfail006.hs - + testsuite/tests/ffi/should_fail/ccfail006.stderr - + testsuite/tests/ffi/should_fail/ccfail007.hs - + testsuite/tests/ffi/should_fail/ccfail007.stderr - + testsuite/tests/ffi/should_fail/ccfail008.hs - + testsuite/tests/ffi/should_fail/ccfail008.stderr - + testsuite/tests/ffi/should_fail/ccfail009.hs - + testsuite/tests/ffi/should_fail/ccfail009.stderr - testsuite/tests/numeric/should_compile/T23907.stderr - testsuite/tests/perf/compiler/all.T - testsuite/tests/rep-poly/RepPolyRecordPattern.hs - testsuite/tests/rep-poly/RepPolyRecordPattern.stderr - testsuite/tests/rep-poly/RepPolyRecordUpdate.stderr - testsuite/tests/rep-poly/T20113.stderr - − testsuite/tests/rep-poly/T20363.stderr - − testsuite/tests/rep-poly/T20363_show_co.hs - − testsuite/tests/rep-poly/T20363_show_co.stderr - − testsuite/tests/rep-poly/T20363b.stderr - + testsuite/tests/rep-poly/T20363c.hs - testsuite/tests/rep-poly/all.T - + testsuite/tests/rts/T27585.hs - + testsuite/tests/rts/T27585.stdout - testsuite/tests/rts/all.T - testsuite/tests/simplCore/should_compile/T24229a.stderr - testsuite/tests/simplCore/should_compile/T24229b.stderr - testsuite/tests/simplCore/should_compile/T3717.stderr - testsuite/tests/simplCore/should_compile/T3772.stdout - testsuite/tests/simplCore/should_compile/T4081.stderr - testsuite/tests/simplCore/should_compile/T4908.stderr - + testsuite/tests/th/AssocDefaultNotAssoc.hs - + testsuite/tests/th/AssocDefaultNotAssoc.stderr - + testsuite/tests/th/TH_InvalidTopDecl.hs - + testsuite/tests/th/TH_InvalidTopDecl.stderr - + testsuite/tests/th/TH_cvt_DefaultDataInstDecl.hs - + testsuite/tests/th/TH_cvt_DefaultDataInstDecl.stderr - + testsuite/tests/th/TH_cvt_GadtNoCons.hs - + testsuite/tests/th/TH_cvt_GadtNoCons.stderr - + testsuite/tests/th/TH_cvt_IllegalDeclaration.hs - + testsuite/tests/th/TH_cvt_IllegalDeclaration.stderr - + testsuite/tests/th/TH_cvt_IllegalSumAlt.hs - + testsuite/tests/th/TH_cvt_IllegalSumAlt.stderr - + testsuite/tests/th/TH_cvt_InvalidCCallImpent.hs - + testsuite/tests/th/TH_cvt_InvalidCCallImpent.stderr - + testsuite/tests/th/TH_cvt_InvalidTyFamInstLHS.hs - + testsuite/tests/th/TH_cvt_InvalidTyFamInstLHS.stderr - + testsuite/tests/th/TH_cvt_InvalidTypeInstanceHeader.hs - + testsuite/tests/th/TH_cvt_InvalidTypeInstanceHeader.stderr - + testsuite/tests/th/TH_cvt_RecGadtNoCons.hs - + testsuite/tests/th/TH_cvt_RecGadtNoCons.stderr - + testsuite/tests/th/TH_cvt_SumAltArityExceeded.hs - + testsuite/tests/th/TH_cvt_SumAltArityExceeded.stderr - testsuite/tests/th/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6e10933a32ab9fd552aa3f26b462bd3... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6e10933a32ab9fd552aa3f26b462bd3... 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
participants (1)
-
Marge Bot (@marge-bot)