Tomek Czajecki

Tomek Czajecki

@tchayen.com

EM @expo.dev working on EAS product infrastructure I blog about my hobbies – a mix of graphics programming and gamedev – see tchayen.com

941 followers213 following110 posts

A use case for LLMs where they shine the most for me is doing research for non-urgent online shopping. Sometimes I have very specific requirements, like Japanese rice cooker that cooks rice for a single person not a village and ships to Finland. Or a 5K IPS screen, ideally >60Hz

Then every couple months I ask ChatGPT deep research to find something. And it works great so far! I often end up on exact store page where I just have to make an order and I am done.

I don't know how I survived this long recompiling WASM binary after every change but I finally wrote a mini Vite plugin for HMR. Now when I change anything and save the file, WASM module is automatically compiled and reloaded.

View full thread

I don't know how I survived this long recompiling WASM binary after every change but I finally wrote a mini Vite plugin for HMR. Now when I change anything and save the file, WASM module is automatically compiled and reloaded.

I have a 'wasm' command declared in package.json which compiles the binary and places it in web/bin. Plugin is listening for changes in zig/ and runs that command. Finally handleHotUpdate() notices that a *.wasm file changed and sends HMR to the browser.

It's crazy how Cursor packs two opposite user experiences in one app. Tab autocomplete is reading my mind, while chat agent mode feels like trying to get the dumbest coder I have ever met to fix my code without giving him ability to run it.

My watch told me my sleep goal was met but then I checked the app and turns out it included yesterday evening nap. Well, explains why I don't feel like my sleep goal was met

I was working on a WebGPU demo and decided to try how fast I can make it. Zig in WASM generates a buffer with command stream sorted to minimize GPU state changes. This is 10k individual draw calls, unoptimized, no instancing, no render bundles. Every object is controlled separately.

Asked gemini for WebGPU setup with several cylinder models and orbiting camera. Got interstellar scene (unfortunately had to first spend 15 minutes to fix it).

Writing a blog over a span of several years is a great practice in fighting perfectionism. I hate most of my old blogposts. The problems I was solving were poorly defined, approach badly explained. The scope so small that I wouldn't bother posting about it now.

View full thread

Perfectionist me would love to see my blog read uniformly like a book. But that would mean I didn't improve at all and I am very proud of the progress I made since I started this blog 6 years ago.

I learned two main things from this: 1) Don't wait until you are ready to start. You most likely have a very wrong idea what it takes and you wouldn't be able to get ready anyway. 2) Similarly, finishing something teaches you way more than any amount of unfinished attempts.

Writing a blog over a span of several years is a great practice in fighting perfectionism. I hate most of my old blogposts. The problems I was solving were poorly defined, approach badly explained. The scope so small that I wouldn't bother posting about it now.

But I am keeping them all. They are a reminder that back then they were the best thing I could produce. And without getting them through the finish line, I wouldn't improve and wouldn't be able to write ones I can write now.

Recently Arc started randomly changing window size and now all the open non-pinned tabs went blank and don't refresh. How does unmaintained software get more buggy over time lol.

Just copied some code from GitHub for a change, not from LLM. Someone tested it, ran who knows how many times and even wrote unit tests. Worked on the first try. Incredible feeling. I already miss it.

Uhhh… hours_wasted_because_my_struct_was_stack_allocated_and_should_have_been_on_heap += 3. I was sitting with debugger staring at two memory regions and pulling my hair wondering why one and changes one doesn’t. Having code run orders of magnitude faster than equivalent JS comes at a price…

I am trying Biome on some side projects and loving it so far. Happily haven't had to touch the default config yet, but forcing me to omit else when there are earlier returns is just plain wrong.

if (...) { ...; return ...; } else { ...; return ...; } and if (...) { return ...; } ...; return ...; syntactically mean the same thing but send different message.

First one says: this function in the end splits into two execution branches. Both are expected and likely to happen. Second: there's an edge case that we handle early and then there's the main flow. We focus on the latter. I hope this makes it clear that they are very much not the same!

Tried GPT-4o for the first time (when it came out I was using Claude 3.5 Sonnet and wasn’t looking back). Initially 4o started by impressing me with one or two super solid code samples but the usual problems came quickly – it was hallucinating things and getting stuck in a loop on a fix attempt.

I love when after a flu my body decides that afternoon naps were actually the sleep and the night sleep was an extended nap, which we don’t need to do anymore.

There’s this weird mix of pride and disappointment when I ask Perplexity about a problem and it quotes back my blogpost. Good for me I guess but I am sorry to everyone if that’s the best resource out there. It’s just my notes from trying to learn that – they often don’t age well.

Small weekend (I lost track of time anyway) project: mesh picking in WebGPU. There's a render pass which draws scene to a r32_unit texture where color of mesh is its ID. Then a compute shader given mouse coordinates writes which color it was to a tiny buffer which is mapped and read back CPU side.

Validations in Dawn are absolutely fantastic. Such a breeze compared to OpenGL. I appreciate them now even more as this time I had problems with buffer mapping and I had to fix it via trial and error, changing sizes of buffers, mapping and so on. Didn't miss that.

Oh I forgot to run device.tick() and that’s why WebGPU read back from buffer in Dawn was so slow (happening every 7th frame which is kind of weird on its own). In old programming fashion, I found solution in GitHub issues of a completely unrelated project – Swift bindings for WebGPU.

Note to self: writing texture to a buffer and reading from it in WebGPU is trickier than I expected. Mapping buffer in my particular case seems to be slow, only happens on every 7nth so it must be 100+ ms.

I had 20h between leaving home and entering hotel in NYC. Spent half of that time watching the X-Files (for the first time!). Woah, it’s way better than I expected

It was interesting to notice how some episode feel like the X-Files remake of… there was one episode with HAL 9000-like computer straight from Kubrick. Or another basically following plot of The Thing.

React Native tip of the day: For perfectly juicy chicken breasts, bake at 200°C/400°F and use a meat thermometer. Remove from oven when internal temperature reaches 76°C/169°F. This became my go to method for making chicken for lunch.

You are up to date.