Skip to content

[DRAFT] zjit bump max versions+zjit filter send with block local reloads#1005

Draft
alanwu-shopify-inc wants to merge 94 commits into
masterfrom
zjit-bump-max-versions+zjit-filter-send-with-block-local-reloads
Draft

[DRAFT] zjit bump max versions+zjit filter send with block local reloads#1005
alanwu-shopify-inc wants to merge 94 commits into
masterfrom
zjit-bump-max-versions+zjit-filter-send-with-block-local-reloads

Conversation

@alanwu-shopify-inc

Copy link
Copy Markdown

just running CI

XrXr and others added 30 commits June 19, 2026 20:43
The resulting type of a `GuardType` we prove cannot pass is `Empty`. Any HIR instructions using the type information from the `GuardType` will also see `Empty` and propagate that type through the compiler. Any generated code would not be executable at run time due to the always failing guard, so there's no point in generating it.
An `Empty` value has no representable size. The caller trying to get the size is operating on an unreachable instruction that should have already been removed.
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
* ZJIT: Reuse instruction profiling for recompile exits

Deduplicate recompile-exit profiling by sharing the per-instruction
profiling logic used by zjit_* instructions.

Recompile exits now use the materialized CFP state to recover the
current instruction and collect profiles through profile.rs, instead of
passing kind-specific profiling payloads across the C ABI.

* ZJIT: Restore HIR Recompile struct

Keep HIR recompilation metadata as Option<Recompile> instead of a bool.
This preserves a typed extension point for future recompilation policy
without changing the shared recompile-exit profiling path.
Commit 0ea210d renamed ROBJECT_IVPTR to ROBJECT_FIELDS, so it would have
caused compatibility issues anyways. Since there has been no issues, it
means that nobody is using it. We can make this dangerous API private since
no C extension should be using it anyways.
* ZJIT: Add perf symbol for block padding

* ZJIT: Explain HIR-only padding perf symbols
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
… numbers

When parsing JSON floats with extremely negative exponents (like
123.456e-789 or 123e-10000000), the parser would fall back to
rb_cstr_to_dbl which internally calls strtod. When strtod returns
ERANGE due to underflow to 0.0, Ruby emits a "Float out of range"
warning, causing noise in the test output.

Fix: when mantissa_digits + exponent < -324, the effective value is
less than 10^(-324) < DBL_TRUE_MIN/2, so it must round to 0.0 in
IEEE 754 round-to-nearest. Return 0.0 directly without going through
rb_cstr_to_dbl, avoiding the spurious warning.

This fixes warnings introduced by JSONMinefieldParserTest tests
(test_i_number_double_huge_neg_exp and test_i_number_real_underflow)
added in commit ruby/json@6507a836c5.

ruby/json@724eddaeaa
template/Makefile.in is used only by the GNU make build, so on mswin the
common.mk stub was an empty rule and nmake check silently skipped the
SyntaxSuggest spec. Move the recipe to common.mk so both builds share it,
matching how test-bundled-gems-spec is already shared.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The recipe moved into common.mk kept the literal `-Ispec/syntax_suggest:spec/lib`
from template/Makefile.in. On Windows Ruby treats `:` as an invalid path
separator (the drive-letter delimiter), so spec_helper fails to load and the
mswin run errors out instead of running the SyntaxSuggest spec. Use
$(PATH_SEPARATOR) (`;` on mswin, `:` on Unix), matching RAKER just below, so the
single recipe works for both builds. Verified 170 examples, 0 failures on the
VS 2022 mswin build and the msys2 UCRT64 GNU make build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dependabot Bot and others added 30 commits June 29, 2026 05:53
…xtures/tapioca

Bumps [yard](https://yardoc.org) from 0.9.42 to 0.9.44.

---
updated-dependencies:
- dependency-name: yard
  dependency-version: 0.9.44
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

ruby/rubygems@b8e687623c
These specs were authored directly in ruby/ruby, where this rubocop
config does not lint them, so they reached for `/mswin/.match?` and a
`%r{}` literal that Performance/StringInclude and Style/RegexpLiteral
flag here. Align them with the equivalent `include?`/`//` forms.

ruby/rubygems@22ebbb0cc7
The forward-ported specs repeated RUBY_PLATFORM.include?("mswin") to gate
limitations specific to the nmake/MSVC build. Extract it into a
Spec::Platforms predicate so the make jobserver skip and the other Windows
skips share one definition.

ruby/rubygems@b384022119
The platform-conflict lock spec skipped on mswin because the raygun-apm
fixture only built linux, darwin, and mingw variants. Add an x64-mswin64
build so the local platform resolves and the example runs there too.

ruby/rubygems@ff8601ff12
…tens the path

The guard recomputed the basename slice from the trimmed suffix, so when the
basename was long enough to be truncated it grew back by exactly the bytes
removed from the suffix and the path length never changed. Slice the basename
once up front and trim that already-sliced value after the suffix, so the
temporary path is brought within MAX_PATH instead of staying put.

ruby/rubygems@1fc7ff87ba
Bumps [github.com/microsoft/vcpkg](https://github.com/microsoft/vcpkg) from master to 2026.06.24. This release includes the previously tagged commit.
- [Release notes](https://github.com/microsoft/vcpkg/releases)
- [Commits](microsoft/vcpkg@f3e1065...cd61e1e)

---
updated-dependencies:
- dependency-name: github.com/microsoft/vcpkg
  dependency-version: 2026.06.24
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the github-actions group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) | `1.16.1` | `1.17.0` |
| [actions/cache](https://github.com/actions/cache) | `5.0.5` | `6.1.0` |
| [actions/cache/restore](https://github.com/actions/cache) | `5.0.5` | `6.1.0` |
| [actions/cache/save](https://github.com/actions/cache) | `5.0.5` | `6.1.0` |
| [taiki-e/install-action](https://github.com/taiki-e/install-action) | `2.82.2` | `2.82.6` |

Bumps the github-actions group with 1 update in the /.github/actions/setup/directories directory: [actions/cache](https://github.com/actions/cache).


Updates `actions-rust-lang/setup-rust-toolchain` from 1.16.1 to 1.17.0
- [Release notes](https://github.com/actions-rust-lang/setup-rust-toolchain/releases)
- [Changelog](https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md)
- [Commits](actions-rust-lang/setup-rust-toolchain@46268bd...166cdcf)

Updates `actions/cache` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@27d5ce7...55cc834)

Updates `actions/cache/restore` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@27d5ce7...55cc834)

Updates `actions/cache/save` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@27d5ce7...55cc834)

Updates `taiki-e/install-action` from 2.82.2 to 2.82.6
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](taiki-e/install-action@9e1e580...9bcaee1)

Updates `actions/cache` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@27d5ce7...55cc834)

---
updated-dependencies:
- dependency-name: actions-rust-lang/setup-rust-toolchain
  dependency-version: 1.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: actions/cache
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/cache/restore
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/cache/save
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.82.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/cache
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
File.symlink decided whether to create a directory symlink by calling
GetFileAttributesW on the target as given, which resolves a relative
target against the current directory instead of the link's directory.
When the two differ, a relative target pointing at a directory became a
file symlink, so Dir operations on it failed. Resolve relative targets
against the link's directory before testing for a directory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
MEMCPY checks the size calculation for overflow, unlike a raw memcpy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e link dir

A target starting with a single backslash is relative to the root of the
current drive, not to the link's directory.  Treat any backslash-leading
target (root-relative or UNC) as non-relative when deciding the directory
flag; otherwise w32_symlink builds a malformed path and fails to detect
the directory attribute.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The flag also covers drive-relative and root-relative targets, which are
not absolute paths.  "independent" describes that the target is not
interpreted relative to the link's directory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The "# default:" marker records the source path relative to the build
directory, but default_gem? re-prefixed it with srcdir, resolving a
non-existent path and wrongly removing every default gemspec whenever
srcdir is deeper than one level. The sibling layout used on CI
(srcdir=../src) only canceled the double prefix by accident.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
minitest's assertion tests compare against unified diff output produced
by the `diff` command. Where it is not on PATH (e.g. a minimal Windows
environment) those tests fail spuriously, so add minitest to the
default allowed failures in that case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rake's TestBacktraceSuppression#test_system_dir_suppressed expects
RbConfig's rubylibprefix to be suppressed from backtraces. In an
uninstalled out-of-tree build it is a POSIX "/usr"-style prefix that
File.expand_path turns into a drive-prefixed path on Windows, which no
longer matches rake's suppression pattern.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rbs's stdlib Resolv tests resolve "localhost", which raises
Resolv::ResolvError on hosts where the Resolv library cannot resolve it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Windows has no executable bit or shebang dispatch, so `bundle exec
./script.rb` is rejected as "not executable". Invoke the script via ruby
there. The spec exercises force_activate under a bundle environment, not
shebang execution.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On Windows the backtick runs through cmd.exe, which keeps the POSIX
single quotes literally. coreutils stat then fails on the invalid
filename and returns empty output, so Integer(nil, 10) raises
ArgumentError instead of being skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mountvol needs elevation to (un)mount, and without it prints
"Access is denied." to stdout. Under the parallel runner the worker
stdout is the IPC channel, so the message leaked through as a bogus
"unknown command". Capture the output and omit like test_readlink_junction.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On Windows default_external is UTF-8, but an interactive console STDIN
is read in the locale (console code page) encoding and transcoded to
the default external encoding. The previous assertion held only when
stdin was redirected, so it failed on a console with a non-UTF-8 code
page. Expect the locale encoding when stdin is a tty.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pm_setup_args mallocs one kw_arg buffer with references = 0. The inline_new branch then feeds that same pointer
to three callinfo constructions:

- 3789 — new_callinfo(... method_id="new" ..., kw_arg, 0) -> the opt_new ci
- 3795 — PUSH_SEND_R(... "initialize", ..., flags | VM_CALL_FCALL, kw_arg)
- 3800 — PUSH_SEND_R(... method_id="new", ..., flags, kw_arg) (fallback)

Tracing the refcount through rb_vm_ci_lookup()

1. It increments kwarg->references and allocates a fresh new_ci before the dedup st_update
2. The dedup (vm_ci_hash_cmp) compares kwarg contents, not the pointer. So if an earlier line already interned a new ci with the
identical keyword set, st_update returns that pre-existing ci (which holds a different buffer) and discards our new_ci.
3. Our kw_arg is now orphaned: references == 1, but the only holder is the discarded new_ci, which is a normal collectable imemo
4. An allocation like PUSH_INSN2 opt_new at or new_callinfo() can trigger a GC. References back to 0, kw_arg buffer freed.
5. new_callinfo() using the freed buffer, does argc += kw_arg->keyword_len (use-after-free)

The fix: Keep the buffer alive across the allocations in inline_new.

Fixes [Bug #22104]
This was an accidental copy/paste error that caused optcarrot to have
uncached getivar fallbacks in optcarrot, completely regressing it.
We want to make sure these don't get any bigger and also ratchet down if we shrink them.
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.