HNHacker News
TopNewBestAskShowJobs

ncruces

2,551 karma · joined May 25, 2023

https://github.com/ncruces
submissionscomments
ncruces··on Postgres 19 is late because so many more bugs are being found now
I dunno about holes, but…

SQLite has gone into a frenzy of bug fixing this past year, changing long stable processes to ease things up: opening a specific report channel just for these kinds of bugs, adding features to Fossil to help manage things on their end (and that's just the visible stuff).

And with all that, the latest release has unfortunately been the buggiest I've experienced so far.

I skipped the .0 because of a crash, and only released .1 after giving up waiting for a .2 that never came, with a patch to fix a serious performance regression.

I spent a month supposedly shipping old bugs no one had a problem with, rather than shipping new bugs that instantly crashed things or caused measurable regressions.

That's on a software with stellar testing, and a good engineering team known to favour stability over the new shiny.

ncruces··on Casio Watches of the 1980s
I have a digital Casio with an analog display. It's solar, so it never needs to be charged. It sets itself to the correct time, and date, across DST and timezone changes.

It doesn't have the mechanical beauty of an automatic with a perpetual calendar, but is otherwise better in every way that matters, and it is just as pretty.

ncruces··on Gemini 4 Carbon is the new #1 on the Artificial Analysis Intelligence Index v5
People who are already using it (both internally and/or select partners) can speak more freely about it if it's announced.

This is especially true around earnings, not necessarily for some sinister reason, other than it's material information that can influence the market.

ncruces··on Treap (Cartesian Tree)
I personally found balancing weight balanced trees pretty straightforward: https://yoichihirai.com/bst.pdf

What I like about immutable treaps is that, if you using hashing rather than randomness, you can achieve O(1) equality for entire trees.

Unfortunately, my current language of choice makes hash consing too slow.

ncruces··on Forging a Microsoft Edge Full Chain with Logic Bugs Only
And much better for not going into needless detail.

In fact, a problem with LLMs is that they consistently write more than I want to read.

ncruces··on Two high-speed trains collide near Toledo, Spain
But then you increase the risk of (suspected) sabotage disrupting the Dutch railway network. Which obviously is better than an deadly accident, but...
ncruces··on Serbia's Vucic concedes election defeat in historic win for student movement
Dead people not removed from the registry?
ncruces··on Show HN: Steal My Bitcoin
80h ago everyone was advising everyone else to take all their websites immediately down.

Now it's only worth it to hack a website that's asking to be hacked if the prize is $15k.

ncruces··on Remove pgrust: the entry is cheating (per-query kernels and result caching)
Did they ask Claude "don't cheat" this time round?
ncruces··on Two-Stack Sliding-Window Aggregation
Ongoing draft: https://github.com/ncruces/go-sqlite3/pull/438
ncruces··on SQLite 3.54.0 Released
Already superceded by 3.54.1, mostly due to a memory corruption issue on 32-bit builds.

I'm still holding on releasing my Go bindings on another just uncovered performance bug.

It's honestly been the most unstable .0 release I remember. If this is what a frenzy to fix LLM reported bugs causes to a well established project, I don't know what the future holds.

ncruces··on Two-Stack Sliding-Window Aggregation
This is very cool.

SQLite uses the "streaming" push/pop/eval API for windowed aggregates.

DuckDB implements "segment tree aggregation" by swapping "combine" for "pop".

This means I can offer an adapter that turns combinable aggregates into invertible aggregates, in amortized O(1).

ncruces··on A look at the math that OpenAI claims computes faster Fourier transforms
> In computer science, the median of medians is an approximate median selection algorithm, frequently used to supply a good pivot for an exact selection algorithm, most commonly quickselect…

https://en.wikipedia.org/wiki/Median_of_medians

That's pretty much what I posted: median-of-ninthers is an evolution of median-of-medians, that I use to pick a better pivot whenever the pivot supplied by median-of-3 turns out to be bad.

Using it all the time would simply make quicksort/quickselect about twice as slow as it is now, but still faster than heapsort/heapselect. It's a better backstop algorithm than the common introsort/introselect.

There's also no randomisation, the implementation is completely deterministic, and depends exclusively on the input order.

And median-of-ninthers is faster, but median-of-medians is far from terrible, so calling it a galactic algorithm or completely useless in practice is far from the truth, IMO.

ncruces··on A Modern Web App in C
I do. I had it listed in my own README as an alternative for a long, long time, and both show up in these often posted benchmarks: https://github.com/cvilsmeier/go-sqlite-bench

But for the point I was making, it is in fact not an alternative. In my version each SQLite connection is confined to a sandbox, and a C memory bug cannot corrupt the Go runtime, call stack or heap. In their version, a C pointer becomes an unsafe.Pointer that can address all Go memory.

ncruces··on A look at the math that OpenAI claims computes faster Fourier transforms
> "median of medians" (finding the median in a list in O(n) worst-case time) is useless because it is not used in practice.

This one is just not true. Here it is in 255 lines of well commented Go code: https://github.com/ncruces/sort/blob/v1.0.3/quick/quick.go

It's worse case linear, as used for sorting it beats the Go standard library on the average and worst cases, lagging a bit on the best cases.

In my experience, median-on-ninthers (which is only slightly more complicated than median-of-medians) definitely beats both heap sort and particularly heap select as a fall back for the degenerate case.

And it's not just academic: I've sped up significant stuff at work by switching from sorting to partial sorting and/or selection.

ncruces··on A Modern Web App in C
Shameless plug: if you value Go, and CGO_ENABLED=0, and SQLite, and are worried about C in a web server and RCEs, may I interest you in my SQLite driver?

https://github.com/ncruces/go-sqlite3

I just wrote up the security goals of the tool I use to translate C to Go: https://github.com/ncruces/wasm2go/blob/main/SECURITY.md

I obviously can't make any promises, as it's just a personal pet project, but those are the goals, and they do catch memory corruption bugs in practice: https://sqlite.org/bugs/forumpost/543f94984b

ncruces··on 100+ reactions to 100+ solutions
For OpenAI/Anthropic/etc it's apparently not enough to be the tool that helped a mathematician with a discovery/proof/etc.

They need to state it was entirely autonomous.

ncruces··on Port of the TypeScript compiler, checker and lsp to Rust, by LLM
More comments than upvotes make it sink, because it's a contentious topic.
ncruces··on Using Theme park rides and smartphones for demonstrating Newtonian mechanics
That's the app they used:

The phyphox app recorded acceleration and angular velocity at a sampling rate of 100 Hz.

I wonder if they considered using the fact that a roller coaster trajectory is closed loop? That tends to help with calibration, but maybe the devices are nicely factory calibrated to begin with. They get close, but stop short of mentioning it:

The measurements were stopped after the attraction returned to its resting state. This provides reference points at the beginning and the end of the ride where the velocity is zero.

And this gets you real close to building visual inertial oximetry:

Smartphone video recordings were used to correlate specific ride manoeuvres with the recorded data for the roller coaster.

ncruces··on GitHub's new dashboard experience now the default
I'm not complaining, just offering a different PoV. :)
ncruces··on GitHub's new dashboard experience now the default
For OSS work, I actually rather like finding out what other people I follow are up to.

A list of tasks I'm already behind on is the last thing I want to be reminded of constantly.

:)

ncruces··on Gemini 4 Argon
Because (maybe particularly) at 1e100 scale, having a super intelligent butler that does whatever everyone asks of it can easily get you to hundreds of thousands of daily PRs merged to the monorepo, but won't necessarily help coordinate efforts, and may actually cause certain projects to collapse under their own weight.
ncruces··on Gemini 4 Argon
Because none of the people who can use it (have been and will be using it) can talk about it if it hasn't been announced. NDAs and stuff.
ncruces··on Sonnet 5.5
Not true. Claude is laser focused at finding the next load bearing thing. /s
ncruces··on Nissan's third generation e-POWER powertrain
And the Toyota has planetary gears.

Both offer direct, mechanical engagement that avoids the continuous friction slip of a wet clutch.

Which was the point.

ncruces··on Nissan's third generation e-POWER powertrain
Renault's version doesn't have a clutch either.
ncruces··on Lunar Terminator Paradox
In that time lapse, when the moon is visible, the illuminated portion is always facing “down,” i.e. the horizon?
ncruces··on When did Google get so weird?
In TFA the chatbot got confused, and the author never decided to correct it with "no I'm trying to find an old tweet about NBA Dario" which a normie would do, and be satisfied with the result.
ncruces··on Go Concurrency Distilled
You can try this yourself: GODEBUG=asyncpreemptoff=1

Also platforms like Wasm still do Mx1 scheduling without async preemption, where Gosched is required at places.

E.g.: my "transpiled" SQLite driver takes special care to make sure long running SQL queries (and the busy handler) can be canceled with contexts even on platforms without async preemption.

ncruces··on U.S. appeals court upholds designation of Anthropic as supply chain risk
The DoD can require contractors not use Claude to do whatever they're being contracted to do.

It doesn't need to say if you do any business with Anthropic (for other customers, internal tools or processes), you lose all your contracts with us.

Page 1 of 34Next →