Posts by gfxstrand@social.treehouse.systems
(DIR) Post #B4YirlmN3B76UidMn2 by gfxstrand@social.treehouse.systems
0 likes, 2 repeats
New blog post out!"Re-thinking framebuffers in PanVK"https://col.la/framebufferspanvk
(DIR) Post #B650Z2Riv9AaiZQYq0 by gfxstrand@social.treehouse.systems
0 likes, 2 repeats
RE: https://floss.social/@collabora/116533723198138565In case you missed, it, my blog post about memory optimization in NIR was published today.RT: https://floss.social/users/collabora/statuses/116533723198138565
(DIR) Post #B6jXrZzYU7Aw8yqeNk by gfxstrand@social.treehouse.systems
0 likes, 0 repeats
II complain about #freedesktop GitLab reliability sometimes but it could be worse. We could be on GitHub.
(DIR) Post #B6kbUAeD8rQ7r1uy6i by gfxstrand@social.treehouse.systems
0 likes, 1 repeats
Hey, look! I wrote another compiler.https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41841
(DIR) Post #B6kbUCKms34V5MqU6q by gfxstrand@social.treehouse.systems
0 likes, 0 repeats
Eventually, if I write enough of these, I might actually get good at it. š
(DIR) Post #B81lxdReZPB5XasS9o by gfxstrand@social.treehouse.systems
0 likes, 1 repeats
Yesterday, I was talking to a colleague about what Iām doing on the Panfrost compiler and I mentioned that I typed out texture support the other evening while watching TV. Their immediate response was, āWhy didnāt you use AI? If you can do it while watching TV, Claude can probably do it.āIām so tired of this. Why do I need to justify how Iām writing code? Especially, why do I have to justify it to someone who demonstrably canāt write a compiler? I donāt.But also, I will. So hereās 3 better things I can do with an easy project than feed it to a chatbot:
(DIR) Post #B81lxhn4Pigb1Avc5w by gfxstrand@social.treehouse.systems
0 likes, 0 repeats
Take a break. I like writing code. There are plenty of parts of my job that I find stressful but writing code isnāt one of them. I enjoy it. And sometimes I need an easy little project.Maybe itās Friday afternoon and Iāve got a few more hours but donāt want to start something big. Or maybe Iām having an off day and I canāt do research grade compiler theory. Or maybe I just want to relax in the evening with a glass of wine and an easy coding project.
(DIR) Post #B81lxjOKSg5Fz1MsoC by gfxstrand@social.treehouse.systems
0 likes, 0 repeats
Give it to a junior dev and let them learn. No one learns compilers by staring with register allocation. You have to start small. You start with āhook up the rest of the float ops.ā Yes, Claude could probably do that. But Claude wonāt learn and Claude wonāt turn a junior developer into a senior.
(DIR) Post #B81lzQzrp5V3VqjqOe by gfxstrand@social.treehouse.systems
0 likes, 0 repeats
Do it right. Even though I was distracted by the television, my texture code pretty much worked on the first try. I found out a couple days later that I missed a single line in a match statement. Thatās it. All the code was correct. I just missed a line that hooked up the āemit a derivativeā code.If I had Claude do it, it would have output something and it may have even gotten some tests passing. But I would have had to very carefully read every single line to make sure itās correct. āHack on it until it passes testsā is how you get a shitty compiler that falls over in weird corner cases.And no, that isnāt just AI hate. When a human takes that approach to compiler writing, you get the same result. And the answer is usually to do a full human audit and check every enum and every bit.Meanwhile, I can write code faster than I can read it so if I actually care about it being correct, Iām better off just writing it myself from the start.
(DIR) Post #B81lzSgnWxR0lHpdx2 by gfxstrand@social.treehouse.systems
0 likes, 0 repeats
Oh, but isnāt that the same work youād have to do if a junior dev did it? Yes and no.First, if theyāre someone whoās actually trying, even if they donāt really know what theyāre doing, I can assume a certain level of intent. Theyāre not just generating random streams of āprobably closeā tokens and revising until it compiles. That changes where I effort as the reader needs to go.Second, when I spend my time reviewing code from a junior, Iām investing in them as a person and in their skills and their career. When Iām reviewing AI slop, Iām not investing in anything but my own insanity.Third, yeah, sometimes I have to review or fix human slop and I usually get kinda pissed off when that happens. Because when that happens, their starting point might have given me a few pointers but Iām basically rewriting it from scratch at which point why bother with their code. They may have given me a few pointers but if I still have to do 90% of the effort, what are we doing?
(DIR) Post #B81lzULxLPx3vE61k8 by gfxstrand@social.treehouse.systems
0 likes, 0 repeats
Going back to the top, can we take a moment to appreciate the absurdity of a man who knows nothing about compilers implying that Iām not doing it right because Iām not using his favorite toy?At the end of April, I told the Panfrost team that, when I got back, I would write them a new compiler over the summer. The optimistic goal is to have all the hard parts pretty much sorted by XDC.That deadline is absolutely insane.And Iām on track.But, sure, tell me how much better/faster it would be if I used AI. š
(DIR) Post #B81lzVrBkmWqaNiU40 by gfxstrand@social.treehouse.systems
0 likes, 1 repeats
This is a classic example of where people miss the forest for the trees. Yes, there are probably tasks here or there which a codebot could get mostly right. But those āspeedupsā donāt matter if Iām fighting bugs later because of it.A huge part of why Iām able to go so fast is because Iām taking my time and getting things right from the start. I can move fast because I know I can trust the code. I can move fast because Iām not constantly finding dumb bugs. There are bugs, to be sure. Iām not perfect. But the bugs are usually minor oversights which are easily caught and fixed. I can move fast because the architecture is sound and Iām not constantly finding deep bugs and rewriting things.If I offload even simple things to a codebot, I either have to fix it up myself until itās at my standards (which would take just as much time as writing it) or accept slop because thatās the easy thing to do. If I accept the slop, then I end up with a sloppy, buggy code base that Iām constantly fighting.Fighting with the code is what takes time. Not writing it. Fighting with it.So yeah, I can cheap out now and pay through the nose for it later or I can invest human time now and get a piece of software that actually works for us, our customers, and our users.