14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
This code is simpler than Vello (the new name for piet-gpu), focused on vector path rendering. It's also a strong demo of the power of WebGPU, while also having a performant software-only pipeline. I definitely encourage people to take a closer look.
comment 3y ago · link · parent
comment 4y ago · link · parent
Disclosure: Google Fonts funded Matt's work and I was involved in the decision to do so.
comment 4y ago · link · parent
comment 4y ago · link · parent
Of course people will get excited. If Elon were to flog a "Hunter Biden's laptop" story that turned out to be that its hard drive was 4500 RPM when the SKU was marketed as 5400, and that capacity was measured in gigabytes rather than gibibytes, people would still get excited. Facts have little to do with any of this, it's all a post-modern, post-truth exercise in perceptions.
comment 4y ago · link · parent
I think this has always been the goal, but it wasn't obvious at the outset that it would be achievable. The fact that we now have empirical evidence in real shipping products is significant.
comment 4y ago · link · parent
There's also a bunch of stuff in there about Euler spirals (aka clothoids), including application to railways - see section 6.6, page 106. Fun fact, I'm going to get my first tattoo soon, and it will be an Euler spiral.
comment 4y ago · link · parent
Honestly, I don't think services need to be dumbed down so much, people can figure it out. And having a little friction might be a good thing, unless the goal is just to rack up engagement numbers as high as they can be optimized - and arguably that incentive is one of the things that was really wrong with Twitter.
comment 4y ago · link · parent
And the feeling is... very different. There was lots about Twitter that subtly enraged me, like pop-sci Covid takes showing up in my algorithmic feed after I had extremely carefully curated my followers to only include actual scientists who knew what they were talking about. And it's also refreshing not to have all those ads. In general, I feel like you've got a lot of control of your Mastodon experience, if you curate your followers well, it can be quite good. I have rules of immediately "unfollow boosts of" anybody who posts viral "boost this if..." or bullshit polls, and that's cleaning up my feed as well.
I've also been followed by my first crypto account (so I might go to followers-need-approval), and have seen glimmers of the same kind of dumb drama you see on Twitter, but overall feel like I generally have the tools I need to keep all that in check. I was finding that Twitter was bad for my mental health, and took a bunch of breaks from it even when I was having generally positive interactions and finding good info. We'll see how this goes, especially as things scale.
comment 4y ago · link · parent
comment 4y ago · link · parent
Also a warning, right shifting a negative number gives the expected result (arithmetic right shift) in C++20, but is still implementation defined even in the C23 draft spec. Likely you're good, but the spec doesn't guarantee it.
comment 4y ago · link · parent
One thing that gets me is that, putting aside the question about whether one side or the other is right, the culture war stuff is just incredibly stupid. It's like people have gotten a lobotomy and their ability to do critical reasoning and respond to empirical data has been replaced with just pure tribal identity. My sense is that this is happening across the country (and perhaps to some extent the world), and HN actually has it easier than a lot of other places.
comment 4y ago · link · parent
comment 4y ago · link · parent
It didn't work out. It turns out to be very complex to support modern UI, and making it async upped the complexity even more. I'm not saying this couldn't be done, but these days I'm much more interested in UI architectures where everything is in process and more tightly coupled.
comment 4y ago · link · parent
comment 4y ago · link · parent
A couple examples. [1] computes the sum of the number of bytes used of four consecutive segments of a bezier path - each segment can be lineto, quadto, or curveto, can be the end of a path or not, and be i16 or f32. 4 tag bytes are packed into a 32 bit word, it computes all these, then sums them together.
[2] linearizes a recursive subdivision into an iterative loop. The stack depth is represented as the number of zeros in a word, so pushing the stack is a left shift, and popping is a right shift. It turns out you want to pop multiple levels at once, and the number of levels is computed by countTrailingZeros. ([2] is experimental Rust code, but I will adapt this into a compute shader)
[1]: https://github.com/linebender/piet-gpu/blob/main/piet-wgsl/s...
[2]: https://github.com/linebender/kurbo/blob/euler/src/euler.rs#...
comment 4y ago · link · parent
Vulkan has a perfectly fine memory model, and it's non-optional in Vulkan 1.3. The rest of GPU land of course has some catching up to do. It guarantees atomicity but does not guarantee progress (there's active work on characterizing that). And fairness is probably not something you want, as it almost always comes at a performance cost.
comment 4y ago · link · parent
comment 4y ago · link · parent
I'll also point out that fma is relatively new, so it's pretty easy to write code that works fine when compiled with default x86_64/SSE2 but will break when compiled for a more recent target cpu.
comment 4y ago · link · parent
[1]: https://randomascii.wordpress.com/2012/03/21/intermediate-fl...