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 4y ago · link · parent

It's not bad, but I've heard that the person who started it is a jerk who constantly posts self-serving comments on HN, and always seems to pop up on threads about the DX7.

comment 4y ago · link · parent

Really well said, thank you.

I think the lesson here is that one shouldn't listen either to antivax grifters or to greedy pharma execs who oversell their products because of the enormous incentive to do so, whether it be vaccines or Alzheimers treatments. The best approach is to listen to what real scientists who actually understand the subject say, but that does take patience and a willingness to invest time.

comment 4y ago · link · parent

This is a thoughtful and thought-provoking blog post. I think it's worth asking similar questions of computer science. I think you'll find some math-like patterns -- there's basically no chance Quicksort or any other fundamental algorithm paper will fail to replicate -- and some patterns which will fail to replicate, like in software engineering.

Some of the early results on pseudorandom generators and hash functions aren't holding up well, but I think that's just progress. We understand the problem a whole lot better than we did back then.

Perhaps more interesting is the literature on memory models. The original publications of the Java and C11 memory models had lots of flaws, which took many years to fix (and that process might not be totally done). I worry that there are a bunch of published results that are similarly flawed but just haven't gotten as much scrutiny.

comment 4y ago · link · parent

To me, that's actually one of the more interesting questions. It's possible to grade the output of the AI against objective criteria, like does it run, and resources consumed (RAM, CPU time, and, particularly of interest to me, parallel scaling, as GPU algorithms are too hard for most programmers). To what extent can you keep training by having the AI generate better and better solutions to a relatively smaller input pool of problems? I skimmed the paper to see how much they relied on this but didn't get a clear read.

comment 4y ago · link · parent

This is correct, though I can certainly see how someone would come to the conclusion that starting colors are not identical, as default painting mode is less than full opacity, so the mixed color is generally a lot more saturated than plain sRGB.

And a clarification, I wouldn't call this RGB linear mixing, to me that's mixing in a physical light intensity space. Rather, it's alpha compositing in an sRGB color space, which is probably the most common mode. It's possible to verify this by setting transparency to exactly 50%, painting 50% black over white, and 50% white over solid black, verifying that the color is the same, and measuring that - it's very close to sRGB (128, 128, 128). Linear mixing would give approximately (188, 188, 188). Incidentally, this also shows that Mixbox doesn't retain neutral hue when mixing black and white - it gives something closer to (129, 127, 130), a slight reddish-purplish tone compared with neutral gray.

comment 4y ago · link · parent

This is a great paper, will likely move the state of the art forward. I've been aware of Kubelka-Munk representations of painting surfaces since [1], which used a six-dimensional space (scattering and absorption for 3 wavelength bands, not really spectral). Doing it all in RGB makes it way more practical.

I'm fiddling with an alternative approach based on IPT-like color spaces, which won't need the 10MB lookup table, and will have a tunable parameter for paint opacity (between watercolors and pastels). So far I have promising but not compelling results. If people are working on, say, a free software painting application, get in touch.

[1]: https://www.levien.com/gimp/wetdream.html

comment 4y ago · link · parent

In the spirit of being charitable, I would say that the article is highlighting a place where the guarantees are incompletely documented. And not having a solid specification and clear documentation is absolutely one of the things that makes unsafe Rust hard.

