Cheng Shao activity https://gitlab.haskell.org/TerrorJack 2026-03-19T18:00:33Z tag:gitlab.haskell.org,2026-03-19:623290 Cheng Shao commented on merge request !15551 at Glasgow Haskell Compiler / GHC 2026-03-19T18:00:33Z TerrorJack Cheng Shao [email protected]

needs to fix js failure: https://gitlab.haskell.org/ghc/ghc/-/jobs/2454388

tag:gitlab.haskell.org,2026-03-19:623289 Cheng Shao commented on merge request !15737 at Glasgow Haskell Compiler / GHC 2026-03-19T17:57:19Z TerrorJack Cheng Shao [email protected]

the benchmark is conducted by running the command once to warnup the *.gbc files first, then running it the second time to collect the stats. having *.gbc files on disk means we skip bytecode generation, and using :print main instead of main skips actual execution of bytecode; the rationale of the mini benchmark is to focus on serialization and linking logic of bytecode, which have the lowest hanging fruits for optimization at the moment.

tag:gitlab.haskell.org,2026-03-19:623281 Cheng Shao commented on merge request !47 at Glasgow Haskell Compiler / ghc.nix 2026-03-19T17:36:01Z TerrorJack Cheng Shao [email protected]

yes. i noticed a huge spike in cpu usage on my runner and hence this patch. i think the CPUS convention for our gitlab instance is underdocumented indeed, but it's better to document it elsewhere like ci-config, instead of a commit message in a specific repo that invokes gitlab ci.

tag:gitlab.haskell.org,2026-03-19:623274 Cheng Shao commented on merge request !15737 at Glasgow Haskell Compiler / GHC 2026-03-19T17:15:28Z TerrorJack Cheng Shao [email protected]

I tried running the benchmark, but .gitlab/hello.hs doesn't typecheck with the given invocation. Could this affect the space usage?

