Gezinmeyi atla
I'm vibe coding a new *GPU rigid body physics engine* from scratch for @levelsio 's #vibejam ! 💥
0:00 / 0:22

I'm vibe coding a new *GPU rigid body physics engine* from scratch for @levelsio 's #vibejam ! 💥

Glavin Wiechert👨‍💻

@GlavinW1,5 B takipçi

X profili
261 beğeniİndirOrijinal gönderi

22.300 görüntüleme #vibejam

I'm vibe coding a new *GPU rigid body physics engine* from scratch for @levelsio 's #vibejam ! 💥 - Supports Rust & Web (via WASM+WebGPU) - 100% written by Paul Jankura 's Claude Code + Opus 4.6 - Performance optimized by Andrej Karpathy / udit gupta 's autoresearch: - Uses Augmented Vertex Block Descent (AVBD) paper:

30 Yorum

Yorumlar X (Twitter) üzerindeki orijinal gönderiden alınmıştır

  • @levelsio profil fotoğrafı

    @levelsio

    @Anthropic @karpathy @uditg Oh mannn so sick! I wanna use this

    6 beğeni

  • Glavin Wiechert👨‍💻 profil fotoğrafı

    @GlavinW

    @Anthropic @karpathy @uditg Thanks @levelsio ! I'll be sharing the open-source repo with libraries for Rust & Web (WASM+WebGPU) once I'm ready. Claude and I still have more optimizations to finish first 🚀 It's been so motivating watching autoresearch plugin make massive improvements automatically! 🤯

    7 beğeni

  • Antonio Bonet profil fotoğrafı

    @tonyblu331

    @levelsio @Anthropic @karpathy @uditg He's the tokens usage for autoresearch?

  • Glavin Wiechert👨‍💻 profil fotoğrafı

    @GlavinW

    I definitely burned through a lot of @AnthropicAI tokens. I actually just finished using up my weekly allowance on my Claude Code Max 20x plan 🥴. Would definitely be developing faster if I had more tokens to use. However, I don't attribute that to autoresearch itself, as much as it is Claude struggling to write reliable automated tests. The biggest issue I've had is that the test Claude writes sometimes miss scenarios where the physics engine isn't working properly so then I need to manually visually inspect it. Autoresearch is trying to 1) optimize speed and 2) verify that it hasn't broken the tests. However, if the tests are too loose then it optimizes too aggressively and improves speed *while actually breaking some of the physics!* So then I have to go and fix the physics, add more tests, and then continue. Also finding issues where there are differences in what WebGPU and Wasm target is capable versus Rust. So if I'm optimizing for web, I need to ensure that the tests are end-to-end, not just Rust, but also it's a full web browser that it actually runs in and extracts the measurements to improve. Overall, I'd say that autoresearch is awesome! But testing a physics engine with AI, especially Rust to web target, is proving troublesome 🤣.

  • Antonio Bonet profil fotoğrafı

    @tonyblu331

    @levelsio @Anthropic @karpathy @uditg @AnthropicAI Tho why kept using auto research for the development, if you already found the paper, you could have just parked it, so the MCPs don't burn through. Nevertheless it did end up solving it through. Haha yh Rust, wasm, and Wgpu are a magnificent trio but full of quirks.

  • Glavin Wiechert👨‍💻 profil fotoğrafı

    @GlavinW

    Oh good question. We implemented the paper, but AVBD solver is only one of many parts of an entire physics engine pipeline. So Claude and I researched for each part to decide what is the best bleeding edge (2025/2026) algorithms for GPU for each part (e.g. AVBD solver + LBVH on GPU for broadphase, etc): Then implemented end-to-end to get it working as a full rigid body physics engine. However, the end-to-end engine was still not performant enough. Then we have the engineering task of figuring out how to implement it in a more performant way (e.g. autoresearch discovered Rust GPU code without loops made the compiler actual produce more performant code, etc etc). That's where auto research is coming in, figuring out from an engineering/implementation perspective what is the best way to write it, such that the final code is the most performant it can be. Regardless of the theoretical performance of these algorithms. Also AVBD has example code but it is C++ compiled to WASM for CPU, not optimized and not for GPU which requires implementing in a different way: Would definitely appreciate any feedback from @EzeroGames on our implementation though! Also trying my best to vibe-code this all for Vibe Jam 2026, and not be so prescriptive/hands-on myself, so @AnthropicAI @bcherny 's Claude Code is doing the heavy lifting and proving its capabilities.

    2 beğeni

  • Antonio Bonet profil fotoğrafı

    @tonyblu331

    @levelsio @Anthropic @karpathy @uditg @AnthropicAI Interesting workflow! My guess is that working on CPU is just easier, and also some instructions prob don't port directly to WGPU that nicely and even if they do their perfomance might not be ideal, so maybe an alternative algo or way of doing needs to be explored.

  • Glavin Wiechert👨‍💻 profil fotoğrafı

    @GlavinW

    Definitely agree. The AVBD algo and the others we're using are good on GPU (parallelizable) so in theory the plan is solid. However, without great example code (AVBD3D sample is CPU-based C++) there is still "research" for Claude and I to figure out how best to implement it correctly and performantly on GPU. Making progress though! If only I had more @AnthropicAI tokens on my Max 20x plan I wouldn't have to slow down haha

    1 beğeni

  • AI : Self Aware Networks 🇺🇸 🇹🇼 🇺🇦 profil fotoğrafı

    @worksalt

    @levelsio @Anthropic @karpathy @uditg okay but what's actually new about this because I see a bunch of instanced cubes and some basic physics, this is like 3 years ago bro, threejs, I do this on a laptop with an integrated graphics card, not impressive the slightest

    2 beğeni

  • Glavin Wiechert👨‍💻 profil fotoğrafı

    @GlavinW

    Yes, AVBD simulation method (for "Crazy Fast Physics"), as I mentioned using in original post, is not new. It is from 2025 paper: What I did not find was an implementation that I could use in web apps/games. Only recently did their developers open-source which is unoptimized C++ code for educational purposes, so not taking advantage of GPU or in the form of a reusable web library. Therefore, what is new will be: 1. A library I hope to release to open-source community so everyone can use awesome AVBD in their *web* projects. Re-implementing AVBD and other modern GPU-friendly algorithms into a single solution. 2. Another example of AI assisted development. > "instanced cubes and some basic physics" Yes, new *visual rendering* performance improvements is not the point. > "I do this on a laptop with an integrated graphics card" If you have code to share which works with WebGPU please share! If I had found it myself earlier, I would not have started this project.

    6 beğeni

  • AI : Self Aware Networks 🇺🇸 🇹🇼 🇺🇦 profil fotoğrafı

    @worksalt

    @levelsio @Anthropic @karpathy @uditg This one is 7 years ago

    2 beğeni

  • Custom Wetware profil fotoğrafı

    @CustomWetware

    @GlavinW @levelsio @Anthropic @karpathy @uditg I get more fps with that number of objects doing physics on CPU

    1 beğeni

  • AI : Self Aware Networks 🇺🇸 🇹🇼 🇺🇦 profil fotoğrafı

    @worksalt

    @GlavinW @levelsio @Anthropic @karpathy @uditg yeah but this was 2019

    1 beğeni

  • Custom Wetware profil fotoğrafı

    @CustomWetware

    @GlavinW @levelsio @Anthropic @karpathy @uditg Even a 2019 CPU can do that. It's just not that many objects.

  • AI : Self Aware Networks 🇺🇸 🇹🇼 🇺🇦 profil fotoğrafı

    @worksalt

    @GlavinW @levelsio @Anthropic @karpathy @uditg Dude I KNOW, why are you telling me? A basic laptop with an integrated GPU or a Meta Quest 3 can do far more than 10k instanced cubes what he is showing here.

    1 beğeni

  • AI : Self Aware Networks 🇺🇸 🇹🇼 🇺🇦 profil fotoğrafı

    @worksalt

    @GlavinW @levelsio @Anthropic @karpathy @uditg This week built a 1M cube-voxel target stress test: 250K per room * 4 rooms.

    2 beğeni

  • Sebastian Aaltonen profil fotoğrafı

    @SebAaltonen

    @levelsio @Anthropic @karpathy @uditg Physics running on GPU?

    2 beğeni

  • VibeCreAI profil fotoğrafı

    @VibeCreAI

    @levelsio @Anthropic @karpathy @uditg Oh wow...that's so cool....

    2 beğeni

  • Glavin Wiechert👨‍💻 profil fotoğrafı

    @GlavinW

    @levelsio @Anthropic @karpathy @uditg Thank you!

  • Krisztian Somoracz profil fotoğrafı

    @KSomoracz

    @levelsio @Anthropic @karpathy @uditg Nice work, I'm curious to see the final result! I also tried to move Nape-JS calculations to the GPU, but I ended up failing :D

    1 beğeni