Skip to content

Comments

feat: add gds-control — state-space control DSL over GDS#7

Merged
rororowyourboat merged 3 commits intomainfrom
feat/cross-domain-comparison
Feb 21, 2026
Merged

feat: add gds-control — state-space control DSL over GDS#7
rororowyourboat merged 3 commits intomainfrom
feat/cross-domain-comparison

Conversation

@rororowyourboat
Copy link
Collaborator

Summary

  • Adds gds-control package: state-space control DSL that compiles to GDSSpec/SystemIR
  • Third independent DSL (after stockflow and games) validating GDS as a universal compositional substrate
  • Maps classical (A,B,C,D) state-space form to canonical (X,U,g,f) decomposition
  • All non-state-updating blocks use Policy — no ControlAction — preserving clean canonical structure
  • 4 semantic spaces (State, Reference, Measurement, Control), 6 verification checks (CS-001..CS-006)
  • Cross-built equivalence tests (double integrator) at Spec, Canonical, and SystemIR levels
  • Parametric canonical invariants across 3 archetypes (tiny/medium/large)
  • 117 new tests, zero regressions on gds-framework (373) and gds-stockflow (215)

Test plan

  • uv run --package gds-control pytest packages/gds-control/tests -v — 117 passed
  • uv run --package gds-framework pytest packages/gds-framework/tests -v — 373 passed (regression)
  • uv run --package gds-stockflow pytest packages/gds-stockflow/tests -v — 215 passed (regression)
  • uv run ruff check packages/gds-control/ — clean
  • uv run ruff format --check packages/gds-control/ — clean

…ntics

Third independent DSL compiling to GDSSpec/SystemIR, validating GDS as a
universal compositional substrate. Maps classical (A,B,C,D) state-space
form to canonical (X,U,g,f) decomposition using only Policy for all
non-state-updating blocks (no ControlAction).

Includes 4 semantic spaces (State, Reference, Measurement, Control),
6 verification checks (CS-001..CS-006), cross-built equivalence tests
at Spec/Canonical/SystemIR levels, and parametric canonical invariants
across 3 archetypes. 117 tests, zero regressions.
Copilot AI review requested due to automatic review settings February 21, 2026 13:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds gds-control, the third independent DSL for the GDS framework (alongside gds-stockflow and gds-games). It provides a declarative state-space control system DSL that compiles to GDSSpec and SystemIR, demonstrating GDS as a universal compositional substrate for control theory.

The package maps classical state-space control theory (A,B,C,D) matrices to the canonical GDS decomposition (X,U,g,f), where states become Mechanisms with Entity state variables, sensors and controllers become Policy blocks, and inputs become BoundaryActions. The design introduces four semantic spaces (State, Reference, Measurement, Control) with six domain-specific verification checks (CS-001 through CS-006).

Changes:

  • Adds complete gds-control package with DSL elements, compilation to GDSSpec/SystemIR, and verification system
  • Integrates package into workspace via root pyproject.toml dependencies and ruff configuration
  • Provides 117 comprehensive tests covering element construction, model validation, compilation, state-space correspondence, and verification checks

Reviewed changes

Copilot reviewed 18 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Adds gds-control to workspace dependencies and known-first-party imports
packages/gds-control/pyproject.toml Package metadata, dependencies, and build configuration
packages/gds-control/README.md Minimal package description linking to GDS ecosystem
packages/gds-control/CLAUDE.md Comprehensive architecture and convention documentation
packages/gds-control/gds_control/init.py Public API exports for DSL, compilation, and verification
packages/gds-control/gds_control/dsl/types.py ElementType enum for control system categories
packages/gds-control/gds_control/dsl/errors.py Domain-specific exceptions (CSError, CSValidationError, CSCompilationError)
packages/gds-control/gds_control/dsl/elements.py Frozen Pydantic models for State, Input, Sensor, Controller
packages/gds-control/gds_control/dsl/model.py ControlModel with construction-time validation and compilation methods
packages/gds-control/gds_control/dsl/compile.py Compiler mapping ControlModel to GDSSpec and SystemIR with composition tree building
packages/gds-control/gds_control/verification/checks.py Six domain-specific verification checks (CS-001 through CS-006)
packages/gds-control/gds_control/verification/engine.py Verification orchestration running CS checks and optional GDS checks
packages/gds-control/tests/test_elements.py Tests for element construction, defaults, and frozen behavior
packages/gds-control/tests/test_model.py Tests for model validation with valid and invalid configurations
packages/gds-control/tests/test_compile.py Tests for GDSSpec registration and SystemIR compilation
packages/gds-control/tests/test_state_space.py Comprehensive cross-built equivalence tests and canonical invariants
packages/gds-control/tests/test_integration.py End-to-end integration tests for SISO, MIMO, and open-loop systems
packages/gds-control/tests/test_verification.py Tests for all six CS verification checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 279 to 281
if not tiers:
return _parallel_tier(state_blocks)

Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreachable code detected. This return statement can never be executed because:

  1. ControlModel validation requires at least one state
  2. If state_blocks is non-empty (which it always will be), it gets added to tiers at line 277
  3. Therefore tiers can never be empty at line 279

This code should be removed.

Suggested change
if not tiers:
return _parallel_tier(state_blocks)

Copilot uses AI. Check for mistakes.
…status

Add docs/guides/research-boundaries.md documenting two open questions
at the structural/dynamical boundary: MIMO semantics (scalar ports vs
vector spaces) and timestep semantics across DSLs.

Update architecture.md with stockflow and control semantic layer
contracts, key file listings, and references to the research note.
Update dsl-roadmap.md to reflect validated 3-DSL status and convergent
architectural claims. Update root CLAUDE.md with all six packages,
commands, and the domain DSL compilation pattern.
The empty-tiers guard was unreachable because ControlModel requires
at least one state, so state_blocks is always non-empty. Also removed
the redundant conditional on state_blocks — it's guaranteed non-empty
by construction-time validation.
@rororowyourboat rororowyourboat merged commit 8811144 into main Feb 21, 2026
7 checks passed
@rororowyourboat rororowyourboat deleted the feat/cross-domain-comparison branch February 21, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant