HNHacker News
TopNewBestAskShowJobs

pjdesno

1,193 karma · joined October 12, 2020

submissionscomments
pjdesno··on Optimizing a lock-free ring buffer
That's what "lock-free" means. You still need to use the hardware mechanisms provided for atomicity.

The whole point of lock-free data structures and algorithms is that sometimes you can do better by using these atomic operations inside your own code, rather than using a one-size-fits-all mutex based on those same atomic operations.

(Note that I say "sometimes". Too many people believe that lock-free structures are always faster; as always, your mileage may vary. In this case it's a huge win, to the point where I would bet it almost always moves the bottleneck to the code actually using the ring buffer.)

pjdesno··on False claims in a widely-cited paper
I would point out that most products are useless, and either fail or replace other products which weren't any worse. None of which prevented me from cashing my paychecks for the first half of my career when I worked in private industry.

Most scientific research represents about the same amount of improvement over the state of the art as the shitty web app or whatever that you're working on right now. It's not zero, but very few are going to be groundbreaking. And since the rules are that we all have to publish papers[*], the scientific literature (at least in my field, CS) looks less like a carefully curated library of works by geniuses, and more like an Amazon or Etsy marketplace of ideas, where most are crappy.

[* just like software engineers have to write code, even if the product ends up being shitty or ultimately gets canceled]

Neither of us are going to be changing how the system works, so my advice is to deal with it.

pjdesno··on False claims in a widely-cited paper
Are there any factual allegations on that page? All I could find was "the method described in the paper is not the method the authors actually used", without any elaboration.

I'll add that the reaction of most of academia will be "It's in a management journal - of course it's nonsense."

pjdesno··on Data centers are transitioning from AC to DC
90% of the power in our academic data center goes 13.8kV 3-phase -> 400v 3-phase, and then the machines run directly from one leg to neutral (230v). One transformer step, no UPS losses, and the server power supplies are more efficient at EU voltages.

But what about availability? If you ask most of our users whether they’d prefer 4 9s of availability or 10% more money to spend on CPUs, they choose the CPUs. We asked them.

There are a lot of availability-insensitive workloads in the commercial world, as well, like AI training. What matters in those cases is how much computing you get done by the end of the month, and for a fixed budget a UPS reduces this number.

pjdesno··on Small U.S. town, big company. Can it weather the tariff Blizzard? (Digi-Key) (2025)
I remember ordering parts from Digi-Key in 1980 or so when I was in high school. The catalog was less than 1/4 inch thick, and listed various surplus things on the back.

It was cool to see them grow into a real competitor for the big distributors.

pjdesno··on Entities enabling scientific fraud at scale (2025)
Perhaps relevant to this - if you go to this global ranking of publications:

  https://traditional.leidenranking.com/ranking/2025/list
and select "Mathematics and Computer Science", you'll find the top-ranked university is the University of Electronic Science and Technology of China.

My Chinese colleagues have heard of it, but never considered it a top-ranked school, and a quick inspection of their CS faculty pages shows a distinct lack of PhDs from top-ranked Chinese or US schools. It's possible their math faculty is amazing, but I think it's more likely that something underhanded is going on...

pjdesno··on Two kinds of error
If you're writing code professionally, then you're not in college anymore and your programs aren't simple things that run from the start of main() through to the end and then exit.

If you're providing a service that needs to keep running, you need a strategy for handling unexpected errors. It can be as simple as "fail the request" or "reboot the system", or more complicated. But you need to consider system requirements and the recovery strategy for meeting them when you're writing your code.

Long, long ago I worked with some engineers who thought it was just fine that our big piece of (prototype) telecom equipment took half an hour to boot because of poor choices on their part. Target availability for the device was 5 9s, which is 5 minutes of downtime per year. They didn't seem to realize the contradiction.

pjdesno··on Elsevier shuts down its finance journal citation cartel
https://retractionwatch.com/2026/01/08/finance-professor-bri...

I've boycotted reviewing for Elsevier for years, but it's easy for me - I'm in CS, where ACM, USENIX and IEEE offer higher-status publication venues and Elsevier journals are decidedly second-tier.

pjdesno··on The Popper Principle
Given the argument tactics employed by Socrates in Plato's Dialogues, which include most of the standard catalog of fallacies, the question that arises in the mind of many readers is "why didn't they kill him sooner?"
pjdesno··on Defining Safe Hardware Design [pdf]
I learned logic design in a class where we wired up 74LS TTL, a couple of years before they switched to programmable logic, so my knowledge of this sort of thing comes from looking over the shoulders of folks who actually do it, but it seems really cool. In particular, I love the idea that you can shoehorn all sorts of temporal constraints into a type system.

I fear that progress in this field might be handicapped by the fact that the folks who know a lot of type theory have little idea of how hardware works, and rarely care, and most of the folks who know how hardware works don't know a lot about types beyond possible bad experiences with VHDL. Luckily there's a non-zero set of people in the overlap, though.

pjdesno··on 1 kilobyte is precisely 1000 bytes?
I had a computer architecture prof (a reasonably accomplished one, too) who thought that all CS units should be binary, e.g. Gigabit Ethernet should be 931Mbit/s, not 1000MBit/s.

I disagreed strongly - I think X-per-second should be decimal, to correspond to Hertz. But for quantity, binary seems better. (modern CS papers tend to use MiB, GiB etc. as abbreviations for the binary units)

Fun fact - for a long time consumer SSDs had roughly 7.37% over-provisioning, because that's what you get when you put X GB (binary) of raw flash into a box, and advertise it as X GB (decimal) of usable storage. (probably a bit less, as a few blocks of the X binary GB of flash would probably be DOA) With TLC, QLC, and SLC-mode caching in modern drives the numbers aren't as simple anymore, though.

pjdesno··on Court orders restart of all US offshore wind power construction
In the 70s the oil companies were furious that Venezuela (if my understanding is correct) revoked their leases and forced them to abandon their equipment investments.

That's basically what the administration was trying to do here, under a legal system which (unlike Venezuela in the 70s) is very keen on protecting corporate investment. It seems like a classic "takings" case.

pjdesno··on Parking lots as economic drains
Cambridge MA was rezoned in the mid-20th century to suburban standards, in a city where land in a mid-range neighborhood now costs $350-$400 per square foot. Besides putting in floor area ratio requirements that required most of the existing housing to be grandfathered, they added a requirement of one parking spot per unit.

If it's a traditional 1-car driveway that's about $70K worth of land, although in the end it's zero-sum because it takes away an on-street spot. Parking garages for larger developments probably cost as much or more per parking space - they use less land, but they're expensive to build.

It's insane, and they're trying to fix it, and approving special permits left and right to omit the spots.

pjdesno··on The '3.5% rule': How a small minority can change the world (2019)
Despite whatever the NRA says, governments have a near-monopoly on violence. They've got all the good weapons - Google "Neal Brennan Has a Plan to Test the 2nd Amendment" for a humorous take on this.

That leaves non-violence, which is perhaps a misnomer - there's often plenty of violence, but it's used by the government, not its opponents. When non-violence works, it's typically because those working for the government start refusing to kill their fellow countrymen - they defect, in non-violence scholar-speak.

There's an authoritarian playbook for countering this - you recruit your forces from ethnic minorities, often rural, who already hate the people who are protesting. Thus you see ICE recruits from the Deep South and National Guard troops from Texas being sent into Northern cities.

pjdesno··on Tesla fined for repeatedly failing to help UK police over driving offences
Tesla finance seems legendary in this regard. A friend here in MA got hauled down to city hall because their auto excise taxes were 3 years overdue - they're the responsibility of the owner of a leased car, in this case Tesla finance. According to the person there, the town (50K people or so) had a bunch of Tesla owners in the same boat.
pjdesno··on Dev-owned testing: Why it fails in practice and succeeds in theory
If your review was based on features shipped, and your bosses let you send PRs with no tests, would you? And before you say "no" - would you still do that if your company used stack ranking, and you were worried about being at the bottom of the stack?

Developers may understand that "XYZ is better", but if management provides enough incentives for "not XYZ", they're going to get "not XYZ".

pjdesno··on Dev-owned testing: Why it fails in practice and succeeds in theory
No, they got it published in ACM SIGSOFT Software Engineering Notes.

That's one of the things that publication is for.

The paper is a well-supported (if not well-proofread) position paper, synthesizing the author's thoughts and others' prior work but not reporting any new experimental results or artifacts. The author isn't an academic, but someone at Amazon who has written nearly 20 articles like this, many reporting on the intersection of academic theory and the real world, all published in Software Engineering Notes.

As an academic (in systems, not software engineering) who spent 15 years in industry before grad school, I think this perspective is valuable. In addition academics don't get much credit for this sort of article, so there are a lot fewer of them than there ought to be.

pjdesno··on I/O is no longer the bottleneck? (2022)
Since no one else seems to have pointed this out - the OP seems to have misunderstood the output of the 'time' command.

  $ time ./wc-avx2 < bible-100.txt
  82113300
  
  real    0m0.395s
  user    0m0.196s
  sys     0m0.117s
"System" time is the amount of CPU time spent in the kernel on behalf of your process, or at least a fairly good guess at that. (e.g. it can be hard to account for time spent in interrupt handlers) With an old hard drive you would probably still see about 117ms of system time for ext4, disk interrupts, etc. but real time would have been much longer.

    $ time ./optimized < bible-100.txt > /dev/null

    real    0m1.525s
    user    0m1.477s
    sys     0m0.048s
Here we're bottlenecked on CPU time - 1.477s + 0.048s = 1.525s. The CPU is busy for every millisecond of real time, either in user space or in the kernel.

In the optimized case:

  real    0m0.395s
  user    0m0.196s
  sys     0m0.117s
0.196 + 0.117 = 0.313, so we used 313ms of CPU time but the entire command took 395ms, with the CPU idle for 82ms.

In other words: yes, the author managed to beat the speed of the disk subsystem. With two caveats:

1. not by much - similar attention to tweaking of I/O parameters might improve I/O performance quite a bit.

2. the I/O path is CPU-bound. Those 117ms (38% of all CPU cycles) are all spent in the disk I/O and file system kernel code; if both the disk and your user code were infinitely fast, the command would still take 117ms. (but those I/O tweaks might reduce that number)

Note that the slow code numbers are with a warm cache, showing 48ms of system time - in this case only the ext4 code has to run in the kernel, as data is already cached in memory. In the cold cache case it has to run the disk driver code, as well, for a total of 117ms.

pjdesno··on C Is Best (2025)
> was in unsafe code, and related to interop with C

1) "interop with C" is part of the fundamental requirements specification for any code running in the Linux kernel. If Rust can't handle that safely (not Rust "safe", but safely), it isn't appropriate for the job.

2) I believe the problem was related to the fact that Rust can't implement a doubly-linked list in safe code. This is a fundamental limitation, and again is an issue when the fundamental requirement for the task is to interface to data structures implemented as doubly-linked lists.

No matter how good a language is, if it doesn't have support for floating point types, it's not a good language for implementing math libraries. For most applications, the inability to safely express doubly-linked lists and difficulty in interfacing with C aren't fundamental problems - just don't use doubly-linked lists or interface with C code. (well, you still have to call system libraries, but these are slow-moving APIs that can be wrapped by Rust experts) For this particular example, however, C interop and doubly-linked lists are fundamental parts of the problem to be solved by the code.

pjdesno··on Akin's Laws of Spacecraft Design (2011) [pdf]
> "Trellis coded modulation got this rate up to 50 kilobaud by the 1990s"

Not quite, and an interesting story that fits these engineering maxims better than you might think.

An analog channel with the bandwidth and SNR characteristics of a landline phone line has (IIRC) a Shannon capacity of 30-something kbit/s, which was closely approached with V.34, which used trellis coded modulation plus basically every other coding and equalization mechanism they knew of at the time to get to 33.6kb/s on a good day.

But... by the 80s or so the phone system was only analog for the "last mile" to the home - the rest of the system was digital, sending 8-bit samples (using logarithmic mu-law encoding) at a sampling rate of 8000 samples/s, and if you had a bunch of phone lines coming into a facility you could get those lines delivered over a digital T1 link.

