WIP: Add load-store elimination HTML slideshow#951
Draft
tekknolagi wants to merge 87 commits intoShopify:masterfrom
Draft
WIP: Add load-store elimination HTML slideshow#951tekknolagi wants to merge 87 commits intoShopify:masterfrom
tekknolagi wants to merge 87 commits intoShopify:masterfrom
Conversation
Bumps the github-actions group with 2 updates in the / directory: [ruby/setup-ruby](https://github.com/ruby/setup-ruby) and [taiki-e/install-action](https://github.com/taiki-e/install-action). Updates `ruby/setup-ruby` from 1.288.0 to 1.289.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](ruby/setup-ruby@09a7688...19a43a6) Updates `taiki-e/install-action` from 2.68.18 to 2.68.19 - [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@205eb1d...385db9c) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.289.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: taiki-e/install-action dependency-version: 2.68.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
* remove the temporary buffer object. * simplify the condition under which an extra byte is required for sign extension. * in the case of `R`, raise an error earlier before packing for the negative number.
Since cargo-insta [version 1.45.0], raw string literals are only used when snapshot contents require them. This creates unnecessary diff hunks when updating older snapshots that still use raw literals. Normalize all snapshots to use non-raw string literals to reduce diff noise in future changes. [version 1.45.0]: https://github.com/mitsuhiko/insta/blob/1.45.0/CHANGELOG.md#1450
Previously we initially mapped the full 512MB chunk as
PROT_READ|PROD_WRITE and then set a guard page to PROT_NONE the first
time a new thread stack is needed. Usually that's okay as we don't touch
that memory until it is needed and so it doesn't count towards RSS.
However, on Linux even with vm.overcommit_memory=0 (the default) if on a
system (like a tiny cloud VM) with <512MB of RAM+swap that would error
with.
Thread#initialize': can't create Thread: Cannot allocate memory (ThreadError)
This changes the chunk to be mapped initially with PROT_NONE, then
instead of mapping the guard pages we map in the machine and VM stacks
using mprotect. This ensures we don't commit stack memory until it is
first used, and as a side benefit any stray pointers into unused stack
should segfault.
When a stack is freed/reused there is no change from the previous
behaviour, we just use madvise and leave the same regions in place.
[Bug #21944]
This PR introduces an almost verbatim implementation of load_store_forward optimization as described in Max's [blog post](https://bernsteinbear.com/blog/toy-load-store/). After this PR is merged, we will add type based alias analysis.
* This reverts commit ruby/prism@ffe8f7a6e236. * No longer necessary as the Makefile depends on all *.c and *.h. ruby/prism@5a33460adc
It gets confused for syntax introduced in https://bugs.ruby-lang.org/issues/20925 But it actually should be a plain method call. `!`/`?` are not valid as part of an identifier, methods however allow them as the last character. Fixes [Bug #21946] ruby/prism@5d80bc5e1a
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action). Updates `github/codeql-action` from 4.32.5 to 4.32.6 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@c793b71...0d579ff) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.32.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
When checking whether CXXFLAGS is valid, we try to compile with a stdio include which causes a warning. This does the same when we check whether "-fdeclspec" can be used, that way the flag is not added if it would lead to a warning later.
Add a new optimization pass that eliminates redundant CheckInterrupts instructions within each basic block. Only the first CheckInterrupts is needed per stretch of non-call code, since the interrupt flag only needs to be checked once. The flag resets when an intervening instruction writes to InterruptFlag (e.g. a Send).
In certain cases, things like Array#sort can result in a confusing error
message. For instance where a and b are characters in a string,
`"string"`:
```ruby
array.sort { |a, b| string.index(a) <=> string.index(b) }
```
If one of the index calls returns nil, we will get "comparison of String
with String failed", which is somewhat unhelpful, since it's easy to be
confused, given that what is really being compared is a Fixnum or
NilClass (the cause of the error). Yes, as far as Array#sort is
concerned, the two characters are the things being sorted, but it's
useful to call attention to the return value of the comparison in this
case.
This patch adds a "reason" argument to rb_cmperr, which will provide an
error message of "comparison of String with String failed: comparator
returned nil" in the case above, or, in the case of:
```ruby
1.upto('10').to_a
```
it will provide the message: "comparison of Fixnum with String failed:
coercion was not possible"
Pend test_with_webauthn_enabled_failure on TruffleRuby where it fails intermittently. ruby/rubygems@6e062ccef1
Remove unused si.to_yaml calls that stored YAML at URLs that were never fetched. With the pure-Ruby parser, NilClass no longer has to_yaml, but these lines were dead code regardless. ruby/rubygems@6ab25e49ac
unsigned long is only 32b on some platforms. ruby/json@0a4fb79cd9
Use the appropriate modifier. `size_t` is not always `unsigned long`, even if the size is the same.
Replace the simple dump_hash method with dump_obj that can serialize Gem::Specification, Version, Platform, Requirement, Dependency, Hash, Array, Time, and String objects into YAML format. This enables pure-Ruby YAML serialization without depending on Psych. The serializer handles multiline strings (block scalars), special character quoting ($, !, &, *, :, @, %), and proper indentation for nested structures. ruby/rubygems@bffb238b35
Replace the simple regex-based load method with a full recursive
descent parser (parse_any) that handles nested hashes, arrays, block
scalars (| and |-), YAML anchors (&anchor) and aliases (*alias),
!ruby/object: type tags, flow notation ({} and []), and non-specific
tag stripping (! prefix).
Add helper methods: parse_block_scalar for multiline strings,
build_permitted_tags for security validation, unquote_simple for
type coercion (booleans, integers, timestamps, quoted strings),
and improve strip_comment to handle # inside quoted strings.
The parser returns raw Ruby data structures (Hash, Array, String)
with :tag metadata for typed objects, without yet reconstructing
Gem-specific objects.
ruby/rubygems@053b576c20
Add convert_to_spec and convert_any methods that transform parsed YAML data structures (with :tag metadata) back into Gem::Specification, Version, Platform, Requirement, and Dependency objects. Wire these into the load method so it returns fully reconstructed Gem objects. convert_to_spec normalizes specification_version to Integer, rdoc_options to Array of Strings, and other array fields (files, test_files, executables, requirements, extra_rdoc_files) to proper arrays. convert_any handles Gem::Version::Requirement (legacy) and validates requirement operators and dependency type symbols against permitted lists. ruby/rubygems@fe1a29ef2d
…YAML backend Add Gem.use_psych? and Gem.load_yaml branching so that YAMLSerializer is used by default, while Psych remains available via the use_psych config option in .gemrc or RUBYGEMS_USE_PSYCH environment variable. ruby/rubygems@d67561aa06 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruby/rubygems@d81ae0a870 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruby/rubygems@b4655ddeb2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruby/rubygems@21c33bb482 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…h fallback ruby/rubygems@895c8799fc Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruby/rubygems@9d54d0f830 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruby/rubygems@825d4eba3c Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tests covering the full pure-Ruby YAML implementation: - Gem object serialization round-trips (dump and load) - YAML anchors and aliases (enabled and disabled) - Permitted classes and symbols validation - Real-world gemspec parsing (fileutils, rubygems-bundler) - Edge cases: empty requirements, Hash-to-Array normalization, rdoc_options conversion, flow notation, non-specific tags, comment-only documents, special character quoting ruby/rubygems@b38681e4e8
* I always had an interest about the benchmark stdlib and did significant contributions to it, notably 979ec8d. * Ref: https://bugs.ruby-lang.org/issues/21948
* The timeout could trigger before the `raise`. ruby/timeout@e4aa36096f
Also remove BASE_SLOT_SIZE.
Index on 8 byte chunks instead of individual bytes. This works because all pool stot sizes are pointer aligned, so all sizes in an 8 byte range map to the same heap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
optimize_load_storepass{iseq_name}_load_store.htmlin the working directory for each compiled functionTest plan
miniruby --zjiton a script with ivar access and verify HTML output