Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from erlang:master #221

Merged
merged 13 commits into from
Feb 18, 2025
Merged

[pull] master from erlang:master #221

merged 13 commits into from
Feb 18, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Feb 18, 2025

See Commits and Changes for more details.


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

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

Summary by Sourcery

This pull request includes several enhancements and bug fixes. It adds support for buildinfo to the FIPS provider in the crypto library, improves the performance of the JIT compiler, and fixes a potential crash when using erts_sched_local_random without a scheduler. It also updates the build system to use mix format for Elixir code formatting.

New Features:

  • Adds support for buildinfo to the FIPS provider in the crypto library, allowing users to retrieve information about the FIPS provider's build configuration.
  • Adds zstd to the list of algorithms in the stdlib documentation.

Bug Fixes:

  • Fixes a potential crash when using erts_sched_local_random without a scheduler.
  • Fixes an issue where the optimizer would generate incorrect code when using unary minus on small values.

Enhancements:

  • Updates the JIT argument value type to use a scoped enum for better type safety.
  • Improves the performance of put_tuple2 and new_small_map_lit instructions in the JIT compiler by using AVX instructions to move two elements at once when possible.
  • Updates the crypto NIF to load the FIPS provider if available.
  • Updates the crypto NIF to include the FIPS provider buildinfo in the crypto:info() map.
  • Updates the crypto test suite to check for the FIPS provider buildinfo.

Build:

  • Updates the build system to use mix format for Elixir code formatting.

CI:

  • Adds a format check to the CI pipeline.

Documentation:

  • Updates the documentation for the crypto module to include information about the FIPS provider.
  • Updates the documentation for the stdlib module to include zstd in the list of algorithms.

Chores:

  • Updates the dependencies in the smoke-mix.exs file.
  • Updates the erlang-logo.png path in make/ex_doc.exs to use :code.root_dir().

@pull pull bot added the ⤵️ pull label Feb 18, 2025
@pull pull bot merged commit 9493040 into garazdawi:master Feb 18, 2025
Copy link

sourcery-ai bot commented Feb 18, 2025

Reviewer's Guide by Sourcery

This pull request includes several enhancements and fixes across the OTP codebase. Key changes include refactoring the ArgVal enum to a class-based enum for improved type safety, enhancing FIPS mode support in the crypto library, improving register cache management in the JIT compiler, addressing a potential race condition in erts_sched_local_random, enhancing const correctness, and applying formatting changes.

Updated class diagram for RegisterCache

classDiagram
    class RegisterCache {
        -CacheEntry[] cache
        -Reg xregs_base
        -Reg yregs_base
        -size_t entries
        -size_t position
        --
        +Reg get(const Memory &mem)
        +void add(const Memory &mem, const Reg &reg)
        +void invalidate(const Reg &reg)
        +bool isCached(const Reg &reg) const
        +bool validAt(size_t offset) const
    }
Loading

File-Level Changes

Change Details Files
Updated dependencies in smoke-mix.exs to align with current project requirements.
  • Reformatted the list of dependencies for better readability.
  • No functional changes were made; only formatting was adjusted.
lib/compiler/scripts/smoke-mix.exs
Refactored ArgVal enum in beam_jit_args.hpp to a class-based enum for improved type safety and readability.
  • Changed ArgVal::TYPE to ArgVal::Type and made it a class-based enum.
  • Updated usages of ArgVal::TYPE to ArgVal::Type.
  • Added explicit casts to UWord when constructing ArgVal with the enum class.
erts/emulator/beam/jit/beam_jit_args.hpp
erts/emulator/beam/jit/beam_jit_main.cpp
erts/emulator/beam/jit/arm/beam_asm_module.cpp
erts/emulator/beam/jit/x86/beam_asm_module.cpp
erts/emulator/beam/jit/x86/instr_bs.cpp
erts/emulator/beam/jit/arm/instr_bs.cpp
erts/emulator/beam/jit/x86/instr_select.cpp
Enhanced FIPS mode support in the crypto library, including build information and provider availability checks.
  • Added a check for FIPS provider availability.
  • Included FIPS provider build information in the crypto:info() output when available.
  • Modified info_nif to include FIPS provider details.
  • Added check_fips_provider and have_provider_support functions to crypto_SUITE.erl to verify FIPS provider status.
  • Loaded the FIPS provider during initialization and unloaded during cleanup.
  • Adjusted the size of the keys and vals arrays in info_nif to accommodate the new FIPS-related information.
lib/crypto/c_src/info.c
lib/crypto/test/crypto_SUITE.erl
lib/crypto/src/crypto.erl
lib/crypto/c_src/crypto.c
Improved register cache management in the JIT compiler.
  • Added cbegin and cend methods to RegisterCache for const iteration.
  • Made isCached and validAt methods const.
  • Ensured that temporaries are not aliased in the register cache.
erts/emulator/beam/jit/beam_jit_register_cache.hpp
Addressed a potential race condition in erts_sched_local_random when called without a scheduler.
  • Introduced erts_sched_local_random_nosched_state to maintain random state when no scheduler data is available.
  • Modified erts_sched_local_random to use erts_sched_local_random_nosched_state if esdp is NULL.
erts/emulator/beam/erl_process.h
erts/emulator/beam/erl_process.c
Enhanced const correctness in erl_io_queue functions.
  • Made the q parameter const in erts_ioq_size, erts_ioq_peekqv, and erts_ioq_peekq functions.
erts/emulator/beam/erl_io_queue.c
erts/emulator/beam/erl_io_queue.h
Improved const correctness in NIF-related functions.
  • Made the mod parameter const in erts_nif_get_funcs and erts_nif_get_module.
  • Made the reg parameter const in erts_call_dirty_nif.
  • Made the p and E parameters const in erts_printable_return_address.
erts/emulator/beam/global.h
erts/emulator/beam/erl_nif.c
erts/emulator/beam/beam_common.c
Fixed a typo in a comment in instr_bs.cpp.
  • Corrected erts_current_bin offset calculation in update_bin_state and emit_i_bs_create_bin.
erts/emulator/beam/jit/x86/instr_bs.cpp
erts/emulator/beam/jit/arm/instr_bs.cpp
Added zstd to the list of algorithms in stdlib docs.
  • Added :zstd to the ALGORITHMS list in lib/stdlib/doc/docs.exs.
lib/stdlib/doc/docs.exs
Applied formatting changes to Elixir files.
  • Ran mix format to apply consistent formatting to Elixir code.
make/ex_doc.exs
lib/ssh/doc/docs.exs
scripts/otp_check_html_links.exs
lib/observer/doc/docs.exs
lib/stdlib/doc/docs.exs
.formatter.exs
Relaxed optimization flags in cygwin, msys, and wsl cc.sh scripts.
  • Allow -O0 and -Og optimization flags.
erts/etc/win32/cygwin_tools/vc/cc.sh
erts/etc/win32/msys_tools/vc/cc.sh
erts/etc/win32/wsl_tools/vc/cc.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants