Skip to content

Prevent undefined values from entering RVM sets - #841

Merged
Anand Krishnamoorthi (anakrish) merged 1 commit into
mainfrom
copilot/create-smaller-self-contained-prs
Oct 16, 2026
Merged

Anand Krishnamoorthi (anakrish) merged 1 commit into
mainfrom
copilot/create-smaller-self-contained-prs

Conversation

Copilot AI commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Begin splitting the causality/partial-evaluation work into self-contained PRs by isolating an existing RVM correctness bug. Experimental functionality, default-off explanations gating, and design benchmarks remain outside this prerequisite PR.

  • Set accumulation: Skip Undefined in SetAdd and set-comprehension yields across both VM execution modes. Preserve invalid-target errors and defined values, including null and false.
  • Regression coverage: Add interpreter-parity cases and bytecode cases for empty/shared sets, deduplication, and malformed targets.

For missing input.missing, this rule should produce an empty set—not a set containing Undefined:

package example

values contains input.missing if { true }

Co-authored-by: anakrish <35780660+anakrish@users.noreply.github.com>
Copilot AI changed the title fix(rvm): omit undefined set emissions (standalone prerequisite for #835) Prevent undefined values from entering RVM sets Oct 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused guards preserve validation and defined values, with relevant regression coverage and no blocking findings; tests were not executed.

0 open findings

What changed in this PR

Fixes RVM set accumulation so undefined values are omitted, matching interpreter behavior.

Changes:

  • Skip Undefined in SetAdd and both set-comprehension execution modes.
  • Preserve invalid-target errors and defined values.
  • Add regression coverage for interpreter parity, shared sets, and deduplication.
File Description
tests/​rvm/​vm/​suites/​set_operations.yaml Tests undefined insertion, shared sets, and invalid targets.
tests/​rvm/​rego/​cases/​undefined_set_values.yaml Adds parity cases for both execution modes.
src/​rvm/​vm/​dispatch.rs Prevents SetAdd from inserting undefined values.
src/​rvm/​vm/​comprehension.rs Filters undefined set-comprehension yields in both modes.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@anakrish
Anand Krishnamoorthi (anakrish) marked this pull request as ready for review October 16, 2026 03:09
@anakrish
Anand Krishnamoorthi (anakrish) merged commit 1833df6 into main Oct 16, 2026
61 checks passed
@anakrish
Anand Krishnamoorthi (anakrish) deleted the copilot/create-smaller-self-contained-prs branch October 16, 2026 15:49
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.

4 participants