placeholder

How malloc broke Serenity's JPGLoader, or: how to win the lottery - sin-ack's writings

I got the chance to investigate an interesting bug in SerenityOS this week. It was related to the decoding of JPG images in the operating system. For some reason, when a JPG image is viewed, it comes out like this: Lenna, showing up with incorrect colors. Weird, huh? Also seems like a simple confusi...

Click to view the original at sin-ack.github.io

Hasnain says:

As an HN commenter alludes, this is why hashmaps should explicitly always randomize iteration order (at least in test mode) so people don’t rely on this behavior. It was surprising how many bugs shook out when we did this at FB

“Thanks to CxByte, Gunnar, Andrew and Brian for their help with debugging this, and their helpful tips. Gunnar in particular was the one who uncovered this bug, and despite my satirical jab in the commit message helped uncover this very interesting bug, so he’s the one who made this post possible.

Also, thanks to the person who introduced this bug (the commit log gets a little fuzzy, so I’m not quite sure who did) and hope he buys a lottery ticket. :^)”

Posted on 2024-07-07T17:26:09+0000

placeholder

Advantages of incompetent management

What constitutes managerial competence? As a vague starting point for an answer, we could say that competent management sets achievable objectives and then achieves them, by organizing and incentivizing the necessary work.

Click to view the original at yosefk.com

Hasnain says:

Kept nodding while reading this.

“Healthy laziness begets agility - you have way less code, less systems, less everything, and therefore way more ability to maneuver and actually change things with a small number of motivated people - and there’s always a small number of motivated people in any place, and this place might even keep them, if they learn to bargain for raises. And you also don’t need to grow as much, because you don’t need to be adding people to take care of all these sprawling systems that you quickly come to depend on.”

Posted on 2024-07-07T07:22:00+0000

placeholder

Hasnain says:

“All this provides a read-only SQL queryable data in a single file representing OpenStreetMap metadata. The project evolved from merely transferring format migration to optimizing it for efficient search. This highlights the importance of iterative refinement and the power of combining different technologies to solve problems.”

Posted on 2024-07-07T04:33:43+0000

placeholder

Hasnain says:

“During the COVID-19 pandemic, when millions of professionals suddenly began working from home, some employers rolled out software that captured screenshots of their employees’ computers and algorithmically scored their productivity. It’s easy to imagine how the current boom in generative AI could build on these foundations: For example, large language models could digest every email and Slack message written by employees to provide managers with summaries of workers’ productivity, work habits, and emotions. These types of technologies not only pose harm to people’s dignity, autonomy, and job satisfaction, they also create information asymmetry that limits people’s ability to challenge or negotiate the terms of their work.

We can’t let it come to that. The battles that gig workers are fighting are the leading front in the larger war for workplace rights, which will affect all of us. The time to define the terms of our relationship with algorithms is right now.”

Posted on 2024-07-07T02:33:16+0000

placeholder

Gloom about the ‘day after’ the Gaza war pervasive among Mideast scholars | Brookings

A new survey of Middle East scholars suggests that a two-state solution to the horrific devastation of the Gaza war is highly unlikely.

Click to view the original at brookings.edu

Hasnain says:

“Their assessment of the resultant reality is equally dark: Respondents describe Israeli actions in damning terms, with 41% saying they constitute major war crimes akin to genocide, nearly 34% saying they constitute genocide, and 16% saying they are not akin to genocide, but are still major war crimes. While these views may seem surprising, they are not markedly different from the views of some segments of the American public, especially Democrats, with one recent poll showing a majority of Democrats saying Israeli actions amounted to genocide.”

Posted on 2024-07-07T00:50:46+0000

placeholder

FIFO queues are all you need for cache eviction

FIFO queues are all you need for cache eviction Computer Systems Cache · August 01, 2023 · by Juncheng Yang More information can be found at https://s3fifo.com EDIT: Many people have noticed a bug in pseudocode of the original blog post when S3-FIFO was posted on lobste.rs. This post has been upda...

Click to view the original at blog.jasony.me

Hasnain says:

Yay for caches. And simplicity.

“We demonstrate that a cache often experiences a higher one-hit-wonder ratio than common full trace analysis. Our study on 6594 traces reveals that quickly removing one-hit wonders (quick demotion) is the secret weapon of many advanced algorithms. Motivated by this, we design S3-FIFO, a Simple and Scalable cache eviction algorithm composed of only Static FIFO queues. Our evaluation shows that S3-FIFO achieves better and more robust efficiency than state-of-the-art algorithms. Meanwhile, it is more scalable than LRU-based algorithms.”

Posted on 2024-07-07T00:48:39+0000

placeholder

Synchronization is bad for scale

In the early days of Mailgun I started working on a distributed lock service. Something I had worked on briefly at Rackspace. Even as I implemented the thing, I had the sneaky suspicion that it was a bad idea.

Click to view the original at wippler.dev

Hasnain says:

“Since synchronization is literally built into the database, it’s very tempting to use the Database and the transactions they provide as the synchronization point for EVERYTHING. I would advise caution here, because the database is an expensive part of; and often is THE MOST EXPENSIVE part of your infrastructure. It’s better suited for storing bits on disk, than for synchronizing all of the things for you. If you rely on the DB for synchronization, you will inevitably need to shard and rebalance your database in order to continue scaling, and BTW, you are scaling the most expensive part of your infra.”

Posted on 2024-07-06T22:00:22+0000

placeholder

I Have No Constructor, and I Must Initialize

It has been three days. The room is cold and dark, but your screens are blinding. You feel disoriented as you come in and out of dissociative episodes. Now and again, you laugh, to no accompaniment. Why are you here? Was this your fault?

Click to view the original at consteval.ca

Hasnain says:

“That should be most of it. I mean, there are special initialization rules for static variables (constant initialization included), but, like, do you really care? In my humble opinion, here’s the key takeaway: just write your own fucking constructors! You see all that nonsense? Almost completely avoidable if you had just written your own fucking constructors. Don’t let the compiler figure it out for you. You’re the one in control here. Or is it that you think you’re being cute? You just added six instances of undefined behaviour to your company’s codebase, and now twenty Russian hackers are fighting to pwn your app first. Are you stupid? What’s the matter with you? What were you thinking? God.”

Posted on 2024-07-06T06:23:19+0000

placeholder

Beating NumPy’s matrix multiplication in 150 lines of C code

TL;DR The code from the tutorial is available at matmul.c. This blog post is the result of my attempt to implement high-performance matrix multiplication on CPU while keeping the code simple, portable and scalable. The implementation follows the BLIS design, works for arbitrary matrix sizes, and, wh...

Click to view the original at salykova.github.io

Hasnain says:

“TL;DR The code from the tutorial is available at matmul.c. This blog post is the result of my attempt to implement high-performance matrix multiplication on CPU while keeping the code simple, portable and scalable. The implementation follows the BLIS design, works for arbitrary matrix sizes, and, when fine-tuned for an AMD Ryzen 7700 (8 cores), outperforms NumPy (=OpenBLAS), achieving over 1 TFLOPS of peak performance across a wide range of matrix sizes.”

Posted on 2024-07-05T00:21:31+0000

placeholder

How Uber Migrated Financial Data from DynamoDB to Docstore

Introduction: Each day, Uber moves millions of people around the world and delivers tens of millions of food and grocery orders. This generates a large number of financial transactions that need to be stored with provable completeness, consistency, and compliance. LedgerStore is an immutable, ledger...

Click to view the original at uber.com

Hasnain says:

This is how we measured the success of this critical project:

* Not a single production incident, given how critical money movement is for Uber
* We didn’t have to rollback the migration for a single table
* We backfilled 250 billion unique records and not a single data inconsistency has been detected so far, with the new architecture in production for over 6 months
* Our new data model reduced complexity in the query path, and we observed latency improvements in both read and write path on Docstore
* The project also resulted in technology consolidation, reducing external dependencies

From a business impact perspective, operating LedgerStore is now very cost effective due to reduced spend on DynamoDB. The estimated yearly savings are $6 million per year, and we also laid the foundation for such other future initiatives.

Posted on 2024-07-04T22:45:32+0000