Eventually someone realized that if your ISP-side modem directly outputs digital audio, the downstream channel capacity is significantly higher - in theory the limit is probably 64000 bit/s, i.e. the bit rate of the digital link, although V.90 could only achieve about 56000 b/s in theory, and more like 53kb/s in practice. (in particular, the FCC limited the total signal power, which means not all 64000 combinations of bits in a second of audio would be allowable)

I worked with modem modulation folks when I was a co-op student in the mid-80s. They had spent their lives thinking about the world in terms of analog channels, and it took some serious out-of-the-box thinking on someone's part to realize that the channel was no longer analog, and that you could take advantage of that.

A few years later those same folks all ended up working on cable modems, and it was back to the purely analog world again.

pjdesno··on Inside CECOT – 60 Minutes [video]
Bryan Cantrill, "Do not fall into the trap of anthropomorphizing Larry Ellison" https://news.ycombinator.com/item?id=15886728

The specific lines about Ellison and a lawnmower start at 38:28 in the linked video; the entire Oracle rant starts at about 34:00.

pjdesno··on The Coffee Warehouse
I've got to say, there's nothing more infuriating than standing in front of a register while everyone behind the counter is busy working on online orders that won't get picked up for quite a while, as evidenced by their repeatedly calling out names for the online orders waiting forlornly at the end of the counter.

(this is at a campus Dunkies where there's no drive-through, and I have a hard deadline to start my lecture. If there's no line at the register, and I've got five minutes before class starts in a room down the hall, it shouldn't take a logistical genius to get me a regular coffee in time for class)

pjdesno··on Samsung may end SATA SSD production soon
Yeah, you need an adapter. Search on eBay for "freeNAS" and "LSI" and you'll find a bunch listed for way under $100.
pjdesno··on Samsung may end SATA SSD production soon
> Maybe a boot drive for some VM host?

Actually that's a really common use - I've bought a half dozen or so Dell rack mount servers in the last 5 years or so, and work with folks who buy orders of magnitude more, and we all spec RAID0 SATA boot drives. If SATA goes away, I think you'll find low-capacity SAS drives filling that niche.

I highly doubt you'll find M.2 drives filling that niche, either. 2.5" drives can be replaced without opening the machine, too, which is a major win - every time you pull the machine out on its rails and pop the top is another opportunity for cables to come out or other things to go wrong.

pjdesno··on Samsung may end SATA SSD production soon
No advantage over SAS here - it's the same form factor.
pjdesno··on Samsung may end SATA SSD production soon
The storage markets I can think of, off the top of my head: 1. individual computers 2. hobbyist NAS, which may cross over at the high end into the pro audio/video market 3. cloud 4. enterprise

#1 is all NVMe. It's dominated by laptops, and desktops (which are still 30% or so of shipments) are probably at the high end of the performance range.

#2 isn't a big market, and takes what they can get. Like #3, most of them can just plug in SAS drives instead of SATA.

#3 - there's an enterprise market for capacity drives with a lower per-device cost overhead than NVMe - it's surprisingly expensive to build a box that will hold dozens of NVMe drives - but SAS is twice as fast as SATA, and you can re-use the adapters and mechanicals that you're already using for SATA. (pretty much every non-motherboard SATA adapter is SAS/SATA already, and has been that way for a decade)

#4 - cloud uses capacity HDDs and both performance and capacity NVMe. They probably buy >50% of the HDD capacity sold today; I'm not sure what share of the SSD market they buy. The vendors produce whatever the big cloud providers want; I assume this announcement means SATA SSDs aren't on their list.

I would guess that SATA will stay on the market for a long time in two forms: - crap SSDs, for the die-hards on HN and other places :-) - HDDs, because they don't need the higher SAS transfer rate for the foreseeable future, and for the drive vendor it's probably just a different firmware load on the same silicon.

pjdesno··on Apple Maps claims it's 29,905 miles away
Back in the days of MapQuest there was a (usually) very good site called mapsonus.com, but it evidently had one of the ferries that crossed Boston Harbor in its map as a zero distance link.

Since it was offline, the bug was obvious although a bit frustrating - you had to put in multiple waypoints to make it forget its urge to send you on the ferry to Hull when you were trying to get to parts of the South Shore.

pjdesno··on Apple Maps claims it's 29,905 miles away
In Boston it's a very frequent occurrence to be driving in the Central Artery Tunnel and have your map software think you're on the surface, or vice versa, or to be on a highway overpass and again have it think you're on a surface road that is inaccessible from your location. You get used to it.

This seems like an entirely different level of craziness, though.

pjdesno··on The Typeframe PX-88 Portable Computing System
This is tempting.

I fairly frequently leave my phone in the office and take a clipboard full of lined paper and a ballpoint to a place where I can write without access to the internet - I've got a number of published CS papers and at least one funded grant where a significant amount of writing was done in longhand on paper.

Of course this would require a bit of software work and maybe a brain swap to make it into the sort of portable typewriter that I'm really looking for, but given this as a starting point it should be fairly easy.

One question I have - what is the finished weight?

pjdesno··on We built another object storage
Because (a) you have to mount a file system, so the user running the app needs permission to do that, and (b) It’s really hard to have a filesystem shared across untrusting admin domains.

With S3 you just do an http request and you’re done.

A lot of folks get hung up on the theoretical equivalence of things, and forget that their favorite solution may be flat out unworkable in practice for reasons that have nothing to do with the theoretical features they’re talking about.

← PreviousPage 2 of 9Next →