Skip to content

chore: rename @ShadowVariableLooped to @ShadowVariableInconsistent #1749

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

Conversation

Christopher-Chianelli
Copy link
Contributor

  • Solving will automatically update all shadow variables, so you can now pass in solutions with incorrect/stale shadow variables and they'll be correctly updated.

  • SolutionManager.update(SolutionUpdatePolicy.UPDATE_SCORE_ONLY, ...) will now fail fast if any @ShadowVariableInconsistent member is null or if any @InverseRelationVariable is null or incorrect.

Copy link
Collaborator

@triceo triceo left a comment

Choose a reason for hiding this comment

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

I have not done a full review yet. The changes I'm requesting will alter this PR enough that I will re-review from scratch when done.

@triceo
Copy link
Collaborator

triceo commented Aug 19, 2025

Also, I wonder... the performance impact of this could be mitigated if we know that these checks will be done elsewhere. If we know that var listeners will be triggered, and that those have all of those assertions, can we not skip this work?

@Christopher-Chianelli
Copy link
Contributor Author

Christopher-Chianelli commented Aug 19, 2025

Var listeners will not be triggered, since this code is only run for SolutionManager.update(SolutionUpdatePolicy.UPDATE_SCORE_ONLY, ...), which skip variable listener calls.

The code doesn't make that at all clear. There is no comment, nor does the structure of the code suggests that. If we moved this code to a place where the SolutionManager.update() happens, there could be no discussion. But since the correct place for this is probably in the score director for performance reasons, at least there ought to be a series of comments explaining the purpose of this.

Copy link
Collaborator

@triceo triceo left a comment

Choose a reason for hiding this comment

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

Leaving my review.

I also pushed a small commit adding Javadocs to the methods that have to do with update policies. I figured it'd be more effective to do it than to spend even more time explaining it so that you can do it.

@triceo
Copy link
Collaborator

triceo commented Aug 20, 2025

Also, tests are failing.

@triceo
Copy link
Collaborator

triceo commented Aug 20, 2025

Having reviewed the Sonar suggestions, I'd say they're useful.

Christopher-Chianelli and others added 4 commits August 20, 2025 15:15
- Solving will automatically update all shadow variables, so you can now
  pass in solutions with incorrect/stale shadow variables and they'll be
  correctly updated.

- SolutionManager.update(SolutionUpdatePolicy.UPDATE_SCORE_ONLY, ...)
  will now fail fast if any @ShadowVariableInconsistent member is null
  or if any @InverseRelationVariable is null or incorrect.
@triceo
Copy link
Collaborator

triceo commented Aug 21, 2025

I have just added my final comment. Once that's resolved, I'll approve, provided that those changes don't result in anything questionable.

@triceo triceo linked an issue Aug 22, 2025 that may be closed by this pull request
Copy link

@triceo triceo merged commit c5ab8c3 into TimefoldAI:main Aug 22, 2025
34 checks passed
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.

Finalize @ShadowVariableLooped
2 participants