Skip to content

[pull] master from ruby:master - #1402

Merged
pull[bot] merged 6 commits into
turkdevops:masterfrom
ruby:master
Sep 12, 2026
Merged

pull[bot] merged 6 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Sep 12, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

hsbt and others added 6 commits September 12, 2026 13:24
IO#input_pending? reports a pipe correctly there.

6600e7feed98

ruby/io-console@2598c88cec

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Extracted from `rb_str_chomp_string` and `rb_str_delete_suffix_bang`.
test_rehash mutates a key until its own `hash_hint` (the low byte of
`Array#hash`) changes, then asserts the stale key no longer hits.

Since 127e903 "hash.c: add a substition hint", `ar_do_hash_hint()`
maps RHASH_AR_CLEARED_HINT (0x00) to RHASH_AR_SUBSTITUTION_HINT (0x01),
so hash values ending in 0x00 and 0x01 share a hint. When the mutation
loop happened to exit on such a pair, the test believed the hint had
changed while the AR table's hint had not: `ar_find_entry_hint()` still
matched and `ar_equal()` compared the key against itself, so the lookup
returned 100 instead of nil.

That commit adjusted the affected specs but not test/ruby/test_hash.rb.
Mirror the substitution in `hash_hint` so the loop keeps going until the
hint really changes.

The hash seed is per process, so this depended on the run; measured over
2,000,000 independent starting hashes the old loop failed 63 times
(1/31746), matching the predicted (2/256) * (1/255). Both TestHash and
TestHash::TestSubHash fail together because they share a process and
build the same strings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Sep 12, 2026
@pull pull Bot added the ⤵️ pull label Sep 12, 2026
@pull
pull Bot merged commit 74d4ed7 into turkdevops:master Sep 12, 2026
0 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants