Skip to content

ZJIT: Align Integer#downto with the C implementation - #1115

Closed
efegokdemir wants to merge 1 commit into
Shopify:masterfrom
efegokdemir:efe/zjit-downto-parity-1114
Closed

efegokdemir wants to merge 1 commit into
Shopify:masterfrom
efegokdemir:efe/zjit-downto-parity-1114

Conversation

@efegokdemir

Copy link
Copy Markdown

Use the C implementation’s < comparison in the ZJIT Integer#downto override to preserve its behaviour for Float::NAN endpoints. Raise ArgumentError when the comparison returns nil. Regression tests cover both cases. Fixes #1114.

Tests: test/ruby/test_integer.rb under ZJIT (40 tests, 424,653 assertions) and the focused test_zjit_cli comparator test (1 test, 4 assertions) passed.

Use the same comparison as the C implementation so NaN endpoints continue iterating under ZJIT. Raise when the comparator returns nil, matching the C error path.

Fixes Shopify#1114.
@github-actions github-actions Bot added the jit label Nov 8, 2026
@tekknolagi

Copy link
Copy Markdown

Please file PRs to ruby/ruby.

@tekknolagi tekknolagi closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZJIT: Align Integer#downto with the C implementation

2 participants