Retire the Stately backend#949
Merged
Merged
Conversation
Removes the Stately (state-diagram export) code generator, which is no longer maintained. Deletes Src/PCompiler/CompilerCore/Backend/Stately/ and unwires it everywhere it was referenced: - CompilerOutput: drop the Stately enum value. - TargetLanguage: drop the Stately backend registration and using. - PCompilerOptions: drop the 'stately' --mode case, the allowed value, and the help-text mention. - ParsePProjectFile: drop the 'stately' project Target case and remove Stately from the expected-target error message. No tutorials, tests, or CI jobs referenced Stately. Build and unit tests pass.
Contributor
There was a problem hiding this comment.
Pull request overview
Retires the unmaintained Stately backend by removing its implementation and unwiring it from the compiler’s backend registration and CLI/project-file target parsing.
Changes:
- Removed the
Statelybackend implementation and its registration inTargetLanguage. - Removed
CompilerOutput.Statelyand eliminated CLI /.pprojparsing support forstately. - Updated user-facing help/error strings to no longer mention Stately.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Src/PCompiler/PCommandLine/Parser/ParsePProjectFile.cs | Removes stately target parsing and updates the invalid-target error message. |
| Src/PCompiler/PCommandLine/Options/PCompilerOptions.cs | Removes stately from --mode help text and allowed values; removes stately switch case. |
| Src/PCompiler/CompilerCore/CompilerOutput.cs | Removes Stately from the CompilerOutput enum. |
| Src/PCompiler/CompilerCore/Backend/TargetLanguage.cs | Removes Stately backend using and registration. |
| Src/PCompiler/CompilerCore/Backend/Stately/StatelyCodeGenerator.cs | Deletes the Stately code generator implementation. |
| Src/PCompiler/CompilerCore/Backend/Stately/CompilationContext.cs | Deletes Stately compilation context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| default: | ||
| throw new CommandlineParsingError( | ||
| $"Expected PChecker, PObserve, Stately, PVerifier, or Symbolic as target, received {projectXml.Element("Target")?.Value}"); | ||
| $"Expected PChecker, PObserve, PVerifier, or Symbolic as target, received {projectXml.Element("Target")?.Value}"); |
| var modes = Parser.AddArgument("mode", "md", "Compilation mode to use. Can be bugfinding, pex, pobserve, or stately. If this option is not passed, bugfinding mode is used as default"); | ||
| modes.AllowedValues = new List<string>() { "bugfinding", "pex", "pobserve", "stately", "verification", "coverage" }; | ||
| var modes = Parser.AddArgument("mode", "md", "Compilation mode to use. Can be bugfinding, pex, or pobserve. If this option is not passed, bugfinding mode is used as default"); | ||
| modes.AllowedValues = new List<string>() { "bugfinding", "pex", "pobserve", "verification", "coverage" }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Retires the Stately backend (state-diagram export), which is no longer maintained. This is the first step in simplifying the multi-backend codebase.
Deletes
Src/PCompiler/CompilerCore/Backend/Stately/(StatelyCodeGenerator.cs,CompilationContext.cs) and unwires every reference:CompilerOutput: drop theStatelyenum value.TargetLanguage: drop the Stately backend registration and itsusing.PCompilerOptions: drop thestately--modecase, remove it from the allowed-values list, and update the help text.ParsePProjectFile: drop thestatelyprojectTargetcase and removeStatelyfrom the expected-target error message.Scope / safety
grep -ri statelyacrossSrc,Tst,Tutorial,.githubreturns nothing after the change.Verified locally (.NET 8 SDK)
dotnet buildofPCommandLine(pulls inCompilerCore+CheckerCore): 0 errors (only the unrelated pre-existingTransformASTPass.cs:796CS0162 warning).dotnet buildofUnitTests: 0 errors.Note: this is a user-visible removal —
p compile --mode statelyand<Target>Stately</Target>in.pprojfiles will now error. That's intended.Generated by Claude Code