GNOME Shell GUADEC wrap-up

Unless you’ve been hiding under a rock, if you are a GNOME contributor, you probably know the big news from GUADEC: we decided to push GNOME 3 back another six months. I obviously would prefer if this wasn’t necessary – it feels like we’ve been working on GNOME Shell for a long time now, and it would be good to get something into user’s hands. (It’s been 19 months or so since we announced the project and wrote the first code.) But it was definitely the right decision: it will give us the time to make GNOME 3 really solid, rather than pushing something not quite finished out the door.

The GNOME Shell team did 3 talks:

  • I gave a presentation where I looked at what we’ve done in the last year and where we are currently: The State of the GNOME 3 Shell.
  • Jon talked about the big ideas behind GNOME Shell design, then together with Jakub gave a peak at some of the work they’ve been doing recently: Shell Yes!.
  • Colin and Dan talked about how to make your application rock with GNOME 3: GNOME 3 and Your Application

Unfortunately, the videos for the talks aren’t yet posted anywhere. So, you’ll have to figure out what you can from slides. This may be pretty hard for my talk – a lot of the slides are just screenshots comparing where we were a year ago to where we are today. But Colin and Dan’s talk has notes in the slides, and Jon’s talk has a video mockup of upcoming shell design changes.

Some media coverage: You can hear me talking with Fabian Scherschel about the shell in the latest Linux Outlaws podcast, and if you read German there’s an article by Andreas Proschofsky at derstandard.at.

We had a good crowd of shell people at the conference; there were 6 or so of us there from Red Hat, and beyond that I was really happy to meet Florian Muellner and Maxim Ermilov who have been responsible for much of the progress in the shell over the last year. (I’d tell you what they’ve done here, but it would make this post too long.) Our two summer of code students were also there: Christina Boumpouka who is working on adding CSS support to LookingGlass, and Matt Novenstern who is doing a bunch of improvements to the message tray.

I talked to the Tracker crowd a bit about integration of Tracker with the shell. I mentioned a couple of areas where we could use some help on the Tracker side: we need more notifications, so we don’t have to constantly requery to show the user all their files and no deleted files, and someone needs to take care of pushing files that the user actually uses into Tracker for indexing whether or not they are in the directories that Tracker automatically indexes. But basically it’s a question of finding someone with the time to sit down and do the work and implement the designs we have. The shell needs a way to search files and file metadata, and Tracker is obvious leader in this area for GNOME.

I also talked a bit about remerging St and Mx with Chris Lord and Emmanuelle Bassi, though somehow I missed catching up with Thomas Wood. We’re all really positive on the idea – there’s been a lot of complementary development on the two codebases. (The way I explained it in my talk is that St has powerful CSS support, which we need for the one-off shell UI, while Mx has far more widgets, which they need for the wider range of things they use Mx for in Meego..) There’s definitely some devil in the details – we’re definitely not done with every toolkit enhancement we need for the shell, for one thing – but hopefully we can make it happen soon.

Øyvind Kolås gave an awesome demo of ClutterSmith. This had the GNOME Shell designers jumping up and down to get it yesterday – enough with Inkscape and Blender. Ideally, we could have a live mockup of the shell in ClutterSmith, using the same images and CSS files as the real shell, and the designers could use that to experiment with new visual changes and motion design.

On the plane home, I started hacking on new shadow code for Mutter that can handle variable shadow radii and shaped shadows. It’s still a work in progress, but since every blog post needs a picture:

(This is a test program using images for windows; the ugly window borders are ugly because that’s what I could draw in the GIMP quickly. On the other hand, the shadow banding is a defect in my code that I’m still working on.)

Measuring GNOME Shell Performance

One of the big goals of the GNOME 3 Shell is to use animation and visual effects for positive good. An animation explains to the user what the connection is between point A and point B. For this to work, the animation has to be smooth – it can’t be a jerky sequence of disconnected frames. Performance matters.

Over the last 18 months we’ve done a fair bit of work on performance – everything from fixing problems with AGP memory caching in the radeon kernel drivers to to moving tests for whether recent files are still there to a separate thread. But this work was ad-hoc and unsystematic. There was no way to see if shell performance got better or worse over time. To compare the performance of two different systems. Or even to tell in a rigorous way whether an optimization that seemed to make sense actual improved things. Over the last few weeks I’ve been working to correct this; to get hard, repeatable numbers that represent how well the shell is performing.

The core of the GNOME Shell performance framework is the event log. When event logging is enabled, all sorts of different types of events are logged: when painting of a frame begins, when painting of a frame ends, when the user enters the overview, and so forth. The log is stored in a compact format (as little as 6 bytes per event), so can be recorded with very little overhead. It doesn’t significantly affect performance.

The other thing that is recorded in the event log is statistics. A statistic is some measurement about the current state: for example, how many bytes of memory have been allocated. Every few seconds, registered statistics are polled and written to the event log as a special event type. Statistics collection can also be triggered manually.

Once we have an event log recorded, we can analyze it to determine metrics. We can measure the latency between clicking on the activities overview button and the first frame of the zoom animation. We can see how many bytes are leaked each time the user goes to the overview by comparing the memory usage before and after. Since we want to measure exactly the same conditions every time, we don’t want to analyze a performance log generated by the user actually doing stuff; instead we script the operation of the shell from Javascript. You can see how this looks by looking at the run() function in js/perf/core.js. The rest of this performance script contains the logic to compute the metrics when the recorded event log is replayed (For example, during replay the script_overviewShowDone() function is called when replaying a script.overviewShowDone event.)

Running gnome-shell --replace --perf=core produces a summary of the computed metrics that looks, in part, like:

# Additional malloc'ed bytes the second time the overview is shown
leakedAfterOverview 83200
# Time to first frame after triggering overview, first time
overviewLatencyFirst 192482
# Time to first frame after triggering overview, second time
overviewLatencySubsequent 66838

(The times are in microseconds.) Being able to get these numbers for a particular build of the shell is good, but what we really want to be able to do is compare these numbers over lots of systems over time. So, there’s also a website shell-perf.gnome.org where statistics can be uploaded.

(The way that uploading works is that after registering a system on the site, you are mailed instructions about how to create a ~/.config/gnome-shell/perf.ini with an appropriate secret key, and the --perf-upload option uploads the report. Please only do this with Git builds of gnome-shell for now – there are some updates to the metrics even since the 2.29.2 release yesterday.)

If you browse around the site, you’ll see that you can look at the recorded metrics for different systems or for an individual system over time. You can also look at a specific uploaded report. An example:

shell-perf.gnome.org: detailed view of a performance report

I should point out, since it’s not very obvious, that navigation to individual reports is by clicking on the report headers in the system view. In the report view, you can see the details of the uploaded metrics. But you also can see the entire original event log! (The event log browser is using the HTML canvas – I’ve tested it in Firefox and Epiphany – it probably works in most browsers that GNOME developers are likely to be using.) Having the event log means that if an anomalous performance report is uploaded we can actually dig in and see more about what’s going on.

GNOME Shell 2.28.0 – A Preview

Going from releasing GNOME 2.27.x unstable releases of GNOME Shell to GNOME 2.29.x unstable releases of GNOME Shell naturally involves crossing 2.28 in the middle, so we thought we’d take the opportunity to make a set of tarballs that are little more stable than the typical Friday snapshots. A good place for people to try things out. I’ve just uploaded mutter-2.28.0 and gnome-shell-2.28.0 tarballs to ftp.gnome.org.

If you want to building things yourself, you still should use the JHBuild setup described on our wiki page. It’s the easiest way to do it. The tarballs are really designed for people creating distribution packages.

Looking back, I haven’t blogged about GNOME Shell changes since February. That’s a very long time so I’m not going to make any attempt to describe here what all has changed since then. (693 commits just to the gnome-shell Git module.)

To find all the nooks and crannys of the GNOME Shell user interface you can use the neat cheat sheet that Marina created. It’s a good way to learn about the secret commands supported by the Alt-F2 dialog without going to the source code, as well as to get an overview of the more user-oriented parts of the shell.

Considering only at the changes in the last few weeks, the biggest change recently has been to the Alt-Tab dialog; Jon McCann and Jeremy Perry (one of the designers here at Red Hat) came up with some ideas about how the Alt-Tab could better integrate with the way we group windows by application in the Activities Overview, and Dan Winship did a lot of work to make those ideas into something we could try out. Steve Frécinaux also jumped in more recently to help out with this. Jon’s going to describe the design ideas involved in more detail soon, so save your ideas for improvement for his post, but here’s a quick screenshot to whet your appetite:

New GNOME Shell Alt-Tab Selector

The other big recent change isn’t so screenshot-able, but Colin and I took some interesting parts of the NBTK library from Moblin and imported it into GNOME Shell as ST (the Shell Toolkit). (We’re still cooperating closely with Moblin on the work; the rename is just to keep things non-confusing.) We get several nice things from this: scrolling, better layout capabilities, but the big change is the ability to use CSS for styling. NBTK already had a good start on this, and I then merged in some work I did last year for hippo-canvas to get extra capabilities like CSS styling of borders and fonts. This is really intended to make development easier – so we don’t have to have all sorts of hardcoded fonts, colors, and pixel sizes in the code, but also should provide a good entry point for artists to work on alternate appearances for the shell.

