Patrick Walton
pcwalton.bsky.social
Patrick Walton
@pcwalton.bsky.social
Programming languages and graphics person. Rust compiler, Firefox, and Bevy contributor. Currently working on an unannounced project!
I filed an issue on what I think the minimum set of instructions that wasm needs to efficiently implement JITs of systems with MMUs is: try-load and try-store. github.com/WebAssembly/... Interested in feedback.

(From what I see, this would enable fast emulation on non-jailbroken iOS.)
Add “try-load” and “try-store” instructions · Issue #23 · WebAssembly/memory-control
JITting emulators like http://copy.sh/v86 incur significant overhead from having to check page tables on every memory access. Traditionally, emulators implement this by trapping SIGSEGV. The signal...
github.com
November 8, 2025 at 1:36 AM
Interesting that having to emulate paging via softmmu and 80-bit x87 floats are what kills copy.sh/v86 wasm-based JIT performance. I wonder how fast you could go with MMU-less RISC-V Linux? Could be nice for non-jailbroken iOS.
v86
Run KolibriOS, Linux or Windows 98 in your browser
copy.sh
November 6, 2025 at 9:57 PM
Project that'd be fun but that I have no time for: Compile and run native code on-device on iOS by running macOS (or Windows?) interpreted in a VM on-device, and have the VM talk to the iOS device via a tiny device ($5 microcontroller?) you plug into the USB port that loops the USB back.
October 29, 2025 at 6:49 PM
I noticed that x86 APX has a prefix that allows for 3-operand insns (e.g. add rax,rbx,rcx instead of mov rax,rbx; add rax,rcx). I wonder what the advantage of that over the 2 instruction pair is? Couldn't the CPU fuse the latter instruction pair into effectively a 3-operand insn?
October 21, 2025 at 3:21 PM
OK, the way Clippy told me to replace cos(pi / 4) with the FRAC_1_SQRT_2 constant is wild. Clippy is becoming self-aware.
October 19, 2025 at 4:45 AM
Bevy 0.17! I only have minor improvements in this one, because my engine-level work has been focused on VFX instead of Bevy proper, but the improvements everyone has contributed to this have been awesome to see!
bevy.org Bevy @bevy.org · Sep 30
Bevy 0.17 is out now! It features Raytracing, Improved Observers / Events, UI Widgets, Rust Hotpatching, Light Textures, DLSS, Tilemap Chunks, Web Assets, Reflect Auto-Registration, UI Gradients, Raymarched Atmosphere, Virtual Geometry BVH Culling, and more!

bevy.org/news/bevy-0-17
Bevy 0.17
Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever!
bevy.org
September 30, 2025 at 7:52 PM
OK, I love this. tl;dr using knowledge of your allocator, speed up linked list traversal by adding a branch that guesses where the next linked list element is and pre-populates the "next" variable to eliminate stalls if the allocations are well-behaved.
September 28, 2025 at 1:31 AM
Wrote up how Unity's "Freeform Stretching" and "Rotate With Stretch" features work so that the next person who wants to run them on GPU doesn't end up pulling their hair out: gist.github.com/pcwalton/ff7...
Unity Freeform Stretching
Unity Freeform Stretching. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
September 26, 2025 at 6:53 PM
Just reverse engineered Unity's "Freeform Stretching" and "Rotate With Stretch" particle system features. Never had a problem devolve into "write down as many random observations as I can until I get down to 2 equations with 2 unknowns and can solve for the result" before, but sometimes it works!
September 26, 2025 at 5:05 AM
RTX in Bevy!
New blog post: "Realtime Raytracing in Bevy 0.17 (Solari)"
jms55.github.io/posts/2025-0...
September 22, 2025 at 3:48 AM
Well, that was certainly a bug.
Problem: Hanabi particles are too fast. I store direction and magnitude separately, but direction wasn't being normalized. Hmm. Bug in my normalization code? No, it looks right... 1/
September 22, 2025 at 12:52 AM
I made my temporary fork of Bevy Hanabi more concrete. It's now called Hanabi-Batched: github.com/pcwalton/bev...

This is a temporary fork that provides much better performance in real-life scenarios, making the difference between a shippable game and not in most cases.
GitHub - pcwalton/bevy_hanabi: A fork of Bevy Hanabi, the GPU-driven VFX system for Bevy, with improved performance and functionality
A fork of Bevy Hanabi, the GPU-driven VFX system for Bevy, with improved performance and functionality - pcwalton/bevy_hanabi
github.com
September 16, 2025 at 11:33 PM
Also true for Rust.
everyone is so impressed with LLMs ability to generate JavaScript that they try to start applying it to things like Kotlin or Swift and then rapidly find out the hard way that there exists orders of magnitude more training data for JS
September 16, 2025 at 9:10 PM
With the GPU-driven rendering work I did earlier this year and the Hanabi VFX work I'm doing now, Bevy is consistently hitting 120 FPS for me. Looks really nice on a high refresh rate display.

Building a GPU-driven renderer is a ton of work, but the results *really* pay off.
September 9, 2025 at 10:24 PM
Just pushed a branch of Hanabi, the GPU VFX system for #bevyengine, with a significant overhaul of the way scheduling works: github.com/pcwalton/bev...

In my tests, I can now have 500+ different particle *systems*, each with many particles, on screen at once and still hit 120 FPS.
GitHub - pcwalton/bevy_hanabi at batching-2
🎆 Hanabi — a GPU particle system plugin for the Bevy game engine. - GitHub - pcwalton/bevy_hanabi at batching-2
github.com
August 31, 2025 at 3:20 PM
Asking ChatGPT "what is two-phase occlusion culling?" and it confidently gives the wrong answer, saying that it involves artists placing occluders manually, when a huge draw of 2-phase is that it *doesn't* require artists to do that.
August 29, 2025 at 3:56 PM
It's hilarious to me that ChatGPT can now write decent Rust, but it's completely useless at doing anything but the most basic operations in ImageMagick. ImageMagick is objectively more difficult than the borrow checker
August 21, 2025 at 5:34 PM
Always resist the temptation to store extra data alongside indirect draw parameters. It may seem convenient now, but you will want to support multidraw indirect eventually and then you will have to redo all your bind group management and you will hate yourself.
August 20, 2025 at 2:41 AM
peekable() is nice for iterators, but usually what I really want is pushbackable(). i.e. let me use the equivalent of ungetc(), to push back a single element.
August 19, 2025 at 9:06 PM
Current status: Debugging a race condition in which the easiest way to repro is "put my laptop to sleep, stick it in a bag for at least 10 minutes, turn it on without A/C power, and then start the program".
August 18, 2025 at 10:57 PM
Reposted by Patrick Walton
wrote about some of the work i've done in the past year and what i'm hoping to accomplish next year in bevy! ✨

www.charlotte.fyi/posts/bevys-...
August 12, 2025 at 7:41 PM
What's the origin of the name "rib" for a lexical environment? I believe it's Scheme, based on finding the name inside some Chez Scheme source in Racket and googling bringing up www.khoury.northeastern.edu/home/will/Tw... -- but I'm not sure *why* Scheme chose that name.
Twobit Pass 4: closure conversion
www.khoury.northeastern.edu
August 12, 2025 at 11:23 PM
In WGSL:
* There is neither ternary operator nor expression if/else. Strike 1.
* The replacement, select(), evaluates eagerly. Strike 2.
* select() arguments are in the *opposite* order of the ternary. Yes, that means the else branch precedes the if branch. Strike 3, you're out.
August 10, 2025 at 9:25 PM
Every `EXPRS ::== EXPR | EXPRS ',' EXPR` production in any language ever should be considered a bug. Trailing commas should be allowed everywhere!
July 8, 2025 at 11:25 PM
Reposted by Patrick Walton
Hey #bevy :D It's time for your weekly #bevymergetrain, where I go over the community-reviewed #opensource PRs for the #rustlang game engine that I help maintain!

Somehow, there's already 24 PRs in our backlog today: github.com/bevyengin...

Will we merge the PR, or request changes? Follow along!
Pull requests · bevyengine/bevy
A refreshingly simple data-driven game engine built in Rust - Pull requests · bevyengine/bevy
github.com
July 1, 2025 at 12:00 AM