← Back to Pull requests

Docs: arrays, collections, numbers and types fixes #63818

Open
KristofferC opened this pull request with 267 lines diff across 23 files
View on GitHub
KristofferC KristofferC commented on Oct 14, 2026 13:13 UTC
Author

A batch of small, independent documentation fixes, one commit per issue (bundled to save CI time). These were originally generated by AI, but I have read through and reviewed them manually. Reviewing commit by commit is easiest.

  • Document that issorted requires lt to be a strict weak order (fixes #19280)

  • Document that size(A, d) is 1 for d > ndims(A) (fixes #23985)

  • Expand Base.Pairs docstring (fixes #25675)

  • Document that @fastmath rewrites function calls syntactically (fixes #26828)

  • Document that a single rounding mode applies to both parts of a complex number (fixes #34571)

  • Document the level field of LogLevel (fixes #40460)

  • Document the default BigFloat precision (fixes #41215)

  • Document that Base.Checked functions take integer arguments (fixes #41844)

  • Add a signature and referent to the Base.ReinterpretArray docstring (fixes #45591)

  • Clarify when :compact is set when printing containers (fixes #45776)

  • Describe vect element type in terms of documented promote_type (fixes #46092)

  • Show that invoke takes a tuple type of argument types (fixes #46285)

  • Document that setdiff returns distinct elements (fixes #47006)

  • Clarify that LinearIndices uses the axes of the given ranges (fixes #48613)

  • Fix digits/sigdigits signatures in trunc, floor and ceil docstrings (fixes #48762)

  • Add compat notes to annotated string docstrings (fixes #53043)

  • Clarify that typejoin does not return the narrowest common supertype (fixes #53436)

  • Fix invalid type expression in checked_length docstring (fixes #53645)

  • Clarify valid Val parameters and instances of Type{T} (fixes #53734)

  • Document isassigned with multiple indices and which methods to specialize (fixes #54169)

  • Include Base.Generator docstring in the manual (fixes #54194)

  • Mention ties-to-even default in rounding functions table (fixes #31943)

  • Clarify that seeded RNG reproducibility requires identical calls (fixes #59454)

  • Mention Base.rest and Base.split_rest in the iteration interface docs (fixes #59611)
  • 🤖 Generated with Claude Code

    Diff: 267 lines (+218 / -49) across 23 files Reviewer: adienes Review duration: 6362m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.65) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.65 · 267 lines diff across 23 files
    0.65
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.91 · 5 substantive comment(s)
    0.91
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    91%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.334
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    9 items
    adienes adienes commented on code on Oct 15, 2026 10:03 UTC
    Code Review
    base/abstractset.jl:1
    @@ -202,8 +202,10 @@ intersect!(s::AbstractSet, itr) =
     """
         setdiff(s, itrs...)
     
    -Construct the set of elements in `s` but not in any of the iterables in `itrs`.
    -Maintain order with arrays. The result will have the same element type as `s`.
    +Construct the set of distinct elements in `s` but not in any of the iterables in `itrs`.
    +If `s` is not an `AbstractSet` (e.g. an array), the result is a `Vector` without duplicates
    +that maintains the order in which elements first appear in `s`.
    +The result will have the same element type as `s`.

    do we want to allow narrowing the eltype? e.g. if the original contained missing but the setdiff filtered missings

    vtjnash vtjnash commented on code on Oct 16, 2026 02:09 UTC
    Code Review
    base/essentials.jl:1
    @@ -517,6 +517,30 @@ pairs(::Type{NamedTuple}) = Pairs{Symbol, V, Nothing, NT} where {V, NT <: NamedT
     
     Transform an indexable container into a Dictionary-view of the same data.
     Modifying the key-space of the underlying data may invalidate this object.
    +
    +This is the type returned by [`pairs`](@ref) for arrays, tuples and named tuples,
    +and the type of keyword arguments collected with `kwargs...`. Its keys are those
    +of the wrapped container and `values(p)` returns the container itself. Entries can

    This is inaccurate about the keys. Sayeth Claude to write here instead:

    keys(p) is the key iterator given at construction, which pairs chooses from the container's key space (for an array, CartesianIndices by default or LinearIndices via pairs(IndexLinear(), A)), and values(p) returns the container itself. Entries can be read like those of other AbstractDicts. p[key] indexes the container directly, so it accepts any key in the container's key space, while haskey(p, key) only consults keys(p). p[key] = value writes through to the container if it supports setindex!, but keys cannot be added or removed.

    vtjnash vtjnash commented on code on Oct 16, 2026 02:11 UTC
    Code Review
    base/fastmath.jl:1
    @@ -144,13 +144,23 @@ This sets the [LLVM Fast-Math flags](https://llvm.org/docs/LangRef.html#fast-mat
     and corresponds to the `-ffast-math` option in clang. See [the notes on performance
     annotations](@ref man-performance-annotations) for more details.
     
    +The transformation is purely syntactic: calls to supported functions and operators
    +such as `+` or `sin` in `expr` are replaced with calls to their counterparts in
    +`Base.FastMath` (e.g. `Base.FastMath.sin_fast`), regardless of what these names
    +refer to in the current scope. For arguments without a fast-math implementation,
    +these fall back to the `Base` functions (e.g. `Base.sin`), so a different function
    +that happens to be named `sin` will not be called.

    "different function .. happens to be named"

    I'm not entirely sure what this sentence is envisioning warning me about. Maybe drop it?

    vtjnash vtjnash commented on code on Oct 16, 2026 02:14 UTC
    Code Review
    base/logging/logging.jl:1
    @@ -116,10 +116,15 @@ The log level provides a key against which potential log records may be
     filtered, before any other work is done to construct the log record data
     structure itself.
     
    +The numeric level is available as the `level::Int32` field.

    Design question: Is the field public API or is the convert function more canonical? Not likely we'll change either, but still:

    The numeric level is available with `convert(Int32, level)`.
    

    vtjnash vtjnash commented on code on Oct 16, 2026 02:18 UTC
    Code Review
    base/mpfr.jl:1
    @@ -256,11 +256,13 @@ setrounding(f::Function, ::Type{BigFloat}, r::RoundingMode) =
     
     
     """
    -    BigFloat(x::Union{Real, AbstractString} [, rounding::RoundingMode=rounding(BigFloat)]; [precision::Integer=precision(BigFloat)])
    +    BigFloat(x::Union{Real, AbstractString} [, rounding::RoundingMode=rounding(BigFloat)];
    +             [precision::Integer=precision(BigFloat)])
     
     Create an arbitrary precision floating point number from `x`, with precision
     `precision`. The `rounding` argument specifies the direction in which the result should be
     rounded if the conversion cannot be done exactly. If not provided, these are set by the current global values.
    +The default precision is 256 bits unless changed with [`setprecision`](@ref).

    "The default is 256 unless it is changed" seems like a somewhat empty logic statement. Though I don't know how you'd document that it is the default configuration.

    Maybe saying something like "initially the precision is set to 256 bits, until the default is changed with [setprecision](@ref)"?

    vtjnash vtjnash commented on code on Oct 16, 2026 02:28 UTC
    Code Review
    base/essentials.jl:1
    @@ -1170,9 +1194,13 @@ end
         Val(c)
     
     Return `Val{c}()`, which contains no run-time data. Types like this can be used to
    -pass the information between functions through the value `c`, which must be an `isbits`
    -value or a `Symbol`. The intent of this construct is to be able to dispatch on constants
    -directly (at compile time) without having to test the value of the constant at run time.
    +pass the information between functions through the value `c`, which must be a valid type
    +parameter, such as an `isbits` value, a `Symbol`, a type, or a `Module`. The intent of this

    (or a tuple of them, if we're trying to be entirely pedantic here)

    vtjnash vtjnash commented on code on Oct 16, 2026 02:30 UTC
    Code Review
    doc/src/manual/interfaces.md:1
    @@ -148,6 +148,13 @@ julia> collect(Iterators.reverse(Squares(4)))
       1
     ```
     
    +Iterable types also support [destructuring assignment](@ref destructuring-assignment), like
    +`a, b = Squares(4)`, which is implemented using `iterate`. When "slurping" the remaining elements,

    Should we say unsplatting instead of slurping? (since unsplat is the function name now for this, IIRC)

    vtjnash vtjnash commented on code on Oct 16, 2026 02:31 UTC
    Code Review
    doc/src/manual/interfaces.md:1
    @@ -148,6 +148,13 @@ julia> collect(Iterators.reverse(Squares(4)))
       1
     ```
     
    +Iterable types also support [destructuring assignment](@ref destructuring-assignment), like
    +`a, b = Squares(4)`, which is implemented using `iterate`. When "slurping" the remaining elements,
    +as in `a, b... = x` or `a, b..., c = x`, they are collected by [`Base.rest`](@ref) and
    +[`Base.split_rest`](@ref), respectively. The generic fallbacks return a lazy iterator and a
    +`Vector`, so collection types may want to add methods to these functions, for example to return a

    `Vector`, respectively, so collection types may want to add methods to these functions, for example to return a
    

    Reviewers
    Assignees
    KristofferC KristofferC
    Labels
    risk: low confidence: 91.3% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 65.0% (MEDIUM) · Higher = larger blast radius
    65.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 91.3% · Lower = rushed or shallow review
    91.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.6% · Safe to merge
    5.6%