HNHacker News
TopNewBestAskShowJobs

derf_

2,803 karma · joined July 22, 2012

submissionscomments
derf_··on On the Road to WebRTC 1.0, Including VP8
As someone who harassed you about VP8 support in the past [0], this is really great news. Thank you for all of your hard work. I am also really happy to see the transition to Unified Plan.

[0] https://news.ycombinator.com/item?id=14510045

derf_··on On the Road to WebRTC 1.0, Including VP8
Many RTC stacks (and specifically openh264) also only support H.264 baseline profile. So you are likely to get higher quality with VP8 (subject to variations in the quality of the implementations on each endpoint, of course).
derf_··on Silicon Valley’s Inequality Machine: A Conversation with Anand Giridharadas
The part where he drove it for the maximum legal time he was not required to affix his license plates to the car (six months), and then leased a new one [1].

[1] https://www.itwire.com/it-people-news/enterprise/50649-the-t...

derf_··on Students learn from people they love
> ...fear can have a really positive effect when it comes to learning something.

This has a built-in failure mode caused by the fact that the student is optimizing the objective function, "Reduce the potential for public embarrassment," and not the one the teacher wants, which is, "Learn the vocabulary." At some point, the student decides that the safer path is actively refusing to study and refusing to be embarrassed by this choice. No one knows if they could really learn the material or not (probably not even them), and they maintain self-respect by having the balls to stand up to someone they do not like (especially pre-university, where attendance is legally mandatory and you have little to no influence over your assigned teachers).

I have seen this play out with several obviously bright people (to counter your anecdote with another anecdote). It is particularly sad because it fails expressly for those struggling the most with formal education.

derf_··on You Weren't Meant to Have a Boss (2008)
At one point I had a boss with (roughly) 50 direct reports. To paraphrase him describing how he did it: "badly".

The company later was able to hire more managers and take the load off of him (and in fact he went back to being an IC eventually). But these things happen in periods of rapid growth, despite everyone knowing they're a bad idea.

derf_··on Mozilla Announces Deal to Bring Firefox Reality to HTC VIVE Devices
The Firefox Reality team is much smaller than the FirefoxOS team was (i.e., by more than an order of magnitude).
derf_··on An Apology and an Update
I pretty much gave up on Matrix after the following exchange: https://news.ycombinator.com/item?id=8697151

Perhaps I am overreacting, but that sort of attitude on matters core to basic privacy in the post-Snowden era seems both problematic and incurable.

derf_··on Undefined Behavior Is Really Undefined
It depends on what operation could potentially overflow.

Mozilla has a CheckedInt (C++) type that checks all operations for overflow. You can see examples of how this is actually implemented here: <https://searchfox.org/mozilla-central/source/mfbt/CheckedInt.... You can derive similar C implementations if you work through all of the template magic.

Be warned that the definition of what is undefined, implementation-specific, and well-defined varies depending on the exact version of the C or C++ standard you use.

derf_··on There’s a Hole in the Bottom of the C: Effectiveness of Allocation Protection [pdf]
That was the main reason.

It also means that you don't need to pass around (a pointer to) a big table of function pointers throughout all of your functions that need to use accelerated routines. Instead you just pass a single integer index. But that is pretty minor.

It can be pretty similar to a switch in practice, but I think there are a few differences. One is function argument handling. Each version of an accelerated routine has to be an independent function, compiled in a separate compilation unit, because you have to limit the instruction sets available. So you will duplicate all of the function call setup overhead in each branch of the switch. This probably gets optimized away by a decent compiler. Even if it does, you still wind up essentially duplicating the function table at every call site. That does not seem likely to get optimized away. You could dispatch to a common thunk which selects the accelerated routine to call, but now you have two function calls instead of one. I am also not sure that switch statements handle the default case as cheaply as doing a single bitwise AND with a small, compile-time constant.

But if you have a use of function pointers that can be replaced by a simple switch statement, that is probably the better approach.

derf_··on There’s a Hole in the Bottom of the C: Effectiveness of Allocation Protection [pdf]
One (non-generalizable) solution is to avoid using writable function pointers, to help maintain control flow integrity.

