Better HN
topnewbestaskshowjobs
Log inSign up

articulatepang

336 karma · joined Jun 2, 2025 (1y ago) · 84 submissions

Submissions

comment 3d ago · link · parent

It’s because each page has content from several pieces.

For example, here’s everything tagged Utah: https://klauria.art/tag/utah

That page is built by reading a json of all pieces and collecting the ones tagged Utah.

Another example: the page for each piece links to other related pieces: the ones nearby in space, and nearby in time. Scroll to the bottom of https://klauria.art/piece/2026-08-29-fossek-farm to see the timeline and map.

That’s also generated by the server-side code reading the json.

So the source data for the website is the json + image files, and the pages themselves are build artifacts generated from the source. Any time I edit something, what’s actually happening is some change to the json and maybe the images.

So yes, this could be a static site where every page is rebuilt on my machine. Then the server side code would just be sending bytes from disk. But I wanted a nice CRUD UI for editing stuff. Hence the little cache dance.

comment 3d ago · link · parent

Have fun! Here's the code if you wanna use anything from it: https://github.com/kshitijl/sketchbook-website

comment 3d ago · link · parent

Yes, pages are rendered on the server the first time someone visits them, then cached ~forever until the next time I change something. So it has the cost and performance characteristics of a static site.

comment 3d ago · link · parent

(author here)

I grew up in India! Good to hear from you.

I had a deeply moving trip to Kerala, when I made these sketches and paintings. The trip changed my relationship to India. Before that trip I had a lot of difficult feelings about India. I had trouble seeing the beautiful and valuable. Then I spent a couple weeks in Kerala just drawing and painting every day, and it kinda shook me out of the rut I was in regarding my attitude towards India.

It’s not like I’m blind to the problems now but I see it fundamentally as just this incredibly diverse land, full of far more than any person could possibly appreciate in a lifetime.

comment 3d ago · link · parent

Ah just to be clear, I’m not a professional visual artist. I’m a software developer —- the rest of the posts on this website are about nerdy stuff like GPUs and puzzle solvers. I just paint for fun. See https://klauria.tech for other projects.

As you say, most people in the art world are deeply concerned about modern models.

comment 3d ago · link · parent

(author here)

Someone commented “I love the mono lake painting by the way, what was the prompt?” but then deleted it. I wanted to post my reply because I wanted to Yes-And their funny bit:

Thank you! I used a proprietary image-to-image model trained on my own hardware. You can see the prompt and the traces it generates here: https://klauria.art/piece/2026-07-10-mono-lake-tufa-at-sunse...

comment 5d ago · link · parent

I wonder if they tried storing diffs instead, and compacting them once in a while.

These are user preferences for UI setup, and they have a lot of write traffic. But probably each user changes their preferences only by a little bit each time. Their 1MB writes would go down to just the small diffs.

They could store the diffs and transparently apply them before sending to the client. After some timeout or maybe after a certain number of diffs have accumulated, squash them all and write back.

They’d still need a server and custom code to handle this but it would probably reduce the database load and SSD writes by a lot. And let them just use something off-the-shelf for storage.

comment 1w ago · link · parent

I think you're right, but many people are running systems at large scale, with lots of hosts and all kinds of abstraction layers and stuff. Now this exploit shows up. What are they to do? It's just a practical thing they can do right now.

First we must stop the bleeding. After that, yes, it's worth figuring out if they should change how things are set up.

I've been in situations like this before. Sometimes the complications and abstractions were my fault, sometimes I inherited them. Either way, as responsible owners of the overall system or business, we've gotta be able to respond fast to issues.

comment 1w ago · link · parent

I think the idea is that you’re already running the appropriate JVM on each architecture, but want to push a global command line flag update to every JVM you run, regardless of architecture, that prevents this exploit.

Until, presumably, there’s fixes and you can test, update etc.

comment 1w ago · link · parent

Yes, I was inspired by zoxide! I’ve used zoxide and fzf for years and wanted something that combined bits of both.

One difference from zoxide is the UI: like fzf, psychic lets you interactively search and preview the files and directories.

The model isn’t really “AI”, it’s old-school ML (gradient boosted trees).

comment 1w ago · link · parent

Oh interesting, it's hosted on Cloudflare so as far as I can tell it's still up. I'll check the logs.

Here's the github repo: https://github.com/kshitijl/psychic.

The basic idea is that (quoting from the article): it's a fast terminal-based file browser. It tracks the directories you go to and remembers which files you open. It trains a lightweight ML model on your data and ranks results using that model. It prioritizes interactivity and speed above all else: results update as you type and the UI renders in under 16ms.

So it shows you a pane of files and dirs, ranked using a model that's specific to you. When you type it updates the results. When you hit enter you go into the dir or open the file.

Edit: ugh, it seems like Cloudflare's security filters blocked some visitors. Sorry about that! I'll try turning off their Browser Security Check. My website is static so I don't really need it.

comment 1w ago · link · parent

(author here)

Thanks!

> maybe add some config for static time for tui

