What Feature Requests Can Tell Us

As mentioned yesterday I am currently going through all open feature requests for KWin. This of course tells me quite a lot about what our users want to see in KWin and where we have rough edges. Of course everything there has to be seen with some bias as some reports are really old and KWin has done a transition from being a window manager to a compositor and window manager. Given the age of KWin there has also been a dramatic shift in the targeted user audience of KWin and Linux in general.

One of the patterns I noticed in going through the requests is a high demand for our window specific rules framework. In fact I noticed so many requests for them, that I decided to create an own bug component for bugs and requests specific to the rules framework. This shows that the scripting capabilities currently added to KWin are useful and that there are many users who will appreciate that work.

Another area which has quite a rather large amount of wishes is Present Windows and Desktop Grid. This validates my assumption that it is one of the most powerful features we actually have for window management and that we have to make this more prominent. Personally I have quite some ideas to improve this in 4.10.

On the other hand there are hardly any requests for our other effects and if at all it is for accessibility features. When we introduced desktop effects there were many requests to add this effect and that effect, mostly with the reason that compiz has it, too. The more fancy, the better. Lately we have hardly got any new wishes for adding more eye candy. This quite validates some assumptions I already had. As desktop effects are quite normal nowadays on all systems there seems to be no need any more to have the show off effects. Who wants to burn down windows anymore? That was awesome back in 2005 as no other system could do something like that, but nowadays it looks already quite old fashioned.

Another area which really sticks out are advanced window management features like Focus Follows Mouse, Focus Under Mouse or Window Shading. Concepts probably not known to most users, concepts dating back to the early times of X11 and not really used by our current developers. If I think back to the developer sprints I have been over the last years I have not noticed anyone who used Window Shading.

Overall the feature request highlight something I expected before: feature requests are only reported by very advanced users. Only a very small sub group of our user base is able to report them. And that is no surprise. In most cases we can safely assume that a user of the KDE Plasma Workspaces does not know anything about KDE. Even if she does it is unlikely that she knows anything about KWin (try to find the word KWin in our UI). Even if the name KWin is known it is unlikely that a user knows that she could report a bug or feature request. KWin does not have a Help menu with a “Report Bug…” entry. So there is a huge entry barrier for reporting feature requests.

It shows again that bugzilla is hardly useful for interaction with the userbase as your userbase is not represented correctly. For KWin this will of course be fixed by no longer accepting feature requests in the bug tracker, but sending users to the brainstorm section.

Changing the Feature Request Workflow for KWin

As a reader of my blog you should know that I am rather unhappy with the situation of our bug tracker. Last week there was an incident with our bug tracker which should not have happened: the upgrade of our bugzilla installation broke the automatic submission of crash reports through DrKonqui. Given the stats for KWin of last year, I have to admit that I was not unhappy about it. My first expectation was that for at least a month we would not get any new crash reports and probably none for outdated versions ever again. Now our sysadmins and DrKonqui developers rock and have already fixed the issue 🙂

Nevertheless I took this incident as a motivating factor to start a cleanup of our bug tracker. Not getting new bugs and having to set them to duplicate frees some resources to go through the existing reports. At the time of this writing KWin went down 48 bugs and 160 feature requests over the last seven days.

During this work I concentrated on cleaning up the feature request. In the past the assumption was that each feature request is valid. Of course users may wish new features. Nothing wrong about that. Unfortunately this results in more than 350 feature requests and the oldest ones being reported against KDE 2.0. Well if a feature request has been reported more than ten years ago and nobody has thought about implementing it, we come to the point where we should consider facing the reality and stating that we won’t implement it. From the request I went through there were things which would have required a rewrite of KWin, many features which had been implemented or implemented in a slightly different way, just really bad ideas and many wishes for additions where we just don’t have the time for.

For the future I want to see new workflows established concerning feature request for KWin. First of all feature requests should not be entered in the bug tracker but on the brainstorm section of our forums. This allows other users to vote on the idea giving us developers a better understanding whether the feature is really wanted or just fixing a corner case of one user.

As a result feature requests in the bug tracker should only be there if we plan to implement them. For this I started to introduce “target milestones” for version 4.9 and 4.10 and started to flag the requests I consider as useful with these milestones. Feature requests which I consider as useful but cannot be implemented right now were made dependent on other feature requests which are already targeted for a specific release.

This will also change my own workflow for developing KWin. All the features I work on will end up as tasks in the bug tracker. Currently the ideas are either only in my head or as sticky notes on my whiteboard. Both is not a good solution for doing development planning and tracking dependencies between the tasks or verifying that all tasks get implemented before the feature freeze. But from my own experience I know that bugzilla is very capable of doing exactly that work.

For establishing such a workflow for myself it is of course necessary to first clean up the feature request. But in the end this gives everybody advantages. I have a better managed todo list which is shared with everyone. Given the target milestones all users and possible developers can see what (list is not yet complete) will end up in the release or where help is required.

Changing my own workflow is also quite important as I can manage my own available development time much better. Since November I have reduced my day job to have more time for KDE and started to do consulting work around KDE on the weekdays I have not been at my day job. Since recently I also belong to the group of developers working for the Netrunner OS distribution and since March the BlueSystems, the company behind Netrunner OS, is sponsoring two days a week for KDE development. Thanks a lot for the trust in the KDE community.

Now to something completely different: I not only worked hours through the bugtracker but have also been one day on a development sprint for Plasma Active. We had very good discussions about various aspects of the development of our workspaces 🙂 I used the short train journey to Darmstadt to rebase my JavaScript bindings for KWin Effects on current master with the result that yesterday I merged them into master. It still needs some final adjustments and documentation, but overall I’m quite happy about it. I remember that I talked about the ideas for the first time last year at the sprint before Plasma Active was announced and I think it is just a nice coincidence that I added the finishing touch to this work one year later on the way to and fro the Plasma Active sprint.

Default Options Projects for KWin 4.9

For our next release I want to improve the default options of KWin. For me it is very difficult to find good default options as I have adjusted KWin to fit my personal needs very well, so I need your help.

If you have ideas for better default options please post them in our Wiki on the Default Options page. Everybody can participate, all you need is a 4.8 installation of the KDE Plasma Workspaces.

You can also use the Wiki page to comment on some suggested changes and best is if you are able to open a review request for your change 🙂

Just as a small reminder: if you want to help the KWin development team you can also checkout our ideas.

On Getting Help for KWin and Helping KWin

Let me start this post with a big THANK YOU to our sysadmins and web designers for the awesome job on upgrading bugs.kde.org. The new design looks really great and the new bugzilla version brings some quite nice features. I really like the improved reports page and the HTML mails (although I normally never use HTML mails).

Currently a huge topic in the KWin channel is about providing help. Pablo has done a great job on documenting the Window Specific Rules. Luca from KDE Forum team asked me for a collection of things we could ask users to provide when providing support. I realized that this can be difficult, but that KWin itself knows everything which would help during support. So I added a d-bus and KWin Scripting call to print out support information.

qdbus org.kde.kwin /KWin supportInformation

or

print(workspace.supportInformation())

prints out a wonderful summary of the current state of KWin including used options, used compositing backend and relevant OpenGL driver capabilities. We plan to make this information even more accessible by adding it to our “useractions” menu.

For those who need help on writing KWin Scripts, I updated the KWin Scripting Tutorial to match the new API as used in 4.9. The example used in this tutorial got also updated in the kde-examples git repository. You will soon find there more examples: I intend to submit all the example code I write to test the API to this repository. The declarative scripting support has been merged into master and I intend to finalize the JavaScript bindings for KWin Effects this week.

But we do not only provide help, we also need more helping hands. And luckily we also get help. Just today I pushed a commit of a new contributor who refactored our inclusion checks for windows in the window switcher. Thanks a lot to Stefano for this great work.

Of course I have many more ideas for where KWin could be improved and I also have many ideas for small tasks a new KWin developer could solve (of course with mentoring), so I wrote them down in our community wiki. If you always wanted to contribute something to KWin, check out our Ideas and claim one for work. If you have any questions about one of the ideas feel free to contact us on IRC or mailing list.

The Costs of Supporting Legacy Hardware

The interesting IT news of last week is probably that the next Mac OS X version will drop support for some legacy hardware. Looking back at the history of Apple we see that this is not the first time, but that the company dropped support for old hardware quite regularly by changing the CPU architecture. This time it is different as the GPU is the reason for the drop of support.

This made me wonder what are actually the costs to support legacy hardware in KWin? While it is completely acceptable that new Windows versions and new Mac OS X versions do not run on legacy hardware, there seems to be the demand that free software has to support all kind of legacy hardware. So what does supporting legacy hardware cost for KWin?

What’s important to remember when asking this question is that supporting legacy hardware has nothing to do with supporting low end hardware. That is supporting OpenGL ES 2.0 hardware is in fact an improvement as most of the code is shared with the OpenGL 2 backend, but supporting OpenGL 1.x hardware really requires different code paths. So optimizing for low end hardware improves the overall system while optimizing the legacy hardware might in fact decrease the quality of the overall system.

So what is the legacy hardware we are facing with KWin? Well basically anything not supporting at least OpenGL 2.0 and not supporting non-power-of-two (NPOT) textures. The latter ones are really causing headaches as we are unable to develop for it and have broken support for it during the last release cycles.

Up until recently Mesa did not support OpenGL 2, but this is nowadays no problem any more, so we can be sure that if OpenGL 2 is not supported, the hardware is lacking features. On ATI/AMD OpenGL 2 has been supported since the R300 (with limitations in NPOT support) which got released in 2002. On NVIDIA OpenGL 2 has been supported since NV40 which got released in 2004. On Intel OpenGL 2 has been supported since I965 which got released in 2006. (All this information is taken from KWin code)

This means if I talk of legacy hardware it means hardware which is at least six years old. Supporting such hardware comes with some costs. E.g. on Intel you have the problem that you cannot buy the GPUs, that is you have to get a six year old system just to test. With ATI I faced the problem that even if I wanted to test an old R200 I cannot install it in my system because my system does not come with an AGP socket anymore – the same holds true for old NVIDIA systems.

So the only possible solution to test on real hardware which is not OpenGL 2 capable means to use hardware as old as the GPU to test. As there is the saying that free software development is about “scratching his own itch”, I must admit that I cannot scratch any itch with running legacy hardware. Especially not when I want to develop. I have a rather powerful system to not have to wait for compile jobs to finish. Developing on a several year old single core system with maybe a gigabyte of RAM is nothing I want to do.

So in fact we cannot develop for the legacy hardware. Now let’s have a look at the costs for us to have legacy hardware support. In KWin this comes as the OpenGL 1.x backend and to a certain degree also as the XRender backend. XRender has a some usefulness without considering legacy hardware as it provides translucency for virtual systems. Nevertheless we should consider it as a legacy support system. According to SLOCCount the XRender backend has a size of about 1000 lines of code. But I can only count the discrete source files for XRender. It does not consider the branches in other code pathes and so on.

Getting an overview of the OpenGL 1.x related code is rather difficult. SLOCCount cannot help as the code just uses different code branches in the same files. Looking at the code it is clear that there are several hundred lines of code dedicated to OpenGL 1.x. This is unfortunately also scattered around many files. Overall about 5 % of our core code base  is dedicated for supporting legacy hardware. All OpenGL 1.x related code is also ifdefed to hide it from the gles backends. So each dedicated OpenGL 1.x call comes with an additional ifdef and in many effects there is a branch for OpenGL 1 and for OpenGL 2.

To sum it up: we have increased complexity, increased maintenance costs and lots of code just for OpenGL 1.x related hardware which we cannot really test. So a rather bad situation. Additionally it is nothing which we can continue to support in the future. Neither Wayland nor Qt 5 will make sense on such hardware (XRender based compositing might still make sense with Qt 5, but as the name says not with Wayland).

Given this the logical step would be to remove the OpenGL 1.x related code completely. This would of course clash with the demand of some user groups thinking we have to run on old legacy hardware. In the case of Intel GPUs it might be in fact true that there is still a larger number of users around – this is of course difficult to judge.

Another real issue for removing is that the proprietary ATI driver (aka Catalyst/fglrx) only provides a decent compositing performance with indirect rendering restricting the available API to OpenGL 1.x. So removing OpenGL 1.x support would mean removing OpenGL compositing support for all fglrx powered systems even if the GPU supports OpenGL 4. But to be honest: given that the radeon driver has no problems with OpenGL 2 on the same hardware, I would not mind removing support for proprietary drivers.

What might be a nice solution to this problem are the llvmpipe drivers in Mesa which hopefully provide a good enough experience without hardware support. At least Fedora wants to use llvmpipe drivers for GNOME Shell. As soon as Mesa 8.0 hits my Debian testing system I will evaluate the usage of llvmpipe drivers for KWin as this will hopefully improve our experience on virtual machines. If I am satisfied with the performance, I will be tempted to remove the OpenGL 1.x based legacy code…

Enabling Others to do Awesome

Recently Aaron wrote a blog series for the introduction of Spark, I want to cite a central saying of one post:

I want the things which I help make to become opportunities for others in their turn to participate with their own voice, their own movement and their own passion.

If I reflect my own motivation for my work on KWin and especially the areas of work I decided to work on in the 4.9 cycle I see quite some parallels to the paragraph cited above. But personally I would phrase it slightly different:

I want to help others to do awesome.

This describes perfectly what I am currently working on. I no longer want to write fancy effects – in fact I stopped adding effects quite some time ago. I don’t want to extend KWin to be the window manager which incorporates all other window manager concepts no matter how useful they are – we stopped doing that as well.

But still I want that our users get the window manager they want. Whether it is fancy effects or a tiling window manager or new concepts for virtual desktops, KWin should be the base for it.

At the heart of all these efforts we have the scripting bindings. While we already had bindings since 4.6 they never really got used – this will change 🙂 But JavaScript bindings is just one part of the game, the other part is declarative, that is QML, bindings.

In 4.8 we already experimented with QML for the window switcher layouts to test whether QML fits our needs and I am very happy so far with it. But 4.8 does not yet include the possibility to really write own layouts. While it is possible to do so, there is no way to configure a custom one or even distribute this.

For 4.9 the installation of the window switcher has been adjusted to use the Plasma Package structure which makes it possible to install window switcher through the plasmapkg tool. But this is only part of it: plasmapkg has been extended to support any kind of scriptable KWin content, be it window switchers, KWin scripts or KWin effects written in JavaScript (decoration to be added soon).

For this KWin scripts follow also the Plasma Package structure which is quite awesome as it finally allows to dynamically enable/disable scripts through our KCM:

This dialog wants to tell me: “I want Get Hot New Stuff integration” to directly download new scripts from the Internet. And sure it does need that and this will be added for the 4.9 release.

The screenshot shows two scripts I’m currently working on – both will be shipped with KWin in 4.9. Videowall is a script which scales fullscreen video players over all attached screens to generate a video wall. This is the first script which actually replaces functionality from KWin core. KWin had the functionality to disable multiscreen support for fullscreen windows and that really cluttered both code and UI. And it just did not make any sense. There are just no valid usecases to have in general fullscreen windows span all screens, except for video walls. And that’s what we have here: a small KWin script to make an obsoleted functionality sane. We improved KWin for everyone by removing an difficult and confusing control module without taking away the functionality for expert users.

But even more interesting than the video wall is the other script. This is not a JavaScript based KWin script, but a declarative QML script. It will replace the existing C++ based implementation of the desktop change OSD without any functionality loss. Which means less code and much more readable code 🙂

And what’s really awesome: JavaScript and QML have the same bindings, the API is exactly the same. So going from QML to JavaScript and vice versa is extremely simple. But that’s not all with QML based KWin scripts you can include live window thumbnails. So this is a technology to allow you to do awesome new switchers like Present Windows or Desktop Grid.

As you notice I’m currently dogfooding the bindings to myself. This helps me to see what is needed, what can be improved and to ensure that the bindings will work for any given usecase we can imagine. My wish is to see for example the complete window tiling support in KWin to be rewritten as a KWin script. This should be possible and would proof that you can use scripting to get a completely different window management.

So if you want to make awesome things with your window manager, now is the time to get started. Don’t hesitate to contact me and demand further bindings if anything is missing.

Disclaimer: QML support has not yet been merged into master.

About Compositors and Game Rendering Performance

Today Phoronix published (again) test results comparing the Game Rendering Performance on various desktop environments. As it “seems” like the performance of Game Rendering under KWin got worse in comparison to last year I want to point out a few things.

First of all: keep in mind that this is a test of Game Rendering Performance and doesn’t tell anything about the performance of tasks that matter. The development focus of KWin is clearly not on being great for games. We want to be (and are) the best composited window manager for desktop systems. That is what matters that is what we fine tune the system for.

Another important fact to know is that last years test was seriously flawed and I think this years test is flawed in a similar way. Last year KWin used by default unredirection of fullscreen windows while no other composited window manager in the test did that. With 4.7 we adjusted the default and turned unredirection off. But at the same time Mutter received to my knowledge unredirection of fullscreen windows. In case it is enabled in Mutter we have the explanation for last years bad results and this years good results.

If I would perform such a test, I would not benchmark KWin once but once for OpenGL 2.x backend, once for OpenGL ES 2.0 backend, once for OpenGL 1.x backend, once for XRender backend, the same set with unredirection of fullscreen windows turned on and once without compositing at all. We see there are so many things that would influence the game rendering performance that just one run of the benchmark is not enough.

But still we would recommend to turn compositing off when playing games. At least that is what I would do. A window manager is mostly just in the way of games and that is one of the reasons why gaming on desktop is by far not as good as playing on a gaming console. So if you want to game with KWin use the feature to specify a window specific rule to block compositing as long as the game is running. This will yield the best game rendering performance.

KWin Effects written in JavaScript

Today I cannot make such a nice announcement as Aaron yesterday, but I can at least try announce something I personally consider as awesome.

This weekend I tried to make it possible to write KWin effects in JavaScript. After about two hours of work the effect loader was adjusted to load a Qt script instead of the library written in C++. This is a quite important step for the future of effects in KWin. It finally makes it possible to share effects via Get Hot New Stuff, so that our users can download new effects directly from the control module.

For packaging effects we use the well established Plasma Package structure, so that our script developers only need to know this one common way. The API itself will share as much as possible with the KWin scripting API – of course with adjustments for effects. For animating the API is based on the AnimationEffect introduced in 4.8.

From a performance point of view using JavaScript does not change anything. Our effect system has two phases: one to react on changes in the window manager (e.g. a window got activated) and one to perform the rendering. The scripting API only interacts with the window manager, so all the rendering is still good old C++ code – a similar approach to QML.

Now I guess you want to know what you can do with it. So here I present for example a Fade like effect written in JavaScript (for comparison: C++ version is > 200 SLOC):

var duration = 250;
effects.windowAdded.connect(function(w) {
    effect.animate(w, Effect.Opacity, duration, 1.0);
});
effects.windowClosed.connect(function(w) {
    effect.animate(w, Effect.Opacity, duration, 0.0, 1.0);
});

For us KWin core developers the scripted effects will be an important step as well. For quite some time we have been unhappy with the fact that there are too many effects which become difficult to maintain – especially if we have to adjust the API. With effects written in JavaScript this becomes much simpler. As we do not have to keep the ABI (API compatibility is enough) stable we can move effects written in JavaScript out of the source tree and make them available for download.

At the moment the JavaScript API is just at the beginning. But I expect it to evolve over the course of the current release cycle. For me the scripts are rather important as it also provides us an easy way to have device specific adjustments.

As I wrote currently the scripts do not operate during the rendering. Because of that we don’t have bindings for WebGL. This would at the moment not make any sense. Nevertheless it might be that we allow to upload custom shaders, but I won’t pursue such a task in the 4.9 cycle.

Create Temporary Desktops For Applications

There are applications which are more or less a mess for a window manager. For example The GIMP opens quite a lot of windows and you want to have all of those windows visible. In general you don’t want to have any other window on the same desktop

The solution to that is to move GIMP on it’s own desktop. But how? We can use static window rules to get this working, but what if there are already windows on that desktop? The perfect solution to that would be to have a desktop which gets created when you open GIMP and gets removed again when GIMP closes.

This was so far not yet possible without manual interaction. But with todays additions to KWin scripting this became possible. Here I present a KWin script which does exactly that:

workspace.clientAdded.connect(function(client) {
  if (client.resourceClass == "gimp-2.6" && client.windowRole == "gimp-image-window") {
    // create a new workspace for the Gimp image window (kind of the main window)
    // switch to the new desktop and send the gimp window to it
    workspace.desktops = workspace.desktops+1;
    workspace.currentDesktop = workspace.desktops;
    client.desktop = workspace.currentDesktop;
  } else if (client.resourceClass == "gimp-2.6") {
    // send all other gimp windows to the current desktop
    client.desktop = workspace.currentDesktop;
  }
});

workspace.clientRemoved.connect(function(client) {
  if (client.resourceClass == "gimp-2.6" && client.windowRole == "gimp-image-window") {
    // when closing the gimp window let's remove the last desktop
    workspace.desktops = workspace.desktops-1;
  }
});

I should really start to publish the quite useful example scripts I write to test the scripting functionality on places like kde-apps 🙂 The API for 4.9 is documented on Techbase

The Importance of Mentoring

Currently the KWin team is rewriting the work of two past Google Summer of Code projects. This is of course the worst thing which can happen about the projects. In retrospection we clearly have to say that the projects actually were failures – at least for the developer community. But both students succeeded their project, so we cannot say it’s the fault of the students. On the other hand the projects had different mentors, so blaming the mentors is too easy as well.

In this blog post I want to reflect why we consider the projects after more than one (respectively two) years as failures. What did go wrong and what can be improved in future projects? I hope this can be a help for more projects than just KWin.

I will base all examples on scripting – the project I am currently rewriting. Just to give an example of the scope: when scripting got imported into trunk it consisted of 3200 SLOC and now after the rewrite is almost finished it is down to about 500 SLOC which are mostly written by me. At the same time the provided functionality increased.

Don’t expect Students to Understand Complex Code

The scripting project should make it possible to have scripts run when “something happens”. E.g. if a window gets maximized the scripts should be notified. In the Qt way the best way to achieve that is by emitting a signal. Now this is what our student did. But in all cases I found so far the signals were emitted in the wrong place. So what is wrong?

KWin core works in a way that a user action triggers a method. E.g. entering the fullScreen mode will end up in Client::setFullScreen. But this method does not just perform setting the window to fullScreen, it also evaluates first whether it is feasible to set the window to fullscreen. For example the user might have established a window specific rule to disallow this window to go fullscreen. In that case the method will not change the state of the window.

The common pattern our student introduced was to emit the signal before the method had evaluated whether the window will change the state. So the scripts are notified with potentially wrong state change information.

Of course we cannot expect that the student for whom the code is completely new will understand these concepts. If you don’t know the internals of an application the behavior is in fact unexpected especially if it is only partially documented or commented.

Given this experience it is important to give a student enough time to get familiar with the rather complex code base. In this time it is important to provide the required help. In the example above it would have been a good advice to emit the signals whenever the effects are invoked – which happens at the same place (nowadays the notification of scripting and effects are merged) through direct method invocation.

Work in master

The Scripting GSoC got implemented in an SVN branch. For me as a team member and not being the mentor it was difficult to follow the development. In the end the branch got merged into SVN trunk without a review done by the team.

Some of the issues are resolved nowadays thanks to the git migration. So even if a student works in an own branch the team mates would get the commit mails and would be able to do a post-commit review on each commit. But still working in a branch for a long time brings disadvantages. Most likely the student is disconnected from the work. The team mates might work on the same code area, making merging more difficult – especially for a young developer who also has to learn to work with a complex VCS such as git.

So I think that it is most important to have the work been done in master (or any other development branch) directly. This might be tricky as KDE SC’s release schedule does not align well with GSoC, but as soon as the release branch is created there is no reason to not work on master.

Even while master is frozen the student should follow the common pattern and propose each change as a Review Request. This gives early feedback to the student and moves the burden of mentoring to the shoulders of the complete team. The team mates know what the student is working on and can provide early help and spot potential problems even if the mentor does not spot them. Remember: it’s not your student, it’s the team’s student.

Interfere before the student runs in the wrong direction

One of the tasks of a mentor should be to provide guidance to the student and ensure that the project goes in the right direction. I remember that my mentor did exactly that at one point were I started to do fancy stuff.

In case of the scripting project the student started to implement a kind of JavaScript extension for “Lazy Logic”. This was clearly not in the scope of the project, it might have been fun to implement for the student, but it’s nothing which is needed in a window manager. That’s just the wrong place to design new language features for JavaScript.

Given that the code was undocumented and I did not find any documentation explaining how this language feature works or why I would need it and last but not least I did not understand the code, it was one of the first code parts I dropped. This would not have been needed. The student should have concentrated on the task he is proposed to do.

Remember that the world is round

Yes, there are time zones. Yes most mentors have a day job and are restricted in the time they are available. It is no help to the project if the student works while the mentor sleeps and the student has to wait a day when he needs to ask questions to continue the project.

I remember that we had one project with the student living in Mexico and the mentor living in Australia. Of course this is a rather sub optimal combination. Don’t expect that the student will adjust his sleep rhythm. Even as a GSoC student he has the right for a normal social life.

Personally I decided not to mentor a student who doesn’t live in a European timezone. I just acknowledge with that, that I am constrained in time and that also all team members live in Europe, so we just cannot mentor students living on the other side of the world.

Communicate!

Communication is in my opinion one of the central aspects for a successful projects. During the project I mentored last year I tried to discuss the state of the project each day. And with communication I do not only mean e-mail or IRC, but also phone and personal meetings. If you live close to each other it might be a good idea to meet at least once, if the student lives in Europe Akademy is a must!

But communication is not only important with the mentor. Also with the complete team. The student should subscribe to the mailing list, read and answer review requests, be present in the IRC channel. His project benefits from it and the chances are better that the student stays after noticing how great the KDE community works.

Require Documentation

No code should be merged without documentation and without unit tests (if your project uses them). There is no excuse for a young developer to not write documentation. If the student works on a new area of code it is extremely important to have everything documented in a way that any of your team members can continue working with the code.

In case of scripting the code was lacking any documentation not even a high level description of the design was provided. This made it impossible to continue to work with the project. Trying to understand undocumented code can be more difficult than rewriting from scratch.

During a GSoC project you have the chance to enforce documentation. Make it clear that the student will not pass the final evaluation if the code is not documented. Documentation is not a nice candy, but at least as important as the code itself. Undocumented code is just unacceptable in the year 2012.

Be Prepared for the Worst

The worst for the developer team is that the student stops working with the last day of GSoC. This is bad but happens. The team has to be able to take over the project. A code dump is no solution and in doubt better not merge in the project than introduce bugs and instability. Yes that means that a GSoC project was wasted but it prevents a degeneration of the code base and does not bind your teammates to fix up the code.

In case of scripting we got a code dump which was completely undocumented and basically we have never seen anything of the student again. For me it would have been easier to just write the bindings from scratch than to fix up the project. Between the end of the project and my rewrite I had to fight several times with strange things done in scripting. So overall the project costs for the core team were higher than the benefits.

Adjust the proposed projects to the fact that the student will not be around after the project. $SUPERAWESOMEFEATURE is just bit crap if it cannot be maintained by your team. Use projects were you are sure that it will benefit the team even if the student will never touch the code again.

Adjust Your Own Expectations

Many mentors try to get just “cheap” work done and have the dream to get a new team member which might some day replace their position in the team. This might happen, but is rather unlikely. If that is your aim, you might head in the wrong direction. Now I can say lots about it, but there are people who can do that better, so I recommend to read the slides by Leslie Hawthorn from this years linux.conf.au.

The KWin team has learned from the experience with our failed projects. During last years project I was holding the hand of my student. For me it was important to get good code written and not much code or have him working on new areas. Also this year I will not mentor a project which would introduce a new area in KWin. E.g. Wayland support is out of bounds for a GSoC.