HNHacker News
TopNewBestAskShowJobs

kevincox

15,229 karma · joined November 20, 2013

https://kevincox.ca
submissionscomments
kevincox··on Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
It sounds like you are just writing your own allocator? That sounds great, but why is it going to be better than jemalloc?

There are many reasons a specialized allocator can be better, but just saying "write your own" doesn't really add much value to the discussion.

kevincox··on Three ways to smuggle SQLite into Nix
It seems that you could just compile the data into the WASM blob. Then use a more optimized query engine than sqlite. This should be very fast to compile (most of the WASM is just a byte buffer, the code is just a few binary searches and some result encoding). The downside is that you need to recompile to update the repo, but I don't think that should be particularly expensive.
kevincox··on The August 17 outage
Thundering herd is different. Thundering herd is when a lot of clients trigger requests at the same time. Common situations being a specific time, some other event just occurred or synchronize on other parts of your infrastructure (such as readers queuing behind a R/W lock that then get unblocked at the same time to continue to make a bunch of requests at the same time.

Request amplification via retries is a different problem that causes large amounts of traffic (but it is generally more steady than spiky)

kevincox··on Malicious Rust crate Arrayref runs a build-time payload
Sandboxing the process only works well when the malware requires more capabilities than the software itself.

So if your software needs to make HTTP requests and read the filesystem then the malware will be able to make HTTP requests and read the filesystem, which is enough for a ton of malware. Sure, maybe you can limit the directories it can access a bit and possibly some sort of network filtering, but it isn't a silver bullet.

Capability security in-language would make a huge difference, because the more granular you "sandbox" the less likely it is that the compromised component has the access it wants. For example if the HTTP client library is compromised maybe it can't access the filesystem so can't steal your cookies. Or maybe like in this case no permissions were needed at all and despite the process having enough capabilities for malware this malware can at worst return bad values and try to chain this to an exploit which is far more difficult than just running it itself.

kevincox··on Win-V combo from Windows on Ubuntu
It is if you use full-disk-encryption which is highly recommended.
kevincox··on Show HN: Declarative-forms – await an object the way prompt() awaits a string
I really like this approach. It is very natural for modal dialogs to be things that you await. I have used it in various projects in the past.

The main downside is if you need to affect the dialog from "outside". For example data that refreshes and needs to update the form (although in most cases a changing form is an anti-pattern anyways). But also any form of dynamically updating data (a clock) or lazy loading (maybe for a dropdown that depends on others) you are going to want a full UI library rather than a one-shot declarative form.

When I used this I had a separate call to create the dialog and await the result. This way there is a handle you can use to update the data if you need to. But even then if you are using React it probably doesn't integrate as cleanly as a "regular" component would.

But still, I think in most cases this is what you need and the easiest way to get it. I wouldn't take a more complicated approach until you need to.

kevincox··on Anthropic's ‘watermark’ text adulteration in Claude is a perversion of writing
I assume this oracle will be behind 20 layers of anti-bot protection, CAPTCHAs and hardware attestation challenged. It will be incredibly painful to use. It won't stop the motivated attackers, but will make it too annoying for the average person.
kevincox··on Tell HN: Cloudflare silently injects its analytics when you switch nameservers
Yup, I explicitly had all anaytics turned off. But had a few sites using Cloudflare for caching. Now I'm checking and seeing this on all of them. This is gross and unacceptable. "Caching" does not mean "modifying my site".
kevincox··on AI by Hand
I clicked "Back" to leave the user-hostile website.
kevincox··on Dear people who work at the airport
Or just anyone involved in communication at all. For example my condo management team has names for every part of the building that they just assume that everyone understands. They don't seem to understand that most of the people living here don't spend most of their time reading the building floor plan.
kevincox··on 'Not acceptable': Judge orders Google to make rival app store installs easier
This storm fronts are really just Google trying to dig in as deep as possible.

On one end they are trying to fight the requirements for alternative app stores and making them as hard as possible to use.

On the other end they are trying to put hooks so that they can block installations of apps from other app stores.

Then they hope that regulation will take longer to dislodge the various methods they are using to retain control.

kevincox··on Text AI watermarks will always be trivial to remove
> Malicious compliance is to make cookie acceptance much easier than refusal.

That isn't malicious compliance, it is just non-compliance. If the equally difficult rule wasn't there then it would be malicious compliance.

kevincox··on GLM-5.3: Frontier coding with emergent cyber capabilities
This isn't latency bound, it is trivially parallelize. So you want to run it on the most efficient compute you have, not the fastest.
kevincox··on Pixel 11 Pro Fold
This used to be a critical feature for me I used to customize the colour per-app so I could see what notifications I had at a glance. However always-on displays have supplanted this use case for me.
kevincox··on Muse Glimmer: 30B-parameter model optimized for always-on local agent workflows
No compaction happened. (That is set near 256k.) It seems to really not like my domain but I've seen it for various things as well (especially high-entropy tokens). Dropping random characters or various things. I've tried various flash attention and context quantization settings but nothing seemed to resolve it completely.
kevincox··on London Underground begins scanning passengers' faces
This sentence struck me as well. It says what it is focused on, but nothing about what it actually captures.

What I would like to see is something like this:

- The detectors have a per-determined list of suspect faces and only record information when those faces are spotted.

- These detectors keep only a fixed length of recording that is permanently deleted unless it is actively linked to a crime and explicitly held as part of that investigation.

But it says nothing concrete. Just some nonsense about "focus" which doesn't mean anything.

kevincox··on Updated GPG Key for Signing Firefox and Thunderbird Releases
SSS doesn't support signing AFAIK. When I last looked into it GPG/PGP doesn't support shared signing.

You can use SSS to encrypt the signing key, but then you need to fully materialize the signing key to actually sign the release. Which makes the exact situation that occurred here possible.

The only way to do multi-signer PGP is outside of the PGP protocol, you just need to sign the artifact multiple times then have the verifier assert that a sufficient number of signatures are present. But again, this isn't supported by the regular PGP tools.

kevincox··on Muse Glimmer: 30B-parameter model optimized for always-on local agent workflows
I just downloaded the latest llama.cpp and poolside Q4 and within 10k tokens it corrupted "Use ~/p/kevincox.ca as a reference" into "kevinc.ai" and then starts doing stupid things because the directory "doesn't exist".

In previous testing the Q8 was better but still had the same problem frequently enough to be very difficult to use. I don't know if it is a runner bug or model bug but at least with llama.cpp this seems to always happen and I haven't seen an issue like this with any other model.

kevincox··on Muse Glimmer: 30B-parameter model optimized for always-on local agent workflows
For me Laguna frequently slightly corrupted text then it would be unable to notice the difference and get stuck making the dumbest conclusions. Thinks like typoed directory or function names. It was a great model other than that, but I ended up just going back to Qwen3.6
kevincox··on Auto mode is now the default in Claude Code
This just sounds like they bump their unspecified limits by N% to cover this usage. Which of course means nothing because the next time they re-evaluate their limits they will just ignore this bump.
kevincox··on Tail-call optimization in C is relatively recent (2025)
It's hard to argue that it isn't an optimization, because it doesn't affect the semantics of the program. However most optimizations are very hard to observe. The vast majority of optimizations only affect code size and runtime. TCO is one of the few exceptions. It affects memory usage, and more sensitive stack memory at that. This is why a missed optimization can be so much more catastrophic and it is worth considering things like `musttail` attributes so that the code fails to compile rather than misses the optimization.

I can only think of a few other optimizations that affect memory usage. Register spilling (arguably not really an optimization but a necessity), Rust's niche filling for enum discriminants and C++'s std::vec<bool> (a language-level optimization, arguably a different thing entirely).

I often think about how few memory optimizations we have. The reason is most likely that they tend to be non-local so are much harder to apply than CPU optimizations that generally have no effect outside of the function they are in.

kevincox··on Switching to electric stoves can dramatically cut indoor air pollution (2025)
I consider this a downside. Now whenever I am cooking on a gas stove I keep burning myself because everything in the vicinity of the stove is so hot. I love with induction that I can always grab the handles of the cookware and don't have to worry about stuff nearby on the stove getting hot (example my bowl of pancake batter next to the pan doesn't cook on the near side.

You are right about the wok, it isn't quite the same on the induction stove (at least the flat ones, there are wok-shaped ones but these are generally only found in professional units). If you cook most of your meals in it then you are probably right to go gas (or get a gas burner).

kevincox··on Switching to electric stoves can dramatically cut indoor air pollution (2025)
I usually hate touch controls. But for the stove I actually like them. I always hated cleaning in and around the knobs. When cooking on the stove you almost always get some sort of splatter so it is nice to clean them every time (something I often put off with knobs. So for something that so regularly gets dirty a flat surface can be very welcome.

So it is definitely a tradeoff, but I am happy I picked a stove with touch controls. Although I did pay attention that they were good touch controls (touch anywhere on the arc to set that temperature directly for example). Although there is a small annoying delay after turning on before you can set the temperature. Almost perfect.

kevincox··on A zero-dependency, ultra-lightweight database time machine for SQLite
It uses `safeAtomicCopy` so you know it is good.

Of course safeAtomicCopy only ensures that the output is atomic, it doesn't lock the database in anyway. So yes, you will get corruption. It also attempts to support WAL but just copies the extra files afterwards without any locking so even more corruption.

So I would definitely heed the warnings that this is not for production use.

kevincox··on Windows 11's built-in Weather app wastes more than 1 GB of RAM
Mostly rendering. A bunch of images, text, UI elements. On a modern high resolution display it adds up quite quickly. You can surely cut it down a bit, but 100MB isn't absurd.
kevincox··on We replaced Redis with MySQL for inventory reservations and it scaled
Flash sales are a huge scaling issue for Shopify. There are celebrities who want to sell thousands of items in a few minutes window at the end of an advertised countdown.

Basically this is an incredibly rare case but a feature that they want to support.

kevincox··on Improving Heuristics for A* Pathfinding
Ah, I figured it out. It is because he isn't using the distance to the landmark as the heuristic but the difference between the distance to the current location and the distance to the target. This means landmarks behind you will be negative (or useful in an undirected graph). This is also important for making the heuristic admissible as otherwise your heuristic would say zero when you are standing on top of the landmark.
kevincox··on Improving Heuristics for A* Pathfinding
I don't understand how the multiple landmarks works. If you just max all of the landmark distances wouldn't some landmark near the starting point eventually dominate as you move away from it? Once you get halfway through the path the useful landmarks would be returning lower and lower values while ones behind you return larger and larger values. Or just in general one far-away landmark would complete nullify any input from useful ones.

It seems to me that you would need a step to select useful landmarks but the code doesn't seem to do this and I don't see it discussed.

kevincox··on Signal can easily work across multiple Android devices and iPhones now
It seems that this is still a primary device that the replica devices connect to. So if your primary is offline, out of battery or broken your other device are still useless. Not proper multi-device support.
kevincox··on _for-sale DNS records
My personal website is a "low quality blog" but I definitely feel that it shouldn't be up for grabs because I don't want to pay thousands of dollars a year.
← PreviousPage 2 of 34Next →