ANDREW/
MenuLab

ANDREW YUAN / PUBLIC PROJECTS

Engineering Lab

Engineering questions. Working code. Evidence.

These public projects explore performance, capacity, deployment, resource allocation, cache reuse, remote-change recovery, uplink failover, offline startup and incident recording. I start with a constraint, build something to examine it, and measure what happens. Follow a question to the evidence, the full article or the code.

The models and measurement methods have different scopes. Their numbers are not a ranking across projects.

Explore the interactive experiments ↓ BSP documentation pilot →

Performance & validation

tiny-infer-lab

Faster code. How do we know it still does the work?

What I built
I built a small C inference engine with a system-BLAS path, then added a same-model comparison across six backends and independent numerical checks.
Experimental evidence
Across five batch sizes, all six backends agreed on every class for 450 held-out examples, scoring 438/450 (97.33%). Probability outputs also passed checks against an independent float64 reference.
Measurement scope
Apple M5 Pro; a 64→32→10 Digits model. Timings cover warm, probability-producing Python-facing APIs.
How to read the result
Amortized time per example is not individual-request latency, and process RSS is not model-only RAM. The fastest backend changes with batch size; handwritten C has no universal win.

Memory & capacity

tiny-arena-lab

Can tensor reuse make a workload fit?

What I built
I built a C11 memory planner and graph executor that reuse storage according to tensor lifetimes, with checks on intermediate values, actual addresses and deliberately injected faults.
Experimental evidence
At batch 16, the tensor arena fell from 8,832 to 6,144 bytes—about 30.4%—and inference completed within a configured 7 KiB arena budget. Both layouts agreed on every class and scored 438/450 (97.33%).
Measurement scope
A host experiment on Apple M5 Pro, comparing separate storage with lifetime-based reuse using the same Digits weights, schedule and kernels.
How to read the result
Arena storage is not total program RAM. The 7 KiB budget is an experiment setting, not a measured MCU limit. Observed timing ranges overlap: this demonstrates capacity feasibility, not a reliable speedup.

Deployment & measurement

inference-doctor

CoreML was enabled. Did inference actually get faster?

What I built
I built an ONNX deployment diagnostic tool that checks outputs, times synchronous inference calls, measures worker RSS and reports the available execution-provider evidence and its gaps.
Experimental evidence
CPU EP had shorter warm inference times at all four tested maximum batch sizes. Both EPs agreed on every class and scored 436/450 (96.89%); logits and probabilities also passed reference checks.
Measurement scope
Apple M5 Pro; one small Digits ONNX model and 450 held-out examples. Maximum batches were 1, 16, 64 and 128, with short final batches fully executed and checked.
How to read the result
This compares deployment paths, not the theoretical power of CPUs and GPUs/NPUs. Enabling a provider does not prove Neural Engine use. Worker RSS excludes CoreML helper processes and device memory.

Resource allocation & fairness

tiny-fair-proxy

Should more connections mean more bandwidth?

What I built
I built an experimental Rust TCP relay with bounded payload buffers, backpressure and tenant-weighted byte scheduling to compare per-connection and per-tenant allocation.
Experimental evidence
Three randomized paired blocks, 24 trials. With equal weights, one connection for A and four for B, A’s median share in the common receiver window was about 20% with connection scheduling and 50% with tenant scheduling. Overall throughput, including tails, was broadly similar.
Measurement scope
Native macOS ARM64 loopback; 512 KiB per connection and a shared 512 KiB/s cap in each direction. Receiver shares cover 0.4–1.4 seconds after the common start; listeners classify tenants in a trusted local environment.
How to read the result
Window shares are not total-payload shares, instantaneous ratios or request-latency guarantees. Listener classification is not authentication. Bounded payload buffers do not bound whole-system memory; sampled proxy RSS excludes peers and kernel socket buffers.

Caching, routing and expiry

tiny-dns-router

When can a cached DNS answer be reused?

What I built
I built a local DNS forwarding service in Python with suffix routing, positive and negative caching, capacity limits and timeout failover.
Experimental evidence
In the repeated-query UDP workload, caching disabled and enabled each had three trials. The median of trial p50 latencies fell from 7.33 to 0.69 ms; median upstream queries fell from 120 to 4.
Measurement scope
Native macOS loopback with a controlled 6 ms upstream delay. Each trial began with an empty cache and scheduled 120 queries, one every 3 ms, reusing four query keys. Latency runs from actual client invocation through response validation, excluding pre-send scheduling wait.
How to read the result
Unique queries showed limited benefit. TTL limits reuse time; it does not guarantee freshness or correctness. Colima Linux results are reported separately. This does not establish Internet performance or maximum throughput; there is no DNSSEC validation, and cache limits are not a hard process-RAM limit.

Remote changes & recovery

rulemoor

After a firewall change, can the operator reconnect?

What I built
I built an experimental remote Linux firewall service with management-port preflight, fresh TLS confirmation and recovery. Opt-in Boot Guard checks the journal and both policies before enabling a designated interface.
Experimental evidence
The same source passed 132 portable tests on each of macOS and Linux, plus 12 actual-systemd/Linux VM phases including setup and cleanup. With a real EISDIR receipt-write error, tested cleanup and stop paths still attempted close and read back DOWN.
Measurement scope
Explicitly enabled isolated namespace, static veth and exclusive interface-activation ownership. Two orderly VM restarts covered pending-baseline and committed-policy recovery. The old executor retired before successor admission; readbacks and probes are finite samples.
How to read the result
Interface operations can fail; a stale OPEN receipt is not readiness. Pre-UP checks do not cover every fault. Real disk exhaustion, sudden power loss, physical NICs, WAN, general network managers and whole-host early-boot zero-gap protection remain untested. Keep independent recovery access.

