cprimozic.net Blog

Personal website of Casey Primozic / ameo
https://cprimozic.net/ (RSS)
visit blog
Fixing a Bug in Google Chrome as a First-Time Contributor
25 Aug 2024 | original ↗

I recently finished up the process of fixing a bug in the Chromium/Google Chrome web browser. It was my first time contributing to the Chromium project or any other open source project of that scale, and it was a very unique experience compared to other open source work I've done in the past. I figured that I'd write up an overview of the whole...

My Favorite Tools + Techniques for Procedural Gamedev
26 Jul 2024 | original ↗

For a couple of years now, I've been working on and off on some 3D scenes and levels that run in the browser. It started off as a scattering of self-contained demos for some custom shaders or similar that I wanted to try out, but over time the project has grown into a pretty substantial interconnected game-like thing. One of the unifying themes...

Trying Kolmogorov-Arnold Networks in Practice
2 Jul 2024 | original ↗

There's been a fair bit of buzz about Kolmogorov-Arnold networks online lately. Some research papers were posted around claiming that they offer better accuracy or faster training compared to traditional neural networks/MLPs for the same parameter count. I was compelled by these claims and decided to test them out myself. Here are my main...

A Process for Subdividing + Deforming Arbitrary 3D Meshes
20 Jun 2024 | original ↗

Overview When I started off, my goal was simply to subdivide 3D meshes. I wanted to add more geometry to simple meshes so that I could apply programmatic deformation like greebling and noise to give them increased detail and realism in procedurally and semi-procedurally-generated scenes. It turns out that basic mesh subdivision is indeed very...

Computing Normals for "Smooth by Angle" Shading Like Blender
20 Jun 2024 | original ↗

Background As part of some other work I was doing that involved programmatically manipulating 3D meshes, I encountered the need to compute normals for them from scratch. Usually this isn't necessary since applications like Blender handle doing this automatically. But in my case, I was doing these transformations dynamically and in the web...

What I've Learned Building Interactive Embedding Visualizations
16 May 2024 | original ↗

Over the past few years, I've built several different interactive embedding visualizations. I have a big interest in exploring and understanding things in a free-form manner, and these kinds of tools feel to me like an extremely effective way of facilitating that sort of experience. My work in this area started out as an experiment using data I...

Trying Out Cloudflare's `foundations` Library for Rust
15 Apr 2024 | original ↗

A couple of months ago, I happened across the announcement blog post from Cloudflare for their newly released library for Rust. It looked like something I'd definitely be interested in using, and I mentally marked it down as something to check out when a good opportunity came up. Well, that opportunity recently came around - so I went ahead and...

Wrapping Meshes With Geodesic Walks
16 Oct 2023 | original ↗

Overview I've been working on building a game engine of sorts in Three.JS, and along the way I've been creating some levels and demos for it. My 3D modelling skills have come a long way but they're still quite bad, so I've been using procedural or semi-procedural generation a lot as part of my work. For one level I was working on, I wanted to...

Growing Bonsai Networks with RNNs
23 Jul 2023 | original ↗

This writeup introduces what I'm calling Bonsai Networks - extremely sparse computational graphs produced by training and pruning RNNs. They provide an interpretable view into the solutions learned by networks for simple logic problems, breaking out of the black box neural networks typically reside in. I give an overview of the process I use to...

Building a Signal Analyzer with Modern Web Tech
16 May 2023 | original ↗

I recently spent some time building a browser-based signal analyzer (spectrogram + oscilloscope) as part of one of my projects. I ended up using some very modern browser APIs and technologies that I'd not worked with before, and I discovered a lot of really interesting patterns and techniques that I'd never seen before in a web app. This...

Reverse Engineering a Neural Network's Clever Solution to Binary Addition
15 Jan 2023 | original ↗

There's a ton of attention lately on massive neural networks with billions of parameters, and rightly so. By combining huge parameter counts with powerful architectures like transformers and diffusion, neural networks are capable of accomplishing astounding feats. However, even small networks can be surprisingly effective - especially when...

Implementing Depth Pre-Pass Optimization for Three.JS
27 Sept 2022 | original ↗

This is a follow-up post that improves upon one I wrote yesterday. The last post implemented this optimization in a manual way, but it turns out that it's possible to do it in a much simpler and more efficient manner using built-in WebGL/OpenGL features. Thanks to /u/kibakufuda and /u/cesium-sandwich in the reddit comments for sharing that info!...

Speeding Up Three.JS with Depth-Based Fragment Culling
26 Sept 2022 | original ↗

