GUADEC: Work in the pipeline for GNOME
GUADEC incorporated a blend of old and new business; there were status reports and updates from various GNOME projects and teams, but there were also a lot of sessions devoted to discussing new components and ideas for the coming development cycle, and for GNOME's long-term future. Some were wild concepts, of course, but not every new scheme was a radical departure — many were just solid bits of engineering that will make life easier for developers (and for users) over the next few releases.
Smooth G
For example, one of the week's largest crowds gathered for Owen Taylor's talk about enabling jitter-free animations in GTK+ applications. Smooth animations are not a new idea, but it has taken a while for the right approach to fall into place. Taylor addressed one specific type of animation: 2D redraws, of the kind that are commonly found when dragging or re-sizing an application window, or when translating an object across the screen. GTK+ and GNOME applications have never performed all that well in these circumstances, with tearing and jumpy updates being among the common complaints.
![[Owen Taylor]](https://static.lwn.net/images/2012/08-guadec-taylor-sm.jpg)
Taylor identified the root cause of such unpleasant visual artifacts as a lack of synchronization between the application and the compositor (following a lengthy investigation, documented on his blog). Historically, compositors attempted to draw new frames whenever they happened to arrive from the application. But this resulted in uneven timing. At times an application might generate more frames than the frame rate (say, 60 frames per second), causing some frames to be dropped, at other times it produces frames too slowly (either by consuming too much CPU or due to system load), and at still other times it may deliver frames too late to be drawn (with a buffer swap during the display's vertical blanking interval). The result is redraws that are unevenly spaced, so they appear jumpy to the eye. The compositor can attempt to be smart about which frames to draw and which to drop, but there has never been a mechanism for applications and compositors to keep in step with one another.
Taylor's solution is to introduce a frame synchronization protocol, which allows the application and the compositor to agree on redraws. The protocol centers on _NET_WM_SYNC_REQUEST_COUNTER, a counter (managed by the X Synchronization Extension, and visible to both the application and the compositor) which the application increments to an odd value whenever it begins to update a new frame of the animation. When the application finishes drawing the new frame, it increments the counter to even, and the compositor can draw the update to the screen. When the update is complete, the compositor sends a _NET_WM_FRAME_DRAWN message back to the application. This synchronization scheme does not enable faster frame rates, but it ensures that the compositor is drawing updates as fast as the application can produce them, be that 30 frames per second, 40, or any other number — and that the application will not draw new frames before the compositor is ready for them
Taylor also observed that there are side benefits to this scheme, including that frames are dropped only when the compositor fails, and that it is possible to benchmark compositor performance independently. That should enable future work benchmarking and improving compositor performance. Taylor implemented the frame synchronization protocol in the Mutter window manager used by GNOME, but he also posted it to the window manager specification list, where it drew positive reactions from KWin developers and others. He had demonstration animations on hand illustrating the smoother performance on several animation effects when frame synchronization was active. The demos included window dragging and rescaling, but there is still some work to be done to make more and easier-to-use animated effects in GTK+ itself.
To the trees
Colin Walters's OSTree does not extend new features to the GNOME environment or applications, but it is designed to make life simpler for both developers and users. The concept is to replace the package-centric installation model with a Git-like repository of the entire filesystem tree — which can be cloned and updated on the client machine. Installing a new operating system is a matter of cloning the repository, and updating it is a matter of pulling in the changes. But unlike a simple OS ghosting setup, OSTree can retain multiple, named versions of the tree and boot into any of them. That allows developers to do things like maintain experimental builds, roll back to earlier versions to try to reproduce bugs, and ensure that the entire development team can boot an identical set of components.
![[Colin Walters]](https://static.lwn.net/images/2012/08-guadec-walters-sm.jpg)
In his talk, Walters described another feature that OSTree would provide to the core GNOME team: the ability to bisect regressions down to a single commit. As he described it, a regression means an unintentional break in functionality. GNOME has historically had problems identifying and fixing regressions because the vast majority of GNOME users do not install the environment directly: they install packages delivered by their distribution. That separates the discovery of the regression from the commit that caused it by a considerable gulf — both of time and activity. First is the commit, he said, followed by time, then the creation of a tarball, followed by more time, then the package, still more time, the release of the package to the repository, yet more time, installation of the package, updating the filesystem, then finally a reboot, after which the user notices the regression.
If developers and users could immediately see the changes, Walters said, they would find and fix regressions much faster. Walters's ostbuild is an auxiliary build tool that makes this possible. It watches a git repository and creates binary builds stored in an OSTree repository based on each commit. Because ostbuild only re-builds changed components (and OSTree only stores changed portions of the system), it does not use an excessive amount of space, but more importantly it allows developers to track down exactly which commit caused a regression.
The resulting improved feedback rate is one benefit, he said, but OSTree also makes reverting regressions simple: a new commit that fixes the regression can be deployed from the repository, and users can simply boot into a pre-regression OS until a fix is available. Such an option is impossible with traditional packages like those used in RPM and Debian systems, he said, because they rely heavily on the version numbers assigned to packages — and the definition that version numbers must strictly increase over time. OSTree and ostbuild are also fully atomic (side-stepping several problems common in package managers), they eliminate the overhead and headaches of working with GNOME's existing build system jhbuild, and they make it possible to incorporate continuous integration testing into GNOME development.
On the other hand, Walters cautioned that there are a number of issues
with using OSTree that have yet to be worked out. For starters, there
is no way to push out security updates (as distinct from any other
commit), which could prove annoying for system administrators. It would
also be necessary to find a way to integrate the OSTree distribution
model with existing governance structures that define policy and
longer-term strategic decision-making — and in a related issue,
without the version numbers required by packages, it would be hard to
do marketing and branding to highlight a new release. At a more
technical level, there is not yet a preferred way to install
applications from outside sources (although OSTree itself is agnostic
to how applications are installed), configuration files in
/etc make automatically rolling back to a previous version
risky, and as Walters put it, the whole system is "barely
documented
".
Despite such shortcomings, Walters has been using OSTree for GNOME development for several months, via a service running at ostree.gnome.org.
Other bits
Plenty of other sessions dealt with GNOME's immediate and near-term future. Emmanuele Bassi addressed the plans for GTK+ and Clutter, the two most prominent GUI toolkits used in GNOME. One of the most frequently asked questions is whether the two should be merged into a single toolkit, given that in many ways their features are complimentary. Bassi's answer is that they need to remain separate, but both need to be adapted so that they will work better together. Clutter 2.0 is still in development, only after that will the plan for GTK+ 4.0 (including changes targeting better Clutter integration) take concrete form.
Alejandro Piñeiro Iglesias outlined GNOME's accessibility plans, including focus-tracking in the magnifier tool. Tim Muller discussed GStreamer's future, including more GPU support and improved memory management. By and large, major changes like Walters's OSTree were a rarity; most of the work that goes into each successive GNOME release consists of incremental improvements, even if (as in the case of Taylor's animation work) the result fixes a long-standing issue.
[The author would like to thank the GNOME Foundation for travel assistance to A Coruña for GUADEC.]
Posted Aug 23, 2012 2:11 UTC (Thu)
by walters (subscriber, #7396)
[Link]
I have just a few minor corrections to the OSTree segment:
* It is entirely possible to deliver "asynchronous" security updates; what I more meant is that doing so requires dedicated person-power that I don't believe we have. The entire system is designed to allow forking/merging, and a security update is no different from a slightly modified tree.
NixOS on the other hand really suffers on the security update side because the package system forces a rebuild of *everything* when libc changes. See https://live.gnome.org/OSTree/NixOSComparison
* ostbuild actually monitors over 200 git repositories right now, not just one. Every commit to X.org gets immediately built for example. Some things are fixed at specific tags though - my one server would kind of choke doing continuous integration of WebKitGtk =)
* The marketing/branding thing is really independent of the build system. It's more a generic issue when shipping something more directly consumable than git repositories.
I wish the article had highlighted more what I consider the biggest issue - the inability of both dpkg and rpm to go backwards. I'd revert Fedora rawhide for example back to a state where it could start GDM this very second if it were possible. Reverting is not always the right answer of course - it's important to debug things. But it's a lot more important to have a constantly usable development tree.
Posted Aug 24, 2012 17:13 UTC (Fri)
by jengelh (guest, #33263)
[Link] (8 responses)
Why do they have to strictly increase? What about rpm --install --oldpackage gtk-2.0...rpm?
Posted Aug 24, 2012 18:01 UTC (Fri)
by walters (subscriber, #7396)
[Link] (7 responses)
Oh, there are many possible workarounds. "yum" does have "distro-sync". Debian's apt has "pinning", and will downgrade. But both of them by default look for upgrades. And the default is very influential on the architecture of the entire system.
For example, in Fedora's Koji, packages that aren't tagged as being part of some "release" are subject to garbage collection. So if GTK+ regressed, you might find that the previous package had already vanished from the build server/archive mirrors, so you can't even download it.
And what's more important - there's no sane mechanism to push a revert on the build server side, unless you resort to Epoch or ~really. And Epoch has serious drawbacks - for a package like gtk+, we'd have to go and reflect the Epoch bump in every other package using gtk3-devel. That's extreme pain.
More realistically of course, what you would do is cherry-pick a "git revert" of the breakage. But at that point - you're lying about the Version field. You're fighting the system.
The combination of OSTree and the gnome-ostree build system fixes this in two separate ways:
1) You always by default have at least the previous OS you booted into before deploying a new update. In fact, on my laptop, I have hundreds of individual GNOME build snapshots stored in /ostree. And each build points to the exact git repositories and revisions that built it. So I could fork off what I have locally at any time.
You'd be amazed at just how much more pleasant it is to follow Free Software development when you have a "go back to what worked" button locally. In fact - you have two separate undo buttons. OSTree doesn't affect at all whatever distribution you have installed. So you can just reboot back into that too.
2) On the gnome-ostree side, I can pick the git revision of any module I want at any time. And I have used this power several times so far to keep things working while we decide what to do.
It's hard to describe just how powerful this is. For example, I could decide one day to switch the entire tree to KDE. You'd do a pull, and it wouldn't affect your running system at all; there's nothing equivalent to RPM/dpkg deleting files underneath GNOME while it's running. You just download the delta, then deploy a new root, and reboot into it. The next day, I could switch back. And you would basically only download 64 bytes of checksum pointing to the original GNOME tree, and switch back.
Posted Aug 24, 2012 18:38 UTC (Fri)
by walters (subscriber, #7396)
[Link]
Posted Aug 24, 2012 22:01 UTC (Fri)
by daglwn (guest, #65432)
[Link] (1 responses)
Posted Aug 25, 2012 16:53 UTC (Sat)
by walters (subscriber, #7396)
[Link]
https://live.gnome.org/OSTree/VCS
And these are all derived from my original README file which is here:
I've been trying to move that last one into individual wiki pages, but it's probably the best overview from a "hacker" perspective still.
Posted Aug 25, 2012 0:55 UTC (Sat)
by jengelh (guest, #33263)
[Link] (2 responses)
Of course they will — they have no other means. However, "upgrade" is a misnomer, it should really be called "preferred version".
Developers tag their packages such that a tool can decide which among two is more preferred. If gtk-2.27 somehow is more preferred than gtk-2.28 due to a bug, you, as a {upstream and/or distro-level} developer, have to indicate the preference to the tool, *somehow*. Whether that happens by means of Epoch prefixes, amount of lolcats shipped alongside the package, or manual intervention by the end-user (pinning), the choice is irrelevant.
And ostree, the way you describe it, looks a lot like pinning by the end-user. A local "master" branch in a git clone is similarly pinned — you have to manually run pull/merge to change it.
Posted Aug 25, 2012 16:42 UTC (Sat)
by walters (subscriber, #7396)
[Link] (1 responses)
Mmm...there are two fundamental differences versus a user pinning packages on their own machine.
1) You always have the previous working system to boot into. If NetworkManager breaks, you may set up a pin locally for the old version, but that doesn't do you a lot of good if you don't have networking to download it =)
2) The release manager has the option to push arbitrary versions at any time - the closest analogy I can think of would be if someone made a Debian package containing pins. Say it was like "known-good-versions.deb", that dropped a file into /etc/apt.conf.d/known-good-versions.conf.
Basically I think reverting back to older known good versions should be a nearly-constant operation in the development tree. It should be easy for both users and release managers.
If you look at how Mozilla makes Firefox, they "back out" changesets often. Just run "git log --grep=Back" in mozilla-central. Here's an example.
Posted Aug 28, 2012 20:13 UTC (Tue)
by guillemj (subscriber, #49706)
[Link]
That's why front-ends like apt store previously downloaded packages and keep them in a cache on disk (I'm guessing yum might behave in a similar way).
> 2) The release manager has the option to push arbitrary versions at any time - the closest analogy I can think of would be if someone made a Debian package containing pins. Say it was like "known-good-versions.deb", that dropped a file into /etc/apt.conf.d/known-good-versions.conf.
In Debian, this role is taken by the testing distribution.
> Basically I think reverting back to older known good versions should be a nearly-constant operation in the development tree. It should be easy for both users and release managers.
Sure, but that does not really require downgrading, one can always prepare a new package that backs out a specific change, in the same way you'd do with a project on a git repository, going always forward (like your mozilla example). It does require someone to bisect the problematic code though, but that needs to be done anyway at some point. Either that or the user can revert to a previous local version.
Posted Aug 25, 2012 6:40 UTC (Sat)
by scottt (guest, #5028)
[Link]
Why would this be required? Because a bug in the gtk3-devel headers requires a recompile of everything built against it? (but surely that's rare)
GUADEC: Work in the pipeline for GNOME
GUADEC: Work in the pipeline for GNOME
GUADEC: Work in the pipeline for GNOME
Do note though the current gnome-ostree build is actually broken for a few reasons =) I don't actually run it myself because I need to finish making /etc work. However, to see it log into GDM and show gnome-shell at least, you can download this revision.
GUADEC: Work in the pipeline for GNOME
GUADEC: Work in the pipeline for GNOME
GUADEC: Work in the pipeline for GNOME
https://live.gnome.org/OSTree/Ostbuild
http://git.gnome.org/browse/ostree/tree/src/libostree/REA...
http://git.gnome.org/browse/ostree/tree/README.md
GUADEC: Work in the pipeline for GNOME
GUADEC: Work in the pipeline for GNOME
GUADEC: Work in the pipeline for GNOME
> And Epoch has serious drawbacks - for a package like gtk+, we'd have to go and reflect the Epoch bump in every other package using gtk3-devel.
GUADEC: Work in the pipeline for GNOME