Elan Ruskin
@despair.bsky.social
460 followers 51 following 240 posts
Using integers and making games. Also @despair on Twitter, @[email protected]
Posts Media Videos Starter Packs
Pinned
despair.bsky.social
Normalize checking whether things are true before believing them.
despair.bsky.social
Probably the ultimate Turing test.
jdan.me
jordan @jdan.me · Apr 18
I can usually tell by looking at code whether or not it will halt
despair.bsky.social
I think you could find a better analogy for this one.
despair.bsky.social
Or you can use leading zero count (LZCNT aka __lzcnt64()) , which is defined as 0 → 64, and also 2 cycles faster than bsr.

*undefined = on some CPUs it returns 0 and on other CPUs it return either 0 or garbage depending on flags and source operand type and who knows what else
DON'T ASK HOW I KNOW
despair.bsky.social
x86 `bsr` opcode gives an undefined* result for input value 0. Windows intrinsic _BitScanReverse64()'s returns 0 for input 0 to handle this case. Use it in a ternary statement to generate branchless code.

Hope this helps.
despair.bsky.social
That said, I mostly enjoyed Tron: Ares. It's not a great film, but it has a great soundtrack, and it was fun to spot all the quotes and references.
despair.bsky.social
AI as nascent lifeform is also core cyberpunk. But I think we're past that story being "Frankenstein" and need to start doing it as "Dr. Strangelove". The best movie we've had on the peril of overfit machine learning so far is M3GAN.
despair.bsky.social
But a lot of Tron: Ares is cyberpunk about cyberpunk. War between the corporations. Computer hacking is infiltrating a Futurist building in cyberspace, straight out of Neuromancer. The world is saved by a heroic video game developer 😁
despair.bsky.social
There are glimmers. Tron: Ares opens with a depiction of reinforcement learning from the GAN's perspective. One of its AIs transcends its training given more context. Another becomes misaligned from a bad prompt.
despair.bsky.social
Tron isn't religious propaganda, it just uses allegory as a narrative device, and that allegory isn't 1:1. But allegory gives theme; the movie is *about* something, it's a parable of purpose and faith. Tron: Ares is mostly about Tron.
Screenshot from "Tron" : the scene where a dying RAM program looks at Flynn, realizing that Flynn is a user (effectively his god) there for him in his last moment.
despair.bsky.social
The rest is obvious. Tron, his faith in the Users unwavering, is a disciple. The I/O priests are conduits between the programs and their creators. Flynn sacrifices himself to restore that connection, then ascends bodily to the creators' world.
despair.bsky.social
But things in Tron's world *do* have purposes! The tanks and Recognizers are game entities. The solar sail is a research sim. The programs use these things without knowing why they exist. Flynn can work miracles because he has context.
Excerpt from an early draft screenplay of "Tron":
    419  A SHOT FROM THE SIDE OF THE SAILER, RISING WITH TRON         419
         AND YORI

         We see that this vessel is a simulation of a futuristic spacecraft,
         designed for travel in the real world using solar energy, with an
         enormous metallic sail to catch the rays of sunlight like wind, and
         move with the speed of light.  The sail is at the bow of the craft,
         and a long, slender walkway connects it with the deck area, which is
         made up of several connected flattened box-shapes, giving it the
         look of a dragonfly. In this world, the sailer catches data
         transmission beams instead of sunlight, and is propelled along the
         information paths to the Central Processing Unit.

                               TRON V.O.
                    Can it carry us?


                               YORI V.0.
                    The design is good... We don't know
                    why the User abandoned the project...


         The elevator platform brings Tron and Yori through the center,
         forming part of the deck as it reaches a level position, locked
         into place. Screenshot of the Solar Sailer simulation CGI in "Tron"
despair.bsky.social
The same actors portray both programmers and their programs. AIs are made in their creators' images. So when Flynn gets abducted into cyberspace, he's literally The Creator bodily manifested among his creations, then condemned by Pilate.
despair.bsky.social
Some programs believe they were created for a purpose by a higher power they cannot see. The local authority wants them to serve itself instead. So the ones who believe in The Users are sent to the games to die.
Russell Crowe as the gladiator in "Gladiator" Peter Jurasik as one of the disc game gladiators in "Tron"
despair.bsky.social
Tron's story asks what arcade games would be like for the characters in them, sent to fight in deadly sports on behalf of users they never see. Reach into history for a parallel and you'll find gladiators. The rest of the story flows from there:
Excerpt from early draft Tron screenplay:

        Two other game warriors on the grid, this time throwing
         glowing disks at one another like frisbees. We see the
         one colored blue throw; his disk smashes into the second
         warrior, and he dissolves into thousands of glowing lines.
despair.bsky.social
Something that got lost between screenplay and screen is *why* the cyberspace of Tron looks the way it does: it's a world built from video games and simulations. The people are game avatars. The vehicles are CAD assets and research sims.
Excerpt from an early draft TRON screenplay:

    6    ELECTRONIC WORLD                                             6


         Futuristic tanks bearing down on one another in a flat grid-like
         landscape. One FIRES, and the other disappears when it is hit, to
         reappear, spinning wildly, in the distance. We HEAR a sound
         like a crack of lightning.


    7    REAL WORLD                                                   7


         A video game in an arcade. On the screen is a typical version of
         Tank Wars with computer generated representations of tanks in a 2-D
         maze. Screenshot from Tron:  CLU's tank faces down a Recognizer
despair.bsky.social
Tron: Ares is a very colorful movie in which many things happen. But it misses a big part of what made the original "Tron" work. Since no one asked, let's talk a bit about cyberpunk, video games, and religious allegory.
despair.bsky.social
How widespread is that readiness?
despair.bsky.social
[Me: buys various plumbing and cleaning chemicals at hardware store]
Cashier (joking): Heh, are you building a bomb?
Correct answer: "Ha ha no, these are all for different rooms."
My answer (distracted): "What? No, combining this would just make chlorine gas; you'd need an oxidizer for detonation."
despair.bsky.social
In 426BC, Athenian politician Cleon prosecuted the comedian Aristophanes for making fun of him in front of foreigners. In response, Aristophanes produced The Knights, a play comprised entirely of slander against Cleon. It won Best Comedy in 424BC.

en.wikipedia.org/wiki/The_Kni...
despair.bsky.social
Just noticed I misspelled “prefetching” as “prekvetching” in a dozen comments, and tbh that might be a more honest description of how I perf
despair.bsky.social
Yeah, that’s always been the hazard of that adage. First the optimization is premature, then it’s too late.
despair.bsky.social
“Don’t worry about perf now, we’ll optimize later” is like buying a king size bed and saying “we’ll figure out how to get it into my Miata in the parking lot”. Devs have had to design around hardware since forever! If you know 1000 NPCs barely fit on top end, wtf is your plan for minspec?