Sign in

Patrick Walton

@pcwalton.turbofishstudios.com
2.6K followers 47 following 164 posts

Programming languages and graphics person. Rust compiler, Firefox, and Bevy contributor. Currently working on an unannounced project!

PostsRepliesMedia
Patrick Walton @pcwalton.turbofishstudios.com · 21/07/2026
One programming language "lane" that's still wide open is an native AOT compiled language with a high-performance, tracing, generational, moving GC. Imagine something like C# or C++ but safe and in which malloc is 5 CPU insns so you don't have to worry about allocating all the time.
4171
Patrick Walton @pcwalton.turbofishstudios.com · 11/07/2026
These days most of my attempts to improve Bevy's 3D performance fail. This might seem disappointing, but actually in my experience this is a *good* thing! It indicates that the low-hanging fruit is largely gone and Bevy's 3D is getting increasingly close to optimal.
1683
Patrick Walton @pcwalton.turbofishstudios.com · 12/06/2026
Doing mass edits to 3D scenes in glTF format from the command line using Nushell (since glTF is just JSON) is amazing.
0100
Patrick Walton @pcwalton.turbofishstudios.com · 07/06/2026
I read a bunch of folks saying "I tried Nushell and went back to Bash" and I'm like, how on earth. I do so much simple data manipulation and automation in Nushell that going back to having to use sed/awk, or reaching for Python and writing 3× the code, feels miserable. Do others just… not do that?
7290
Patrick Walton @pcwalton.turbofishstudios.com · 06/06/2026
After working with it for a couple of days, I can fairly confidently say Swift is such a beautiful disaster of a language, and I mean that in the nicest way possible
3100
Patrick Walton @pcwalton.turbofishstudios.com · 03/05/2026
Can't believe it's 2026 and we're having to disable GPU occlusion culling on flagship Google phones due to driver bugs. Pretty ridiculous. github.com/bevyengine/b...
github.com
Limit Pixel 10 to GPU preprocessing without GPU culling by SkiFire13 · Pull Request #24101 · bevyengine/bevy
Objective Workaround for Bevy crashes on Google Pixel 10 #23754 until we find the actual issue or Google fixes its driver Solution Limit Pixel 10 to GPU preprocessing without GPU culling Testin...
5243
Patrick Walton @pcwalton.turbofishstudios.com · 01/05/2026
Vim digraphs are the most convenient general purpose IME I've seen. I wish they worked in all apps!
150
Reposted by Patrick Walton
JMS55 @jms5517.bsky.social · 12/04/2026
Bevy 0.19 is releasing soon, which means it's time for a blog post! jms55.github.io/posts/2026-0...
0627
Patrick Walton @pcwalton.turbofishstudios.com · 14/04/2026
This mess is a stress test of Bevy 0.19 with 2,000,000 instances of 100,000 separate meshes. Runs at 60 FPS on my laptop. Each of the 2M mesh instances is a separate entity. There's no special "instanced mesh" component needed; the GPU driven rendering does all the batching automatically.
Grayscale static (essentially) in a window saying "many_cubes"
21369
Patrick Walton @pcwalton.turbofishstudios.com · 26/03/2026
A graphical frontend to Nushell in which you can drag in commands to create pipelines might be, like, the ideal form of visual programming. It might even be not terrible on a phone for “I need to format this data real quick” throwaway stuff.
4190
Patrick Walton @pcwalton.turbofishstudios.com · 11/03/2026
Been a while since I had a good old fashioned LL vs. LR vs. PEG debate (LR is the best, don't @ me)
1181
Patrick Walton @pcwalton.turbofishstudios.com · 09/03/2026
Gone too long without saying this so to reiterate yet again: • Reference counting does not prevent GC pauses; you can deallocate a lot of objects at once • It is possible to write RC that cleans up cycles and as a user you should demand this • Most tracing GCs are bad and you should demand better
2200
Patrick Walton @pcwalton.turbofishstudios.com · 09/03/2026
Maybe it's just me, but it feels like, more than any project I've worked on, the Discourse around Bevy is disproportionately just incorrect. Not sure if it's because: * Bevy moves so fast (aside from the editor); * Bevy is relatively niche; * Gamedev attracts a lot of confidently incorrect people
7434
Patrick Walton @pcwalton.turbofishstudios.com · 03/03/2026
Often times when people say "oh, there's room for X and Y to coexist", that's just wishful thinking and either X or Y ends up totally displacing the other in the end. But regarding Go and Rust, that's actually ended up being true! Definitely a nice outcome.
1170
Patrick Walton @pcwalton.turbofishstudios.com · 23/02/2026
Really excited about the performance benefits coming in Bevy for mega-worlds. With all my patches we're starting to be able to render millions of mesh instance entities with hundreds of thousands in view with just a handful of drawcalls.
2896
Reposted by Patrick Walton
JMS55 @jms5517.bsky.social · 19/02/2026
🧵 I've been experimenting with caching the best lights in world space to improve NEE sampling. Inspired by ReGIR, MegaLights, and www.yiningkarlli.com/projects/cac....
1468
Reposted by Patrick Walton
philpax @philpax.me · 11/02/2026
hacked and adapted Bevy's existing atmosphere support in last night, re-enabled lighting, and made a few more tweaks. enjoy some sunsets #bevy
3667
Patrick Walton @pcwalton.turbofishstudios.com · 09/02/2026
In my GPU clustering branch, which is making its way through review, Bevy 0.19 can render ~8,000 visible lights (of 100k total) at about 200 FPS on my laptop 4070. This also adds the infrastructure for particle systems to emit lights entirely from GPU without any CPU involvement at all.
A screenshot of Bevy's `many_lights` stress test, showing about 8,000 small colored lightsA screenshot of the Tracy profiler showing a frame of Bevy rendering at 4.22 ms
1776
Patrick Walton @pcwalton.turbofishstudios.com · 07/02/2026
I'm taking no position on the technical merits of Godot here, but I will say that this is the exact kind of thing people used to say about GCC right up until it and LLVM killed all the other compilers because they couldn't keep up.
These findings, combined with the general messaging of “we’re an engine made for our users and contributors, not an engine made for our own goals” (paraphrased heavily), gives me the impression that there is no plan. Godot will have the features people decide to build for themselves, or the features that lots of people ask for, on some sort of timeline. And even if you make a feature, there’s no guarantee it will get merged, even if it is highly upvoted. This doesn’t have to be a bad thing, but it does mean you can’t expect from Godot the sort of steady, planned, expected updates you can expect from a professional software company. This is a risk, and one that should not be dismissed out of hand if you’re a games company that needs to ship your game to pay the bills. Consider carefully whether or not you’re comfortable needing to review changes before taking new versions, or taking what is in the engine right now with no guarantee vague future promises will materialise, because that is the worst case scenario of this sort of development. (To be perfectly clear I am not saying this will come to pass with Godot, just that with their current structure it is very possible, and would leave you with no recourse).
1291
Patrick Walton @pcwalton.turbofishstudios.com · 04/02/2026
Landed light probe falloff and blending in Bevy 0.19: github.com/bevyengine/b... Along with parallax correction, I think that's the last of the features that are needed to make light probes really usable. Still would be nice to have in-engine baking, of course.
github.com
Implement gradual falloff and blending for light probes. by pcwalton · Pull Request #22610 · bevyengine/bevy
Currently, if a fragment overlaps multiple reflection probes and/or irradiance volumes, Bevy arbitrarily chooses one to provide diffuse and/or specular light. This is unsightly. The standard approa...
0295
Patrick Walton @pcwalton.turbofishstudios.com · 03/02/2026
TIL about Autoconf quadrigraphs and I'm screaming
8.1.6 Quadrigraphs

When writing an Autoconf macro you may occasionally need to generate special characters that are difficult to express with the standard Autoconf quoting rules. For example, you may need to output the regular expression ‘[^[]’, which matches any character other than ‘[’. This expression contains unbalanced brackets so it cannot be put easily into an M4 macro.

Additionally, there are a few m4sugar macros (such as m4_split and m4_expand) which internally use special markers in addition to the regular quoting characters. If the arguments to these macros contain the literal strings ‘-=<{(’ or ‘)}>=-’, the macros might behave incorrectly.

You can work around these problems by using one of the following quadrigraphs:

‘@<:@’
    ‘[’
‘@:>@’
    ‘]’
‘@S|@’
    ‘$’
‘@%:@’
    ‘#’
‘@{:@’
    ‘(’
‘@:}@’
    ‘)’
‘@&t@’
    Expands to nothing. 

Quadrigraphs are replaced at a late stage of the translation process, after m4 is run, so they do not get in the way of M4 quoting. For example, the string ‘^@<:@’, independently of its quotation, appears as ‘^[’ in the output.
57013
Patrick Walton @pcwalton.turbofishstudios.com · 29/01/2026
My fork of Bevy Hanabi, Hanabi-Batched, has been updated to support 0.18 and has many more improvements, such as lookup textures, PBR particles, and GPU mergesort for ribbons: github.com/pcwalton/bev... If you're looking for a way to use Hanabi on 0.18, feel free to grab it!
github.com
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
0404
Patrick Walton @pcwalton.turbofishstudios.com · 13/01/2026
Bevy 0.18 is out! My main contribution to this one was portals and mirrors: github.com/bevyengine/b...
github.com
Implement the infrastructure needed to support portals and mirrors. by pcwalton · Pull Request #13797 · bevyengine/bevy
Implement the infrastructure needed to support portals and mirrors. Bevy currently supports multiple cameras and rendering to off-screen render targets, so one might naïvely think that the engine h...
0705
Patrick Walton @pcwalton.turbofishstudios.com · 07/01/2026
Strangest issue I've encountered in the wild when fuzzing: `vaddps xmm0,xmm0,xmm1` and `vaddps xmm0,xmm1,xmm0` are *not* the same on x86 when it comes to which NaN payload it chooses. But LLVM will reorder the arguments anyway! Lesson learned: always canonicalize your NaNs when fuzzing.
0151
Patrick Walton @pcwalton.turbofishstudios.com · 19/12/2025
16 different versions of glam in my Bevy project. The ecosystem *might* want to improve this a bit :)
3253
Patrick Walton @pcwalton.turbofishstudios.com · 10/12/2025
I dusted off an old patch and landed the infrastructure for portals and mirrors in Bevy for 0.18: github.com/bevyengine/bevy/pull/13797 This builds the Lengyel oblique clip plane technique into the engine, which is the fastest way to do the clipping necessary for mirrors to work.
An example of mirrors in the Bevy game engine. A low-poly fox looks at a reflection of itself in a mirror.
0509
Patrick Walton @pcwalton.turbofishstudios.com · 09/12/2025
Landed normal maps, metallic/roughness maps, and emissive maps for clustered decals in Bevy 0.18: github.com/bevyengine/b... They compose with other decals and whatever maps are on the base material, if any. Additionally, in a custom shader you can use these textures for whatever you want.
A demonstration of many Bevy logo decals on a plane. Each decal has normal, metallic/roughness, and emissive maps. The plane has its own normal map.
1423
Reposted by Patrick Walton
Arseny Kapoulkine @zeux.io · 08/12/2025
After nine years of development, meshoptimizer has reached its first major version, 1.0! This release focuses on improvements in clusterization and simplification as well as stabilization. Here's a release announcement with more details on past, present and future; please RT! meshoptimizer.org/v1
meshoptimizer.org
🐇 meshoptimizer v1.0
Mesh optimization library that makes meshes smaller and faster to render
924975
Patrick Walton @pcwalton.turbofishstudios.com · 08/12/2025
"Analyzing the Performance of WebAssembly vs. Native Code" places a lot of the blame for the worse performance of wasm on register spills, esp. with JS engines' reserved registers. Sounds like APX could actually help by bumping the register count from 16 to 32? ar5iv.labs.arxiv.org/html/1901.09...
ar5iv.labs.arxiv.org
Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code
All major web browsers now support WebAssembly, a low-level bytecode intended to serve as a compilation target for code written in languages like C and C++. A key goal of WebAssembly is performance pa...
0161
Patrick Walton @pcwalton.turbofishstudios.com · 22/11/2025
Seriously considering putting a bounty on x86-64 support for copy.sh/v86: github.com/copy/v86/iss... A proper modern JITting emulator on the Web platform (including non-jailbroken iOS) would be amazing! I'm amazed how fast the jitcode can be, even with softmmu.
copy.sh
v86
Run KolibriOS, Linux or Windows 98 in your browser
1202
Patrick Walton @pcwalton.turbofishstudios.com · 14/11/2025
Noooo, even with APX the DIV and IDIV instructions are hardwired to rdx:rax :(
140
Patrick Walton @pcwalton.turbofishstudios.com · 08/11/2025
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.)
github.com
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...
170
Patrick Walton @pcwalton.turbofishstudios.com · 06/11/2025
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.
copy.sh
v86
Run KolibriOS, Linux or Windows 98 in your browser
191
Patrick Walton @pcwalton.turbofishstudios.com · 29/10/2025
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.
150
Patrick Walton @pcwalton.turbofishstudios.com · 21/10/2025
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?
200
Patrick Walton @pcwalton.turbofishstudios.com · 19/10/2025
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.
2425
Patrick Walton @pcwalton.turbofishstudios.com · 30/09/2025
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!
0311
Patrick Walton @pcwalton.turbofishstudios.com · 28/09/2025
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.
0312
Patrick Walton @pcwalton.turbofishstudios.com · 26/09/2025
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...
gist.github.com
Unity Freeform Stretching
Unity Freeform Stretching. GitHub Gist: instantly share code, notes, and snippets.
0232
Patrick Walton @pcwalton.turbofishstudios.com · 26/09/2025
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!
0260
Patrick Walton @pcwalton.turbofishstudios.com · 22/09/2025
RTX in Bevy!
0340
Patrick Walton @pcwalton.turbofishstudios.com · 22/09/2025
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/
2211
Patrick Walton @pcwalton.turbofishstudios.com · 17/09/2025
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.com
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
1294
Patrick Walton @pcwalton.turbofishstudios.com · 16/09/2025
Also true for Rust.
1190
Patrick Walton @pcwalton.turbofishstudios.com · 09/09/2025
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.
1843
Patrick Walton @pcwalton.turbofishstudios.com · 31/08/2025
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.com
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
0883
Patrick Walton @pcwalton.turbofishstudios.com · 29/08/2025
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.
0271
Patrick Walton @pcwalton.turbofishstudios.com · 21/08/2025
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
1191
Patrick Walton @pcwalton.turbofishstudios.com · 20/08/2025
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.
0131
Patrick Walton @pcwalton.turbofishstudios.com · 19/08/2025
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.
3130