HNHacker News
TopNewBestAskShowJobs

orlp

8,870 karma · joined March 27, 2013

Developer at https://pola.rs/.

Publish a blog at https://orlp.net/blog/.

Other socials:

    http://github.com/orlp/  
    https://stackoverflow.com/users/565635/orlp  
    https://linkedin.com/in/orson-peters/
submissionscomments
orlp··on Static search trees: faster than binary search
One dimension that is not explored is partitioning the queries in batches. The primary cost is doing lookups on the out-of-cache table, so if you have a sufficiently large amount of queries you can resolve a couple layers of the tree in one step while those layers are in cache, grouping them based on where they land deeper in the tree, and then resolving all those queries that touch the same deeper part of the tree in one batch as well.

In theory, with an infinitely large amount of input queries you will never have to do an out-of-cache lookup, it can be completely amortized away into linear scans.

That said, you now end up with a bunch of results that need to be put back into the correct output order, which likely makes it not worth it. But if the operation can be fused into a reduction (e.g. find the sum of the binary search results) or the output order does not matter in some other way then all of a sudden it might make sense.

orlp··on PQConnect: Automated Post-Quantum End-to-End Tunnels
Seems a bit disrespectful to only list the big name professors in the title and shove the PhD student who seemingly actually wrote the pqconnect software (Jonathan D. Levin) into the ohters [sic] category.
orlp··on Ask HN: Is ChatGPT down?
That's the next stage of deflection after passive voice.

1. In normal and honest language you state things you have done, and their consequences.

2. Passive voice attempts to deflect blame by only stating the consequences as if they just magically occurred through divine intervention.

3. In the next stage they don't even acknowledge the consequences, and instead place the entire issue inside your experience of the facts.

orlp··on Navtive FlameGraphViewer
I can really recommend samply: https://github.com/mstange/samply. It just works out of the box.

