From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: Regression in dump-emacs-portable Date: Thu, 16 Feb 2023 04:54:33 -0500 Message-ID: References: <83ttzocomk.fsf@gnu.org> <834jrncd6a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="420"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 16 10:55:13 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSayu-000ANN-Qa for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Feb 2023 10:55:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSayY-0001wi-CZ; Thu, 16 Feb 2023 04:54:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSayX-0001wZ-1p for emacs-devel@gnu.org; Thu, 16 Feb 2023 04:54:49 -0500 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSayU-0003gl-WB; Thu, 16 Feb 2023 04:54:48 -0500 Original-Received: by mail-pg1-x52c.google.com with SMTP id c29so912634pgm.5; Thu, 16 Feb 2023 01:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=n30vmqU9TpDID+x1h+t48G7QxSoQkDh4c3uZEfQfAAE=; b=Ppg2RK5T6PHKnZzXZGppvBT1+OVfMSfB0NcKAvAczeZ1Y+kA6DFeIuiYMMped/ptvZ 2WO0pXQwz991pg/xuOlHg0V5uSeOjEuToKhJxJKKLgVVWmzAtWGYTGojs+IuQDoaYIcI 5lsKS86fRXrYq77kptPKjXrcoil8rSrz9Kno1rWHzANnL2mGZip/4LwVtWDo/zSn6HEd +GanG3PrImarotOz/1Dqo3NRd7Z89AJpRqnRwWhBO5JffnGQ7myySnxyY3PFNa2L/Vpq gHHUhNjwwIeihXuKaNo1aaK/fA2FwTraFuisVYP+c7aFoNbqBRW13NN2PGSaEmG1uFwp eEtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n30vmqU9TpDID+x1h+t48G7QxSoQkDh4c3uZEfQfAAE=; b=Y+3lAdojM6obPiaF/OYoLq1B4/+AVJPVeDRLYSWHxtvJ0wfA6uyfa2D5srl4CSjdby fSJJAAT4sahGaoJ8E88Mff10ei+yenmyPjSGAxOc2F4BvdJkTZQxJnC7aZCcAbAAP9Yk FK3uf9fL9vOBbnu4sCNPPWAgJP4tuUvf6dKxxpSIaOdJzKtKBDSv2xjlvIr//jtEzAsZ pKG8oht55M+tlLtsIDKWVatManbnzj185EB/U6EKY5mz/zExRczQmyjm0ErxXjNO74qS gM+6EF4QrcDSV1fGzpkST4M50BCxRTt2UszD0HqCcBaa/1o8ZPpfrt1QFJSsZoTYT6bh 46Gw== X-Gm-Message-State: AO0yUKVgXaWKkC9kbLCZgMsnhup/lefCd6d/yeXoHcPu9wliaK2rdZxf A9Ohdr6Mgy65G94DTR1zjrju+9z1KNm3leHrR8hjG/6I X-Google-Smtp-Source: AK7set8R1MDuj96cd+wPr1anz6zD3pDlWKcck8s35T7FrU18bD1YwfLQUqCmQIZSJ9BhHT17xh4NertDu84pFIvC82Q= X-Received: by 2002:a63:360c:0:b0:4fb:c9e6:87ed with SMTP id d12-20020a63360c000000b004fbc9e687edmr767978pga.3.1676541284680; Thu, 16 Feb 2023 01:54:44 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=owinebar@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303391 Archived-At: On Thu, Feb 16, 2023 at 4:31 AM Lynn Winebarger wrote: > On Wed, Feb 15, 2023, 7:43 AM Eli Zaretskii wrote: >> > From: Lynn Winebarger >> > Date: Tue, 14 Feb 2023 18:26:07 -0500 >> > Cc: emacs-devel@gnu.org >> > >> > On Tue, Feb 14, 2023 at 9:23 AM Eli Zaretskii wrote: >> > > >> > > What do these tests actually test? >> > >> > Whether libraries expected to be redumpable are in fact redumpable. >> >> That's the goal, not the actual testing algorithm. I asked about the >> latter. How do you intend to test that a dump succeeded (assuming >> there's no crash)? > > > The dump will have to be performed in a separate emacs process. The easie= st criteria to judge is whether the dump file exists and is greater than 0 = bytes. Emacs appears to create a 0 byte file when dump-emacs-portable is i= nvoked, which is just not updated if the dump terminates unsuccessfully. > A second criteria is then to invoke emacs with the dump-file and evaluate= some simple expression to verify no unexpected errors were encountered on= load. > I've started automating my process with some simple shell scripting track= ed at https://github.com/owinebar/emacs-redumping. It's not much yet, but = at least I was able to align my efforts between 28.2 and 30.0.50. The next= step will be to create a proper load-time dependency graph, so I can autom= ate the calculation of the minimal list of features that need to be provide= d so that the maximum number of libraries can be loaded for the dump, with = the artificially provided features loaded on an after-init hook (because be= fore-init happens prior to the X frame initialization). > Once these dependencies are identified and lists are calculated, then cre= ating a set of canned tests should be straightforward. Some makefile-based= approach should be adequate for determining which parts of the dependency = graph need to be recalculated after an update. > I want to calculate these dependencies (and compile-time dependencies) to= construct a more robust native-compilation build process anyway. > For a regression test, I would want to record the results from 28.2 as a = basis for measuring 29 and 30, at least as a starting point. In any case,= I never see an "abort signal" termination in 28, or even a "weird pseudove= ctor" message. It's either something incompatible (because I blindly attem= pted to load the world) as in the "term" subdirectory or dos/w32 libraries = under linux, or some redefinition of a character table (which is why I calc= ulate the files loaded in the baseline dump and exclude them). I got some = very lengthy error messages printing out explicit objects from some obsolet= e libraries, so I exclude them as well. > And viper demands user input at startup when it's loaded, so it has to be= excluded from dumping. There might be some variable to turn off that anno= ying behavior, I'm just not interested in investigating. > >> > Almost every library in 28.2 could be redumped, excepting those which >> > simply failed to load for whatever reason. >> >> Don't we have Lisp objects that cannot be dumped? If we do, then not >> every library could be dumped even in principle. > > > In 28.2, using dump-emacs-portable, the answer is, not many in the librar= ies in included in the Emacs source distribution. I excluded the term and = obsolete subdirectories from generating the set of libraries to dump (but n= ot from the final set determined from load-history). Even outside of the e= macs distribution, the only problematic objects are dynamic modules. I ass= ume this is due to dumping in batch-mode. My exclusion on wid-edit.el is b= ecause dumping it in batch-mode appears to bar it from ever subsequently cr= eating proper buttons in a graphic terminal. But dumping it still succeed= s. > >> Another potential issue with this is (assuming you suggest to actually >> try dumping every library) that it will take too long, and thus will >> be likely to be skipped in any "normal" run of the test suite, thus >> missing the point. > > My 2017-vintage laptop dumps the 1252 files, including all of leim, in 34= seconds, for a 135MB dump file. > When I added leim to the exclusions list, 1172 libraries are dumped in 2= 4 seconds for a 83MB dump file, which explains why my effort with 30.0.50 p= roduces a 75MB dump. I excluded leim for 30.0.50 because I was encounterin= g too many errors to deal with manually, which explains most of the size re= duction. > I'm not sure how the tests are normally run, but I would think anyone wor= king on pdumper should be interested in a comprehensive test at some point.= Aside from testing on a per-commit basis, isn't there a more comprehensiv= e set of regression tests run pre-release? Does emacs have a CI process reg= ularly running the test suite, or is it more ad hoc? If nothing else, fail= ures reported from such a routine run could be used to create a more target= ed test set for someone actively working on pdumper. Just to finish this thought - dumping the full set of libraries, excluding a few expected to fail, should be the "normal" test. If 24-34 seconds is too long, there are probably other large subsets that provide substantial coverage in less time. The more comprehensive file-by-file approach should be reserved for tracking down the cause of failures in the normal test. Theoretically, pdumper might be able to indicate the source library(ies) associated with particular error, but the file-by-file approach is always available. Lynn