powerio-pkg
The .pio.json document: one PowerIO model JSON object with versioned metadata.
PowerIO has no single flattened "universal network" struct. It keeps two concrete static-grid IR families distinct:
powerio::BalancedNetwork— the scalar positive-sequence transmission model (historicallypowerio::Network);powerio_dist::MulticonductorNetwork— the wire-coordinate distribution model (historicallypowerio_dist::DistNetwork).
A NetworkPackage owns exactly one of those model JSON objects at a time and
carries the metadata a compiler artifact needs to be trustworthy:
- an explicit
model_kind(never inferred from which field is present); producerandoriginmetadata;sourcesandsource_maps(which canonical field came from which source record, by whatmapping_kind);- structured
diagnosticswith stable codes; - a
validationsummary; lowering_history;- optional
operating_pointsfor replayable states over the static model JSON; - optional
derivedmetadata for matrix stats, normalized solver table identities, and cache keys.
It serializes to .pio.json. Binary .pio is out of scope until the JSON
document stabilizes.
Operating points are overlays, not separate model JSON objects. Each point
names table rows and fields to update on the one static model JSON object.
Model rows carry stable uid identities (source uids where the format has
them, synthesized {table}:{row} values otherwise); an update's source_uid
resolves against them and is authoritative, with the wire row as a fallback
and consistency check. GOC3 document construction extracts the time series into
this block while the balanced model JSON holds the first interval.
See docs/src/compiler-ir.md and docs/src/pio-json-schema.md in the
repository root.
use ;
let net = in_memory;
let pkg = from_balanced;
assert_eq!;
assert!;
let json = pkg.to_json_pretty.unwrap;
let back = from_json.unwrap;
assert_eq!;
Balanced documents can record the dense normalized solver table layout without embedding every table row:
let net = parse_str.unwrap.network;
let mut pkg = from_balanced;
pkg.attach_normalized_solver_table_metadata.unwrap;
Operating points can be inspected or materialized:
let text = read_to_string.unwrap;
let parsed = parse_str.unwrap;
let pkg = from_balanced;
if let Some = pkg.operating_points
let static_pkg = pkg.materialize_operating_point.unwrap;
assert!;