HNHacker News
TopNewBestAskShowJobs

gopalv

4,101 karma · joined August 20, 2012

@php.net / @apache.org / @isotopes.ai

https://aidnn.ai

submissionscomments
gopalv··on Weightlifting beats running for blood sugar control, researchers find (2025)
Outside of the (in mice) factor, the study compares optional exercise with mandatory exercise factors.

> To eat, the mice had to lift the lid while wearing a small shoulder collar, causing a squat-like movement that engaged the muscle contractions people use during resistance exercise.

vs

> For the endurance group, mice were given open access to a running wheel, an established model of aerobic exercise

The study is comparing the exercise that came in right before eating, which is effective at sugar control over the exercise done at any time as desired.

Speaking as a runner, I ignore the diet bump which makes me put on extra fat when I am training up for the SF (+2.5 kg over June & July is normal).

Mostly because I eat more the night before and mostly light carbs.

In fact, I'd bet my resting metabolism is actually slower when I'm training and the resting heart rates drop to 45 bpm & sleep takes up fewer calories too.

The muscle mass increase from lifting probably never cuts your metabolism needs when you are recovering or resting.

Cardiovascular fitness doesn't really cause weight loss when you're resting. So you'll be comparing something which reduces the calorie spend for the all the time you're not running vs something slightly bumps the spend when you are not lifting.

gopalv··on The future of Flipper Zero development
> I don't think I would use it enough to justify the investment

This is not a rational purchase - most of the rule breaking done with the zero is for fun or convenience, rather than being truly illegal.

It used to be more fun before the hotels started handing out NFC unlocks with your phone.

Still, being able to send each other a key for a hotel room on Signal is a nice trick if you are traveling with a sufficiently tech savvy group of people.

gopalv··on Optimizing an algorithm that's quadratic by design
The rule partial order problem seems to be very similar to how Rule engines are optimized for ACL rule application.

> Once per candidate, we precompute a bitmask, an integer whose bits flag which rules that candidate is eligible for. For a pair, the bitwise AND of their two masks is exactly the set of rules both are eligible for, and we check only those.

Once I see a bit-mask loop, the next item I pick up is a Karnaugh Map[1] as a way of looking at the rules.

If one side is generally immutable to automatically reorder the generators of the bits (i.e can I turn a 192 bit expression into a 64 bit followed by a 128 bit - if so which bits are important).

The C++ template hacks over this looks a bit like a fastdiv from Lemire.

The specific one where I spent 2+ months optimizing this was the UserAgent matcher with regexes - an extension replacement for the get_browser() in PHP where the goal was to split up the regexes and build a KV Map for it, so that you can run 40+ small regexes instead of looping through 400.

[1] - https://en.wikipedia.org/wiki/Karnaugh_map#Don't_cares

gopalv··on Postgres transactions are a distributed systems superpower
> Is it really a distributed system or just a bunch of services with a central database?

I've asked myself this question every single time I've had to use Zookeeper.

Apache Kafka being the poster child of the problem, with HBase in a close second.

gopalv··on NUMA: Cores, memory, and the distance between them
> Kubernetes deployed on a server with hundreds of CPU cores

Was that a Power9 or some sort of IBM machine?

Not all NUMA is the same, ccNUMA from the Intel is a different beast from the PPC version of the same.

gopalv··on TerraPower in deal with Meta for eight Natrium 345 MW nuclear plants
The name makes me think it is a molten salt reactor, but it uses liquid sodium. Still aptly named.

I was hoping the Thorium molten salt ones with atmospheric pressure vessels would pick up pace thanks to this boom in power demand or Helion would arrive on the scene right on time for this.

gopalv··on How TimescaleDB compresses time-series data
> What does compression do to query performance?

That section is the most relevant whenever compression in a DB is discussed.

The purpose of a database is to find, aggregate or update data - storage is where the trade-off gets expressed. There are no silver bullets here.

Any method of compression which speeds up either filter rejection or scan rate is better than something that only trades off IO for CPU usage.

For example, dictionary encoding can be slower to read (because you decompress the whole dictionary and not just the skip read after filter), but not if you can squeeze out an IN clause by turning string comparisons into O(1) dictionary followed by a simple integer filter. Remember, this can be arbitrarily complex (Druid is a great example of this) and then the bitmaps can be used because the dictionary index will be a dense 0-N.

Even better if that can feed a deterministic operation like UPPER() so that you do it over the dictionary hits once, instead of each row. You can even use it over the same hash slot, instead of another dictionary collision check or hash computation.

If anyone is looking at JSONB compression, go take a long look at the Variant encoding proposals from Databricks/Snowflake for Iceberg[1].

Turning a single column "payload" JSONB field into chunks which are columnarized and strictly typed allows you to do all the tricks mentioned here, but on loosely typed data but chunk by chunk.

[1] - https://github.com/apache/parquet-format/blob/master/Variant...

gopalv··on The only scalable delete in Postgres is DROP TABLE
> So in terms of allocating space, it's more like a delete plus an insert.

Unless you're using zHeap, you have a narrow Heap-only-Tuples scenario where the indexes stay the same. TOAST kinda helps there, if the update is off the tuple area itself. The original zHeap docs have a lot of detail about why an UNDO log can help with long running transactions from the past etc.

That is a postgresql specific thing though. Mysql indexes were created with the idea of different storage engines in mind, so Mysql doesn't suffer from the index update ovehead on update/delete the same way.

Uber had a long blog post about switching to Mysql from Postgres for wide tables with hundreds of indexes. The HN entry is still there[1], but I can't read the original post now.

As a side note, I've used postgres partitions to the same effect to drop old data periodically - detach and then drop the partition instead of a direct DELETE (similar tricks in HBase existed).

[1] - https://news.ycombinator.com/item?id=10894047

gopalv··on Making Claude a Chemist
The non-professional side of Organic Chemistry is one place where I think AI would really shine.

Feels complex like solving a Rubik's cube to write down synthesis steps but it is all a sequence of memorized tricks. Do Cannizaro if you want this, Bergmann to do that.

But the synthesis plan is only 10% of the actual work.

The gap between writing down the synthesis step and actually doing it is also extremely large.

Even if you get the right molecule, it might be the wrong way around or just clump up into a useless mess.

The Ritonavir episode of Veritasium is a great example of how all chemistry on paper is a mere shadow of what actually happens in real life.

gopalv··on Waymo Premier
> me Waymo, Uber, and Lyft are methods of last resort.

Most of my Waymo rides were from or to a BART station - the real utility of these services is to pull a last mile when I don't have a car.

There's no better way of getting out of Powell out of the traffic deadlock at 5 PM than BART.

But once you get south of Daly City, there's no timed connections for the surface streets.

If you need to go to Brisbane from Powell, the 2 mile car ride is worth the effect.

gopalv··on Claude Desktop spawns 1.8 GB Hyper-V VM on every launch, even for chat-only use
The weird thing is that this is probably a performance optimization for quick responses when a user asks a question.

My agent harness spins up a VM too, but it spins up on demand, cools down in 10 minutes and warms up when I focus back on the app.

The files it works on actually lives in a mount.

People take more time to type a prompt than the VM takes to spin up on a fast machine and on a slow machine, the cooldown naturally frees RAM back to the machine.

gopalv··on What it feels like to work with Mythos
> It worked for nine and a half hours.

> Again, it wasn’t perfect. As an expert, I was able to spot some errors and omissions (some as a result of the design I had asked for) that I had the AI correct

That's the bit that stuck out to me - that's longer than I would expect to work on a problem in a day or even expect to go back & fix the output of something that has a core reward loop of hours.

My customers are currently clamoring to push down my agent response times from 85 seconds down to below the 20s mark.

At the same time, it is very dissonant to see the industry heading towards hour+ long workflows with an agent.

gopalv··on Why are so many young people getting cancer?
My personal bugbear is the lack of sleep & entirely tied to the phone for that.

I remember being in my 20s and not being able to sleep, but the most distracting thing I could reach for was a pile of books in my bedside table.

Now, I can't sleep, there's an endless stream of things to keep me awake.

The jokes about "5G gives you cancer" is probably not as funny, if you think about the sleep you miss while you doom scroll.

gopalv··on SQLite is all you need for durable workflows
> an example of a case where you'd use SQLite instead of jq or grep through Markdown?

Usually we end up writing a script to incrementally refresh a data-set I'm analyzing (or have someone send me a copy after they pull it).

I've been using sqlite for anything which needs an UPDATE - modifying a row deep inside the data-set with jsonl is a pain.

My github is full of java programs which update sqlite3 files with threadpools and a single big lock around the UPDATE (& then I write or have an agent write code to analyze it).

DuckDB is slowly replacing it in the context of python, simply because of the ease of pushing a UDF into the SQL.

Also because I really like expressing things as LEAD/LAG with a UDF on top.

gopalv··on New York passes pied-a-terre tax
> It is great to want to give your kids a headstart in the world

I might live till 72, my kids will be my age right now when they hit inheritance instead.

That's not a headstart.

gopalv··on Tech CEOs are apparently suffering from AI psychosis
> Well, there is also a big difference that it will not learn over time.

My work is in tick-tock loop of learning - learn without modifying weights, demonstrate learnings to human, but then lock it back in (accumulate and spread).

This looks less like training and more like mentoring.

Getting a human to mentor an agent is a hard UX task, but the learning loop is not a technological problem anymore.

We can only get a tick once a week, no matter how many tocks we can do an hour.

gopalv··on Tech CEOs are apparently suffering from AI psychosis
If you manage 500+ people organization, most of the headaches with agents already exists with you - you set directions, ask people to go run fast in those directions, check in frequently and course correct on results without actually understanding those people do.

Those aren't the deal breakers.

They entirely rely on the competence of the folks they hired and cross-match enforcers with the drivers they have - they deal with fallible people on both sides of that.

The fundamental difference is that the humans are good consequence predictors, have built up reputations they are not willing to trash, can say no to things and in general don't want to go jail.

AI tools look like that, but don't have any of the useful conflict which came for free with employing humans.

It also doesn't have any useless conflict, but not all conflict between what I say and what someone is willing to do is bad conflict.

gopalv··on Ferrari shares fall after launch of first EV as Jony Ive design proves divisive
> he ruined at least some Apple products

In my small circle of car friends, the new Ferrari is being called the "Magic mouse" of ferraris and posting memes of the car upside down with the cable plugged in at the bottom.

