Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procedural constraints annotation processor + build logic #1611

Merged
merged 9 commits into from
Mar 28, 2025

Conversation

skovati
Copy link
Contributor

@skovati skovati commented Nov 22, 2024

Description

This PR does a few things related to procedural constraints workflow:

  • creates the ConstraintProcedure annotation and handles it together with scheduling procedures in the same processor.
  • Modifies the procedure-building gradle script to do scheduling and constraints procedures together.
  • Implements the EditablePlan, Plan, and SImulationResults interfaces for stateless-aerie plan objects.
  • Creates a basic test constraint ObeyConservationOfBanana and tests it using plan stubs and stateless simulation. This is less a test of the constraint itself, and more a test-that-testing-is-actually-possible kind of thing.

Verification

Documentation

I still need to update the procedural constraints docs.

Future work

We now have nearly everything for a full-loop external scheduler run. Once we make a plan serializer, you could make a driver that loads a plan from file, runs a series of constraints and goals (with simulation), and outputs a result plan.

@Mythicaeda
Copy link
Contributor

This PR is currently orphaned, pair programming hosted by @mattdailis prior to handoff.

This PR has compiled a constraint w/o arguments, so it's potentially close.

@JoelCourtney to add example constraints to this branch

Decision to be made: support non-records or updating docs? @JoelCourtney proposing to just update docs and allow non-records later.

Let's start with only records and double-back for non-record support.

@JoelCourtney JoelCourtney force-pushed the feature/procedural-constraints-processor branch from db9d10f to 4dc61a6 Compare February 11, 2025 23:52
@JoelCourtney
Copy link
Contributor

State of PR:

The annotation processor worked without any extra work. It was actually so good at combining the scheduling / constraints workflows that the gradle task can't tell them apart, and the original buildAllSchedulingProcedureJars task would build the constraints as well. So I've just removed the Scheduling, making it buildAllProcedureJars. I don't see why the user would need separate workflows for them anyway. The annotation processor does still generate different value mapper types for goals & constraints. Since this gives us a bit of type safety during procedure loading, I figured I'd leave it and not combine them. So:

  • two different annotations
  • one annotation processor
  • two value mappers
  • one gradle command

I haven't made the equivalent of the scheduler's Procedure.java for constraints. I'm not sure that's included in this task, but I can work on it because it seems like the logical next step.

@JoelCourtney JoelCourtney marked this pull request as ready for review February 12, 2025 22:54
@JoelCourtney JoelCourtney requested a review from a team as a code owner February 12, 2025 22:54
@JoelCourtney JoelCourtney requested a review from jmdelfa February 12, 2025 22:54
Mythicaeda added a commit that referenced this pull request Mar 14, 2025
This fix belongs in #1611 but I want tests on my branch to pass
Mythicaeda added a commit that referenced this pull request Mar 18, 2025
This fix belongs in #1611 but I want tests on my branch to pass
Mythicaeda added a commit that referenced this pull request Mar 19, 2025
This fix belongs in #1611 but I want tests on my branch to pass
Mythicaeda added a commit that referenced this pull request Mar 19, 2025
This fix belongs in #1611 but I want tests on my branch to pass
@Mythicaeda Mythicaeda added feature A new feature or feature request constraints Anything related to the constraints domain labels Mar 24, 2025
@JoelCourtney JoelCourtney force-pushed the feature/procedural-constraints-processor branch from b2ee0d9 to 20065c2 Compare March 26, 2025 23:11
Copy link
Contributor

@Mythicaeda Mythicaeda left a comment

Choose a reason for hiding this comment

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

LGTM!

@JoelCourtney JoelCourtney force-pushed the feature/procedural-constraints-processor branch from 20065c2 to 48218db Compare March 27, 2025 22:28
@JoelCourtney JoelCourtney force-pushed the feature/procedural-constraints-processor branch from 48218db to c06a715 Compare March 28, 2025 18:09
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@JoelCourtney JoelCourtney merged commit 20ce22d into develop Mar 28, 2025
10 of 11 checks passed
@JoelCourtney JoelCourtney deleted the feature/procedural-constraints-processor branch March 28, 2025 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
constraints Anything related to the constraints domain feature A new feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Annotation Processor updates for Procedural Constraints
3 participants