Tom Jankauski

Generalist Programmer

Many skills are required to bring a project to completion, from dev ops, web server development, project management, to UI design. The requirements can be different for every project. I'm always learning new skills to overcome these challenges. I strive for improvement in every aspect of my work.

Boids

source

Rust Web-Assembly Web

Boids are a common swarm simulation program. Each entity (called a boid) accelerates based only on what the nearby boids are doing. Each boid tries to keep close to it's neighbors while maintaining a safe distance. It will adjust to try to move in the same direction as it's neighbors. Even though boids only act based on their neighbors, they can still navigate as a whole group and can form some interesting patterns. In this version, I've added some basic obstacle avoidance. The boids will move to avoid the mouse pointer.

I started this project to learn more about Web Assembly (wasm). Wasm is a portable binary format for code that modern browsers can run. You can compile Rust and C++, for example, to wasm and cut out the cost of running a garbage collector. This makes it a good choice performance intensive code.

There were still a few challenges to make this run smoothly. After running and profiling the code, I discovered that a considerable amount of time was spent allocating and freeing space for the array of neighbors for a boid. Rewriting the code to reuse the same allocated space gave the algorithm a 20% speedup. For reference, this was just a bit less than the time that it takes to actually calculate the neighbors for the boids using the brute force O(n2) algorithm.

Returning the boids' positions to JavaScript was another performance bottleneck. Values returned from wasm must be copied and converted to JS values. Fortunately, JS can directly read wasm's memory, which allows JS to read all the positions without copying them.

rpstats.com

source

Haskell Web Dev Ops UX Nix

This site manages a character sheet for the Pathfinder Role Playing Game (rules). It automatically calculates important stats for the player and updates them in real time. The spellbook allows the player to quickly search through all the spells, to select which ones they want to prepare for the day.

This project has some interesting UX challenges. A character sheet contains a lot of information. All of it will be needed at some point, but usually not all at the same time. Keeping information organized helps the player quickly navigate to what they need.

Pathtracing Research

source, paper

Research C++ Graphics Performance

Pathtracing is a method for rendering computer graphics that is used in film and movies. It can calculate a physically accurate representation of light and produce realistic images. Pathtracing calculates the light that travels along a path in the scene (which may bounce off of tables or chairs for example), and integrates this over all possible paths to determine the final lighting. This project implements a few different pathtracing algorithms, such as bidirectional-pathtracing and Metropolis Light Transport (MLT).

For an undergrad research project, I extended the MLT algorithm to improve performance. MLT is an integration algorithm that integrates the lighting equation using random sampling. Samples are selected by mutating the previous sample. The mutation may be rejected with a random chance proportional to it contribution to the image. This allows MLT to spend more time sampling paths that make greater contributions to the final image. This allows MLT to reduce the noise in the final image and make a more accurate result.

My research extends the MLT algorithm to support stratification. It then shows, experimentally, that stratifying across light sources weighted by their intensity can reduce the rejection rate of samples. Reducing the rejection rate will get more samples for the same amount of work, which improves performance.

CRDT

source

Distributed Systems Haskell
This is a distributed chat program, that implements a form of conflict free replicated data types (CRDT). This algorithm allows different nodes in the system to modify the chat simultaneously. This system is resilient to network fragmentation. The different fragments of the network can still communicate as normal. When the network connection is restored, the nodes will automatically repair the chat history, bringing everyone up to date. This also works under arbitrary connected network architectures. As long as all nodes are reachable, nodes will relay messages between nodes that are not directly connected.

Dice Roller

Typescript React
This was more just convenience. I couldn't find an online dice roller and random number generator that I liked, and it ended up being faster to program one. It needs to be simple. Just go to the page, type the dice and roll. There was already a dice notation parser library, so I just threw it in with a react interface and here it is.