Live data from Hacker News

Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

github.com

551–560 of 756 posts

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#551
post #452
post #438

Earlier quoted context omitted.

That’s not true for Postgres however: due to its usage of a shared memory pool, whenever a subprocess is terminated unexpectedly, Postgres will kill all other processes and enter recovery mode, replaying the WAL, during which time it will not accept connection requests. It does this because it can’t possibly know whether the dying process did bad things to the shared memory pool.

You are correct! TIL, and thank you. Connection processes get a SIGQUIT, shared buffers cleared, and WAL replayed, but postmaster stays alive. It's effectively an online restart.

I’d be very curious to hear what an online restart approach for sketchy extensions crashing a shared thread per connection process might look like. This is more a question for the author of the project but I’m curious if they have plans in that direction.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#552

Don’t understand these rewrites. - typically they are behind a single person. That’s usually bad because of spf - typically they are achieved in a very short amount of time, so the author hasn’t acquired any discipline in creating the project. That means it’s unlikely the author is going to stick to the project in the mid and long term - anyone that wants to contribute to the project needs to pay. Needs to pay tokens…

spf meaning...

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#553

Earlier quoted context omitted.

You seem to have the restrictiveness backwards? The MIT license (uutils coreutils) is less restrictive than the GPL (GNU coreutils), and the AGPL is more restrictive than the PostgreSQL license. And it doesn't violate the PostgreSQL license to license the rewrite more restrictively. That's part of what makes MIT-style licenses less restrictive than the GPL or AGPL: they allow for more-restrictive relicensing.

Perhaps ‘restrictive’ was a poor choice of words. ‘Less free’ in the free-software sense. I’m still putting together my thoughts on various open source licenses especially as we see automated AI rewriting.

I think licensing will have to be re-invented, because now it's trivial to just say: claude, do a "clean-room implementation", so that noone can accuse me of stealing code.

That's what LLM companies have done for years anyway. Inline completions are trained on licensed code. And nobody cares! ;)

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#554
post #14

Earlier quoted context omitted.

> not mostly the test, but the real world production scars Most extensive test suites are exactly production scars: every time you have a bug or a regression, you write a test that confirms correct behaviour. SQLite is a good example to bring up because its extensive closed-source tests are what’s often cited as being what keeps people from forking it. (Turso did it, though, but it takes a company to deliver some gua…

This feels like the image of the plane that returns from battle with bullet holes, and the engineer being asked to path up where the holes to make it stronger. Only to be told to patch where there weren't holes as those planes didn't make it home. While not an exact fit of an analogy, those tests patch what was a problem with Postgres in the wild. What it doesn't cover are the things that worked in Postgres without t…

Anything that doesn't have tests is unspecified behaviour. While it is true that a port may differ in behaviour where the behaviour is unspecified, "fail" is not the right framing as there is no definition of what it should do.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#555

Earlier quoted context omitted.

How is this good? Copyleft licenses are also being ignored.

Patents and copyright stifles innovation. Knowledge should be communal and free.

Free and communal knowledge means you're easily replaceble by someone else.

I wonder what communal answer you have for someone who would say, "moi2388, your work will be now done by moi2389. Thanks and good bye."

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#556
post #552

Don’t understand these rewrites. - typically they are behind a single person. That’s usually bad because of spf - typically they are achieved in a very short amount of time, so the author hasn’t acquired any discipline in creating the project. That means it’s unlikely the author is going to stick to the project in the mid and long term - anyone that wants to contribute to the project needs to pay. Needs to pay tokens…

spf meaning...

single point of failure

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#557

Given that you reuse Postgres' tests and LLM have been clearly trained on Postgres' three decades of contributions, this may constitute a license violation. Unless you include the original license of course. From a human level I also understand how you ended up with a less permissive license.

License for test might be subject to debate, because afaik the project is merely running them.

but yes the test files should be presented under their original licence.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#558
post #182

2664 "unsafe {", 1835 "unsafe fn". This is completely unsafe. It doesn't look like a rewrite that understands what's actually going on or how the architecture should be redesigned to take advantage of Rust strengths. Instead, it looks like an AI generated transpilation with extensive use of raw pointers.

Note that most of the unsafes are confined to the parser which was generated by running c2rust over the Postgres parser. The Postgres parser is itself generated from yacc/bison, so I decided to port it over mechanically rather than idiomatically. If there's particular unsafes that you think are egregious, let me know.

I don't know if converting the code could be an issue with copyright, but might be contrived as plagiarism

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#559

Earlier quoted context omitted.

If you don’t like the license just let an LLM spend a few days “porting” it and give that port any license you like because that is apparently what we do now.

Yeah. I'm gonna have an LLM rewrite Star Wars and then film it. Should be fine, right?

Making a movie that has basically the same plot as a previous movie with slight changes is a common occurrence.

The thing you have to be wary of with movies is trademark law. Your Star Wars copy can't use the word "Darth Vader", that's trademarked. It can't use Darth Vader's mask, Darth Vader's suit or Darth Vader's breathing either, all trademarked. And with trademark law the bar to pass is basically "would a reasonable but uninformed consumer be at risk of confusing your product for the trademark". LLMs can't launder that for you. You have to make actual changes, like Spaceballs did

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#560
post #78

How would one go about reviewing a piece of code like this? One of the things I'd typically do is peek at the commit history. Seeing what people worked on and how they did it tends to say a lot about a project. But with LLMs generating 7101 commits in less than a month that isn't feasible. Even looking at a single day is way too much [1]. It probably also doesn't make sense since the commits content won't tell you mu…

I started by looking at the dependencies.

Then I lost count, so I ran wc -l Cargo.lock

   1467 Cargo.lock
Easily over a thousand dependencies. And "rewritten in Rust" is supposed to be a good thing? I bet this doesn't even compile faster than the original.
Post reply on HN