HNHacker News
TopNewBestAskShowJobs

michelpp

1,699 karma · joined February 27, 2018

https://github.com/michelp/

Get my name on github, email is last.first @ gmail

submissionscomments
michelpp··on Mystery Science Theater 3000: The Definitive Oral History of a TV Masterpiece
Cinimatic Titanic is also great, with a mix of the original mst3k cast doing studio and live shows. The live show of Alien Factor is hilarious!

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

michelpp··on The CRDT Dictionary: A Field Guide to Conflict-Free Replicated Data Types
Automerge is an excellent library, with a great API, not just in Rust, but also Javascript and C.

> All you need for the backend is key-value storage with range/prefix queries;

This is true, I was able to quickly put together a Redis automerge library that supports the full API, including pub/sub of changes to subscribers for a full persistent sync server [0]. I was surprised how quickly it came together. Using some LLM assistance (I'm not a frontend specialist) I was able to quickly put together a usable web demo of synchronized documents across multiple browsers using the Webdis [1] websocket support over pub/sub channels.

[0] https://github.com/michelp/redis-automerge

[1] https://webd.is/

michelpp··on What nicotine does to your brain
I caught covid for the first time in jan of 2024, the illness itself wasn't that bad for me, like a common cold, but the aftereffects lingered for months. Eventually my ability to smell and taste came back in a few weeks, but the mental brain fog would not let go. I would sleep over 12 hours a night and still be tired. According to my fitness tracker my daily step and energy burn counts were cut in half. It was so bad I forgot my own phone number at one point and my gmail password. Looking at a screen of code was impossible, I couldn't focus for more than a few seconds. My friends commented on the noticeable changes in my acuity and behavior.

Based on some online anecdotal evidence, I decided to try nicotine "therapy". I bought 4mg smoking cessation mints, cut them in half with a pill cutter, and took 10-12 2mg doses per day at roughly one hour intervals. The effect was immediate and brain fog lifted in less than a week. It was like coming out of a long dream, or like I had been stoned for six months and then suddenly I was sober again. My fitness stats have exceeded where I was before I got sick.

This is just my own anecdotal experience, and there have definitely been some downsides. The mints are about $50/month. My dosage has ticked up a bit and I'm certainly addicted, at least once a day I take a full mint instead of a half for an extra kick. I'd like to taper off, but I'm not sure if I do how to know if any effects are withdrawal or resumption of the covid brain fog. I have a light caffeine habit (2 cups every morning) and I don't see the mints being any more harmful than the coffee, so I think I'm just going to stick with it.

michelpp··on A graph explorer of the Epstein emails
There are open source projects moving toward this scale, the GraphBLAS for example uses an algebraic formulation over compressed sparse matrix representations for graphs that is designed to be portable across many architectures, including cuda. It would be nice if companies like nivida could get more behind our efforts, as our main bottleneck is development hardware access.

To plug my project, I've wrapped the SuiteSparse GraphBLAS library in a postgres extension [1] that fluidly blends algebraic graph theory with the relational model, the main flow is to use sql to structure complex queries for starting points, and then use the graphblas to flow through the graph to the endpoints, then joining back to tables to get the relevant metadata. On cheap hetzner hardware (amd epyc 64 core) we've achieved 7 billion edges per second BFS over the largest graphs in the suitesparse collection (~10B edges). With our cuda support we hope to push that kind of performance into graphs with trillions of edges.

[1] https://github.com/OneSparse/OneSparse

michelpp··on Lace: A New Kind of Cellular Automata Where Links Matter
An interesting approach to characterize graph topology, both locally and globally is to use a graphlet transform, there some interesting research happening around these types of topology signals, here's one that takes a very algebraic approach

https://github.com/fcdimitr/fglt

michelpp··on UUIDv47: Store UUIDv7 in DB, emit UUIDv4 outside (SipHash-masked timestamp)
uuidv8 does not contain a timestamp or counter unless you put them in there, it only contains a version and variant field. It's a very broad format that lets you contain whatever bits you want.

This library converts a uuidv7 into a cryptographically random but deterministic uuidv4 recoverable with a shared key. For all intents and purposes the external view is a uuidv4, the internal representation is a v7, which has better index block locality and orderability.

michelpp··on UUIDv47: Store UUIDv7 in DB, emit UUIDv4 outside (SipHash-masked timestamp)
That still exposes the timestamp, and the shift just drops precision, so I'm not sure what you're going for here.
michelpp··on UUIDv47: Store UUIDv7 in DB, emit UUIDv4 outside (SipHash-masked timestamp)
Because then you leak the timestamp. The idea is, present what looks like v4 random uuids externally, but they are stored internally with v7 which greatly improves locality and index usability. The conversion back and forth happens with a secret key.
michelpp··on Adjacency Matrix and std:mdspan, C++23
You're right, I did read the article before commenting, but I see your point that I didn't completely understand the intent.
michelpp··on Adjacency Matrix and std:mdspan, C++23
Fair enough, showing my age with "impossible".

But still true that dense growth is not linear but quadratic to the number of nodes.

michelpp··on Adjacency Matrix and std:mdspan, C++23
It's an interesting exploration of ideas, but there are some issues with this article. Worth noting that it does describe it's approach as "simple and naive", so take my comments below to be corrections and/or pointers into the practical and complex issues on this topic.

- The article says adjacency matrices are "usually dense" but that's not true at all, most graph are sparse to very sparse. In a social network with billions of people, the average out degree might be 100. The internet is another example of a very sparse graph, billions of nodes but most nodes have at most one or maybe two direct connections.

- Storing a dense matrix means it can only work with very small graphs, a graph with one million nodes would require one-million-squared memory elements, not possible.

- Most of the elements in the matrix would be "zero", but you're still storing them, and when you do matrix multiplication (one step in a BFS across the graph) you're still wasting energy moving, caching, and multiplying/adding mostly zeros. It's very inefficient.

- Minor nit, it says the diagonal is empty because nodes are already connected to themselves, this isn't correct by theory, self edges are definitely a thing. There's a reason the main diagonal is called "the identity".

- Not every graph algebra uses the numeric "zero" to mean zero, for tropical algebras (min/max) the additive identity is positive/negative infinity. Zero is a valid value in those algebras.

I don't mean to diss on the idea, it's a good way to dip a toe into the math and computer science behind algebraic graph theory, but in production or for anything but the smallest (and densest) graphs, a sparse graph algebra library like SuiteSparse would be the most appropriate.

SuiteSparse is used in MATLAB (A .* B calls SuiteSparse), FalkorDB, python-graphblas, OneSparse (postgres library) and many other libraries. The author Tim Davis from TAMU is a leading expert in this field of research.

(I'm a GraphBLAS contributor and author of OneSparse)

michelpp··on Adjacency Matrix and std:mdspan, C++23
Yep, for any decent sized graph, sparse is an absolute necessity, since a dense matrix will grow with the square of the node size, sparse matrices and sparse matrix multiplication is complex and there are multiple kernel approaches depending on density and other factors. SuiteSparse [1] handles these cases, has a kernel JIT compiler for different scenarios and graph operations, and supports CUDA as well. Worth checking out if you're into algebraic graph theory.

Using SuiteSparse and the standard GAP benchmarks, I've loaded graphs with 6 billion edges into 256GB of RAM, and can BFS that graph in under a second. [2]

[1] https://github.com/DrTimothyAldenDavis/GraphBLAS

[2] https://onesparse.com/

michelpp··on Adjacency Matrix and std:mdspan, C++23
For a powerful sparse adjacently matrix C library check out SuiteSparse GraphBLAS, there are binding for Python, Julia and Postgres.

https://github.com/DrTimothyAldenDavis/GraphBLAS

michelpp··on The Little Book of Linear Algebra
Beautiful, a great intro to and reference to core concepts. Definitely keeping this one around for mental refresh!
michelpp··on GPU-rich labs have won: What's left for the rest of us is distillation
Not sure why this is being downvoted, it's a thoughtful comment. I too see this crisis as an opportunity to push boundaries past current architectures. Sparse models for example show a lot of promise and more closely track real biological systems. The human brain has an estimated graph density of 0.0001 to 0.001. Advances in sparse computing libraries and new hardware architectures could be key to achieving this kind of efficiency.
michelpp··on Automerge 3.0
There is also a C api wrapper, not sure the state of it wrt this latest release.
michelpp··on Billions of Edges per Second with Postgres
Author and CEO here, we're excited to get OneSparse off the ground and show off some high performance graph processing with Postgres. Feel free to ask any questions!
michelpp··on Thnickels
Usd nickles have smooth edges.
michelpp··on Implementing a Forth
Mastering Forth is also an excellent book and gets deep into the subject with very clear writing and excellent diagrams.

https://archive.org/details/mastering-forth-by-anderson-anit...

michelpp··on Show HN: PgDog – Shard Postgres without extensions
FRENCH GUARD: You don't frighten us, English pig-dogs! Go and boil your bottom, sons of a silly person. I blow my nose at you, so-called Arthur King, you and all your silly English k-nnnnniggets. Thpppppt! Thppt! Thppt!

GALAHAD: What a strange person.

michelpp··on Show HN: A5
I'm not sure about A5, but I do know that HEALPix cell boundaries are not geodesics, whereas S2 cells are always bounded by four geodesics.
michelpp··on Implementing State Machines in PostgreSQL (2017)
While this is a good approach to implements state machines, the transition function is hardwired to one transition graph. Another approach is to generalize the state and transition graph into a table, and group those transitions by a machine id, as shown here:

https://github.com/michelp/pgfsm

Now many machines (sub-graphs of state transitions) can be defined in general, and the transition checking function checks the validity of the next state based on the table, instead of static rules in a function.

michelpp··on Mathematician solves algebra's oldest problem using intriguing number sequences
Agreed, his videos on Tropical Algebra are also very good!
michelpp··on Mathematician solves algebra's oldest problem using intriguing number sequences
> There is nothing mathematically wrong about that world

Thank you for acknowledging this. Every time Norm's work comes up on HN there is a subcurrent of comments about how his philosophy of math is wrong or dumb whose are arguments can be summed up as "Lol no infinity wtf".

Do I personally agree with his philosophy? No. But I still watched all his videos because they are entertaining, thoughtful, and his is rigorous in his definitions and examples.

michelpp··on Supabase raises $200M Series D at $2B valuation
I turn 50 tomorrow and I love vibe coding. In the hands of an expert with decades of experience in all the internal corners of C, Python and Postgres I find AI tools to be miracles of technology. I know how to ask them exactly what I want and I know how to separate the goodness from the bullshit. If Supabase is bringing AI closer to the developer at the database level then that is a great thing.
michelpp··on New Proof Settles Decades-Old Bet About Connected Networks
I agree with you, I work with graph algebra libraries and this article did a very nice job.
michelpp··on Show HN: Pg_CRDT – CRDTs in Postgres Using Automerge
Main contributor here, had a lot of fun working with automerge and its amazing C API around the core Rust library and collaborating with Supabase. This allowed me to take advantage of expanded datum features and improvement in postgres 18 driven by a feature I needed for another project storing large in-memory sparse matrices [1][2]. Based on these new features, lots of rich object data model API can now be used very efficiently from sql when doing multiple complex operations in a function.

This is still experimental bleeding edge stuff that's only available on the unreleased pg 18 so far (using the current dev mainline branch) but will open up a lot of possibilities in the future. Future improvements I hope to make to pg_crdt include implementing the sync() api for easy peer-to-peer synchronization and a full round-trip example application. Word is automerge 3.0 will have some nice new features and I look forward to that.

As an HN specific side note, there was a choice to make initially to use either Rust via pgrx or the automerge C API. At the time (and maybe still?) pgrx did not support expanded datum, which I think would be an amazing addition, but it was out of my scope, and my familiarity with the postgres C extension API made us choose C. Happy to discuss further improvements in this regard as I go up the Rust learning curve myself.

[1] https://www.postgresql.org/message-id/flat/647219.1736019347...

[2] https://onesparse.com/docs.html

michelpp··on Why Vermont farmers are using urine on their crops
Sprouting is an excellent and compact way to get some fresh greens into your diet in a small space. No urine required (although I too do dump my urine on my farm hosts' compost). I live in a short school bus with less than 8sqm of space and do my sprouting in a small clear plastic tote. Every day I eat fresh sprouts, usually with something like wild-caught canned mackerel.
michelpp··on Postgres as a Graph Database: (Ab)Using PgRouting
Thanks Paul! OneSparse author here, we're still in early dev stages (OneSparse requires some new features in postgres that won't be available until pg18) but my plan is to do a benchmark shootout with various graph tool for postgres. Initial results look good, on my 4-core 11th gen intel laptop we're getting some really good numbers!

             LiveJournal                 Orkut
  Nodes:     3,997,962                   3,072,441
  Edges:     34,681,185                  117,185,037
  Triangles: 177,820,130                 627,583,972

                  Seconds  Edges/Second  Seconds  Edges/Second
  Tri Count LL:   2.69     12,892,634    32.03    3,658,602
  Tri Count LU:   1.78     19,483,812    16.38    7,156,338
  Tri Centrality: 1.45     23,918,059    12.22    9,589,610
  Page Rank:      7.12     4,870,953     23.14    5,064,176
Orkut was as big as I could go due to limited RAM. One of my constrains is limited access to big enough hardware to do the kinds of Graphs Of Unusual Size (billions of edges, trillions of triangles) where we can really flex the scale that CUDA support gives us. Stay tuned!
michelpp··on PostgreSQL Anonymizer
Yep, it's a completely generic feature, and I'd argue the keyword 'SECURITY' is a noise word and 'LABEL' by itself would be even better, but that's what we're stuck with. As the documentation states: " PostgreSQL places no restrictions on whether or how a label provider must interpret security labels; it merely provides a mechanism for storing them."
Page 1 of 11Next →