14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions
comment 6y ago · link · parent
This thing looks very unpleasant, but hopefully it conveys the message that Zig is potentially valuable. Figuring out how to fund such a project and organize the community is a hard problem, and again I wish them well in finding a good path.
comment 6y ago · link · parent
If done carefully, this would give you smoother animations at considerably lower power consumption than traditional triple buffering. It's not the way present APIs are designed today, though, one of my many sadnesses.
As I hinted, this is a good way to synchronize window resize as well. The window manager tells the application, "as of frame number 98765, your new size is 2345x1234." It also sends the window frame and shadows etc with the same frame number. These are treated as a transaction; both have to arrive before the deadline for the transaction to go through. This is not rocket science, but requires careful attention to detail.
comment 6y ago · link · parent
But I don't want to underestimate the engineering challenges either. You'd have to make this stuff actually work.
comment 6y ago · link · parent
comment 6y ago · link · parent
Counting Intel, most (by number) desktop devices have pretty sophisticated hardware layer capabilities. Sky Lake has 3 display pipes, each of which has 3 display planes and a cursor. The multiple pipes are probably mostly used for multi-monitor configurations, but it's still a decent setup. From the hints I've picked up, I believe DirectFlip was largely engineered for this hardware.
There are lots of interesting latency-reducing tricks. Some of those might be good inspiration, but what I'm advocating is a general interface that lets applications reliably get good performance.
Thanks for the discussion!
1087.
The compositor is evil(raphlinus.github.io ↗)
248 points · by raphlinus · 6y ago · 175 comments
comment 6y ago · link · parent
That person is definitely not helping the perception that a significant fraction of the cryptofinance community is scammers, and that their presence has a negative effect on the community.
comment 6y ago · link · parent
I'll have to check out the Kmett talk - from the description it sounds very interesting.
comment 6y ago · link · parent
I think examples like generating mergesort from insertion sort are maybe trying to be too clever. I mostly just want something that lets you slice up the problem into chunks, process each chunk in parallel, then combine them back in ways that don't kill performance on modern GPU hardware.
comment 6y ago · link · parent
comment 6y ago · link · parent
My personal feeling is that as PC's become more locked down and less under user control, paying for the digitally signed version might increasingly become a viable business model. Trademarks and TOS enforcement might be a more effective moat against being undercut than copyrights and licenses.
comment 6y ago · link · parent
The problem is slightly different, though, because the major focus for transparency is concurrent writing from potentially many different shaders, while in the stack case each thread can build its data structure without any concurrency or need for atomics; once an aggregate is built, it is "published" (see my prefix sum blog for details on that) and treated as immutable.
These kinds of concurrent approaches do become important for later stages in the JSON parsing process, like building hashmaps for keys in a dictionary. I'm pretty sure the whole problem is tractable and have thoughts how to solve it, but deliberately kept the scope of this blog post limited, as I figured it was challenging enough. But it's very cool to reach people who appreciate the ideas, and if you find anything else that's relevant, I'd love to hear from you.
[1]: https://on-demand.gputechconf.com/gtc/2014/presentations/S43...
comment 6y ago · link · parent
I think there are probably a number of on-ramps. One easy way to get started is shadertoy, which if nothing else should give familiarity with GLSL syntax and intuition for performance in the simplest case: each "thread" computes something (a pixel value) independently of the others. You'll quickly run into limitations though, as it can't really do any of the more advanced compute stuff. I think as WebGPU becomes real, an analogous tool that unlocks compute kernels (aka compute shaders) could be very powerful for pedagogy.
I think most people that do compute on GPU use CUDA, as it's the only really practical toolchain for it. That has a large number of high quality open source libraries, which tend to be well-documented and have good research papers behind them. You can start by using these libraries, then digging deeper to see how they're implemented.
As I've been going on about, I believe this space is ripe for major growth in the next decade or so. As a rough guide, if you can make your algorithm fit the GPU compute model nicely, you'll get about 10x the compute per dollar, which is effectively the same as compute per watt. Why leave such performance on the table? The answer is that programming GPUs is just too hard. In certain areas, including machine learning, an investment of research has partially fixed that problem. But in others there is fruit at medium height, ripe for the picking. And in some other areas, you'll need a tall ladder, of which I believe a solid understanding of monoids is but one rung.
comment 6y ago · link · parent
The fact that these listings are so easily gamed is to me a sign of something seriously wrong at Amazon. I know from experience how hard the abuse problem is (it was my job for a couple years at Google), but this should be Amazon's bread and butter.
comment 6y ago · link · parent
1100.
The Stack Monoid(raphlinus.github.io ↗)
195 points · by raphlinus · 6y ago · 47 comments
comment 6y ago · link · parent
comment 6y ago · link · parent
comment 6y ago · link · parent
https://raphlinus.github.io/programming/rust/2018/08/17/unde...
comment 6y ago · link · parent
Not exactly obj-C, but there are also problems two inconsistent ways of wrapping other macOS types: some (like the Metal crate) use foreign_types, while others use the TCFType mechanism. Among other things, these have two different meanings for "Ref" types, which can be very confusing.
So it's possible to get stuff done, but it doesn't feel nice. By contrast, the Rust/Windows world pretty well organized, with Peter Atashian's winapi providing a solid foundation, the wio crate being a good way to get ComPtr and other utilities, and Microsoft's com-rs coming soon as a standard way to do Rust-side implementation of COM interfaces.
comment 6y ago · link · parent
comment 6y ago · link · parent
The downside is the complexity. Now there are more things that can go wrong: the OT algorithm can fail (either due to bugs or because of corrupted data), and now also the distributed consensus algorithm can fail as well. When you have this level of complexity, going to CRDT is pretty appealing as an alternative.