ah, i forgot to mention, you need to add {-# LANGUAGE ImplicitPrelude #-} to .gitlab/hello.hs. if it doesn't typecheck this would of course significantly affect the stats! i'd be interested in whether you can reproduce similar improvements in your setup

tag:gitlab.haskell.org,2026-03-19:623273 Cheng Shao commented on merge request !15737 at Glasgow Haskell Compiler / GHC 2026-03-19T17:13:41Z TerrorJack Cheng Shao [email protected]

this one is for the Binary class in binary package, which is transitively used by bytecode object serialization

tag:gitlab.haskell.org,2026-03-19:623228 Cheng Shao commented on merge request !14805 at Glasgow Haskell Compiler / GHC 2026-03-19T16:28:25Z TerrorJack Cheng Shao [email protected]

needs to rebase and catch up with recent ghc-internal changes.

tag:gitlab.haskell.org,2026-03-19:623221 Cheng Shao commented on merge request !15741 at Glasgow Haskell Compiler / GHC 2026-03-19T16:01:24Z TerrorJack Cheng Shao [email protected]

i agree that most inline stuff should just be static in headers and be left to the c compiler to decide whether to inline or not. but there are two issues with keeping -Winline:

  • it's sensitive to the toolchain version, the c toolchain can make different decisions and emit different warnings based on what's inlined and not
  • we also have vendored c sources like xxhash, and might vendor other cbits in the future, and we don't want to carry custom patches just for -Winline

i agree with opening a ticket and trying to remove some inline hints. i don't think -Winline should stay though.

tag:gitlab.haskell.org,2026-03-18:623008 Cheng Shao commented on issue #27059 at Glasgow Haskell Compiler / GHC 2026-03-18T20:45:32Z TerrorJack Cheng Shao [email protected]

i figured out the culprit, see #27066. it's my bad

tag:gitlab.haskell.org,2026-03-18:623007 Cheng Shao opened merge request !15746: hadrian: fix missing +werror in validate flavour at Glasgow Haskell Compiler / GHC 2026-03-18T20:44:15Z TerrorJack Cheng Shao [email protected]

This patch fixes missing +werror in validate flavour, which was an oversight in bb3a2ba1. Fixes #27066.

tag:gitlab.haskell.org,2026-03-18:623006 Cheng Shao pushed new project branch wip/validate-fix-werror at Glasgow Haskell Compiler / GHC 2026-03-18T20:43:23Z TerrorJack Cheng Shao [email protected]

Cheng Shao (ec230141) at 18 Mar 20:43

hadrian: fix missing +werror in validate flavour

tag:gitlab.haskell.org,2026-03-18:623005 Cheng Shao opened issue #27066: Hadrian validate flavour is missing `+werror` flavour transformer at Glasgow Haskell Compiler / GHC 2026-03-18T20:41:20Z TerrorJack Cheng Shao [email protected] tag:gitlab.haskell.org,2026-03-18:623003 Cheng Shao commented on merge request !15676 at Glasgow Haskell Compiler / GHC 2026-03-18T19:43:40Z TerrorJack Cheng Shao [email protected]

it would be nice to move the custom client code to a proper test case, where a ghc api program invokes it as iserv and issues the custom iserv commands. but that can be left to subsequent patches.

tag:gitlab.haskell.org,2026-03-18:623002 Cheng Shao approved merge request !15676: Add support for custom external interpreter commands at Glasgow Haskell Compiler / GHC 2026-03-18T19:41:52Z TerrorJack Cheng Shao [email protected]

Adds support to extend the external interpreter's server function with Custom commands.

For an example client, see the haskell-debugger's use of external commands https://github.com/well-typed/haskell-debugger/pull/222 to add features to the external interpreter such as listing threads or decoding the stack and serializing the result directly.

Closes #26652

tag:gitlab.haskell.org,2026-03-18:623001 Cheng Shao commented on merge request !15676 at Glasgow Haskell Compiler / GHC 2026-03-18T19:38:00Z TerrorJack Cheng Shao [email protected]

would it make sense for CustomHandler to return Either String ByteString to provide a more informative error message for unhandled custom message?

tag:gitlab.haskell.org,2026-03-18:622999 Cheng Shao commented on merge request !15676 at Glasgow Haskell Compiler / GHC 2026-03-18T19:25:32Z TerrorJack Cheng Shao [email protected]

I definitely won't die on this hill. If you feel strongly that I should change Word8 to Word32 I will.

me neither! as long as it's considered and you have your conclusion, then i trust it

tag:gitlab.haskell.org,2026-03-18:622998 Cheng Shao commented on merge request !15737 at Glasgow Haskell Compiler / GHC 2026-03-18T19:09:17Z TerrorJack Cheng Shao [email protected]

thanks for the comments! do you have specific benchmarks where these 0/1/2 element special cases make a significant difference overall? for the record, the benchmark numbers shown in the previous thread is my mini benchmark of loading ghc as a library with breakpoints enabled by default, and i think it's a good approximation of the "average" workload involving a single home module large project.

i'm not convinced that preserving FlatBag in UnlinkedBCO makes much sense! in regard of compactness, the SmallArray fields are now unboxed, and each StgSmallMutArrPtrs closure only carries an extra word for length anyway. and it's not just about making UnlinkedBCO compact; using SmallArray uniformly allows us to reduce marshaling overhead in assembleBCO/linkBCO, and also slightly improves bytecode object serialization code paths, since there are no extra FlatBag variants to check at runtime.

What flavour did you run the benchmarks with?

quick-validate+debug_info

How does the heap profile look like with and without these changes?

i have not built with profiling enabled; the heap stats are generated by adding +RTS -s -RTS to ghci

tag:gitlab.haskell.org,2026-03-18:622976 Cheng Shao pushed to project branch wip/dont-oversubscribe at Glasgow Haskell Compiler / ghc.nix 2026-03-18T17:41:57Z TerrorJack Cheng Shao [email protected]

Cheng Shao (f80dc8c7) at 18 Mar 17:41

ci: respect $CPUS in ci jobs

tag:gitlab.haskell.org,2026-03-18:622974 Cheng Shao commented on merge request !15528 at Glasgow Haskell Compiler / GHC 2026-03-18T17:41:04Z TerrorJack Cheng Shao [email protected]

needs to rebase again and catch up with recent ghc-internal changes.

tag:gitlab.haskell.org,2026-03-18:622959 Cheng Shao pushed to project branch wip/dont-oversubscribe at Glasgow Haskell Compiler / ghc.nix 2026-03-18T17:08:58Z TerrorJack Cheng Shao [email protected]

Cheng Shao (c2c5a708) at 18 Mar 17:08

ci: respect $CPUS in ci jobs

tag:gitlab.haskell.org,2026-03-18:622949 Cheng Shao commented on issue #27059 at Glasgow Haskell Compiler / GHC 2026-03-18T16:48:11Z TerrorJack Cheng Shao [email protected]

of course i want to enforce it in ci and stop playing whack a moles in ghc-internal, but even after i added 9.14 to bootstrap matrix, it passes in ci but still fails locally on my machine. very confusing.

the easiest way to enforce in ci is to add hadrian logic, but that's a very heavy hammer and i'd like a better understanding of why 9.14 validate job doesn't catch it first.