unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lynn Winebarger <owinebar@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Regression in dump-emacs-portable
Date: Thu, 16 Feb 2023 10:05:00 -0500	[thread overview]
Message-ID: <CAM=F=bBqqBUXQjNCiiimOffgmz=xbk877UEnGFs=-T5KDTgBGg@mail.gmail.com> (raw)
In-Reply-To: <CAM=F=bDyAu9qLgVCzi3fhzA+u8mLjvMVnZp4YXPT9jwLUq9Z4w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6631 bytes --]

On Thu, Feb 16, 2023, 4:54 AM Lynn Winebarger <owinebar@gmail.com> wrote:

> On Thu, Feb 16, 2023 at 4:31 AM Lynn Winebarger <owinebar@gmail.com>
> wrote:
> > On Wed, Feb 15, 2023, 7:43 AM Eli Zaretskii <eliz@gnu.org> wrote:
> >> > From: Lynn Winebarger <owinebar@gmail.com>
> >> > 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 <eliz@gnu.org> 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
> easiest 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 invoked, 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
> tracked 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 automate the calculation of the minimal list of features that need to
> be provided 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 before-init happens prior to the X frame initialization).
> > Once these dependencies are identified and lists are calculated, then
> creating 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
> pseudovector" message.  It's either something incompatible (because I
> blindly attempted 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 calculate the files loaded in the baseline dump and exclude
> them).  I got some very lengthy error messages printing out explicit
> objects from some obsolete 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
> annoying 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
> libraries in included in the Emacs source distribution.  I excluded the
> term and obsolete subdirectories from generating the set of libraries to
> dump (but not from the final set determined from load-history).  Even
> outside of the emacs distribution, the only problematic objects are dynamic
> modules.  I assume this is due to dumping in batch-mode.  My exclusion on
> wid-edit.el is because dumping it in batch-mode appears to bar it from ever
> subsequently creating proper buttons in a graphic terminal.   But dumping
> it still succeeds.
> >
> >> 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
> 24 seconds for a 83MB dump file, which explains why my effort with 30.0.50
> produces a 75MB dump.  I excluded leim for 30.0.50 because I was
> encountering too many errors to deal with manually, which explains most of
> the size reduction.
> > I'm not sure how the tests are normally run, but I would think anyone
> working 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
> comprehensive set of regression tests run pre-release? Does emacs have a CI
> process regularly running the test suite, or is it more ad hoc?  If nothing
> else, failures reported from such a routine run could be used to create a
> more targeted 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.
>

I do see something in the redumped emacs that seems like a bug to me.  The
process I use for creating the dump uses the -Q flag.  But some of the
settings I see in "emacs -Q --dump-file ..." are not the ones I see with
just "emacs -Q".  Some are pretty basic - menu-bar-mode, tool-bar-mode,
global-font-lock-mode, transient-mark-mode are all nil in the redumped
process but not the baseline.  I should check if that happens even when the
only expression evaluated is the call to dump-emacs-portable, with nothing
additional loaded.
A general test would be load the additional files to be dumped, write out
all the symbol properties, variable values, and function values, then load
the dump file and compare everything with equal, including the set of
symbols, variables and functions defined.
Is it fair to say that is the correct expectation of the dumping procedure?

[-- Attachment #2: Type: text/html, Size: 7991 bytes --]

  reply	other threads:[~2023-02-16 15:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13  0:51 Regression in dump-emacs-portable Lynn Winebarger
2023-02-14  1:13 ` Lynn Winebarger
2023-02-14 14:23   ` Eli Zaretskii
2023-02-14 23:26     ` Lynn Winebarger
2023-02-15 12:42       ` Eli Zaretskii
2023-02-16  9:31         ` Lynn Winebarger
2023-02-16  9:54           ` Lynn Winebarger
2023-02-16 15:05             ` Lynn Winebarger [this message]
2023-02-16 15:34               ` Eli Zaretskii
2023-02-16 23:45                 ` Lynn Winebarger
2023-02-17 13:22                   ` Lynn Winebarger
2023-02-17 14:31                     ` Eli Zaretskii
2023-02-17 23:44                       ` Lynn Winebarger
2023-02-18  7:07                         ` Eli Zaretskii
2023-02-21 14:21                           ` Lynn Winebarger
2023-02-23  2:41                             ` Lynn Winebarger
2023-02-23 13:21                 ` Lynn Winebarger
2023-02-16 15:46           ` Eli Zaretskii
2023-02-17  1:29             ` Lynn Winebarger
2023-02-17  3:19               ` Lynn Winebarger
2023-02-17  4:10               ` Lynn Winebarger
2023-02-17  5:21                 ` Po Lu
2023-02-17 12:57                   ` Lynn Winebarger
2023-02-23 15:08 ` Gregory Heytings
2023-02-23 22:32   ` Lynn Winebarger
2023-02-25  4:11     ` Richard Stallman
2023-02-25  4:11     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAM=F=bBqqBUXQjNCiiimOffgmz=xbk877UEnGFs=-T5KDTgBGg@mail.gmail.com' \
    --to=owinebar@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).