Better HN
topnewbestaskshowjobs
Log inSign up

raphlinus

14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions

I do research on fundamental UI technology and 2D graphics, with a focus on Rust and fonts. @raph@mastodon.online
Submissions

comment 5y ago · link · parent

There's a proposal for a new version that has a much richer imaging model: https://github.com/googlefonts/colr-gradients-spec

comment 5y ago · link · parent

I'm actually not 100% sure what audience would find this most compelling, it's something of an experiment. I'm personally motivated by 2D vector graphics rendering, but that's a pretty small world, and I wouldn't be surprised if the main applications for compute shaders ended up being scientific and machine learning.

comment 5y ago · link · parent

That's a great motivating example for compute shaders, and I'm sure very fun to play with. It should be reasonably straightforward to put the ant-like agent simulation logic on top of the infrastructure in my sample code (either wgpu or the lightweight abstraction layer), and I'd love to see that.

comment 5y ago · link · parent

It's how the internal "AST" for Markdown is represented in pulldown-cmark - a Vec of a node enum. A major motivation was reducing the allocation cost (it's extremely common to do one allocation per node for this kind of thing), but another benefit is that a tricky "splice" information for inline markup (basically, moving a sequence of text spans, possibly with their own emphasis, between two asterisks into a subtree) is pretty easy to represent.

comment 5y ago · link · parent

Sculpted prim. The object was basically a mesh of triangles in a fixed configuration, but the coordinates of the individual vertices were derived from an image (compressed using lossless JPEG2000, as any compression artifacts, not to mention chroma subsampling, would cause really ugly distortion). This was a halfway point between allowing arbitrary meshes and only pre-made object geometries (but with skinnable textures).

http://wiki.secondlife.com/wiki/Sculpted_prim

comment 5y ago · link · parent

Hmm, now I'm a lot less sure. Both this website and the recent Vanity Fair article represent the "Drastic" team as heroes, but establishment public health people are less impressed. Here's a fascinating Twitter thread on the Drastic authors[1], though I'm sure their fans would dismiss this as an ad hominem attack.

The fact that the SPR people are anonymous is something people should be aware of when deciding how much stock to put in them.

[1]: https://twitter.com/wokeglobaltimes/status/13991870957642793...

comment 5y ago · link · parent

That is not necessarily true. In some cases, the compositor maybe configured to sample the input buffer directly from YUV420, applying the transformation on scanout and thereby saving memory bandwidth to read from the framebuffer. This makes a tremendous amount of sense when the source is a video, but much less sense when the source may be rendered vector graphics, which generally look pretty bad with subsampled chroma.

comment 5y ago · link · parent

I never claimed my scale wasn't biased :)

Point 5 could be the "when you don't know, all probabilities are roughly 50%" fallacy, but I think it can also charitably interpreted as belief that a careful weighting of the evidence is roughly equal.

But your points are well taken. I'm not going to edit it here, as I don't think that would be fair to the people who have responded.

Your final paragraph is of course the only reasonable position for the truly open-minded (and actually represents my own position quite well), but I didn't bother to put it on the scale as it seems hardly represented at all, at least in Twitter discussions and HN threads.

comment 5y ago · link · parent

Racism is, I guess, technically orthogonal to one's belief on the lab leak issue, but correlates pretty strongly. I bring it up because it is having an effect, especially in the US - attacks against Asian Americans are way up - and we might be able to do something about it.

By contrast, knowing the origins of Covid doesn't, in fact, have a lot of relevance to preparedness against the next pandemic. Both spillover and biosecurity incidents happen regularly enough that we really need to protect against both. If the CCP is lying about lab leak and covering it up, that has political implications but not really public health.

It's also, I think, digging deeper into this to explore trustworthiness of news sources. Mainstream sources haven't done a good job, mostly parroting conventional wisdom (as they will do). Social media has been worse, often a source of plain misinformation (in either direction). Real science journalists have done a good job, but people don't pay much attention to them, and in many cases what they write has been distorted and misrepresented (see [1] for a recent and relevant example).

[1]: https://twitter.com/amymaxmen/status/1400648773169156097

comment 5y ago · link · parent

Agreed, that looks surprisingly good to my admittedly non-expert eyes. Thanks for posting!

comment 5y ago · link · parent

