test: Add RVM compiler testing to ACI tests (#509)

code fixes:
  - compiler: add `is_var_bound_in_current_scope` and use it in destructuring so
    only the innermost scope blocks rebinding while still catching duplicates
    within that block.
  - rvm: treat `not` over undefined operands as a successful negation to match
    interpreter semantics.

tests/aci:
   migrate YAML cases to `data.policy.rule` queries with `{x: …}`
  bindings, expand the harness to run interpreter plus RVM (with optional
  skipping), align results to the binding format, add readable timing output,
  and support a `--filter` flag for targeting cases.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2025-12-01 16:58:44 -06:00
committed by GitHub
parent a8a3a9809b
commit 12c083e29e
5 changed files with 215 additions and 61 deletions
+4 -1
View File
@@ -299,7 +299,10 @@ impl RegoVM {
let operand_value = &self.registers[operand as usize];
if operand_value == &Value::Undefined {
self.registers[dest as usize] = Value::Undefined;
// In Rego, `not expr` succeeds when `expr` has no results.
// When the operand evaluates to undefined we should treat it as
// a successful negation instead of propagating undefined.
self.registers[dest as usize] = Value::Bool(true);
return Ok(InstructionOutcome::Continue);
}