Skip to content

Conversation

maennchen
Copy link
Contributor

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

Changing the order of statements can have a performance impact.

eg. (var and expensive()) will check expensive() only if var is true.
If it were reversed, the expensive() check would always be run.
Allows to execute a callback on each node in the given boolean
expression to replace the current node. Has a variant with and
without an accumulator.
Takes a boolean expression and performs logical constant folding and
simplification by removing redundant negations, constants, and tautologies.
Will walk the expression and apply the callback to expand nodes.
It will constantly optimize the expression itself to avoid expansion
where logical constant folding does no longer require a value.
Allows direct access to the internally used expression
Remove conditions to check which policies might apply and track the
decision in the expression instead.
All done in expand_constant instead
All besides true / false are done in simplify_policy_expression
@maennchen maennchen changed the title Jm/policy refactoring Policy Refactoring Oct 10, 2025
@zachdaniel zachdaniel merged commit 79749c2 into ash-project:main Oct 10, 2025
45 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

@maennchen maennchen deleted the jm/policy_refactoring branch October 10, 2025 17:56
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.

2 participants