The SWAT+ engine SWATGenX runs — and how far it is from stock | SWATGenX
SWATGenX runs a pinned SWAT+ build (stock swat-model/swatplus + a NetCDF backend + print-filtering + two engine fixes). This page is the commit-pinned changelog: stock to previous to current production, with the runtime and output-size effect of each layer on a 94k-HRU basin.
Commit-pinned · stock 5ccf6f0 → 768f1d1 → production 247e95b
A recurring source of confusion is the word "production": which exact SWAT+ binary builds SWATGenX models, and how it differs from the stock distribution. This page pins it down — every engine is a commit, and every speed/size claim is measured against the stock original.
It is an overview, not a re-derivation. The detailed evidence for each contribution lives on its own deep-dive page; here we show the cumulative stock-to-production ladder and a changelog of every contribution and its state (all now in production, each with an open upstream PR).
Read this first
- Production = a pinned commit (rafiei-vahid/swatplus@247e95b), not a loose label.
- NetCDF + print-filter cut output 341x; the two engine fixes cut runtime ~2x — all deployed.
- Every contribution is also an open upstream PR against swat-model/swatplus (#213/#214/#219/#220).
Motivation
What SWATGenX runs, and how far it is from stock SWAT+
"Production" should never be a vague word. The SWAT+ engine SWATGenX builds models with is a specific fork commit, and it differs from the stock distribution in ways we can point to and measure. This page pins down exactly what we run and how far it is from the original.
It is the changelog and the integrator: a stock → previous → current-production ladder, plus a table of every contribution and its state. The detailed proof for each lives on its own deep-dive page — here we show the cumulative effect, anchored to commits.
Methods
Every engine, pinned to a commit
Three engines are compared, each pinned. Baseline is stock swat-model/swatplus@5ccf6f0. The current production build that serves SWATGenX is rafiei-vahid/swatplus@247e95b — stock plus a NetCDF backend, the channel_sd print-filter, and the two engine fixes. The middle rung, rafiei-vahid/swatplus@768f1d1, is the previous production (NetCDF + filter, no fixes); it is kept on the ladder to separate the output-size axis from the runtime axis.
All three were run on the same basin and window (Peace River HUC-8 (03100101) — 94,303 HRUs, 90 simulated days, ifx -O3 -ipo). Each is run in its own native output mode — stock writes formatted-text channel_sd for all channels; both fork builds write gauge-filtered NetCDF — so the ladder reflects how each engine would actually be used, not an artificial common setting.
| Role | Repo @ commit | What it is |
|---|---|---|
| stock | swat-model/swatplus@5ccf6f0 | stock SWAT+ (upstream/main) — formatted-text output, no filter |
| Previous production | rafiei-vahid/swatplus@768f1d1 | previous production — NetCDF backend + channel_sd print-filter (deployed until 2026-06-06) |
| production | rafiei-vahid/swatplus@247e95b | current production — NetCDF + print-filter + the two engine fixes (deployed 2026-06-06) |
- Baseline: swat-model/swatplus@5ccf6f0 (stock).
- Previous production: rafiei-vahid/swatplus@768f1d1 (NetCDF + filter).
- Current production (deployed 2026-06-06): rafiei-vahid/swatplus@247e95b.
- Each measured number on this page is sourced from the release manifest, not hand-edited.
Results and discussion
Stock → previous → current production
Peace River HUC-8 (03100101) — 94,303 HRUs · 90 simulated days.
- Output size (MB)
- Wall time (s)
Figure 1. Wall time and output size across the three pinned engines on Peace River HUC-8 (03100101) — 94,303 HRUs (90 simulated days). NetCDF + filtering crushed size; the two fixes crushed runtime; both are in the deployed build.
Table 1. Stock → previous → current production, each pinned to a commit, with wall time, output size, and ratios versus stock.
| Stage | Commit | Wall (s) | Output | vs stock (wall) | vs stock (size) | State |
|---|---|---|---|---|---|---|
| Stock | 5ccf6f0 | 462 | 695.10 MB | 1.0× (baseline) | 1.0× (baseline) | upstream original |
| NetCDF + print-filter | 768f1d1 | 414 | 2.04 MB | 1.1× | 341× smaller | previous production (superseded 2026-06-06) |
| Production | 247e95b | 227 | 2.04 MB | 2.0× | 341× smaller | deployed — current |
The two contribution families move different axes. NetCDF + print-filtering (stock → previous production) cut output ~341× (695 MB → 2.0 MB) while wall time changed only ~1.1× — because once output is small, the bottleneck is compute, not I/O. The two engine fixes (previous → current production) then attack the compute: the same run drops to 227 s, ~2.0× faster than stock with byte-identical results. The deployed engine is therefore ~2.0× faster and ~341× smaller than the stock distribution.
Contributions and their state
Table 2. Every engine contribution: the axis it moves, its headline effect, its state (all in production, each with an open upstream PR), and a link to its deep-dive evidence.
| Contribution | Axis | Headline | State | Upstream PR | Details |
|---|---|---|---|---|---|
| NetCDF output backend | output format | enables compact NetCDF output | in production; upstream PR | # | runtime benchmark |
| channel_sd print-filter | output scope | gauge-only channel_sd → 341× smaller | in production; upstream PR | # | runtime benchmark |
| hru_read O(1) name index | runtime (startup) | string name-matching 75 → 7 s | in production; upstream PR | # | performance profiling |
| varinit per-row reset | runtime (daily loop) | array zeroing 28 → 2 s | in production; upstream PR | # | performance profiling |
Conclusion
- Production is a pinned commit (rafiei-vahid/swatplus@247e95b) — stock SWAT+ plus a NetCDF backend, print-filtering, and two engine fixes — not a moving label.
- Versus stock on a 94k-HRU basin, the deployed build writes ~341× smaller output and runs ~2.0× faster, with byte-identical results.
- Output size and runtime are independent axes: NetCDF + filtering won on size, the two fixes won on speed, and both are now in the shipped engine. Each contribution is tracked here with its commit, its state (in production; PR open upstream), and a link to its evidence.
FAQ
What SWAT+ engine does SWATGenX run in production?
A pinned fork commit, rafiei-vahid/swatplus@247e95b, which is stock swat-model/swatplus@5ccf6f0 plus a NetCDF output backend, channel_sd print-filtering, and two engine fixes (PRs #219/#220). "Production" is always a specific commit, not a moving target. The previous production build, 768f1d1, was the same engine without the two fixes.
How does production compare to stock SWAT+?
On a 3-month Peace River run (94,303 HRUs), stock writes a 695 MB channel_sd text file in 462 s; the deployed build writes a 2.0 MB filtered NetCDF file in 227 s. So the engine cuts output size ~341x and wall time ~2.0x, with byte-identical results.
Are the two engine fixes in production?
Yes. As of 2026-06-06 the deployed engine is rafiei-vahid/swatplus@247e95b, which includes #219 (O(1) name lookup in hru_read) and #220 (per-row reset in varinit). Together they cut a Peace run a further ~45% (414 s → 227 s) with byte-identical output. Both are also open as independent upstream pull requests against swat-model/swatplus.
Where do the detailed numbers live?
Each contribution has its own deep-dive page that owns its evidence: the performance-profiling page for the two engine fixes, and the runtime-benchmark page for output format and print scope. This page is the changelog/overview that links to them.
Related guides
Explore related
Last updated 2026-06-06.