Skip to content

fix early type checks for comparison/logical ops in binaryOpNode - #9163

Open
skyyash wants to merge 4 commits into
processing:mainfrom
skyyash:warn/invalid-strands-comparisons
Open

skyyash wants to merge 4 commits into
processing:mainfrom
skyyash:warn/invalid-strands-comparisons

Conversation

@skyyash

@skyyash skyyash commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Resolves #8445

Changes:

  • add early type validation for comparison and logical operators in binaryOpNode.
  • ordering operators (<, <=, >, >=) are now rejected when either operand is a vector, matching glsl rules.
  • equality and logical operators also get matching dimension/base-type checks.
  • errors are thrown via the existing fes helpers.

PR Checklist

@skyyash skyyash changed the title Warn/invalid strands comparisons fix early type checks for comparison/logical ops in binaryOpNode Sep 11, 2026
@p5-bot

p5-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

Continuous Release

CDN link

Published Packages

Commit hash: 6879d00

Previous deployments

e85a6e6


This is an automated message.

@perminder-17 perminder-17 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi, thanks for your work on this! Do you think it would be worth adding two more cases?

  1. Comparing two boolean values using <, etc. such as a < b where both a and b are booleans.
  2. Comparing a boolean with a number using equalTo() or notEqual().

Both are invalid in GLSL, so catching them early with a strands error would be helpful? what do you think

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.

[p5.strands] Some comparisons are allowed by strands but disallowed by GLSL

2 participants