Science in your browser

Research software rebuilt to open in a browser tab, with nothing to install, and checked number for number against the code it came from. The first in a series.

Published
28 November 2026
Read
7 min
Contents
  1. The formula has no angle
  2. The same code, in a browser tab
  3. Checked number for number
  4. Nine so far
  5. When the check finds something
  6. What a check can’t tell you

Fire helium ions at a tungsten wall at 1 keV, the kind of thing that happens all day inside a fusion reactor. Head-on, it takes about 24 ions to knock a single tungsten atom out of the surface. Before reading on, have a guess at what happens if the ions come in at a slant, say 75° from straight on.

It takes nine. The wall wears away 2.7 times faster, and the usual shortcut formula has no angle in it at all. Finding that out properly means running a collision code, which usually means a Windows program or compiling a research library from source. In this case it means opening a browser tab, and that is what this series is about.

I’m doing this to build a portfolio. I hope to build software people will use, and to help scientists get more use out of their own software.

Each app in the series takes an open source package from published research, rebuilds it to run in a web page, and comes with a write-up that leads with what the model finds. Every one is checked against the package it came from, and the write-up says exactly how. This post walks through one of them in full, then shows how the same recipe and the same kind of check carry over to the others. It’s for anyone who uses research software or writes it, and you don’t need to know any of the fields to follow along.

The formula has no angle

The usual shortcut for how fast ions wear a surface away is a fit by Yamamura and Tawara to measured yields for many pairs of ion and target. However, every measurement behind it was made with the beam hitting the surface head-on, and real beams rarely do. A wall designer using the head-on number for a glancing beam could be out by almost a factor of three.

To see what a slanting hit does you have to follow the collisions, one ion at a time. SRIM, the standard program for this, is free but only runs on Windows. RustBCA, from Jon Drobny and Davide Curreli at the University of Illinois, is an open source alternative written in Rust. Using it means building it from source and writing an input file.

The same code, in a browser tab

ions is RustBCA compiled to WebAssembly without changing a line, so it runs inside the page on your own machine. It opens on argon hitting tungsten, drawn as a slice through the metal, and 5,000 ions take about 2 seconds.

● modlit.io/ionsopen to run
Blue zigzag paths of argon ions entering a tungsten surface and spreading downwards, criss-crossed by short orange paths of tungsten atoms they knock loose
Open ions ↗
fig. 1 — the first 30 argon ions at 1 keV into tungsten. Blue paths are the ions, orange the tungsten atoms they set moving.

From there you can change the ion, the energy and the angle and watch the yield move. Tilting argon pushes its cascade closer to the surface, where more of it can escape, and the yield climbs to 1.56 times the head-on value at 55–60° before collapsing as the ions start skimming off. Helium, being much lighter, peaks later and higher, which is the 75° in the opening.

Checked number for number

None of that is worth much if the browser version doesn’t give the same answers as the original. RustBCA’s documentation works through an example of 10,000 argon ions into tungsten at 1 keV. Upstream counts 10,291 sputtered atoms and 3,297 reflected ions. The page counts 10,291 and 3,297, with the reflected energy agreeing to 12 decimal places. Fifteen more reference runs, some at a slant and one below the energy needed to sputter anything, match count for count as well.

ions is the easiest kind of check, because it’s the same code. Most apps in the series aren’t, and I think it helps to separate three levels:

  1. Same code. The original compiled for the browser. The check is that the numbers come out identical.
  2. Same method. The algorithm rewritten, following the original’s choices. The check goes stage by stage, so any difference can be pinned to the part that was written differently.
  3. Same equations. Nothing shared but the maths in the paper. The check is against the original on benchmarks, ideally ones with exact answers.

range is the second kind. It maps where a species’ climate suits it, following elapid’s version of MaxEnt, with its own fitting step in place of the glmnet library elapid calls. The features built from the climate data agree with elapid’s to 10⁻¹². Given elapid’s fitted coefficients, range reproduces its map to 10⁻⁵. With range doing its own fitting, the finished maps correlate at 0.996 or better on seven species. A correlation on its own could hide a small bug that happens to wash out, but the first two numbers rule that out everywhere except the fitting.

● modlit.io/rangeopen to run
A map of Europe and the Mediterranean with Iberia and North Africa in green and western France, southern England and the Po valley in blue
Open range ↗
fig. 2 — where the bluetongue midge's climate could be by 2071–2100 under high emissions. Green stays suitable, blue becomes suitable.

column is the third. It simulates a chromatography column, the step that pulls antibody drugs out of everything else a cell culture makes, and shares no code at all with CADET, the open source reference simulator. On a benchmark with exact solutions its peaks are within 0.17% in height. Set up with an identical model, grid and scheme, the two programs’ outlet curves agree to single-precision rounding.

● modlit.io/columnopen to run
A glass column shaded blue at the top and red at the bottom, next to a chromatogram with green, orange and blue peaks and a rising salt line
Open column ↗
fig. 3 — three proteins separating on a column with a salt gradient: the bed on the left, the detector trace on the right.

Nine so far

Here is every app with a check against its original, and what the check found.

AppFieldOriginalCheck
ionsplasma physicsRustBCAidentical counts on 16 reference runs
rangeecologyelapidmaps correlate at 0.996 or better
columnbioprocessingCADETpeaks within 0.17% on a benchmark
pulsephysiologysystoleheart rate variability to one part in a million
dosepharmacologydrcthe published fit to every printed digit
lawsmachine learningPySINDyfitted coefficients to 10⁻⁹
poresporous materialsPoreSpyidentical checksums on generated images
gtraxporous materialspytraxtortuosity within 1% on every axis
neuronneuroscienceJaxleyconverges to within 1.4%

Several of these do the job of programs people pay for or have to install. pulse reads an ECG the way Kubios HRV does, dose fits curves the way GraphPad Prism does, and column covers ground that commercial software such as Cytiva’s GoSilico covers. None of them does everything the desktop programs do, and each write-up says what’s missing.

When the check finds something

Most of the time the check just agrees, which is the point of it. Now and then it turns something up.

One of the originals is pytrax, which I published with colleagues in 2019. It sends random walkers through an image of a porous material to measure how much the structure slows diffusion. Its browser version, gtrax, agrees with it within 1%. However, fitting the same walks a second way showed that on an image with large pores, pytrax’s own fit reads 23% low, because it includes the early steps before the walkers have left the pore they started in. Both programs gave the same pair of numbers, so it isn’t a bug in either. It’s a weakness in the fit pytrax uses, and it only came out because the rebuild had to be checked.

● modlit.io/gtraxopen to run
A slice through a porous volume with a green cloud of walkers spreading from its centre between grey particles, a 3D view of the volume top right, and below it a plot with the tortuosity along x, y and z
Open gtrax ↗
fig. 4 — a burst of walkers spreading from the centre of a slice through a porous volume, the whole volume top right, and the tortuosity along each axis below it.

The neuron check against Jaxley looked 11% out at first. Giving both programs 2, 4 and then 8 times as many points showed neuron’s answers barely moving while Jaxley’s crept up to meet them. The two just divide the cell up differently.

And sometimes the check stops a fix. Boron fired into silicon runs too deep in RustBCA, and multiplying one of its inputs by 1.5 lands it right on the usual range tables. Against 12 measurements, though, the shortfall wanders between 0.98 and 1.55, and no single factor fits them within 10%. So there’s no fudge factor, and the page warns you instead.

What a check can’t tell you

Every one of these checks compares a program with another program, not with the world. For argon on tungsten at 556 eV, RustBCA gives 0.671 atoms per ion against 0.488 from the Yamamura–Tawara fit to measurements, and ions matching RustBCA does nothing to close that gap. A good map of where the midge lives now says nothing certain about 2100. The write-ups say so, with the numbers.

So back to the helium. On the page, the yield at 75° is 2.7 times the head-on value, and you can see it for yourself in a couple of seconds. Whether real tungsten agrees is a question for measurements, and the people best placed to answer it are the ones who wrote the original code. If you’re one of them and something in my version looks off, please tell me.

ions is the first in the series, and the others follow every couple of weeks.

Spotted something that doesn't hold up? I'd like to hear about it. Get in touch