I'd actually like to qualify that a bit. Doing unsafe is not especially hard, just use pointers everywhere instead of references. That's exactly like C (which doesn't even have references), but the syntax is clunkier, you have to use function calls instead of concise operators like * and ->. What is hard is finely interleaving safe and unsafe Rust, as the author is trying to do. That's difficult because the unsafe code has to upload all the safety invariants of safe Rust, and those are indeed complicated.

comment 4y ago · link · parent

I don't think I come across as an alien. For example, I'm very deeply involved in my local Quaker meeting, and I don't think any of that is particularly different than others. That said, I can nerd out extremely deeply into a problem, to a point where I've noticed other people's eyes glaze over. Case in point, I've become interested in memory models for GPUs, and while most people in the field would be content to leave it there, I've actually dug into the Alloy code for the formalization of the Vulkan memory model (and found some issues along the way). I'd estimate there are probably less than two dozen other people in the world who have dug that deep, and, thinking about it now, I can see a pretty direct line to what child-prodigy-me would do in a similar situation.

comment 4y ago · link · parent

Unusually, we have pretty good documentation about Prof Tao's background, childhood, and mathematical education. I found this a good read.

http://math.fau.edu/yiu/Oldwebsites/MPS2010/TerenceTao1984.p...

My favorite part is when he was asked, at age 8 minus epsilon, whether addition distributes over multiplication (after having established that multiplication distributing over addition is an example of a distributive law), and he said, "only for Boolean algebras."

(Disclosure: I was also a child prodigy, so much of this story resonated with me. I'm now a research software engineer at Google, working on lots of mathematically intensive topics in 2D graphics, but obviously nowhere nearly as accomplished as Prof Tao)

comment 4y ago · link · parent

Danny is correct here. I was aware of it at the time (having been on Android 2012-2016), but won't leak any further details. I recommend taking the word of a highly credible person who has first hand knowledge over a thinly sourced article in the tech press.

comment 4y ago · link · parent

That is already possible with just a weight axis. The benefit is a lot more flexibility in design and layout, plus just a preference. The Iosevka font also being discussed here today is on the narrow side, while Source Code Pro is slightly wider and Courier even more so. Inconsolata can cover all these and more.

comment 4y ago · link · parent

Why thank you :)

People may not know that Inconsolata is now a 2-axis variable font with a particularly wide width range: 0.5 to 2.0 of the nominal width.

comment 4y ago · link · parent

This is very much changing. IMHO, doing shader language design today, you should give let the programmer express things in the most natural way possible, and let the compiler figure out whether to generate a branch or branchless code. Yes, often you want the latter, but compilers are pretty good at figuring that out.

comment 4y ago · link · parent

If my understanding is correct, Agda and Coq disallow general recursion, so all programs terminate by construction, but Idris relaxes this, in a desire to be more pragmatic at the cost of not as clean mathematically (functions have to be modeled as partial in general, to account for the fact they might not terminate).

comment 4y ago · link · parent

Can I pick your brain on MLIR? It sounds awesome from what you describe, but I want to know more about whether it's specialized to machine learning types of workloads or whether it's good for more general things.

comment 4y ago · link · parent

Yes, I bet you could do something interesting there, but one of the lessons is that social graphs can become very noisy, especially if people have an incentive to add edges. Don't expect a purely technical (reputation) system to solve what is a social/cultural problem.

comment 4y ago · link · parent

While non-BMP Unicode has only become popular somewhat recently due to emoji, it's been part of the relevant official specs for a quarter century.

I know you were kinda joking by using scare quotes for "recently", but let me fill that in for people who might be less familiar with the history. Unicode broke out of the 16-bit limit as of version 2.0, released in July 1996, so yeah, a quarter century. The first RFC for UTF-8 (RFC 2044, Oct 1996) explicitly supports UCS-4. As far as I know, there has never been a time where UTF-8 restricted to the BMP (ie 3 bytes) has been in widespread use. In other words, I am questioning your assertion that 3-byte UTF-8 has ever been considered "long enough," except perhaps in sloppy implementations made without much care for following specs.

comment 4y ago · link · parent

Very interesting, thanks. I'll add that to my collection of alternative languages targeting GPU compute.

comment 4y ago · link · parent

Speaking of people who have written C++ compilers, what do you think of Circle? Have you given any thought to targeting GPU shaders from D? I think "C-like low level control but with strong compile time metaprogramming" might be something of a sweet spot, though there is a lot of complexity to the space (mostly the oddball storage spaces).

comment 4y ago · link · parent

I vouched for your comment but suffice it to say it doesn't match my experience. Being on the right team and having the right project makes a lot of difference. Way too many meetings is definitely a common problem at Google but you also don't have to be completely passive and helpless about it either.

In any case, glad you have found your niche in academia! Working with students is indeed rewarding - I've gotten to do some through Summer of Code, but academia is definitely a better place if that's your passion.

comment 4y ago · link · parent

A Zach-like with music synthesis as the core mechanic. I still think it's a good idea, but I don't really know how to write fun games (I think you have to write one or two to get enough experience) and I do know how to write 2D renderers, and increasingly feel able to claim I know how to program GPUs as well. I think it was Ivan Sutherland who said a good plan for research is to do something you think is easy and other people think is hard.

comment 4y ago · link · parent

I thought about starting a company, but that's not where my energy is, it's doing the science. Everything I do is permissively licensed open source (though if I had a chance to work on awesome rendering in a proprietary product I would not turn it down).

I'll also add, I looked into academia and talked to some people about steps in that direction, for example seriously considering taking on teaching a class at UC Berkeley. But I decided that the daily grind of academia was not for me. I think I get to spend a larger fraction of my time actually working on my problems at Google than I would at a university.

comment 4y ago · link · parent

That's not too different than what I did. I left Google fall 2018, at the time thinking I'd write a video game. That morphed into doing research on 2D rendering, because building the infrastructure for that was more interesting and exciting than the actual game. For a while (not the whole time) it was pure unstructured time, no outside responsibilities. I rejoined Google a year ago with a research software engineer title, mostly because it was a better place to pursue this research than just continuing on my own.

Partly I'm posting this to support 'lapsedacademic's assertion, you can do good research in industry. It takes a certain element of luck to land a spot, but it also helps to be very passionate about the research itself.

I'm now writing a paper on an exciting GPU algorithm, but it's pure love, funding doesn't depend on it, it just makes a nice point on my list of accomplishments during perf time.

comment 4y ago · link · parent

In my opinion, the rope is easily superior to these other types, but it also depends on whether your language supports abstractions well. The problem with an "array of paragraphs" is that it helps when your problem involves the paragraph boundary, but gets in the way when it doesn't. For example, pressing backspace at the beginning of paragraph 2 causes a merge of paragraphs 1 and 2, which is not trivial. With a rope, it's the same as deleting a backspace within a simple string, once you have a good rope library under you.

The other big reason to prefer a rope is that the worst case complexity is excellent. Basically all incremental operations are O(log n). With an "array of paragraphs" you get various pathological performance cases such as a huge number of small paragraphs or one very big one.

A good rope implementation is not trivial, but when done right it hides its internal complexity from the layer above. And it's a solved problem. There are at least two or three solid rope crates for Rust (just to pick the language I'm most familiar with), and will likely be more, as people find it fun to implement.