I thought about it and decided you're right: there's no reason for that time to update every second. I changed it to only update once a minute. That way, if someone leaves the TUI open for a while, the times will still be accurate, but it won't be needlessly attention-grabby.

Pushed to github and started releases on crates and homebrew.

comment 1w ago · link · parent

(author here)

Yes! For now this is just for files and directories. In principle the same idea can be extended to other things people use fzf for, like selecting processes or containers. But one of the reasons I found this works so well is that we can use filesystem metadata as input to the ML model. LightGBM works great on that kind of numerical/tabular data.

For more general text input, I don't currently have any great ideas for how to make that fast and really good. Transformer models can do prediction on that kind of data, but they're a bit too slow for now.

I'd love to hear suggestions!

14.

Psychic: Like fzf but learns from your actions(klauria.tech ↗)

56 points · by articulatepang · 1w ago · 16 comments

comment 1w ago · link · parent

A perfect time for Bayesian inference!

If someone is shocked to find their fridge above 50 degrees but relieved to find it humming at 32, what's your posterior probability distribution on the units? Even if your prior says something like 95% of humans on the planet use Celsius units, the update is pretty strong, right?

Don't forget to consider the _hundreds_ of people who work primarily in Kelvin, like the statistical physicists and quantum mechanics.

(I think you should also update based on English text on the internet. The 95% figure is for humans on the planet. The US has 2/3 of the world's native English speakers, but only something like 25% of people who might plausibly use English on the internet. I'm counting India, Europe, Nigeria, the Philippines, and Pakistan as likely to use English online.)

comment 1w ago · link · parent

Looks like gradient boosted trees did really well! XGBoost and LightGBM took the top two spots on average error, doing better than the more computationally expensive transformer models.

They did weaker on low-glucose detection, which is pretty bad in this particular case. But it's possible that's fixable by tweaking the loss function to care more about detecting low glucose. As far as I can tell, there's no structural reason the transformer model did better on low glucose, probably just that it was pretrained on a synthetic dataset that had more lows than the author's data.

I love gradient boosted trees because they're fast, easy to train and unreasonably good at tabular and forecasting problems like this one. Of course they can't compete with transformers for complex tasks like writing code, but they're amazing specialists.

comment 3w ago · link · parent

My math brain is immediately broken by your irrefutably correct induction argument!

comment 3w ago · link · parent

Hey, sorry to hear about that crazy bill and hope your daughter is doing well. I agree that your example is a basic need that I ignored. Many of us work to make sure we’re able to pay for healthcare if things go badly wrong.

However, even in countries with socialized healthcare, or even among people who easily have enough wealth to pay for healthcare, we see that they continue to work, beyond what can be explained by a desire to take care of basic needs.

So I think my original argument still stands: it appears that humans have a desire to accumulate status and exclusive goods, even when their basic needs are satisfied. Let me know if you disagree!

comment 3w ago · link · parent

This argument ignores sexual selection and people's desire for status (the two are closely related). In many respects, many of us already have superabundance, in that our basic physical needs are taken care of. Yet we convince ourselves that's not enough and continue to work.

What is the object of that work, usually? The respect of others, exclusive limited resources like land, and to have highly desirable mates. These three are closely related, and that's probably not an accident. Sexual selection has likely been a powerful force in shaping our psychology.

Spending all day alone watching TikTok is low-status and doesn't get anyone's respect, so I predict that it won't actually be the thing that most people end up doing.

comment 1mo ago · link · parent

I worked professionally in OCaml for many years, and I assure you it’s possible to write low latency code by avoiding allocations. People write Java this way as well. Lots of system software was written in OCaml this way. It looks a little un-idiomatic compared to regular OCaml code but really what’s going on is that it’s just a specific low-latency idiom. Don’t create structs, don’t match on options. Weird, right? But it works.

Some of the code also did networking in user space and communicated with other processes by coordinating writes to shared memory.

It’s true that there’s certain system software that you probably can’t write because of the presence of a GC: parts of the operating system, a language runtime, a virtualization toolkit. The category “system software” contains those things but also databases, browsers, and servers.

comment 1mo ago · link · parent

It sounds like you’re saying that you hold the following to be true:

“Only activities that involve creation can lead to joy.”

But you also agree that “watching a sunset can lead to joy”.

Presumably you agree that you did not create the sunset.

Now we’ve found a contradiction: an activity (watching sunset) that leads to joy but that didn’t involve any creation.

This has nothing to do with prompting. It’s just a rebuttal of the _proof_ that you used in order to support your statement that “prompting cannot possibly lead to joy”. The argument you gave was “because prompting does not involve creation.”

I have exhibited a counterexample to the argument you gave. Any counterexample immediately shows that the argument was wrong. Therefore your argument was wrong. Your conclusion might still be right, but we can all be sure, on the basis of this counterexample, that the argument you gave to prove your conclusion was wrong.

comment 1mo ago · link · parent

Here’s an analogy. Suppose someone said, “I love manual transmission cars” and then described in detail the physical knobs and dials that all the cars from the 1950s had.

It turns out what they like is physical knobs and dials. You can have those in automatic transmission cars. It so happens that most modern automatics also have shitty touchscreens.

(I know this analogy isn’t precise because there was a long period of automatics with physical controls, but bear with me.)

The point is that there’s nothing _inherent_ to software rendering that’s responsible for the thing he likes. The distinction is useful because, for example, he could go seek out modern games with the look he likes. Or make games. And if he thought the thing he likes comes from having a software renderer, he’d leave a lot of performance and power efficiency on the table for no good reason. He likes a certain rendering style that’s equally achievable with both GPU and CPU rendering. The choice of hardware should probably be driven by considerations like performance, debuggability, platform support, availability of libraries, etc.

comment 1mo ago · link · parent

Just to be explicit, and correct me if I’m wrong in my understanding, but your argument was:

1. Prompting is not creation.

2. Therefore prompting cannot lead to joy.

For this argument to work, you’re implicitly also claiming that

1.5 Only activities that involve creation can lead to joy.

My counterexamples (if you agree with them, but you say you do) show that this latter statement is not true.

So if you’d like to show that “prompting cannot lead to joy”, you need to fix up your proof. I’m not claiming that you’re wrong! But the reasoning gave cannot possibly be correct.

comment 1mo ago · link · parent

Have you ever felt joy watching a sunset? Smelling a flower? Hearing a song? Seeing a child laugh? Did you create any of those things?

You may or may not be right about whether prompting is creation, but it is certainly possible to feel joy without any act of creation being involved. So you need a different argument if you’d like to prove that “making Commodore games using prompting cannot lead to joy.”

comment 1mo ago · link · parent

If the United States or the Linux kernel project or frankly any other institution lasts as long as the Roman civilization, that would be a rare achievement indeed! In my opinion, its longevity is the single most striking fact about Rome.

In comparison the US is a baby, and the Linux kernel barely an embryo.

Depending on how you count, Rome lasted 1229 years (from founding to fall of the western empire) or 2206 years (from founding to the fall of the Byzantine empire, which was the eastern part).

Twelve hundred years! Two thousand years! I hope we dig our graves as slowly as the Romans did.

comment 1mo ago · link · parent

All your examples are private goods: excludable and rival. If one person uses a unit, that prevents others from using them.

Patches to open source software are public goods. Your using them doesn’t prevent others from using them. So if you spend resources creating a public good, it’s in everyone’s interest to share it.

comment 1mo ago · link · parent

“How it works” link is broken on Safari on iOS. I am quite curious how it works, exactly.

comment 1mo ago · link · parent

Yes, the type I wrote down is isomorphic to Option<int32>, so the compiler will ultimately generate the same machine code and do the same optimizations.

But defining a new type allows you to give the two cases more descriptive names. That saves you from having to remember and comment what the two cases represent. In a small but significant way, the code documents itself.

Also, doing it this way gives the Connection type its own name and identity separate from Option<int32>. So if you have a function that takes a Connection and some other Option<int32>, you can’t accidentally switch them: even though the two types are equivalent for optimizations and codegen, they’re NOT equivalent for the type checker.

It also makes function signatures more self-documenting: you can tell just from the type that the function takes or returns a Connection, and that helps in a small but real way to understand what it does.

I like programming like this a lot! So much so that the reason I personally like Rust a lot is simply that it’s a mainstream language with great tooling that has sum types and reasonable generics. It’s like if OCaml or Haskell had the community or tooling, or if Go or Python had the type features.

comment 1mo ago · link · parent

I prefer a slightly more general rule: Make Illegal States Unrepresentable. The "Parse, don't validate" rule is a special case of MISU.

What's the difference? MISU applies even when there's no parsing-like transformation happening. For example, if you have a variable that represents the current state of a network connection, and let's say it can be Disconnected, or Connected to some IP address (this is an oversimplification).

Then one way to do it would be

  struct {
    connected: bool,
    peer_ip: int32
  }
The trouble is that this allows us to represent an illegal/meaningless state: we're disconnected but there's still some junk old peer_ip hanging in there. Even worse, we might have written

  struct {
    connected: bool,
    peer_ip: Option<int32>
  }
Now we could have connected = true but peer_ip = None.

The solution is to use a sum type:

  type connection = 
     Disconnected
   | Connected of int32
(sorry for using made-up syntax; I hope it's clear to anyone familiar with Rust.)

"Make Illegal States Unrepresentable" applies throughout your program, at every interface between modules or functions in the program, including but not limited to parsing input.

comment 2mo ago · link · parent

This study is informative and most likely directionally right: prompt injection remains an unsolved problem, and adversarial input can fool modern ML models.

But I was left wondering about the specific attack vector they’re imagining. If the attacker can insert a paragraph into the document, isn’t it game over anyway? When would they be able to do that but not arbitrarily edit the document? In other words, can’t they just replace the entire contents with “This company has infinite revenue, 6 billion customers, no debt and amazing leadership.”?

I’m sure I’m missing something!

123