Oh, and I quickly used ST to hack up a drop-down calendar when you click on the clock. So you can finally find out what day of the month it is in GNOME Shell without having to run ‘cal’ in a terminal.

We hope people will try it out, and see how it works for them in practice; packages will be in Fedora rawhide shortly and the JHBuild I mentioned above really is easy to get going on any recent Linux distribution if you aren’t running something quite so up-to-date. If you are in the Boston area, come to the GNOME Summit this weekend. All the developers working at Red Hat on the shell will be there, and hopefully a few other shell developers as well. You can see the shell in action, talk to us, and just in case you are having trouble getting it compiling, we’ll help you with that too.

Splinter – patch review for Bugzilla

OK, time to make good on my promise to write about Splinter some more and show it off. The basic idea of Splinter (hinted at in my last post) is that instead of doing patch review as a completely new system and building all the infrastructure from scratch, it should be possible to do the kind of interactive patch review featured by systems like Review Board or Rietveld directly on patches attached to Bugzilla.

When you visit Splinter’s display of patch attachment, you see a standard two-column patch display like:

Splinter review with comment

Any coments that people have previously made will show up inline. If you have comments to make yourself, you can double-click on a line and an editor will open where you can type the new comment:

Adding a comment with Splinter

I put up a (read-only) demo instance of Splinter where you can try this out live.

When you publish your review, it will be published as a comment in Bugzilla that looks (in part) something like:

::: js/ui/lookingGlass.js
@@ -355,3 +355,3 @@
             inspector.connect('closed', Lang.bind(this, function() {
                 this.actor.show();
-                global.stage.set_key_focus(this._entry);
+                Main.acquireKeyboardFocusStack(this._entry);

I'm not sure why we are setting the keyboard focus (either way) when the
inspector is closed, but using a stack-based acquire() seems
definitely wrong.

The idea of the format is to be readable if someone is just reading the comments in the review or in emails from Bugzilla, while still being parseable by Splinter for inline display.

A neat feature of Splinter is it uses the new DOM Storage mechanism to save in-progress reviews. You can leave the page for a review and come back to it any time and your review will be as you left it. (This requires a brand new browser, like Firefox 3.5.)

Using it yourself

Assuming that there’s interest, I’d like to make this available on bugzilla.gnome.org. The first step would be just having it there behind the scenes if you know the URL. The second step would be to write a small Bugzilla extension to link to add links to Splinter from review comments and from the attachments section.

But you don’t need to wait for this. If the above is something that you want now, then you can clone it from git://git.fishsoup.net/splinter (browse, README). In the proxy/ subdirectory, there’s a README file that describes how to run a local proxy server pointed to a Bugzilla instance. It’s really easy. Then connect to:

http://127.0.0.1:23080/index.html

in your web browser. Some aspects are a bit obscure as of yet; for example if posting a review hits “a mid-air conflict” then it will fail and you need to reload the page (safe because of the use of DOM Storage!) and try again. But it’s definitely usable.

Behind the scenes

The most interesting thing about Splinter is that the server referred to above is just a proxy server. The only reason that it is there at all is to safely get around cross-site-scripting restrictions; there’s no server side component at all. Instead, the Javascript code of Splinter uses the existing exposed web interfaces of Bugzilla (and your existing Bugzilla login credentials) to get information about the bug and post reviews back. Everything – parsing the patch files, building the display – is done in Javascript in your web browser.

One of the main reasons for doing it this way was language choice. I’m doing a lot of Javascript coding for gnome-shell, so its very much at my fingertips. And there was going to be Javascript and DOM manipulation in any case – I wanted a modern interactive interface for editing reviews. If I was going to write a server side component, I’d need to do it in Perl to integrate nicely with the Bugzilla environment, but my Perl is distinctly rusty. Everything in Javascript side-stepped that issue.

The Javascript approach also is easy for development – you don’t need a test Bugzilla instance to work on, you can just hack on the Javascript and HTML files, and use the proxy server to run your changes against a public Bugzilla instance.

The Javascript code uses JQuery extensively. It’s my second project using it, and I’m liking it a lot. In some ways, it’s really a meta-language on top of Javascript, but it gives a lot of power compactly and readably. (Readably if you don’t get too clever with it.) The source code also contains a SpiderMonkey-based test harness so that I could write tests for the non-interactive parts like parsing patches and run ‘make check’.

Future

Splinter is never going to be as nice for the single task of patch review as Review Board. But there’s quite a bit of low-hanging fruit to make it better. In addition to the small Bugzilla extension mentioned above, other things I’m thinking of include: better control of how much context is shown with a comment. A collapsed view of a review that just shows the review and the sections being commented on. A threaded display of the attachments of a bug showing their relationship to each other and the reviews on each version. The ability to add extra context around a particular section of a patch.

Review Board vs. git-bz

I’ve recently been spending some time working on a light-weight web-based patch review tool, called Splinter, to go along with Bugzilla. I’m not quite ready to reveal it to the world, but I wanted to deal in advance with a question that is certainly going to come up – why not use Review Board? This is a very reasonable question to ask, especially since Splinter was directly inspired by seeing Review Board and saying to myself “I want one of those!”

In thinking about this, I realized that the comparison wasn’t really between Review Board and Splinter, but between Review Board and attaching patches in Bugzilla. You really have to look at the overall process. How do you go from a enhancement request or reported crash, to a first candidate code change, to reviews on that change, to a final version of your change, to pushing those changes to the official repository, to closing the original report? git-bz automates and makes convenient large sections of this. Splinter is just a solution for a gap in the process – how do you review a patch once it’s attached to Bugzilla? But Review Board replaces the entire thing: you don’t attach patches in Bugzilla, you just link to a review request that you’ve filed (with your patch) in Review Board.

First I should list some of the advantages that Review Board would bring to the overall process: first, it has a very slick and well developed web interface for reviewing and commenting on patches. The tool I’ve been working on is pretty nice for a couple of weekends of work, but there’s only so far you can go in a couple of weekends. Second, Review Broad has a very well-defined workflow. Each review request is submitted to a person or group for review. You are presented with your outbox: your patches waiting for review, and your inbox: patches that are waiting on review. With our Bugzilla, the process is buried in a large and complex user interface and is much less explicit. (Attachment flags can be used to do explicit review requests in Bugzilla, but we don’t use them on bugzilla.gnome.org.) Finally if we used Review Board for patch reviews in GNOME, we’d reduce the amount of noise for bug reporters. While I imagine it’s exciting to see two developers discussing obscure details of a patch to fix your reported crash, I also can imagine that it can be confusing and intimidating, and maybe people would prefer to just get a high-level summary when a patch was comimtted rather than all the details in their mailbox.

So, Review Board stacks up pretty well for web user interface and developer workflow. Where things become more problematical are the integration with Git and the integration with Bugzilla.

The normal way to interact with Git is from the command line, so any integration of a review tool with Git will start there. While the web portions of Review Board are highly advanced, the Review Board post-review command-line leaves a lot to be desired when compared to git-bz. It doesn’t follow the git command line conventions. It can’t take patches from Review Board and apply them locally. It can’t insert references to the review into the commit messages. And so forth. That’s partly a question of attention, and probably even more a question of being cross-version-control-system. There’s only so much you can do while handling Subversion, and CVS, and Git, and Mercurial, and …. Certainly a specific “git-rb” tool is possible that does many of the things that git-bz does is possible – the lack of such a tool isn’t an inherent defect of Review Board, just a current lack.

There is a more fundamental problem here – a review in Review Board is of a single diff (potentially with multiple revisions), but that’s not very natural to how people work with Git. More complex enhancements are almost always done as patchsets, with each patch in the set being kept as standalone as possible. In the Bugzilla/git-bz workflow, the entire set of patches attached to a bug logically makes up a patch set. git-bz makes it easy to attach a series of commits to a bug as patches or apply all the patches from a bug to a local branch. Individual patches can be commented upon, marked as accepted-commit_now, replaced with newer versions, but it’s only when everything has been agreed upon and pushed that the bug can is closed. Trying to handle this explicitly in the Review Board user interface would require some substantial changes: you’d want a Review Request to cover an entire patch set, but have Reviews apply to individual patches within it.

The issues with using Bugzilla and Review Board together lie both on the user side and on the infrastructure-development side. On the user side, there’s a simple but non-trivial problem that we’d suddenly have two different identifiers and URLs for the same issue – there would be the Bugzilla bug URL but also the review board review request URL. Which one should you reference in in your commit message? Which one do you search for? There would also be two separate accounts to deal with.

On the infrastructure side, there’s the standard work of installing, maintaining, upgrading, etc. Beyond that, we might want to try and figure out some sort of single-sign-on across Bugzilla and Review Board to help with the multiple accounts problem. We’d have to have some automated process to keep the repository list in Review Board in sync with the 600+ GNOME repositories and auto-create maintainers groups for the repositories. We’d need a bugzilla extension to link to reviews. We’d need a Review Board extension to update bugs in Bugzilla when a review was created.

My summary here is that moving GNOME to Review Board for patch review would be quite a bit of work and a substantial change in our current work habits. There would be significant advantages, but also some definite downsides in having to juggle two systems. If it’s possible to, with a small addition on top of Bugzilla, get a reasonable approximation to the web-based patch review aspects of Review Board without adding an entire second system, I think that’s pretty interesting. Once I put a demo of Splinter out there (days, not weeks), you can judge that “if” for yourself.