Patrick Walton

@pcwalton.turbofishstudios.com

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

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.

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.

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?

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"

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.

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

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

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.

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.

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

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).

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 - 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

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.

"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...

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...

ar5iv.labs.arxiv.org