It uses the Firefox profiler to view its recorded profiles. You can (don't have to, just can) even share them, I was looking at this profile just yesterday: https://share.firefox.dev/3PxfriB for my day job, for example.

orlp··on Dividing unsigned 8-bit numbers
Division by 195 is trivial. The answer is simply

    uint8_t div195(uint8_t x) { return x >= 195; }
orlp··on Dividing unsigned 8-bit numbers
It's not entirely a coincidence but also not a general result that one should use the modular inverse as multiplier.

171 * 3 = 2^9 + 1, which is not surprising as we know that 171 * 3 = 1 (mod 2^8). So rearranged we have 171 / 2^9 = 1/3 + 1/(2^9*3) which shows it's a close approximation of 1/3.

orlp··on Dividing unsigned 8-bit numbers
Yes, if you know something is an exact multiple of n = r*2^k where r is odd, you can divide out the multiple by right-shifting k followed by modular multiplication by the modular multiplicative inverse of r.
orlp··on Dividing unsigned 8-bit numbers
What's not mentioned is that in most cases you have a constant divisor which lets you replace division by multiplication with the reciprocal. The reciprocal can be rounded to a nearby dyadic rational, letting you do the division with a right-shift.

For example, 8-bit division by 3 is equivalent to widening multiplication by 171 followed by a right-shift of 9, as 171/2^9 = 0.333984375 which is close enough to 1/3 that the results match exactly.

orlp··on Tldraw Computer
What do you base this on? The main repository (https://github.com/excalidraw/excalidraw) states it's MIT and this has been unchanged for 5 years.

EDIT: I guess you were talking about tldraw rather than excalidraw.

orlp··on Klarna CEO: Company stopped hiring because AI 'can do all of the jobs'
I'd suggest him to lead by example and fire himself.
orlp··on Bitbanging 1D Reversible Automata
It turns out that only the identity gate and the left <-> right moving rules are reversible, plus their negated variants, see my other comment.
orlp··on Bitbanging 1D Reversible Automata
A rule R is reversible if there exists a rule R^-1 such that for all a, b, c, d, e, f, g we see the following evolution (where . stands for "don't care"):

    a  b  c  d  e  f  g

       Apply rule R

    .  b' c' d' e' f' .
       
       Apply rule R^-1

    .  .  c  d  e  .  .
In equations, it means there must exist some R^-1 such that for all a, b, c, d, e, f, g the following holds:

    c = R^-1(R(a, b, c), R(b, c, d), R(c, d, e))
    d = R^-1(R(b, c, d), R(c, d, e), R(d, e, f))
    e = R^-1(R(c, d, e), R(d, e, f), R(e, f, g))
Writing a quick program that checks all possible combinations of R and R^-1 (https://play.rust-lang.org/?version=stable&mode=debug&editio...) we find the following inverse pairs:

   0x33 <-> 0x33
   0x55 <-> 0x0f
   0xcc <-> 0xcc
   0xf0 <-> 0xaa
That is, the following two rules are self-inverses (they're the NOT and IDENTITY gates on the center cell respectively):

    111 110 101 100 011 010 001 000
     0   0   1   1   0   0   1   1
     1   1   0   0   1   1   0   0
We have the left <-> right moving pair you identified:

    111 110 101 100 011 010 001 000
     1   0   1   0   1   0   1   0

    111 110 101 100 011 010 001 000
     1   1   1   1   0   0   0   0
And there's just one more, which is the same as the above but it also inverts the output (move left and invert is the inverse of move right and invert):

    111 110 101 100 011 010 001 000
     0   1   0   1   0   1   0   1

    111 110 101 100 011 010 001 000
     0   0   0   0   1   1   1   1
orlp··on Ask questions of SQLite databases and CSV/JSON files in your terminal
Funnily enough syntax errors is the one thing that you can completely eliminate in LLMs simply by masking the output symbol probability vector to just those which are valid upcoming symbols.
orlp··on Breaking CityHash64, MurmurHash2/3, wyhash, and more
> You can't fit a reasonable hash into 10 cycles.

Not 10 cycles, but my polymur-hash can hash any value <= 49 bytes in 21 cycles on an Apple ARM machine: https://github.com/orlp/polymur-hash/.

I think it's a "reasonable hash" too, considering against non-interactive attackers it's provably secure (collision probability bounded up to n * 2^-60.2 for n bytes).

orlp··on Breaking CityHash64, MurmurHash2/3, wyhash, and more
> None of these hashes are cryptographic.

I never said they were.

> Crypto hashes don't have a problem of being slow.. they are designed to be slow.

No they're not. Only password-based key derivation functions are designed to be slow, every other hash tries to be as fast as possible within their security budget.

> The conclusion tries to tie weak/fast hashes to crypto/secure hashes (the https mention), but they're worlds apart.

Actually, the specific link I made between cryptographic strength universal hashing and maximum-speed universal hashing is precisely because they're not worlds apart. They use the same techniques, and stand on the same mathematical background.

orlp··on How do merging supermassive black holes pass the final parsec?
The point I'm trying to make is that everyone always cites the no hair theorem but completely leaves out the "stationary solution" part, leading to misconceptions. My thought experiment highlights that one can't treat a black hole as a particle that only has mass, charge and angular momentum in a dynamic world, because such a treatment must inherently lead to instantaneous updates to large regions of spacetime in response to 'stimuli' (in the form of mass, charge or angular momentum) for super massive black holes, which is impossible.
orlp··on What Color is Your Function? (2015)
If every line had an implicit await then it is indistinguishable from pre-emption, which I think is the point the person you're replying to is trying to make.
orlp··on How do merging supermassive black holes pass the final parsec?
Again, the no-hair theorem only talks about stationary solutions:

> The no-hair theorem (which is a hypothesis) states that all *stationary* black hole solutions of...

https://en.m.wikipedia.org/wiki/No-hair_theorem

> The field adjustment is instant for the outside observer

And as my above thought experiment shows, any instant changes like such could be used for FTL communication.

orlp··on How do merging supermassive black holes pass the final parsec?
Mental typo, I meant horizon, not origin.
orlp··on How do merging supermassive black holes pass the final parsec?
This is often stated but it literally can't be true. It's true for stationary solutions to the relevant equations, but we're very much not living in a stationary world.

Here's a simple thought experiment disproving your claim. A person hovers just above the origin of a supermassive black hole. They chuck a massively charged object into the black hole. If what you said is true they should observe the charge instantly being transported to the singularity, since a black hole can't have any attributes such as where charge is distributed within the horizon.

Where it gets impossible is that someone very far away around the same supermassive black hole could observe a small charge increment. They in turn could chuck charged stuff into the black hole and now you've got faster than lightspeed communication.

orlp··on Cognizant found guilty of discriminating against non-Indian employees
https://www.youtube.com/watch?v=l3fAcxcxoZ8
orlp··on Fast B-Trees
> You mention that foldhash does not claim to provide HashDoS resistance against interactive attackers, so perhaps that disqualifies it.

The linked CVE is not an interactive attack either FYI, so foldhash would be sufficient to protect against that. When I say an "interactive attacker" I mean one that analyzes hash outcomes (either directly or indirectly through things like timing attacks and iteration order) to try and reverse engineer the hidden internal state.

> If anything, given this requirement, comparing with wyhash, as they do in the article, is misleading.

That is correct. There is no reason to believe wyhash is secure against interactive attackers.

orlp··on Fast B-Trees
XXH3 does not have this property, no more than foldhash does.
orlp··on AVX Bitwise ternary logic instruction busted
That's not what ternary refers to here.

In C, '+' is a binary operator because it accepts two inputs. '?:' is a ternary operator because it accepts three inputs. It is usually referred to as the ternary operator because it is unique in C, but there's nothing fundamental about that.

vpternlogd implements all bitwise ternary operators - those operators that accept three inputs.

orlp··on Fast B-Trees
Why was Rust's hashmap only tested with SipHash? It's known to be pretty bad for performance.

I'm biased as the author of course, but try adding a benchmark with the Rust hasher + foldhash as well: https://github.com/orlp/foldhash.

orlp··on Show HN: Chebyshev approximation calculator
I've had good results in the past with sollya: https://www.sollya.org/.

Note: results. The software itself is a bit of a pain to use.

orlp··on Nvidia releases NVLM 1.0 72B open weight model
Not a lawyer, not legal advice, but... the legal status quo is that neural network outputs are not copyrightable. They are currently considered not made by humans nor considered a derivative work from the training material / network weights (assuming it's not regurgitating copyrighted material verbatim).

The cc-by-nc-4.0 license applies to the network weights. The only thing non-commercial about the license is that it restricts how you may reproduce the licensed material:

> reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and

As long as you are not selling the network weights themselves, nothing in the license prevents you from evaluating the neural network for commercial purposes and selling the outputs. In 'production' you will have to directly download the weights from Nvidia themselves (or another 3rd party which is distributing the network weights non-commercially in good faith) though, you can't share the network weights onto your commercial inference server from another one of your commercial deployment servers. Or at least, it gets more dicy there and may be considered commercial reproduction so better avoid it.

For similar reasons you may 3D print a CC-BY-NC model of a tool and use that tool in your commercial workshop, you may use a CC-BY-NC compiler of a language to compile commercial programs, etc.

orlp··on Coding Font by Typogram – Find Your True Love of Coding Fonts
Not the person you replied to, but I use Iosevka Fixed which is default except everything is always fixed-width and there are no ligatures.
orlp··on Inside Annapurna Interactive's Mass Walkout
> This is a real shame for anyone who cares about really distinctive, original games.

Is it though? Annapurna is a publisher, they didn't make those games. The games you listed were made by:

  - Outer Wilds: Mobius Digital  
  - Stray: BlueTwelve Studio  
  - Lorelei and the laser eyes: Simogo  
  - Cocoon: Geometric Interactive  
  - Neon White: Angel Matrix
I'm confident that creators of distinctive, original games will be able to find other publishers.
orlp··on Fuck founder mode. Work in "Fuck off mode"
People that do believe you need to be innovative are in for a rude awakening when they actually do something innovative successfully only to find out a year later there are now 5 competitors copying you, with decent success.
← PreviousPage 6 of 24Next →