Native Formats
March 30, 2026 · View on GitHub
Surge ships three native network file variants with one shared schema story.
Canonical Extensions
.surge.json— canonical inspectablesurge-jsondocument.surge.json.zst— zstd-compressedsurge-jsondocument.surge.bin— nativesurge-binbinary container
When To Use Which
- Use
.surge.jsonwhen you want a human-inspectable canonical file. - Use
.surge.json.zstwhen you want the same logical document with better disk efficiency. - Use
.surge.binwhen you want the fastest full-model Surge-native load and save path.
Contract
surge-jsonschema version:0.1.0surge-binschema version:0.1.0
Schema versions are tracked separately from the workspace package version.
APIs
Rust:
use surge_io::{load, save};
let net = load("examples/cases/ieee118/case118.surge.json.zst")?;
save(&net, "case118.surge.json")?;
surge_io::bin::save(&net, "case118.surge.bin")?;
Python:
import surge
net = surge.load("examples/cases/ieee118/case118.surge.json.zst")
surge.save(net, "case118.surge.json")
surge.io.bin.save(net, "case118.surge.bin")
CLI:
./target/release/surge-solve examples/cases/ieee118/case118.surge.json.zst \
--convert /tmp/case118.surge.json
./target/release/surge-solve examples/cases/ieee118/case118.surge.json.zst \
--convert /tmp/case118.surge.bin
Notes
- Top-level
loadandsaveinfer the native format from the extension. surge.io.jsonis the explicit text-format module.surge.io.binis the explicit binary-format module.surge-binis a sectioned binary container with packed core entity sections plus typed extension sections for the rest of the Surge model.python3 scripts/benchmark_native_formats.pyruns the packaged native-format cycle benchmark against the shipped example bundles.python3 scripts/benchmark_native_formats.py --validate-solutionssolves the MATPOWER baseline and validates that the native formats match across ACPF, DCPF, DCOPF, and ACOPF.- Pretty JSON is opt-in only. Default JSON output is compact.