- On Thursday I had my last university exam (Computational Complexity). Unless I fail, and I hope I don't, I finished university!
- In the last two weeks of university, I had more and more free time so I began working again on my GSoC project. The current things that are waiting to happen are:
- Fix the triangulation refinement implementation. For those who are not familiar with the algorithm behind the scene, the algorithm itself is based on interpolation of image differences in a triangular mesh. Therfor, it is a critical part.
The algorithm currently would get stuck in an infinite loop of refining the triangulation, even though it was gauranteed to stop (meaning an implementation bug). I think I just fixed it now (now as in 5 minutes ago), more on this below. - Make the algorithm iterate over tiles inside of allocating a big chunk of memory, and thus limiting the maximal image size for the algorithm.
- Fix memory leaks (there are several known leaks, and hopefully none unknown).
- Improve a small glitch on the borders of the image.
- Optimize the speed!
- Get it reviewed, and merge back to master.
- Being free of university, and free from other work (I have a day work on which I don't work "after-hours"), I'm now free from chores on evenings (if I get home at sane hours) and weekends. For the first time in the last 3.5 years, I really have free time with nothing on my mind. So don't worry, I'll get into GIMP :D
- Last time I left the geometry library, I was completly stuck with no idea what was the bug.
- When I got to it again, I decided to re-write it in a language which is more type-safe (no pointer bugs), with less memory issues (garbage collection), and much easier to debug (no offense, but gdb isn't always ideal). Eventually I chose C# (and not Java, my favorite language) in order to learn a bit.
- I have been spending my free time between the exams, in the last two weekends, to re-write the library. The re-write was something like "look at the code and write it in a different language". Almost no structural changes or anything, so that I'll keep synced with the source.
- And then I found the bug...
// Relevant type declarations: typedef enum { INCIRCLE_ON, INCIRCLE_INSIDE, INCIRCLE_OUTSIDE } P2tRInCircle; // Types from GLib typedef int gint; typedef gint gboolean; // The function I called P2tRInCircle p2tr_math_incircle (P2tRPoint* a, P2tRPoint* b, P2tRPoint* c, P2tRPoint* d); // Somewhere in the code, in the function that I knew that // was deeply related to the problem: gboolean inside = p2tr_math_incircle (p, a, q, b); if (inside) { ... }
I don't even feel like explaining this. It is so trivial (and if not, go learn C!) Other than feeling
So, Hurray for C#, Hurray for end of University (hopefully) at least untill second degree, and just some other random hapiness. And don't worry, I'm not gone yet :)
Edit: More silly bugs found. I'm starting to like re-writing stuff - way better than debugging...
Edit 2 (February 11th, 2012): The geometry library works, at least in C#. Now it's time to re-implement in C.
Beautiful news!
ReplyDeleteReturn soon to the Gimp!
If possible to help in the bug list Gimp 2.8 :-)
There is a great team effort (true warriors), but there are still 18 errors for the birth of Gimp 2.8.
I can not wait to participate in the birth of this child named Gimp 2.8;-)
Sorry for the mistakes in the text, I used the google translator.
Maybe you can even make use of the dubious conversion of integer to boolean and define:
ReplyDeletetypedef enum
{
INCIRCLE_ON = 1,
INCIRCLE_INSIDE = 2,
INCIRCLE_OUTSIDE = 0
} P2tRInCircle;
Then it's "true" for INCIRCLE_ON and INCIRCLE_INSIDE and "false" (0) for INCIRCLE_OUTSIDE
Shouldn't compiler warnings be able to pick up these types of bugs? Turning on all of the compiler warnings always helps me out a great deal :).
ReplyDeleteYup, obviously should have been: gboolean inside = (p2tr_math_incircle (p, a, q, b) == INCIRCLE_INSIDE);
ReplyDeleteInstead, I'm guessing inside was only false when INCIRCLE_ON was returned -- first one defaults to 0 correct?
Keep up the good work! :-)
ReplyDeleteNice work! Like so many others, I'm very grateful that you have devoted time to this project.
ReplyDeleteThanks very much for the tool, you are a real asset to the libre design world.
ReplyDelete