Skip to content

RFC: promote the synth generators from internal test tool to a powerio-synth crate #91

@samtalki

Description

@samtalki

Current state

powerio-matrix/src/synth/ generates synthetic cases: tree (random spanning tree), lattice (2-D grid), and pegase-like (spanning tree plus ~n/3 random extra edges, matching the ~2.6 average degree of the PEGASE transmission cases). All take SynthSpec { topology, n, r_over_x, mean_x, seed }, are deterministic per seed, and emit buses and branches only (no loads, shunts, or generators).

The module exists to stress the matrix builders beyond the vendored MATPOWER fixtures: powerio gen + powerio verify exercise B'/B'' structure and solver scaling at sizes like n=100k that no committed fixture reaches. It is an internal test tool, and it stays that way until this RFC concludes. #89 (Python generate_case + an MCP tool) is parked as a draft pending the outcome; #86 tracked the original exposure idea.

Proposal

  1. Extract the module into a workspace crate, powerio-synth, depending only on powerio (it needs nothing but Network). The CLI and powerio-matrix's tests and benches consume it. This is a pure refactor, invisible to every public surface.
  2. Separately decide public exposure: whether powerio.generate_case (Python), a generate_case MCP tool, and eventually C ABI entry points should exist, and under what names.

Doing 1 before 2 keeps the option open: the Rust layout can change freely until a Python or C name ships, and after that it is a contract.

Open questions

  • Naming. "pegase-like" describes a degree statistic, not a realistic European grid, and the name overpromises. Rename to meshed? Keep with blunt documentation?
  • Scope. Topology-only fixtures are cheap to maintain. Load, generator, and cost synthesis would make outputs runnable by power flow tools, and is also the slope toward a full synthetic grid project. Where is the line?
  • API shape. Scalar kwargs mirroring SynthSpec (what feat: expose the synth generators through powerio-py and the MCP server #89 drafts) vs something that can grow per-topology parameters.
  • Distribution. If promoted, does powerio-synth publish to crates.io alongside the other three crates?

What holds regardless

Deterministic seeds (same arguments, identical case) and Network output, so anything generated feeds every converter, the JSON transport, and the matrix builders unchanged.

Comments welcome, especially from anyone generating test or training cases downstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions