From: Alexis Ballier <aballier@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC] Forced/automatic USE flag constraints (codename: ENFORCED_USE)
Date: Tue, 30 May 2017 11:25:18 +0200 [thread overview]
Message-ID: <20170530112518.65b4f9e9@gentoo.org> (raw)
In-Reply-To: <20170530095607.1adbc0b8@snowblower>
On Tue, 30 May 2017 09:56:07 +0100
Ciaran McCreesh <ciaran.mccreesh@googlemail.com> wrote:
> On Tue, 30 May 2017 10:46:54 +0200
> Alexis Ballier <aballier@gentoo.org> wrote:
> > On Tue, 30 May 2017 09:22:45 +0100
> > Ciaran McCreesh <ciaran.mccreesh@googlemail.com> wrote:
> > > On Tue, 30 May 2017 09:42:45 +0200
> > > Alexis Ballier <aballier@gentoo.org> wrote:
> > > > Oh crap, this requires to solve SAT.
> > >
> > > The main problem would not be solving SAT, in this case. The
> > > problem is providing the right answer when not enough information
> > > is given. Spitting out a resolution which satisfies every
> > > dependency isn't typically that difficult. Spitting out a
> > > resolution which doesn't just turn off all your use flags and
> > > uninstall most of your programs is the hard part.
> >
> > I don't really understand here: Assuming the formula is reduced
> > where user-set useflags and profile-masked/forced ones are already
> > assigned their true/false values, this leaves a formula with
> > variables where changing any of those won't turn off (or on)
> > anything you didn't want. If you can solve SAT on this reduced
> > instance then you're safe, aren't you ?
>
> First problem: encoding "don't change this from its current setting
> unless you have a reason to do so" is an utter pain in SAT. There are
> other models like ASP that can just about get around this, but
> expressing it properly is best done by just writing your own solver.
> Remember that you have to allow the solver to toggle some flags, so
> you can't just lock everything, but at the same time, you don't want
> the solver to randomly toggle a flag that isn't specified by the user
> or the profile, unless it absolutely has a good reason to do so.
>
> Second problem: a solver will spit out an arbitrary solution. If the
> user then runs it again, there's no guarantee that it will spit out
> the same arbitrary solution. That can be addressed by the right
> choice of restart policies and tiebreaking etc if you're prepared to
> muck around with the solver enough. But even if you do, suppose the
> user thinks "yes, that's almost fine, but let me change one other
> thing" (or if the install fails half-way through and the user tries
> to carry on after fixing it). The solver will then spit out a totally
> different arbitrary solution that looks nothing like the first one.
The way I see it, this boils down to spec'ing something that guarantees
there's a unique solution given an input. The solution does not have to
be good or bad (we don't have a good metric on that anyway), it just
has to be deterministic so that developers can arrange their
REQUIRED_USE constraints to have PM chose the proper solution.
Note: To me, the problems you describe are really the root of SAT
solving problems (or any NP problem FWIW): An algorithm has to make
choices that might have consequences arbitrary far and it might realize
after running for a while that its initial assumption was invalid.
next prev parent reply other threads:[~2017-05-30 9:26 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-29 15:33 [gentoo-dev] [RFC] Forced/automatic USE flag constraints (codename: ENFORCED_USE) Michał Górny
2017-05-29 16:30 ` Kent Fredric
2017-05-29 16:44 ` Michał Górny
2017-05-29 18:00 ` Alexis Ballier
2017-05-29 21:23 ` Michał Górny
2017-05-29 21:31 ` Ciaran McCreesh
2017-05-29 22:01 ` Ulrich Mueller
2017-05-29 22:05 ` Ciaran McCreesh
2017-05-30 7:47 ` Alexis Ballier
2017-05-30 8:05 ` Ulrich Mueller
2017-05-30 8:10 ` Alexis Ballier
2017-05-30 7:42 ` Alexis Ballier
2017-05-30 8:22 ` Ciaran McCreesh
2017-05-30 8:46 ` Alexis Ballier
2017-05-30 8:56 ` Ciaran McCreesh
2017-05-30 9:25 ` Alexis Ballier [this message]
2017-05-30 12:00 ` Ulrich Mueller
2017-05-30 14:33 ` Michał Górny
2017-05-30 15:33 ` Alexis Ballier
2017-05-30 18:11 ` Michał Górny
2017-05-30 18:46 ` Alexis Ballier
2017-05-31 6:55 ` Michał Górny
2017-05-31 7:24 ` Ciaran McCreesh
2017-05-31 7:34 ` Alexis Ballier
2017-05-31 7:35 ` Michał Górny
2017-05-31 7:51 ` Ciaran McCreesh
2017-05-31 7:54 ` Alexis Ballier
2017-05-31 7:56 ` Alexis Ballier
2017-05-31 7:32 ` Alexis Ballier
2017-05-31 8:03 ` Michał Górny
2017-05-31 8:38 ` Alexis Ballier
2017-05-31 13:04 ` Michał Górny
2017-05-31 17:39 ` Alexis Ballier
2017-05-31 19:02 ` Michał Górny
2017-05-31 22:52 ` Ciaran McCreesh
2017-06-01 8:55 ` Alexis Ballier
2017-06-01 21:31 ` Michał Górny
2017-06-02 6:37 ` Michał Górny
2017-06-02 11:18 ` Alexis Ballier
2017-06-02 13:49 ` Michał Górny
2017-06-02 11:27 ` Alexis Ballier
2017-06-02 13:55 ` Michał Górny
2017-06-02 15:09 ` [gentoo-dev] " Martin Vaeth
2017-06-03 11:00 ` [gentoo-dev] " Alexis Ballier
2017-06-03 15:33 ` Michał Górny
2017-06-03 16:58 ` Alexis Ballier
2017-06-04 8:59 ` Alexis Ballier
2017-06-05 7:55 ` Alexis Ballier
2017-06-05 14:10 ` Michał Górny
2017-06-05 17:24 ` Alexis Ballier
2017-06-05 18:10 ` Michał Górny
2017-06-05 18:15 ` Ciaran McCreesh
2017-06-06 12:08 ` Alexis Ballier
2017-06-06 17:39 ` Michał Górny
2017-06-07 6:49 ` Michał Górny
2017-06-07 8:17 ` Alexis Ballier
2017-06-07 9:27 ` Michał Górny
2017-06-07 9:56 ` Alexis Ballier
2017-06-09 9:19 ` Michał Górny
2017-06-09 11:41 ` Alexis Ballier
2017-06-09 12:54 ` Michał Górny
2017-06-09 14:16 ` Alexis Ballier
2017-06-09 16:21 ` Michał Górny
2017-06-11 16:05 ` Alexis Ballier
2017-06-12 9:08 ` Alexis Ballier
2017-06-12 19:17 ` Michał Górny
2017-06-13 10:27 ` Alexis Ballier
2017-06-13 22:13 ` Michał Górny
2017-06-14 9:06 ` Alexis Ballier
2017-06-14 12:24 ` Michał Górny
2017-06-14 13:16 ` Alexis Ballier
2017-06-14 13:57 ` Michał Górny
2017-06-14 14:09 ` Alexis Ballier
2017-06-15 15:59 ` Michał Górny
2017-06-15 16:07 ` Alexis Ballier
2017-06-15 16:13 ` Ciaran McCreesh
2017-06-15 16:19 ` Alexis Ballier
2017-06-15 16:22 ` Ciaran McCreesh
2017-06-15 16:30 ` Alexis Ballier
2017-06-15 16:32 ` Ciaran McCreesh
2017-06-15 16:37 ` Alexis Ballier
2017-06-15 16:45 ` Ciaran McCreesh
2017-06-15 16:55 ` Alexis Ballier
2017-06-15 17:04 ` Ciaran McCreesh
2017-06-15 17:30 ` Alexis Ballier
2017-06-15 17:48 ` Ciaran McCreesh
2017-06-15 18:09 ` Alexis Ballier
2017-06-15 17:38 ` Michał Górny
2017-06-15 18:05 ` Alexis Ballier
2017-06-14 14:28 ` Alexis Ballier
2017-06-02 12:16 ` Alexis Ballier
2017-06-02 13:57 ` Michał Górny
2017-06-02 14:56 ` [gentoo-dev] " Martin Vaeth
2017-06-02 15:19 ` Ciaran McCreesh
2017-06-02 16:26 ` Martin Vaeth
2017-06-02 18:31 ` Martin Vaeth
2017-06-02 1:17 ` [gentoo-dev] " A. Wilcox
2017-06-02 1:28 ` Rich Freeman
2017-06-02 1:33 ` A. Wilcox
2017-06-02 5:08 ` Michał Górny
2017-05-31 12:38 ` [gentoo-dev] " Duncan
2017-05-30 21:13 ` [gentoo-dev] " Kent Fredric
2017-05-30 8:29 ` Michał Górny
2017-05-30 9:34 ` Alexis Ballier
2017-05-30 14:12 ` Michał Górny
2017-05-29 19:24 ` Ciaran McCreesh
2017-05-29 19:42 ` Michał Górny
2017-05-29 19:44 ` Ciaran McCreesh
2017-06-05 8:26 ` Alexis Ballier
2017-06-09 12:35 ` Jason A. Donenfeld
2017-06-09 12:42 ` Michał Górny
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170530112518.65b4f9e9@gentoo.org \
--to=aballier@gentoo.org \
--cc=gentoo-dev@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox