Recent submissions

Comment · 3 days ago
I love to see this kind of optimization, of course, but there are other cases where Robison division is great, just because it has basically the same form for every divisor:

1. The divisor is not actually a compile-time constant, but comes from a small set. You can compute a table of corresponding constants and use the same code for every divisor.

2. You want to do many divisions by many different divisors (whether known at compile-time or drawn from a small set, like above, or pre-computable and applied many times... think of something like a quantization matrix for image coding, for example). Here Robison easily SIMDifies, whereas an algorithm that needs different code paths for every divisor is going to be much more difficult.

Regarding the lack of native signed-unsigned multiplies, as someone who does a lot of multimedia processing, I find the set of available multiplication instructions on x86 and ARM to be rather shamefully limited (especially x86). I recall a colleague who used to optimize for VideoCore (the GPU in a Raspberry Pi) saying that when he first started he was astounded that it had 80 different multiply instructions, but within a year or two he had used basically all of them.

Comment · 5 days ago
I would also add: anyone who started 4...5 years ago. These people received options grants as the market was in its 2022 slump. Since then the stock is up 1.5x...2.4x (depending on exactly when they received their grant), and those grants are reaching the end of their vest. Yes, there are refresher grants, but realistically these employees' total compensation is about to drop off a cliff, if it hasn't already.

That is not the kind of thing that inspires a person to stick around.

Comment · 17 days ago
From the beginning of Section 3.3 (several pages before the text you quoted in Section 3.3.7):

      Some operators (the unary operator ~ , and the binary operators << ,
  >> , & , ^ , and | , collectively described as bitwise operators)
  shall have operands that have integral type.  These operators return
  values that depend on the internal representations of integers, and
  thus have implementation-defined aspects for signed types.
Comment · 17 days ago
> Previously, in C89, left shift on signed integers was completely undefined...

No, it was implementation defined, which is very different. Every implementation you were ever likely to encounter defined it reasonably. Making some of it undefined now has created a bunch of code that uses macros to cast back and forth between unsigned to get the expected behavior (or, for cases where it is provable that the result is representable, to replace the left shift with a multiplication and hope the optimizing compiler translates it back, because compilers now warn on any left shift of a negative value, despite the fact that the semantics are supposed to be the same as the corresponding multiplication now).

In other words, it created a mess for basically no reason.

Comment · 21 days ago
> That sounds like shifting the property tax burden from homeowners to renters...

This is all obviously very specific to the locality where you live, but at least where I live, property values were recently reassessed to account for the large post-pandemic increases. Individual homeowners were generally stuck with these reassessments, while commercial properties, especially those managed by large property management groups, were organized and successfully petitioned to reduce those assessments in disproportionate numbers. So the balance of power was not equal to start with.

Comment · 1 month ago
I don't think it's correct to say "rates were kept low" as if the Fed had a choice in the matter. All the Fed can really do is respond to market conditions. It can be slow to react, and it could in theory be wrong about the market in a way that causes economic damage (in one direction or the other), but it can't really do better than the implied market rate.

Interest rates were kept at historic lows for a decade because the 2008 crisis caused available credit to absolutely implode, which destroyed a huge swath of the effective money supply. Leverage ratios at banks went from north of 40:1 to closer to 10:1. Without ZIRP and QE and all of the rest, we would have had outright deflation, kicking off the kind of deflationary debt spiral that made the Great Depression so bad.

That kind of dramatic destruction of credit did not happen during the pandemic. The banks were fine [0]. What happened was that the economic output of actual goods and services collapsed. So high levels of stimulus led to more money chasing fewer real resources, and you got inflation instead.

This should not have been a surprise.

[0] Modulo a few like SVB that blew up a couple of years later because they had forgotten that interest rates could also go up.

Comment · 1 month ago
This is fine advice up to a certain point, but you do not accomplish bigger and grander things by working harder, nor even, as this implies, by working more diligently. You accomplish them through leverage.

It is not just about what you are working on. You need to understand what everyone else is working on, and more importantly, what they could be working on (their capabilities) and what they should be working on (the org's priorities). When you find yourself being dragged in to meetings to write roadmaps, estimate schedules, and contribute paragraphs to the annual budgeting process, you know you're on the right track.

He does have one thing right, that this is about reputation, because you cannot just go out and unilaterally take this authority. It has to be earned. Having a large number of lines of code written, commits landed, and tickets closed can be a means to that end, but it is not in and of itself the goal.

Comment · 1 month ago
No, that risk always existed. When the Communists took over Russia, they did not bother to honor all of the Tsarist debts. A country is not like a company. Sovereign default is always a choice. That is what it means to be sovereign.

There have been over 70 incidents of overt domestic default since 1800. The United States defaulted in 1790, when a portion of the interest it owed was deferred for 10 years, and technically defaulted again in 1933 when it abrogated the gold clause.

Comment · 1 month ago
You're welcome. That is what those image sets were for.

I was really happy Thomas Davies added quantization matrices to the spec, because if he hadn't, I would have had to. Fortunately, he did a good job. I am glad someone is finally using them. Don't sleep on per-segment quantizer deltas, either.

Comment · 1 month ago
There were something like 40 companies involved in AV1 standardization. Quite a few technical contributions did not come from Google, and quite a few of Google's proposals were substantially modified by feedback from others before they were included (and not all of them were eventually included).

Source: I lead Mozilla's technical contributions to AV1.

Comment · 1 month ago
> A lower resolution image layered below the full resolution image, which is loaded and rendered first.

Unlike a thumbnail, higher-resolution layers can be predicted from the lower-resolution layer, so those bits are not wasted. That is not possible by layering <img> elements.

Comment · 1 month ago
I don't need the TV to be cheaper. I can afford to make up the difference for whatever few hundred dollars extra they would earn selling my data. But the expensive ones do this stuff, too.
Comment · 1 month ago
My first question was, if the vtable only has a single function in it (as in these examples), can the compiler optimize it to a function pointer to save an indirection?
Comment · 1 month ago
Comment · 2 months ago
Sarah C. M. Paine has an excellent series of lectures on what it means to be a "continental" vs. a "maritime" power, and how the latter build wealth through trade and an international rules-based order. https://www.youtube.com/watch?v=u9VSg4ZSwJs is probably the most succinct, and a good introduction if the name Alfred T. Mahan is not familiar to you. Dwarkesh Patel's channel has a more recent 9-part series (on this and other topics): https://www.youtube.com/@DwarkeshPatel

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton