Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@g.o>
To: gentoo-dev@l.g.o
Cc: pvdabeel@g.o
Subject: Re: [gentoo-dev] RFC - Gentoo on the Lab
Date: Tue, 23 Aug 2005 17:25:21
Message-Id: 20050823171921.GL10816@nightcrawler
In Reply to: Re: [gentoo-dev] RFC - Gentoo on the Lab by Kristian Benoit
1 Lot of text left inline, pardon, just scroll and deal with it :P
2
3 On Tue, Aug 23, 2005 at 12:28:08PM -0400, Kristian Benoit wrote:
4 > Here is my recent communication with Pieter:
5 >
6 > On Sat, 2005-08-13 at 21:59 +0200, Pieter Van den Abeele wrote:
7 > > On 13 Aug 2005, at 19:16, Kristian Benoit wrote:
8 > >
9 > > > I've heard that you might be the last to know something about
10 > > > portage-ng. What's the actual status,
11 > >
12 > > Here's what I've done so far:
13 > >
14 > > I've build upon Andreas' Zeller idea of using Smolka's feature logic
15 > > for software configuration management. Zeller's approach was ok for
16 > > determining consistency/inconsistency of software configurations. In
17 > > his phd thesis he described the algorithm involved and discussed time
18 > > complexity (which goes to NP if you allow for quantification). My
19 > > impression after implementing his idea was that for automated
20 > > construction there were a few things that were lacking, and some
21 > > things were incorrect. I revisited Zellers feature logic, and ended
22 > > up with a clean implementation of a declarative language which has
23 > > some very desirable properties for automated software construction.
24 > > I'd say my approach is closer to the spirit of Smolka's feature logic
25 > > than Zellers approach. My non-destructive feature unification has a
26 > > worst case time complexity of O(n x m) where n is the length of the
27 > > feature term describing your system, and m is the length of the
28 > > feature term describing the component to be added. In practice
29 > > performance is very good. An emerge --vp --emptytree kde with the
30 > > regular portage takes about 55 seconds on my Open Desktop Workstation
31 > > and produces a list of 200 packages. A similar action using my
32 > > implementation:
33 > >
34 > > =====================================================================
35 > > Total time: 14.55 seconds
36 > > =====================================================================
37 > > Predicate Box Entries = Calls+Redos Time
38 > > =====================================================================
39 > > vunify/4 341,900 = 341,900+0 72.6%
40 > > $garbage_collect/1 326 = 326+0 13.6%
41 > > lists:append/3 684,320 = 684,320+0 4.0%
42 > > genterm/2 520 = 520+0 3.9%
43 > > hunify/4 520 = 520+0 3.3%
44 > > is/2 342,420 = 342,420+0 1.8%
45 > > >/2 342,160 = 342,160+0 0.8%
46 > > buildsystem/2 1 = 1+0 0.0%
47 > > val/3 5,200 = 5,200+0 0.0%
48 > > unify/3 260 = 260+0 0.0%
49 > >
50 > > % 9,531,861 inferences, 13.96 CPU in 14.55 seconds (96% CPU, 682798
51 > > Lips)
52 Stating it as nicely as possible, without knowing what that's doing,
53 stats can be construed several ways; faster backend access (both vdb
54 and ebuild/cache), dodging/caching virtuals, etc; language
55 implementation is a point of curiousity also.
56
57 Faster implementation doesn't surprise me- stable portage is fricking
58 *absolutely* retarded about caching, parsing of deps and cpvs, loading
59 of profile, etc. Either way, interest remains in seeing it :)
60
61 > > The search space is kept as small as possible because I've introduced
62 > > lazy feature evaluation and both multi valued and open features.
63 > > Those concepts are missing in Zellers approach. Comparing current
64 > > portage and my implementation performance-wise is difficult. In
65 > > general mine is faster, but current portage doesn't use sql either.
66 > > What is for sure is that mine allows you to express various
67 > > constraints. You can prevent a dependency from being built with a
68 > > specific use flag. My implementation automatically solves 'blockers'.
69 > > Circular dependencies are also solved correctly. For instance, if you
70 > > want to install unixodbc with the qt use flag enabled and you want to
71 > > install qt wit the unixodbc use flag enabled, my portage knows that
72 > > it needs to:
73 > >
74 > > emerge unixodbc without qt
75 > > emerge qt with unixodbc
76 > > remerge unixodbc with qt support
77 > >
78 > > So it makes revdep-rebuild unnecessary basically.
79 revdep-rebuild is still necessary, regardless of use deps or full
80 state graphs- anyone doubting that should take a look at the breakage
81 that has occured whenever mysql/ssl have decided to change their
82 soname while maintaining compatibility.
83 Need a bincompat metadata attribute to kill off revdep-rebuild.
84
85
86 > > Once I was done implementing this new declarative language in which
87 > > for instance ebuild concepts can be easily expressed (but also rpm,
88 > > deb, fink, darwinports).
89
90 This sounds a lot like my restriction subsystem in the rewrite (code's
91 available to anyone after it).
92
93 With the restriction setup, anyone who wants it could just plugin a
94 different repo/pkg plugin, and have deps based on sonames fex; granted
95 anyone doing it would need some form of a binary repository, but the
96 agnostic aspect of representing matching criteria is the key to it.
97
98 > > I implemented a knowledge base in which
99 > > those feature terms can be stored/looked up efficiently. I used an
100 > > odbc bridge design pattern and have tested the thing with postgresql/
101 > > mysql and sqlite. I've also implemented a DCG parser which parses
102 > > ebuilds (no more having to start a bash process for each ebuild like
103 > > current portage does)
104
105 Strictly a stable slow down, and relevant when pulling metadata; 2.1
106 (ebd patchset) is a daeonized ebuild processor effectively. Shaves a
107 good 30% off of runtime, while being proper (sans bugs).
108
109 Alternative implementations welcome of course, but ebd is pretty much
110 something whipped out that addresses long standing bugs without
111 requiring a full rewrite of parsing (interested parties can do it
112 another day, I care not to after filter-env).
113 ~harring