Important Note Since releasing this article, I've been informed that there is actually an even easier and more efficient way of achieving the optimization detailed in this post. It turns out that the main concept implemented here is already commonly used in game engines and other 3D applications, and it's known as a depth pre-pass. Additionally,...

Logic Through the Lens of Neural Networks
19 Jul 2022 | original ↗

Recently, I was experimenting with building small neural networks for sequence-to-sequence use cases. My goal was to create a visualization of how the inner state of a RNN changes as it processes inputs - similar to the browser-based neural network visualization I built previously. I was inspired to explore this area after reading a very...

Middle-End Development with SvelteKit + TensorFlow.JS
2 Jun 2022 | original ↗

I've been building a project over the past month or so — an interactive recommendation web app powered by a relatively basic neural network. Building it has been one of my most unique, engaging, and memorable dev experiences in recent memory. There are multiple reasons for this, and after thinking about it I figure it boils down to two...

Exploring Neural Networks Visually in the Browser
2 Apr 2022 | original ↗

While teaching myself the basics of neural networks, I was finding it hard to bridge the gap between the foundational theory and a practical "feeling" of how neural networks function at a fundamental level. I learned how pieces like gradient descent and different activation functions worked, and I played with building and training some networks...

My Evaluation of SvelteKit for Full-Stack Web App Development
4 Jan 2022 | original ↗

I recently tried out SvelteKit for the first time. This is a summary of my experience setting it up, some information I've collected while researching + learning it, and my thoughts on how it compares to other similar frameworks. If you're not familiar with it, SvelteKit is a framework for building full stack web apps. It builds on top of...

My Setup for Self-Hosting Dozens of Web Applications + Services on a Single Server
29 Dec 2021 | original ↗

Over the years, I've accumulated quite a collection of websites, web applications, APIs, and other services that I've built and continue to host publicly. I've experimented with a lot of different hosting methods for them, switched between several different providers, and have finally arrived at something that I feel comfortable with that meets...

Habits I've Developed for Fast + Efficient Programming
24 Oct 2021 | original ↗

There's been a lot of discussion recently about working fast and being productive in software development, and I thought I'd share some of my own strategies that I've developed for that purpose. There's a lot more than just writing code that goes into being an effective software developer, and there's naturally a lot of discussion that goes on...

Using Graph Embeddings for Music Visualization + Discovery with node2vec
23 Oct 2021 | original ↗

If you listen to music using a modern platform like Spotify, YouTube, SoundCloud, or similar, chances are you've had songs programmatically recommended to you in some way or another. These recommendations were likely generated by a machine learning model or other data-driven approach that takes information about you and what you listen to and...

Building Music Galaxy — An Interactive 3D Visualization of Musical Artists
17 Oct 2021 | original ↗

Music Galaxy is is the culmination of several months of work with artist relationship data from Spotify. It is an interactive 3D visualization of the relationships between over 70,000 artists, positioning them in such a way that artists with similar audiences are closer together in space. It also supports connecting to users' Spotify accounts...

Speeding Up the Webcola Graph Viz Library with Rust + WebAssembly
24 May 2021 | original ↗

For a recent project I've been working on, I wanted to include a graph showing the relationships between different artists on Spotify. Spotify provides the data directly from their API, and I had everything set up to pull it for a user's top artists and into the browser. This is the story of how I took the initial unoptimized graph visualization...

FM Synthesis in the Browser with Rust, Web Audio, and WebAssembly with SIMD
20 Mar 2021 | original ↗

As web browsers have grown and evolved over the years, they've gained many APIs and functionalities that have made them into incredibly capable application platforms in addition to their original role of web page renderers. One of the APIs that I've been particularly interested in is the Web Audio API and its capabilities as a foundation for...

Finding + Fixing a AudioWorkletProcessor Performance Pitfall
12 Nov 2020 | original ↗

TL;DR: There is a non-zero cost that scales linearly with the number of parameters s have. If you are seeing issues with long execution times for with low execution times on the inner "(author script execution)" for the method itself, check if the total number of parameters you have on your AWPs is high. In my case, I reduced it from 544 to 96...

Building SPF420 x SYNC^UP - An Online Concert Experience
19 Jul 2020 | original ↗

Back at the beginning of 2020, I become involved with the people who founded SPF420 - a group of musicians and artists who had started hosting live concerts over an ancient video chat application called TinyChat years before virtual concerts or online events were really even a thing. With the situation created by COVID-19, there was an explosion...

Debugging a Hanging Apache2 Server on the Fly
8 Jan 2020 | original ↗