For example, in libopus we have platform-specific SIMD optimizations that are chosen at runtime.

The common solution is just to have a function pointer that points to the accelerated routine. But there are only a limited number of choices for each routine. So we put pointers to them in a static const array, which gets stored on a read-only page. Then instead of storing a pointer, we just store an index into this array. This index is chosen based on the available instruction sets detected at runtime. This lets us use the same index for every accelerated function.

Then, we pad the array size out to a power of two. To call an accelerated function, we mask off the upper bits of the index. Even if the index gets corrupted, we still call one of the functions in the array. So there's only so much damage it can do.

Obviously this doesn't apply if the set of functions you need to call is open-ended (e.g., a callback, like nginx was using). But it seems like a good pattern to follow when it applies.

derf_··on Experiment that ended in 1767 still linked to higher incomes, education levels
Yes, it is the "Family-wise error rate". You need to perform "correction for multiple tests".

The simplest, most conservative form is Bonferroni correction [1], where you just divide the required significance threshold by the number of tests you perform. In your example, if you required significance at the 99% level (1% chance a false positive, or "Type I error"), then for 100 datasets, each individual one would require significance at the 99.99% level (0.01% false positives for each data set). (99.99%)^100 = 99.005%. This does not require any assumptions about the independence of the tests. Independent tests are the worst case, so this over-corrects if there is actual correlation between the measurements.

There are other, more complicated correction methods that do not give up as much statistical power (i.e., produce fewer false negatives), but that may require making more assumptions.

[1] https://en.wikipedia.org/wiki/Bonferroni_correction

derf_··on Opus 1.3 Released
Technically, the linked article is correct that it is something that I like to say, but I stole the phrase from David Schleef (one of the Dirac developers).
derf_··on A Fast x86 Implementation of Select (2017) [pdf]
I wondered why they used TZCNT instead of BSF. If their algorithm has correctly located the word with the jth bit set, the output of PDEP shouldn't be zero, and these should be equivalent (but BSF doesn't require a dependency on BMI1 support, though if you already require BMI2 for PDEP, maybe this doesn't matter).

But then I found <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50168>.

derf_··on Don’t sign a CLA
> >I am all-for the FOSS movement but there is no need to go full Stallman and say that everything but GPL is evil

> I did not say that, nor do I believe it, nor is it really related.

Not even Stallman believes this [0]. He has even explicitly endorsed the use of a "lax license" when pragmatic concerns justify it [1].

[0] http://openbsd-archive.7691.n7.nabble.com/Real-men-don-t-att...

[1] http://lwn.net/2001/0301/a/rms-ov-license.php3

derf_··on Introducing Dav1d: a new AV1 decoder
You can check for errors with alloca. It returns NULL on failure. You have the same problem as with error checking malloc. On platforms with overcommit (any fork-based UNIX, except maybe Solaris) it doesn't fail at allocation time, it fails when you try to access the memory and fail to map a page. But at least on 32-bit systems it can detect when you exhaust your address space (an actual problem for things like web browsers that still commonly ship 32-bit binaries and use lots and lots of threads).

But yeah, the real reason is that MSVC will never implement VLAs.

derf_··on Ex-Google Employee Urges Lawmakers to Take on Company
> > What about all the other American companies doing business in China?

> We'll get to them eventually.. but why shouldn't we go after the biggest business first? Wouldn't that provide the greatest reduction in harm?

There's actually a name for laws that target one individual while ignoring others guilty of the same behavior, and that's a "bill of attainder" [0]. They're banned by the US Constitution and also every state constitution, which might give you some idea that there are pretty good reasons "why not" (namely, that they're ripe for abuse, they violate someone's right to due process, and can be used by the legislature to take on judicial or executive functions, violating the separation of powers).

[0] https://en.wikipedia.org/wiki/Bill_of_attainder

derf_··on Google Suppresses Memo Revealing Plans to Closely Track Search Users in China
> support governmental action against the company (GDPR, etc)

The GDPR is a hugely pro-Google law. Large corporations can easily afford to wade through its complexity to find ways to comply that do not have a meaningful impact on profits, up to and including getting the law changed, if necessary, ideally by making it more complex.

Their smaller competitors can't.

derf_··on Falling in love with Rust
> my naive Rust was ~32% faster than my carefully implemented C.

One thing that we have noticed in our work on our Rust AV1 encoder, rav1e, is that Rust autovectorizes a lot better than C. In particular, it does a better job of proving that slices have nice sizes (e.g., multiples of 8 or 16 elements). That allows it to leave off all of the boilerplate for handling odd sizes. Rust also does not automatically promote every arithmetic operation to an int. That makes working on 8- or 16-bit types a lot more efficient. The stronger type system, memory safety, and the preference for idioms that avoid bounds checks mean the compiler can successfully autovectorize a lot more code than C, too. We used to joke that the only C code that gets autovectorized is the initialization loops that run exactly once and just set everything to zero.

It's still not as good as hand-written SIMD (maybe within a factor of 2), but it's a lot better than no SIMD.

That said, it makes it hard to do straightforward performance comparisons with C, especially for code where you know you will write the hand-written SIMD, but you just haven't gotten to it yet. There is a lot of code like this in a freshly-implemented video encoder. Rust is using a tool, autovectorization, that it won't get to use when you manually vectorize, and C isn't. That threw off a lot of our early attempts at benchmarking Rust vs. C.

Of course, most things are not video encoders, and most code won't be manually vectorized, so the better autovectorization is an absolute win in the real world.

derf_··on Thoughts On Machine Learning Accuracy
If you set the confidence threshold to 80% in the test you perform in (1), how many misidentifications do you see, if any?
derf_··on Mozilla exec says Google slowed YouTube down on non-Chrome browsers
If you append the magic URL argument "&disable_polymer=1" then things should load instantly in Firefox and Edge.
derf_··on Rav1e: An experimental AV1 video encoder, designed to be fast and safe
There are a number of features that make AV1 structurally more suited to real-time implementations than its predecessor, VP9.

For example, it does adaptive entropy coding instead of explicitly coding probabilities in the header. That means that you don't need to choose between making multiple passes over the frame (one to count symbol occurrences and one to write the bitstream using R-D optimal probabilities) or encoding with sub-optimal probabilities (which can have an overhead upwards of 5% of the bitrate). libaom has always been based on a multi-pass design, as was libvpx before it, but rav1e only needs a single pass per frame (we may add multiple passes for non-realtime use cases later).

In another example, AV1 has explicit dependencies between frames. VP9 maintained multiple banks of probabilities which could be used as a starting point for a new frame. But any frame was allowed to modify any bank. So if you lost a frame, you had no idea if it modified the bank of probabilities used by the next frame. In AV1, probabilities (and all other inter-frame state) propagate via reference frames. So you're guaranteed that if you have all of your references, you can decode a frame correctly. This is important if you want to make a low-latency interactive application that never shows a broken frame.

Some of its tools also become more effective in low-complexity settings. One of the new loop filters, CDEF, gives somewhere around a 2% bitrate savings using objective metrics when tested with libaom running at its highest complexity (although subjective testing suggests the actual improvement is larger). However, when you turn down the complexity, the improvement from CDEF goes up to close to 8%. I.e., using this filter helps you to take shortcuts elsewhere in the encoder.

The real reason the reference encoder is so slow is that it searches a lot of things. You can always make things run faster by searching less. Take a look at http://obe.tv/about-us/obe-blog/item/54-a-look-at-the-bbc-uh... to see how drastically people are limiting HEVC to make it run in real time today (though if you have to go up to 35 Mbps to do so, one might wonder what the point is).

derf_··on Rav1e: An experimental AV1 video encoder, designed to be fast and safe
The "safest" comment is mostly tongue-in-cheek, but the advantages are real. I enjoyed this comment from someone contributing to the project for the first time:

< barrbrain> atomnuker: I felt good when my patch was done and I had exactly what I set out to write.

< barrbrain> I didn't enjoy the compiler forcing me to fix all my bugs upfront.

There are also advantages other than safety to using a modern systems language that has learned something from the last 30 years of programming language design but doesn't come with all of the baggage of C++.

derf_··on Rav1e: An experimental AV1 video encoder, designed to be fast and safe
> Also this currently does delegates work to libaom.

Currently just for the transforms and to initialize the probabilities for the entropy coder.

derf_··on Modern codecs like AV1 can bring better quality video to the open web
https://jmvalin.ca/papers/AV1_tools.pdf has a brief technical description, but no results. It cites a DCC paper from the authors of the tool, but I couldn't find a copy online.
derf_··on The Case Against Patents (2013)
>You're not trying to minimize litigation costs, but rather maximize R&D investment net of litigation costs. So the question is, if competitors could quickly copy the results of R&D efforts, would R&D investment be more or less than 14% lower?

I think you missed the part where, "during the 1990s such costs rose substantially." To give further evidence, from 2006 to 2012 the number of patent troll lawsuits increased by a factor of six [3]. But, "the US economy has seen neither a dramatic acceleration in the rate of technological progress nor a major increase in the levels of research and development expenditure." So the answer is no, all of this litigation is not encouraging R&D spending (for some reason).

> That incorrectly assumes that the only "contribution" is producing an end-user product.

Perhaps I wasn't clear. I'm not saying that ARM doesn't contribute value. I'm saying that a system that allows the separation of "design from production" also allows patent trolls, and you have to trade the benefits of one against the costs of the other. For the benefit of your one ARM example we pay the cost of 2,900 lawsuits by trolls in the year 2012 alone [3], making up 61% of all patent cases [4] (I wish I had more recent numbers).

> If standards don't embody important technical contributions, then why don't implementers rush to create alternative, unpatented standards?

You mean like <https://aomedia.org/>? They do, but I think that there are a few reasons that this doesn't happen more often:

(a) Avoiding patent thickets once they have already been created is incredibly hard work. Much harder than just developing the technology, in my opinion.

(b) It is even harder to collaborate without incurring substantial legal liability. But no such collaboration is required to create the thickets.

(c) Standards organizations often have policies which make it difficult or impossible to achieve these results, and many participants have strong incentives to prevent you from achieving them.

(d) Even if you make something "better", it is not "the standard". Displacing entrenched incumbents is incredibly hard (again, because of the network effects).

The places where you will see this happen is where there are business models that cannot support any per-unit royalty (e.g., giving away your software for free on the internet), because that provides strong incentives to make it happen.

Laptops and routers are not such an industry. They can just pass on the cost to consumers, who are not represented when these standards are set. This is the basic public goods problem.

Again quoting the article: "Notice, too, that many patent lawsuits have a public goods aspect. Consider a case in which the plaintiff is asserting that its patent has been infringed. If the plaintiff wins the lawsuit, by confirming its monopoly position it appropriates all the benefits of winning the lawsuit. A victory by the defendant, by contrast, benefits partly itself, but also other firms that might be sued by the plaintiff for patent infringement as well as consumers who would have a more competitive market. Thus, the defendant receives only a slice of the overall benefits from winning the lawsuit, and will be willing to spend less on such lawsuits than it would if it were to receive all the benefits." The parallel with getting your patent-encumbered technology into a standard vs. some other firm trying to keep it out is exactly equivalent. The correct play is for the other firm to just file their own patents, but this tragedy-of-the-commons result isn't exactly ideal.

[3] https://www.wsj.com/articles/SB10001424127887323469804578525...

[4] https://money.cnn.com/2013/07/02/technology/enterprise/paten...

derf_··on The Case Against Patents (2013)
The claim wasn't that the system is "unworkable" in the sense that it's causing world hunger or something, but that the system doesn't "work" in the sense that, in aggregate, it's not "promoting progress of the useful arts."

People will certainly use patent protection where it is available to them, but that doesn't mean they wouldn't have invested in those technologies solely on the basis of first mover advantage [0], and the lack of any observed effect of strengthening the patent system and increasing the scope of what is patentable on R&D spending tends to back that up.

[0] ARM would need a different business model, but it's unclear to me that other business models (i.e., Intel's) wouldn't have been just as successful, and wouldn't come with the social deadweight loss of patent trolls highlighted in the article.

derf_··on The Case Against Patents (2013)
Great, let's see what the fine article has to say about these things.

1) "In less than 30 years, the flow of patents more than quadrupled. By contrast, neither innovation nor research and development expenditure nor factor productivity have exhibited any particular upward trend." In other words, more patents does not appear to encourage people to splurge on fundamental research in aggregate.

But it gets worse, "The cost of litigating patents is not insubstantial either. Bessen and Meurer (2008) used stock market event studies to estimate the cost of patent litigation: they estimate that during the 1990s such costs rose substantially until, at the end of the period, they constituted nearly 14 percent of total research and development costs." So at least we've identified where some of the money being brought in from all of these monopolies is going (it isn't to the scientists and engineers).

2) It also enables business models that allow taking money from people without contributing anything at all. "On the other hand if a patentholder does not produce a marketable product and hence cannot be countersued---like Microsoft in the phone market or other patent trolls in other markets---then patents become a mechanism for sharing the profits without doing the work. In this scenario, not only do patents discourage innovation, but they are also a pure waste from a social standpoint."

3) "The downstream blocking effect of existing monopoly grants on incentives for future innovation has greatly increased in recent decades because modern products are made up of so many different components. The recent---and largely successful---efforts of Microsoft to impose a licensing fee on the large and expanding Android phone market is but one case in point. ... Microsoft is attempting to charge a licensing fee solely over a patent involving the scheduling of meetings---a rarely used feature of modern smartphones. ... Hence, the main dynamic general equilibrium effect of a patent system is to subject future inventions to a gigantic hold-up problem: with many licenses to be purchased and uncertainty about the ultimate value of the new innovation, each patent holder, in raising the price of his "component," imposes an externality on other patent holders and so charges a higher than efficient licensing fee." The externality isn't just on patent holders. Later, quoting Bill Gates: "A future start-up with no patents of its own will be forced to pay whatever price the giants choose to impose."

Having participated in these kinds of technology sharing efforts, I can assure you that the value extracted is basically unrelated to the actual value of the innovation, and mostly defined by the (current or expected) network effects of the technology in question and the political clout of its proponents in convincing other people to require its use. I.e., you're not paying for an invention, you're paying for a standard, and making standards is not something that requires external incentives.

As for monetization: "At the opposite extreme we have, again among many, the example of the Cornish steam engine discussed in Nuvolari (2004, 2006). Here engineers exchanged nonpatented ideas for decades in a collaborative effort to improve efficiency." I don't think they monetized it via advertising.

derf_··on The Case Against Patents (2013)
You haven't given any evidence that it arose because of that system or in spite of it. There are plenty of examples going back to Singer sewing machines [1] and the Wright Brothers [2] that demonstrate that the surest way to delay the widespread deployment of any transformative technology by many years is to patent it.

[1] https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1354849

[2] https://en.wikipedia.org/wiki/Wright_brothers_patent_war

derf_··on The rich world needs higher real wage growth
You are right, of course. Here's the exact quote:

So the Philips Curve posits that there is a relationship between the degree of slack in the labor market and inflation, and it is an empirical relationship that, while not absolutely tight, has been a consistent relationship over time, and I believe that relationship still holds.

https://www.c-span.org/video/?406675-1/federal-reserve-chair...

> there's considerable support for the idea that an inverse relationship between unemployment and inflation exists at least in the short run

Would you care to cite some? I'm certainly familiar with the post-70's forms of Phillips Curve theory (it's discussed in the very Wikipedia article I linked). But I also cited a 2017 paper from the Philadelphia Fed that looked very hard for such a relationship and couldn't find one, and which itself cites prior research going back to 2001 that agrees.

derf_··on The rich world needs higher real wage growth
http://blogs.marketwatch.com/capitolreport/2016/03/16/live-b...

12:29 pm

The Philips Curve is alive, [Federal Reserve Chair Janet] Yellen says.

← PreviousPage 9 of 17Next →