comment 4y ago · link · parent

Interesting! Was there anything that you think came out significantly better than if you had written it in, say, C or Rust?

comment 4y ago · link · parent

I started something along those lines: https://levien.com/tmp/tractatus.html

comment 4y ago · link · parent

Pretty sure it's this paper: https://ieeexplore.ieee.org/document/1164317

That is Griffin-Lim, which matches the second mention but not the first. It's a fairly well known algorithm for reconstructing speech from spectrum, though I believe is largely superseded these days by vocoders based on neural techniques. (Actually I just checked and the original Tacotron paper cites Griffin-Lim; I do think newer neural TTS approaches have gone beyond it, however)

comment 4y ago · link · parent

Android has a sophisticated algorithm for line breaking, including hyphenation. It's similar to that of InDesign (both were strongly inspired by the Knuth-Plass algorithm used by TeX), but tuned for mobile use. In particular, it's pretty shy about adding hyphens, but if a well-placed hyphen will prevent a two-line sentence from spilling to three (in which the last word is by itself), it will do so fairly aggressively. I'm quite proud of that.

Unfortunately, I don't have a good writeup of that, but some of the details are in this ATypI talk[1].

[1]: https://www.youtube.com/watch?v=L8LD0BM-Vjk

comment 4y ago · link · parent

And of course there is at least one other language by that name[1], though very much a toy and designed by someone who didn't really know what they were doing.

[1]: https://dercuano.github.io/notes/raph-io.html

comment 4y ago · link · parent

I was curious. play.rust-lang.org here. Figures. "n" on the other hand, exactly where you'd expect.
1
202122
63