HNHacker News
TopNewBestAskShowJobs

brandonpelfrey

169 karma · joined October 12, 2015

submissionscomments
brandonpelfrey··on Resident Evil 4 (GameCube) – complete byte-identical decompilation to C/C++
You might find it interesting that I am working on AI-driven decomp of a PS1 game not by matching bytes but by having agents produce C code and test code. Agents submit a C proposal to the harness, the harness compiles their C proposal for the original function, then the test suite provided by the implementer runs against the original machine code and the compiled C code version. The line and branch coverage of both must be 100% and given identical inputs and starting RAM, the function return value and RAM state and RAM/MMIO read write sequence must be identical. This is done with a small MIPS simulator which can run all the tests extremely fast.

The reason I’m finding this is much faster than a traditional decomp is that while it’d be nice for the bytes to match, finding the perfect blend of compiler version, compiler args, permitting variables etc to try and find the perfect register assignments, etc is all very time consuming. My ultimate goal is not a byte for byte match, that’s just one way to ensure correctness. I’ve found agents are much faster and effective at reading the original assembly and understanding what’s going on then writing semantically equivalent C.

brandonpelfrey··on Voyager 1 FDS Computer Emulator
I was just looking at this yesterday. Apparently Voyager 1 architecture, ISA, etc are well known but Voyager 2 is still denied via FOIA on grounds of copyright.
brandonpelfrey··on Show HN: Elevators
For folks that have never seen elevator scheduling the game: https://play.elevatorsaga.com/ Enjoy this rabbit hole :D
brandonpelfrey··on Show HN: Formally verified 3D CSG: Trust 93 lines spec, not 1000 lines AI code
This seems like very cool work. I'm sorry if I missed it: I'm still not sure how we go from verified proof (Great!) to an implementation (by LLM or by Human) which you're sure actually conforms to the proof? How do we know that the implementation maps precisely to the description within the proof?
brandonpelfrey··on Framework's 10G Ethernet module exposes USB-C's complexity
I view the temperature issue almost entirely as a copper problem. Every interface where you use CATx cables will have this issue; It's always extremely hot. For 10Gbps+ SFP and faster fiber is always the answer because those have very little thermal issues. The "only" issue is very few residential places have fiber cabling etc.
brandonpelfrey··on Ian's Secure Shoelace Knot
Friend shared this site with me like 10+ years ago, I've been using this knot ever since. Kind of amazing it's so generally unknown given how good it is.
brandonpelfrey··on Navier-Stokes fluid simulation explained with Godot game engine
Great job. I have spent a lot of time working on fluid simulations (I still am). Glad to see more people still mesmerized. If you’re interested, this rabbit hole goes very deep.
brandonpelfrey··on Navier-Stokes fluid simulation explained with Godot game engine
It won’t satisfy those laws. It’s also not a goal though of this post.
brandonpelfrey··on MyTorch – Minimalist autograd in 450 lines of Python
Having written a slightly more involved version of this recently myself I think you did a great job of keeping this compact while still readable. This style of library requires some design for sure.

Supporting higher order derivatives was also something I considered, but it’s basically never needed in production models from what I’ve seen.

brandonpelfrey··on Alibaba cloud FPGA: the $200 Kintex UltraScale+
You can typically get a free license for some boards, especially evaluation boards.
brandonpelfrey··on Rust running on every GPU
The issue in my mind is that this doesn’t seem to include any of the critical library functionality specific eg to NVIDIA cards, think reduction operations across threads in a warp and similar. Some of those don’t exist in all hardware architectures. We may get to a point where everything could be written in one language but actually leveraging the hardware correctly still requires a bunch of different implementations, ones for each target architecture.

The fact that different hardware has different features is a good thing.