This is fair! I was only really counting events with large numbers of infections (so the 1977 flu and maybe one or two others), but biosecurity incidents themselves are, as you say, common, and many prominent people in the field (Marc Lipsitch particularly comes to mind) have been calling for better biosecurity - and strict limitations on gain of function research - for some time.

comment 5y ago · link · parent

These threads are long, contentious, and often go in circles. To save time, I propose a scale:

1. It was definitely zoonotic, and suggestions otherwise are racist conspiracy theories.

2. While it's impossible to rule out a lab leak, I believe it's zoonotic unless confronted with hard evidence.

3. While I admit the possibility of a lab leak, I secretly am pretty sure it was spillover.

4. Both lab leak and spillover are plausible, and the best priors are past experience (dozens or more spillovers, probably one or two lab leaks).

5. Lab leak and spillover seem equally likely, and a lot of the behavior of the CCP, WHO, EcoHealth Alliance are suspicious.

6. It was almost certainly a lab leak, the CCP is covering it up.

7. Definitely at least a lab leak, probably an engineered bioweapon.

8. Kill Fauci, he was in on it.

This article is 3. The recent Vanity Fair article is 5. Most virologists I follow on Twitter are 2 or 3. As I say, you can save time in responding by just posting the number of where you are on this scale. Explaining why you think so won't add too much more information, it's a function of what sources you pay attention to and that can be pretty reliably inferred from the position on the scale.

comment 5y ago · link · parent

This is a talk I've been working on for a while. It starts off motivating why you might want to write compute shaders (tl;dr you can exploit the impressive compute power of GPUs but portably), then explains the basics of how, including some sample code to help get people started.

Slides: https://docs.google.com/presentation/d/1dVSXORW6JurLUcx5UhE1...

Sample code: https://github.com/googlefonts/compute-shader-101

Feedback is welcome (please file issues against the open source repo), and AMA in this thread.

854.

Compute Shader 101 [video](youtube.com ↗)

177 points · by raphlinus · 5y ago · 18 comments

comment 5y ago · link · parent

Perspective on the rarity of the CGG pair:

https://twitter.com/K_G_Andersen/status/1391507272887455746

Basically, it's somewhat rare but not wildly so. FCoV has an RR pair, the first is coded as CGG, and the second as CGA, a difference of one base pair.

comment 5y ago · link · parent

This is a good article. There's been so much junk over the past couple of weeks or so that it's been very frustrating. I've mostly been watching the debate unfold on Twitter, and it's confirmed for me that Twitter is a terrible place for real intellectually-curious discussion (probably social media in general).

I've been wondering certain things, especially why Marc Lipsitch (one of the most consistently trustworthy voices throughout the pandemic) signed that Science letter, knowing that it would add weight to the "it's a lab leak" propaganda, and stood by the assertion that lab leak is plausible[1].

I hope we do get the true answers to these questions, though think it's not especially likely.

I'll say a couple other things. For an audience of honestly intellectually curious people, the Trumpian right-wingers did enormous damage to their theory, even if it was correct, by being racist and scientifically willfully stupid. Similarly, the Chinese authorities, even if they were correct did enormous damage to their theory by being authoritarian and stifling real communication. But it is very easy to see why both sides acted as they did: these mythical honest intellectually curious people are a tiny fraction of the entire audience, and have relatively little power, so they were quite incentivized to act as they did. And, maybe a little too early to say for sure, but it probably worked.

[1]: https://twitter.com/mlipsitch/status/1398455815959367683

comment 5y ago · link · parent

The Foundation is a recent development. The efforts by Ferrous to make Rust more suitable for safety-critical work predate the creation of the Foundation by quite some time; there was quite a bit of work done under the "sealed Rust" banner before that was rebranded as Ferrocene.

Good specs don't emerge from thin air (though I suspect that many bad specs emerge through spontaneous generation), and the people who work on them deserve to be funded. While I'm not claiming the process the Rust community has is perfect, it is explicitly designed to be sustainable, and I think it's right to be proud of the collaboration between different companies, large and small, and also academia; Ralf Jung's work in particular is foundational and he well earned his recent PhD for it.

comment 5y ago · link · parent

I am not a licensing lawyer, but the license for rustc (and its standard library, and a great many infrastructural crates in the ecosystem) is dual MIT + Apache 2, which was explicitly chosen so that it would be compatible with both GPL v2 and GPL v3.

comment 5y ago · link · parent

The Rust people firmly believe in specs and are working on one (most of the activity is currently in Ferrocene). On the other hand, they fully appreciate that writing a good spec is very hard and takes time, while a bad spec can do lots of damage to the ecosystem.

comment 5y ago · link · parent

I believe gcc-rs has a dependency on Polonius, the new(ish) experimental Rust borrow checker.

comment 5y ago · link · parent

There is a different project that grafts the existing rustc frontend to the gcc backend: rustc_codegen_gcc. The existence of both projects is currently very contentious, as there are concerns about duplicated effort and possible fragmentation of the community. Some of the goals, like the ability to target more architectures, are equally supported by both projects, but for other goals (mostly more organizational and less technical, to my ears) they're pretty different.

comment 5y ago · link · parent

> I know that nobody would ever actually do this

Or would they?

comment 5y ago · link · parent

I'll give my reading, and a tip to the author.

To me, this did not read as a serious proposal to actually commit more fraud. Rather, it was a "modest proposal" in the tradition of Swift, in which the actual call to action was for the field to be more critical of papers, especially to be on the lookout for all fraud, both the obvious kind and the more subtle variants, the latter of which also do great damage to the field.

The tip: humor like this is fun and appreciated by people who run in the same circles as the author, but an essay like this will be read by a diverse cross-section of people. Some won't have the cultural references, some won't have English as a first language, etc. Almost always when I've snuck jokes into my writing, I've found it causes confusion.

So I might have written this a slightly different way, something along the lines of: the community is structurally more equipped to deal with blatant than subtle fraud. Ironically, now that we're seeing more egregious examples of fraud, there's a better chance that things will get better; we would have tolerated the subtle types for a long time, as lots of people benefit from the status quo.

If the author were actually legitimately calling for more fraud, then I apologize for misunderstanding.

comment 5y ago · link · parent

A related question is how to solve quadratic equations robustly using IEEE floating point. When solving ax² + bx + c, the most common problem is when a is very tiny, or even zero (then it becomes a linear equation, which is easy, but the classic solution becomes undefined). There are other things that can go wrong.

At some point I might write up a solution, but in the meantime I'll point to code that implements it[1].

[1]: https://docs.rs/kurbo/0.8.1/src/kurbo/common.rs.html#105-149

comment 5y ago · link · parent

You'll probably be interested in section 3.6 of the spec[1], "optional capabilities." One such is timestamp queries, which I find especially annoying when they're not available.

[1]: https://gpuweb.github.io/gpuweb/#optional-capabilities

comment 5y ago · link · parent

In this case, I was pushing it quite a bit to see how it would respond. Most of the time, it responds quite confidently so it sounds right, even if it isn't, ie about the median of what you'd expect for a Hacker News comment.

comment 5y ago · link · parent

Do you have any insight whether these reparameterizations are better (faster, more accurate) than just applying a standard solver (I'm now a huge fan of the ITP method) over numerical integration to compute arc length (Lagrange-Gauss quadrature is pretty magical)? I'm particularly interested in how it deals with cusps, which are always the most difficult cases with these numerical approaches.

comment 5y ago · link · parent

Disclosure: work at Google, opinions my own.

I've had a chance to play with this and it's eerie how good it is. Most impressive to me, it was able to defend itself persuasively when confronted with evidence of how its previous answers were inconsistent (in the version I played with, it tends to be very coherent but frequently wrong).

comment 5y ago · link · parent

https://github.com/austinEng/webgpu-samples is your friend. Look under sample/*/*.wgsl in particular for shader examples.

comment 5y ago · link · parent

"Does not matter" is overstating the case. There are lots of tools for converting between shader languages (naga, spirv-cross, glslangValidator, dxc), but these conversions aren't 100% lossless and not all shader languages have the same capabilities. To give one example, HLSL (Shader Model 6) has a fairly complete set of subgroup (wave) operations, but is missing nonuniform shuffle. Another gap is that only GLSL (Vulkan flavor) has support for explicit memory semantics. Of course, WGSL currently has none of this, as it's something of a lowest common denominator.

In the game world, it is very common to write shaders in HLSL because of good support on Windows, and then use the tools mentioned above to translate into other shader languages. I explored this for my own work but ultimately settled on GLSL because it allows access to advanced features.

Fans of shader languages should also be aware of rust-gpu, which promises to be considerably higher level; most existing shader languages show their clear lineage to C (through Cg).

1
282930
63