Yesterday, I made a comment on Reddit that included a link to a screenshot I took using my personal screenshot hoster application. The comment was in a very active /r/worldnews thread about the Iranian missile attacks against US military bases, and it soon picked up a lot of steam. Within an hour after posting, I was getting hundreds of requests...

Building a Statically Linked `wasm-opt` for Continuous Deployment
7 Dec 2019 | original ↗

UPDATE 2021-06-26 Binaryen, the repository that contains , actually builds for alpine/statically linked as part of its CI Pipeline. Stealing their code for that, here's a very simple script that handles building statically, no extra work required: That's it! Verifying that the generated binary is actually statically linked: Here's the...

Building a Wavetable Synthesizer from Scratch with Rust, WebAssembly, and Web Audio
4 Dec 2019 | original ↗

A spectrogram visualization of the output of a wavetable of which this article details the construction Overview Wavetable Synthesis is a method for synthesizing audio by interpolating between different pre-sampled waveforms stored in a table. It's a very neat way to generate sounds that change over time, allowing the different waveforms to morph...

Using Rayon for Simple Parallelization of SQL Queries in Rust
30 Sept 2019 | original ↗

While working on the API backend for my Spotifytrack application, I encountered a situation where I needed to fetch two separate pieces of data from the database and combine them both into the response. The SQL queries that returned them could sometimes be non-trivial and take nearly a second to complete, and running them both in series was...

My Thoughts on Rust's Future: A Positive Outlook
3 Aug 2019 | original ↗

I'm feeling really positive about Rust's prospects of popularity and wide-spread adoption in the future. I've been a part of the Rust community for three years now, and it feels like the stars are starting to align in order to let Rust jump into a position of dominance in the programming language world. There are several different, wide-spread,...

Deploying a REST API with Rust, Diesel, Rocket, and MySQL on Google Cloud Run
23 Apr 2019 | original ↗

Google Cloud has a service called Cloud Run, a platform for running stateless webservers via containers in the cloud. It combines the best aspects of both serverless architecures and hosted container solutions such as Amazon's EKS, making the process of deploying stateless web applications to the cloud easier than ever before. In addition, it's...

Phost: A Static Project Hosting Utility
30 Dec 2018 | original ↗

Phost is a tool that I created for hosting small projects, static websites, and code sketches quickly and easily as subdomains of a website that I own. It can take a directory of files such as those produced by WebPack, documentation generators, or HTML reports and make them available publicly at a url like https://gol.ameo.design/ instantly....

A Rusty Advent of Code
27 Dec 2018 | original ↗

For the first time, I took part in the Advent of Code this year. If you haven't heard of it, it's a daily programming challenge that can be solved in any programming language. People compete to be in the first 100 to make it on the leaderboard, or just use it as an opportunity to learn a new programming language. I used Rust for every day's...

Building Robintrack
3 Sept 2018 | original ↗

Robintrack is a website that I created to allow users to view how the popularity of various stocks held by Robinhood users change over time. I built the site along with Alex J as a side project and launched it live in June 2018. Design + Rationale I have a long history of creating *-track websites. I don't know what it is about them, but I really...

Creating a Noise Function Compositor
4 Sept 2017 | original ↗

Over the past few months, I've been working on an application designed to create compositions of noise functions. While looking around for applications or utilities that accomplish this in the manner I envisioned, I couldn't find anything that did what I was looking for so I decided to build it myself! Before getting into the details of how I...

Writing a Hashmap-to-Struct Procedural Macro in Rust
13 Jan 2017 | original ↗

ex0dus-0x has built a more complete library based off of this post that supports conversion both ways, check it out! https://github.com/ex0dus-0x/structmap In one of my projects, I recently had the need to take a HashMap filled with settings and configuration options and use it to populate the fields of a struct. If a certain setting wasn't in...

Osu!Statistics - PP/Rank Over Time
2 Oct 2016 | original ↗

Being the owner of osu!track, I'm in the unique position of having access to a ton of historical player data going back over two years. I decided to dig into this data and pull our some interesting statistics. I've uploaded the full osu!track database here for anyone to use! Also, the scripts I used to parse the data and create the graphs in this...

Building an Algorithmic Trading Platform in Rust
29 Sept 2016 | original ↗

For almost a year now, I've been working on creating an algorithmic trading platform that I can use to create automated strategies for trading. It started out as an experiment - just a fun little idea that I could explore, but it quickly blew up into a full-scale project into which I've poured hundreds of hours. I'm currently on version 4 of the...

↑ these items are from RSS. Visit the blog itself at https://cprimozic.net/ to find other articles and to appreciate the author's digital home.