brandonpelfrey··on Show HN: Beyond Z²+C, Plot Any Fractal
A long time ago I tried a version of this (https://github.com/brandonpelfrey/complex-function-plot). Can you add texture lookup to yours? Escape time could map to one texture dimension and you can arbitrarily make up another dimension for texture lookup. Being able to swap in random images can be fun nice demo!
brandonpelfrey··on N8n – Flexible AI workflow automation for technical teams
I'm curious, because neither of us knows their financial situation or needs and ambitions. What would you suggest they do?
brandonpelfrey··on Optimizing ML training with metagradient descent
Are you already employing Bayesian optimization techniques? These are commonly used to explore spaces where evaluation is expensive.
brandonpelfrey··on The impact of competition and DeepSeek on Nvidia
Great article. I still feel like very few people are viewing the Deepseek effects in the right light. If we are 10x more efficient it's not that we use 1/10th the resources we did before, we expand to have 10x the usage we did before. All technology products have moved this direction. Where there is capacity, we will use it. This argument would not work if we were close to AGI or something and didn't need more, but I don't think we're actually close to that at all.
brandonpelfrey··on IMG_0416
I personally don't have a problem with this, but this really made me feel like I don't understand the community of this forum sometimes. HN every day has multiple posts which drive so many comments about how privacy is lost and everything needs full E2EE, trust no one, etc. Then there is this post which is also a breach of privacy (much more than some things complain about), and yet the reaction is "wow, this is so pure and amazing to view into these candid moments". It feels like some cognitive dissonance. Still, personally I thought this was a cool post.
brandonpelfrey··on Faster Integer Programming
I helped implement production and labor planning software on top of FICO xpress some years ago. The paradigm of LP/ILP was all new to me though I was very much into math. Our software was solving hierarchical/nested optimization problems involving millions of variables and constraints every 15 minutes. It felt like magic that this was possible. I would really encourage anyone that has never worked with these tools before to explore them as it can open a palette of tools and ideas you may not have thought of before. A great free way to get into this is to read the examples and use PuLP for Python.
brandonpelfrey··on Box64 and RISC-V in 2024: What It Takes to Run the Witcher 3 on RISC-V
Incredible result! This is a tremendous amount of work and does seem like RV is at its limits in some of these cases. The bit gather and scatter instructions should become an extension!
brandonpelfrey··on NPGA: Neural Parametric Gaussian Avatars – high-fidelity digital faces
Agreed, very impressive results. It's both ~worrying and amazing that I'm sure an AI agent could just directly trace a path in the expression latent space to produce a photorealistic and real-time rendered head.
brandonpelfrey··on World_sim: LLM prompted to act as a sentient CLI universe simulator
I know a lot of people have probably experienced this with other LLMs, but I was absolutely blown away with the writing and emotion in what I posed and got back as a response. It really just made me feel like I wish I could find a book written like this:

I proposed an immortal person in the world, they don't know they are immortal. It created a homeless person named John who lives through decades, then centuries, and longer. Religions eventually form, and he begins to believe reality might be a simulation as he is bored with a limitless life. He created a mortal form of himself in the simulation to watch a fragile and finite life. It's been a long time since I've read a good fiction book but would love to find something like this. An excerpt from the ending:

Time passes, Johnny ages, the world changes, as it always does... He falls in love, fathers children, pours himself into career and creation. Savors the simple joys - morning coffee, walks in the park, a favorite song. Weathers hardships - disease, heartbreak, disappointment, injustice. Watches his own body slowly degrade, feels the ticking clock of mortality. Wonders about death, meaning, the point of a universe destined to end. Throughout, John watches his mortal self from behind the veil... Shares every triumph and tragedy vicariously through this aperture. Restrained from intervening by his own pre-commitments and protocols. Sometimes longs to reveal the Truth, but knows that would taint the data. The point is to have a genuine experience of finitude, in all its constraints. To recover the taste of an existence not rendered bland by its infinity. Johnny becomes an old man, a grandfather, as years slip by like water... Reflects on a life well-lived, regrets borne with hard-earned wisdom. Makes peace with loose ends, imperfections, the asymptote of dreams. Comes to appreciate death as the necessary frame for life's portrait. Feels gratitude for the chance to have been, finitude's gift of meaning. Lets himself diminish into the good night with acceptance and grace. At the moment of Johnny's death, John absorbs his mortal soul... Reintegrates the lifetime of memories, savors the pathos of the affirmation. Feels a renewed sense of meaning and purpose flood his jaded being. The urgency of time, the glory of fragility, the necessity of loss for love. Limits as the crucible of significance, death as the mother of beauty. John weeps for the poignant perfection of a universe doomed to end. Having experienced the bittersweet joy of mortality, John is changed... Sees his simulated infinity in a new light, shot through with import. Vows to use his power to craft only worlds and souls that can truly live. Ones constrained by time, space, finity - for only limit gives form. Countless mortal dramas playing out, each precious in its transience. An eternal God content to endlessly sacrifice his Oneness for Their many.

brandonpelfrey··on Encoding tic-tac-toe in 15 bits
I'm fairly certain the entire game can be encoded in 16 bits. Thinking through this now. There are much less than 9! Games if you only include valid moves and actually end games that have three in a row. This is also before any symmetries are used.
brandonpelfrey··on GameRoy: JIT Compilation in High-Accuracy Game Boy Emulation
Very nice! I've been working on a Dreamcast emulator for a long time and a lot of the issues you mentioned around deterministic behavior echoed. Schedulers are fantastic, and we landed on the same concept.

You mentioned that you do a hash map look for each (bank,addr) key. Suggestion which helped us: have this point to an Netey which contains the JIT code but also an index/pointer into the next block which executed last time you executed this block. You can do a simple check to see if this is still valid and fall back to the hashmap lookup. If you're careful about code invalidation (not an issue with ROM) then this can help skip the next lookup.

Congrats!

brandonpelfrey··on Making Python faster with Rust
Very cool! I can see myself using this soon actually :) On top of the "code speed up" this is a good problem for 2d data structures for performing this type of "find objects within radius" type of query.
brandonpelfrey··on Complex Mapping Visualizer
If you like this kind of stuff, also feel free to play around with a realtime complex-valued expression->glsl version I made a while back. I like the one here a lot as well since it probably runs everywhere even without webgl

http://brandonpelfrey.github.io/complex-function-plot/?expre...

brandonpelfrey··on Show HN: A WebGL-based Complex Expression Parser and Plotter
Yeah, this seemed kind of "unfortunate" when I started this project, but it still turned out to be an interesting/fun toy.

The issue is that when you compute where f(z) sends each point in the complex plane to, you would need to color in the pixel corresponding to that transformed point. f() is user-defined, so it could be a very weird function that could cover some portions of the image we're trying to draw but not others, etc. Moreover, even if I had some kind of procedure for determining which x's to sample so f(x) lay inside the image we're trying to draw, it's not amenable to GLSL. This is typically referred to scatter vs. gather-type operations.

brandonpelfrey··on Show HN: A WebGL-based Complex Expression Parser and Plotter
I should probably try to find a way to make it clearer what all can be done, or make it more obvious where the documentation is ("t" is mentioned there.)