HNHacker News
TopNewBestAskShowJobs

singron

2,697 karma · joined March 2, 2013

Opinions are my own.

Send hate mail and memes to eculperic@gmail.com

submissionscomments
singron··on Futurelock: A subtle risk in async Rust
This sounds very similar to priority inversion. E.g. if you have Thread T_high running at high priority and thread T_low running at low priority, and T_low holds a lock that T_high wants to acquire, T_high won't get to run until T_low gets scheduled.

The OS can detect this and make T_low "inherit" the priority of T_high. I wonder if there is a similar idea possible with tokio? E.g. if you are awaiting a Mutex held by a future that "can't run", then poll that future instead. I would guess detecting the "can't run" case would require quite a bit of overhead, but maybe it can be done.

I think an especially difficult factor is that you don't even need to use a direct await.

    let future1 = do_async_thing("op1", lock.clone()).boxed();
    tokio::select! {
      _ = &mut future1 => {
        println!("do_stuff: arm1 future finished");
      }
      _ = sleep(Duration::from_millis(500)) => {
        // No .await, but both will futurelock on future1.
        tokio::select! {
          _ = do_async_thing("op2", lock.clone()) => {},
          _ = do_async_thing("op3", lock.clone()) => {},
        };
      }
    };
I.e. so "can't run" detector needs to determine that no other task will run the future, and the future isn't in the current set of things being polled by this task.
singron··on AI scrapers request commented scripts
You don't need javascript to parse HTML. Just use an HTML parser. They are very fast. HTML isn't a regular language, so you can't parse it with regular expressions.

Obligatory: https://stackoverflow.com/questions/1732348/regex-match-open...

singron··on Nix Derivation Madness
It really doesn't matter. As a normal user, you don't use `drv` files directly, and everything you configure yourself will use attribute paths in nixpkgs. E.g. `pkgs.ruby` or `pkgs.ruby_3_3`.
singron··on Jujutsu at Google [video]
Thanks for presenting. I was a fig lover so this area is interesting to me.

This is a really hard topic since it's hard to understand the significance of the jj contributions without explaining a ton of internal details like Piper, CitC, TAP, blaze, etc. I think you struck a good balance here.

I don't think you need to "be more engaging" or be more passionate, and when people say that, it indicates they aren't engaged, but it's not a useful suggestion of how to improve.

I think the main issue was that on just about every slide, I found myself wanting to read ahead on the slides instead of waiting to listen to you talk. There are a couple factors to this:

1. Impatience. I want to ingest information faster. Believe it or not, the "talk slowly" advice is usually not good for a technical talk with decent acoustics. E.g. listen to a talk by Bryan Cantrill and notice how fast he talks while still being clear. Rehearsal helps, but if you simplify your slides, you can also make them easier to perform. Listen to a random slide in your video and notice how much time is filled with silence or filler words.

2. Scanning the slide because I'm unsynchronized with the speaker. E.g. if everything you say isn't clearly correlated with the content of the slide in a linear way, then I have to scan the slide to attempt to "resychronize" and figure out what bullet you are on. Sometimes presenters don't want to read the bullets verbatim, which makes it difficult to match up the spoken language with the written language, whereas if you said the first word in a bullet, I could quickly seek to that line. Skipping bullets also causes this, especially at the end of a slide, since then I want to try to read all the bullets on a slide ahead of you in case you decide to skip them in the future.

Fewer bullets per slide and fewer words per bullet help with both of these. Aggressively cut or summarize material so you don't have to skip over anything (e.g. instead of listing 6 jj piper commands and only talking about 2, list just 2 and write the number of total commands e.g. "we added 22 subcommands including mail and submit"). Put extra material (if any) in an appendix after the end if you think you might have extra time or want to use it for Q&A. Rehearse until you can belt out what you want to say on each slide without fillers or pauses (and record yourself so you can tell how much you are doing this). When I'm sharing my screen, I actually like to point my mouse cursor at the bullet I'm on so nobody has to guess where we are, but sometimes that's not available.

Your first slides essentially teach the audience how to consume your talk. E.g. a good pattern is if (1) all your bullets are short (2) you read every bullet verbatim, elaborate on that bullet for a bit, and then repeat on the next bullet. If you stick with a pattern like that, then your audience knows how to follow along. Other patterns work too.

I'm sorry this wasn't shorter and I hope it's helpful.

singron··on How OpenAI uses complex and circular deals to fuel its multibillion-dollar rise
Nvidia isn't a fab.
singron··on Minecraft removing obfuscation in Java Edition
Proguard can also apply optimizations while it obfuscates. I think a good JVM will eventually do most of them itself, but it can help code size and warm-up. I'm guessing as JVMs get better and everyone is less sensitive to file sizes, this matters less and less.
singron··on Kafka is Fast – I'll use Postgres
Re 1. Look up non-blocking migrations for postgres. You can generally do large schema migrations while only briefly taking exclusive locks. It's a common mistake to perform a blocking migration and lock up your database (e.g. using CREATE INDEX on an existing table instead of CREATE INDEX CONCURRENTLY).

There are globally shared resources, but for the most part, locks are held on specific rows or tables. Unrelated transactions generally won't block on each other.

Also running a Very High Availability cluster is non-trivial. It can take a minute to fail over to a replica, and a busy database can take a while to replay the WAL after a reboot before it's functional again. Most people are OK with a couple minutes of downtime for the occasional reboot though.

I think this really depends on your scale. Are you doing <100 messages/second? Definitely stick with postgres. Are you doing >100k messages/second? Think about Kafka/redpanda. If you were comfortable with postgres (or you will be since you are building the rest of your project with it), then you want to stick with postgres longer, but if you are barely using it and would struggle to diagnose an issue, then you won't benefit from consolidating.

Postgres will also be more flexible. Kafka can only do partitions and consumer groups, so if your workload doesn't look like that (e.g. out of order processing), you might be fighting Kafka.

singron··on Kafka is Fast – I'll use Postgres
Re (2) there is a lot of vacuuming, but the table is small, and it's usually very fast and productive.

You can run into issues with scheduled queues (e.g. run this job in 5 minutes) since the tables will be bigger, you need an index, and you will create the garbage in the index at the point you are querying (jobs to run now). This is a spectacularly bad pattern for postgres at high volume.

singron··on Kafka is Fast – I'll use Postgres
I've basically never had a problem with MSK brokers. The issue has usually been "why are we rebalancing?" and "why aren't we consuming?", i.e. client problems.
singron··on Kafka is Fast – I'll use Postgres
Kafka also doesn't give you all those things. E.g. there is no automatic dead-lettering, so a consumer that throws an exception will endlessly retry and block all progress on that partition. Kafka only stores bytes, so schema is up to you. Exactly-once is good, but there are some caveats (you have to use kafka transactions, which are significantly different than normal operation, and any external system may observe at-least-once semantics instead). Similar exactly-once semantics would also be trivial in an RDBMS (i.e. produce and consume in same transaction).

If you plan on retaining your topics indefinitely, schema evolution can become painful since you can't update existing records. Changing the number of partitions in a topic is also painful, and choosing the number initially is a difficult choice. You might want to build your own infrastructure for rewriting a topic and directing new writes to the new topic without duplication.

Kafka isn't really a replacement for a database or anything high-level like a ledger. It's really a replicated log, which is a low-level primitive that will take significant work to build into something else.

singron··on Kafka is Fast – I'll use Postgres
The log_counter table tracks this. It's true that a naive solution using sequences does not work for exactly the reason you say.
singron··on Summary of the Amazon DynamoDB Service Disruption in US-East-1 Region
Some of the biggest failures have been BGP leaks/hijacks. E.g. https://www.ripe.net/about-us/news/youtube-hijacking-a-ripe-...

This has gotten significantly better in recent years, but it used to be possible and common for a single misbehaving AS to cause global issues.

singron··on Summary of the Amazon DynamoDB Service Disruption in US-East-1 Region
They do fail catastrophically. E.g. https://en.wikipedia.org/wiki/Northeast_blackout_of_2003

I think you could argue AWS is more complex than the electrical grid, but even if it's not, the grid has had several decades to iron out kinks and AWS hasn't. AWS also adds a ton of completely new services each year in addition to adding more capacity. E.g. I bet these DNS Enactors have become more numerous and their plans became much larger than when they were first developed, which has greatly increased the odds of experiencing this issue.

singron··on AI is making us work more
It depends. Fine-tuning is a significant productivity drag over in-context learning, so you shouldn't attempt it lightly. If you are working on low-latency tasks or need lower marginal costs, then fine-tuning a small model might be the only way to achieve your goals.
singron··on J.P. Morgan's OpenAI loan is strange
Microsoft already has rights to the IP. If OpenAI goes bankrupt, they can hire the employees without buying the company (similar to their offer in 2023 when the board tried to fire Sam Altman). Although if OpenAI goes completely bust, that probably means interest in AI across the industry has tanked, so an acquihire makes little sense over just hiring available talent on the market.
singron··on US Passport Power Falls to Historic Low
These days at many airports, precheck has the same procedures as normal screening. You keep your shoes on, laptops and liquids stay in the bag, and you don't show a boarding pass. And the lines are the same length.

Global entry is a real difference, but you need to travel internationally quite a bit to make the application/renewal process worth it (conditional approval backlog is 12-24 months now, although it seems you skip to the front just in time to do interview-on-arrival on your next trip).

singron··on Why Self-Host?
Not OP, but yes. For personal use, you don't have enough traffic to establish reputation, so you get constantly blocked regardless of DKIM/DMARC/SPF/rDNS. Receiving mail is reliable though, so you can do that yourself and outsource just sending to things like Amazon SES or SMTP relays.
singron··on Asked to do something illegal at work? Here's what these software engineers did
The media is terrible about reporting on "maximum sentences". The federal sentencing guidelines are super complicated and lazy journalists usually just add all the maximum numbers up and write these egregious numbers. In reality, a lot of the charges are deduplicated, can be served concurrently, or are automatically attenuated by factors like being a 1st time offender.
singron··on Arbitrary code execution in Unity Runtime
Godot has a known issue where the built in deserialization can lead to arbitrary code execution. E.g. a save file could be modified to execute any script when it's deserialized.
singron··on OpenAI Is Just Another Boring, Desperate AI Startup
The depreciation schedule doesn't affect long term profitability. It just shifts the profits/loss in time. It's a tool to make it appear like you paid for something while it's generating revenue. Any company would look really profitable for a while if it chose long enough depreciation schedules (e.g. 1000 years), but that's just deferring losses until later.
singron··on OpenAI's H1 2025: $4.3B in income, $13.5B in loss
Will people use ChatGPT if it's stuffed full of ads? It seems like the belief that ads are turn-key is useful to their valuation, but if ads actually bomb, then they will take a huge hit.
singron··on OpenAI's H1 2025: $4.3B in income, $13.5B in loss
I think it makes the most sense this way, but I've seen it accounted for in other ways. E.g. if free users produce usage data that's valuable for R&D, then they could allocate a portion of the costs there.

Also, if the costs are split, there usually has to be an estimation of how to allocate expenses. E.g. if you lease a datacenter that's used for training as well as paid and free inference, then you have to decide a percentage to put in COGS, S&M, and R&D, and there is room to juice the numbers a little. Public companies are usually much more particular about tracking this, but private companies might use a proxy like % of users that are paid.

OpenAI has not been forthcoming about their financials, so I'd look at any ambiguity with skepticism. If it looked good, they would say it.

singron··on A SQL Heuristic: ORs Are Expensive
There are many papers on ML for query planners. You can search for "Learned Query Optimization". Some use ML just for the cardinality estimation.
singron··on Fast UDP I/O for Firefox in Rust
It's true, but since this is a Firefox project, it is relevant since rust was largely developed for years specifically for (re)writing exactly this kind of code in Firefox.
singron··on ChatGPT Pulse
I don't think there is anything factually wrong with this criticism, but it largely rehashes caveats that are already well explored in the original paper, which goes through unusual lengths to clearly explain many ways the study is flawed.

The study gets so much attention since it's one of the few studies on the topic with this level of rigor on real-world scenarios, and it explains why previous studies or anecdotes may have claimed perceived increases in productivity even if there wasn't any actual increases. It clearly sets a standard that we can't just ask people if they felt more productive (or they need to feel massively more productive to clearly overcome this bias).

singron··on Trump to impose $100k fee for H-1B worker visas, White House says
Instead of a $100k lump sum by the first employer, what about $10k each year by the current employer? Or even $2.5k each quarter? That way there is no particular incentive to poach a "paid-off" H1B employee, and the company doesn't have to worry about making a $100k investment up front.
singron··on AI Adoption Rate Trending Down for Large Companies
The results are aggregated and not sent to investors. There is no incentive to lie, and this survey is voluntary, so if you respond at all, it's out of some civic duty.
singron··on AI Adoption Rate Trending Down for Large Companies
I believe it's the second case. Otherwise far over 100% of firms "adopted" AI by now, which doesn't make sense unless they keep un-adopting and re-adopting.

The question from BTOS is

> Between MMM DD – MMM DD, did this business use Artificial Intelligence (AI) in producing goods or services? (Examples of AI: machine learning, natural language processing, virtual agents, voice recognition, etc.)

singron··on Anthropic raises $13B Series F
It doesn't make sense to amortize model training over multiple years since they train multiple models per year (e.g. Claude 3.5, 3.7, and 4 were released within 12 months). Or you can, but then you have to overlap amortization schedules multiple times over. E.g. if they amortized over 24 months, then they would still be amortizing Claude 2.1, 3, 3.5, 3.7, 4, and 4.1.
singron··on AI models need a virtual machine
This article is so devoid of specifics, I'm not entirely sure I know what they are proposing. A VM implies an instruction set of some kind with control flow, registers, etc. but they spend the whole article on authorization, which seems orthogonal to the concept. I think what they really mean is a sandbox, jail, or container where a "syscall" equivalent let's the model interact with the outside world.
← PreviousPage 4 of 27Next →