I was hoping for an SF90 meets Nevera when they were talking about it originally :(

But that is entirely unoriginal and derivative, compared to a designer wanting to make a mark.

gopalv··on Is "colorectal cancer" rising in "young people"?
> Yes, if you are currently young, you face higher CRC risk than previous generations did when they were young. That’s the bad news.

Unlike the usual Bettridge's law, the answer to the headline is only a qualified "No".

It is a "So is all other cancers!", which is pretty bad news for folks who are young and healthy right now.

gopalv··on Incident with Actions and Pages
> Some sort of 'distributed source control system' maybe

The day it broke away and became centralized was when we had a PR + mandatory "Required actions" to merge to main.

gopalv··on I believe there are entire companies right now under AI psychosis
The AI psychosis is not the anti-opinion to the use of AI.

I use AI coding tools every day, but AI tools have no concept of the future.

The selfish thinking that an engineer has when they think "If this breaks in prod, I won't be able to fix it. And they'll page me at 3AM" we've relied on to build stable systems.

The general laziness of looking for a perfect library on CPAN so that I don't have to do this work (often taking longer to not find a library than writing it by hand).

Have written thousands of lines of code with AI tool which ended up in prod and mostly it feels natural, because since 2017 I've been telling people to write code instead of typing it all on my own & setting up pitfalls to catch bad code in testing.

But one thing it doesn't do is "write less code"[1].

[1] - https://xcancel.com/t3rmin4t0r/status/2019277780517781522/

gopalv··on Elevated error rates on Opus 4.7
Sonnet is also throwing overloaded error.

My systems are hitting exponential delay retries, so this might not get better because retries overload things again.

> {'type': 'error', 'error': {'details': None, 'type': 'overloaded_error', 'message': 'Overloaded'}, 'request_id': 'req_ ...

I can see a weird spike in my cache hit-rate a few minutes before, so this might actually be some extra caching they have thrown in.

gopalv··on Nullsoft, 1997-2004 (2004)
> when BigTechCos buy SmallCos and then unceremoniously kill them off fairly shortly after

There's many reasons, but in general incompetence, malice and small crumbs problem.

I've done my small share of M&A DD work as an engineer, which was a lot of fun, but the results on my sanity and my outlook was bad.

On one hand, you get to go talk to a core founder of a company and they're entirely open to you picking their brain on "Why this" / "Did it pay off?" on pure eV math they did in their heads.

On the other, you see what happens after your recommendation and it is not within your control to change any of it.

Incompetence is generally "Please rewrite this software by our practices" devops hell or "Let's look for better customers for this product, ignore the old ones" in the ICP land. Google and dodgeball comes to mind.

Malice is more clear cut, where "Let's buy it and shut it down, so that we don't have a threat to our business" - I'm eagerly waiting to see what happens with Groq and Nvidia for example. AWS buying Groq would've been massively different. Classic case in point is Apple buying Fingerworks & shutting it down, but launching the iPhone.

Lastly, there's the small crumbs problem (or as it has been famously said "Do not anthropomorphize the lawn mower").

A company can get bought and the product doesn't really add great value to the buyer, beyond getting a few people who really know the space. The small number of people them gets redistributed into a neat set of existing reqs where they just accelerate the existing company's products based on that knowledge or in general fail to surface back to make a significant ripple in the future.

For example, I am wondering what will happen to Promptfoo after OpenAI.

gopalv··on The text mode lie: why modern TUIs are a nightmare for accessibility
> The reality is different. Most modern Text User Interfaces (TUIs) are often more hostile to accessibility than poorly coded graphical interfaces.

The Claude Code rendering UI is the first place where I realized the TUI is more like a DOS or Borland UI system rather than a command line interface.

I was poking about CLAUDE_CODE_NO_FLICKER=1 setting when I realized what exactly this TUI is, it is layers of stuff showing up on top of each other with terminal codes.

Ended up reading the Ink Terminal implementation of React

https://github.com/vadimdemedes/ink

Fascinating how it ends up looking Wordperfect or Wordstar from the past instead of pixel based graphics.

The usability for a vision impaired user is about the same, though I remember braille pads for DOS tools (80x25) which work better than all the screen readers which came later.

gopalv··on The Prompt API
The better part of this is having a local-first AI, particularly because it has tool-calling builtin & structured output.

I haven't pushed out a full version[1] which uses ducklake-wasm + this to make a completely local SQL answering machine, but for now all it does is retype prompts in the browser.

[1] - https://notmysock.org/code/voice-gemini-prompt.html

gopalv··on Flickr: The first and last great photo platform
Flickr was the coolest thing Yahoo had when I worked there (Brickhouse was a close second).

I really loved all the places where they snuck in "Game Never Ending" in the product, because they didn't set out to make a photo sharing product, but steered hard into that.

Flickr was the only property which was allowed their own version of PHP and despite having PHP inside, every single URL said ".gne" (Game Never Ending). I worked for the PHP team and that was my only excuse to show up to work in the SF office instead of being stuck in Sunnyvale when visiting the US.

They had all the right bits of architecture built out - rest of Yahoo had great code (like vespa or the graph behind Yahoo 360), but everything was more complex than it should be.

Flickr had the simplest possible approach that worked and they tried it before building anything more complex - the image urls, the resize queues, the way albums were stored, machine-tags, gps co-ordinates.

I also took a lot of photos to put up on flickr, trying to get featured on the explore page up front - it was like getting published in a magazine.

Every presentation I made had CC images backed by flickr, it was a true commons to share and take.

And then Instagram happened.

gopalv··on Optimization of 32-bit Unsigned Division by Constants on 64-bit Targets
The linked clang PR is also very readable.

https://github.com/llvm/llvm-project/pull/181288/files

As the PR clearly points out, you can do this in a register but not inside vectors.

I don't think fastdiv has had an update in years, which what I've used because compilers can't do "this is a constant for the next loop of 1024" like columnar sql needs.

gopalv··on All elementary functions from a single binary operator
> Multiplication alone requires depth-8 trees with 41+ leaves i.e. minimal operator vocabulary trades off against expression length.

That is sort of comparable to how NAND simplify scaling.

Division is hell on gates.

The single component was the reason scaling went like it did.

There was only one gate structure which had to improve to make chips smaller - if a chip used 3 different kinds, then the scaling would've required more than one parallel innovation to go (sort of like how LED lighting had to wait for blue).

If you need two or more components, then you have to keep switching tools instead of hammer, hammer, hammer.

gopalv··on Nowhere is safe
The first part of the parabellum quote matters - we have to let the people who want peace prepare for war.

The Smedly Butler book was eye opening to read for me.

Diplomacy and trade works wonders when the enemy still wants you to buy things.

Sanctions work when they've got things to sell (and raw materials to buy), not bombed out craters where their factories were.

Si vis pacem ...

gopalv··on DRAM has a design flaw from 1966. I bypassed it [video]
>> It replicates data across multiple, independent DRAM channels with uncorrelated refresh schedules

This is the sort of thing which was done before in a world where there was NUMA, but that is easy. Just task-set and mbind your way around it to keep your copies in both places.

The crazy part of what she's done is how to determine that the two copies don't get get hit by refresh cycles at the same time.

Particularly by experimenting on something proprietary like Graviton.

← PreviousPage 2 of 25Next →