Skip to content

rjpower/spillbench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spillbench — register deprivation

What happens when you take a compiler's registers away, one at a time, and watch the spills — and the clock — climb?

An interactive report. Stock gcc accepts -ffixed-<reg>, which removes a register from the allocator's pool for good. spillbench compiles nine small kernels over and over, reserving one more register each pass, and for every build reads the spill count out of the disassembly and times the workload on this machine. Two register files are exercised: the general-purpose integer registers (hashes, ciphers, integer matmul, compression, sorting) and the XMM vector registers (double-precision matmul, an FIR filter, Mandelbrot).

Every build is checked against a known answer before it is timed — starving the allocator changes the cost, never the result.

Served at https://spillbench.rjp.io behind halcyon's Caddy front door. The container publishes nothing to the host.

Layout

Path What
src/main.rs The axum server — serves static/, answers /healthz.
static/index.html The report: hand-drawn SVG charts, one interactive control.
static/results.json The measurements the page renders. Generated, committed.
bench/ The measurement harness (Rust) and the kernels (C). Host-only.

Regenerating the data

The numbers are specific to the machine that produced them, so the harness runs on the host, not in the container. It needs gcc and objdump on PATH.

cd bench
taskset -c 3 cargo run --release --bin bench -- 15   # 15 = timing repetitions
# writes ../static/results.json

Pin to an otherwise-idle core; the harness reports the minimum time over the repetitions, the run least disturbed by the scheduler. See bench/README.md for what each kernel is and how spills are counted.

Develop

cargo run                             # http://127.0.0.1:8000
curl -fsS localhost:8000/healthz      # -> ok

Deploy

The checkout under halcyon/spillbench/ is the deployment — no separate release step.

cd ~/code/halcyon && bin/sync spillbench

bin/sync builds the image (the bench/ harness is excluded), brings the stack up, and verifies Caddy is serving spillbench.rjp.io.

Config

SPILLBENCH_PORT (default 8000) and SPILLBENCH_STATIC (default static). The app is stateless. Secrets live in halcyon/secrets/spillbench.env, which halcyon symlinks here as .env — never commit it.

About

Register deprivation: an interactive study of compiler spills and speed as GCC loses registers (integer + XMM).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors