Skip to main content

Projects

This is an informal list of some projects I’ve worked on. Most of these were done in my spare time.

tlsf-pmr

tlsf-pmr is a C++17 implementation of the Two-Level Segregated Fit (TLSF) memory allocator by Masmano et al. (2004), but adapted for use with the std::pmr polymorphic allocator API and with a permissive license (compared to the reference C implementation, which has a GPL license).

This allows it to be used in any standard library container or algorithm that accepts custom memory allocators, such as std::vector. TLSF is a pool allocator features an allocation complexity of $O(1)$, as well as low levels of fragmentation, making it appropriate for use cases that require deterministic execution times, such as real-time applications. The original paper can be found here.

In line with the recommendations of this talk on memory allocator design by Andrei Alexandrescu, it also features the ability to configure custom upstream allocators, which are used when the pool has insufficient memory to support an allocation.

TLSF data structures
An overview of the allocation algorithm. It makes sense if you read the paper. I swear.

hustl

hustl is a performant, cross-platform STL file viewer written in Rust. It is written to support complex, high-polygon shapes and supports GPU acceleration using WebGPU and compiles to both native binaries and WebAssembly. It has very fast load times thanks to the use of vertex indexing along with extensive parallelism—it can load a 3 million polygon model (pictured below) in around 270ms on an AMD Ryzen 5 3600X CPU and a GeForce GTX 660. I suppose you could call it blazingly fast 🚀 👈 😎 👈

Model obtained from Szimuly Casba on GrabCad.

rucksacc - WIP

rucksacc is a C compiler that aims to be compliant with C11, written in Rust and using the Cranelift code generation backend. It is fairly fully-featured, supporting the preprocessor as well as code optimizations. However, it should still be considered a “toy” compiler. In particular, robust error handling is one of the trickiest parts of modern compiler frontends, and Rucksacc’s implementation is fairly simplistic.

Rephrased in technical jargon, rucksacc is a multi-pass compiler frontend that uses a control-flow graph intermediate representation, but defers optimization details like register allocation to Cranelift. The parsing step uses a hand-coded recursive descent parser, but uses Pratt parsing to evaluate expressions. The C lexing problem is solved by deferring identifier classification to the semantic analysis step.

Sounding rockets

As an undergraduate student, one of my main extracurricular activities was building and flying high-powered sounding rockets.

Caladan was a 30,000 ft solid motor rocket built and flown at Spaceport America Cup (SAC) 2019, completely built and designed from scratch by students.

A picture of Caladan
Burning the midnight oil performing rocket surgery on Caladan

Blanche was a 10,000 ft solid motor rocket flown at SAC 2018, where it placed 1st in its category and went on to win the Spaceport America Cup.

A group picture of Blanche
Smelly, sleepless students smile sunnily with Blanche in foreground

Ariel was a proposed 300,000 ft apogee liquid engine rocket that would have been, at the time, the first student-researched-and-designed liquid rocket to breach the Karman line. Due to manpower and schedule restrictions, Ariel was shelved after the preliminary design stage, thereby joining a long, illustrious list of aerospace vehicle concepts that get cancelled before ever seeing the light of day.

Characterization of metal oxide water splitting catalysts

In undergrad, I worked in a research lab where we produced and characterized cathodes for the hydrogen evolution reaction, a.k.a. water splitting for green hydrogen production. Our motivation was to determine to what extent adding iridium to nickel-molybdenum oxides would improve their electrocatalytic performance. Iridium is a very good water splitting catalyst, but is very expensive; molydenum and nickel are much cheaper but are less effective.

Tafel polarization curves
Tafel polarization curves for some of the samples we tested.

Additionally, nickel electrodes are prone to degradation in acidic media (found in, e.g., PEM fuel cells); using oxides makes them more resistant to degradation, but with the tradeoff of reduced performance.

The result of our work was published in Electrochimica Acta. A copy of the paper can be found here.