Uplink failover & health evidence

uplinkstead

Failover switched. Which new requests recovered?

What I built
I built an opt-in dual-DHCP Linux IPv4 service with independent leases and path-bound TLS probes. A privileged writer validates proposed changes, with hysteresis and a persistent switching budget.
Experimental evidence
Retained same-source records: 295 portable tests on each of macOS and Linux, six installed-service upstream blackhole/recovery cycles, and 268 resource samples over about nine minutes with unchanged writer, worker and both DHCP-client identities.
Measurement scope
Isolated Linux VM, controlled DHCP/TLS servers and namespaces sharing one kernel. Fresh LAN TLS succeeded on the expected alternate path; stop/start was tested separately after sampling. The final same-client series used slower renewals to stay below the 64-transaction session cap.
How to read the result
Configured-target reachability does not establish Internet-wide or business-service health. Existing flows may break; budget exhaustion can block another switch. Long-term session rollover, physical ISPs, general DHCP interoperability, sudden power loss and boot-zero-gap remain unqualified. Short sampling does not prove leak freedom.

Artifact caching & offline startup

cacheweft

The download succeeded. Can a fresh service start with the source stopped?

What I built
I built a local HTTPS artifact cache that checkpoints downloads and verifies trusted sizes and SHA-256 hashes. A separate startup adapter checks the release, sets a pin and creates an application-owned model copy before starting the service.
Experimental evidence
Cold startup and a fresh worker started after origin shutdown and cache restart each produced seven HTTP inference responses matching references. The latter recorded no additional transfer attempts or body bytes. A wrong release digest and an old successful ID after unpin and GC both refused startup.
Measurement scope
Native macOS, a controlled loopback HTTPS origin, a 9,890-byte Digits model and the existing tiny-batch-service. The adapter is provided separately from the Cacheweft runtime wheel.
How to read the result
Seven selected rows, not a complete accuracy test. The host was not fully disconnected and all external dependencies were not excluded. Pins are shared flags requiring coordinated retirement; application copies have separate lifecycles. Power-loss recovery, boot availability and long-term stability remain untested; a matching hash does not establish model safety.

Incident observations & evidence handoff

pathquill

After the fault clears, what evidence remains?

What I built
I built a Linux service with bounded recent observations and post-trigger capture, deidentified JSON/HTML packages, explicit retirement and manual archive/new-store handoff.
Experimental evidence
An installed systemd service ran for 329.93 seconds through nine controlled local TCP fault/recovery/export/retirement cycles without restart. Across 161 samples, warmed main-process RSS was about 20.4–21.4 MiB; early-to-late window medians grew by 872 KiB.
Measurement scope
Isolated Colima Linux VM, an installed wheel and a dedicated unprivileged account. The 111 distinct Linux source tests passed. This entry cites retained records without rerunning experiments.
How to read the result
Observations do not establish root cause or complete coverage. High event rates may exceed export budgets; each store has 32 permanent history slots without automatic rollover. Latest installed-service VM reboot, power loss, early-boot continuity and long-term stability remain untested. Deidentified packages still need review.

Certificate updates & recovery

certweft

After the reload, did a fresh connection verify it?

What I built
A TLS certificate-update service for one fixed local Nginx target, requiring three fresh trusted TLS connections and same-connection HTTP 200 with the intended certificate, plus explicit root recovery and reopening.
Experimental evidence
Retained Linux reports include 136 unit tests, nine installed-service capacity cases, eight deployment regressions, and fourteen source-service storage-fault cases. A controlled observation collected 121 samples over about 1,200 seconds without restarting the writer or Nginx master.
Measurement scope
An isolated Linux VM, one fixed local IPv4 listener and one Smallstep CA. Sampled writer RSS after a 180-second warmup was approximately 21.3–21.4 MiB.
How to read the result
Closed admission does not establish certificate restoration. Recovery has its own finite history allowance; there is no automatic renewal scheduler or cleanup. External reachability, sudden power loss and boot zero-gap remain unqualified; a short observation does not establish long-term stability.

INTERACTIVE EXPERIMENTS

Interactive experiments

Does AI save time once you check the answer?

Try a three-minute Jetson BSP source check or join a 30-minute pilot.

Try the BSP exercise →

Illustrative teaching model

What changes a shot of espresso?

Change the grind, temperature or pressure, then watch the modeled flow and yield respond.

Try the espresso simulator →

Illustrative teaching model

Fewer seconds per bowl. A longer wait for yours?

Run a small noodle shop. Change batch size and batching wait to compare latency, throughput and time per bowl.

Try Beef Noodle Benchmark →

Illustrative teaching model

Fast service. Did the noodles arrive?

A noodle-shop game about speed and checking the work. Guess the inspection result, then see whether the order was actually fulfilled.

Try Hold the Applause →

Illustrative teaching model

An empty chair. Is the desk really free?

Watch the office run, compare ways to share desks, then try arranging the seats yourself.

Watch The Great Desk Shuffle →

From measurement to an engineering decision

Before choosing a tool or investing in an optimization, define the constraint, the evidence you need and the decision the result can support.