← Back to Pull requests

reflection: Hide the `which` error message from inference #64587

Merged
KristofferC merged 1 files (2 lines) on Nov 02, 2026 23:56 UTC
View on GitHub
KristofferC KristofferC commented on Nov 02, 2026 17:46 UTC
Author

which(f, t) builds its error message eagerly with sprint(io -> showerror(io, ::MethodError)), so every caller carries an edge into the whole MethodError printer. Loading a package that adds a write(::IO, ::Symbol) method invalidates showerror(::IO, ::MethodError), and with it which, functionloc, _propertynames_bytype, and package code that calls which (e.g. ComputePipeline/Makie). Calling sprint through inferencebarrier, as @assert does for its message, removes the edge. The error message is unchanged.

Found while looking for more cases like #64585.

| unique MIs invalidated loading 30 packages¹ | master | PR |
|---|---|---|
| Linux x86_64 (on top of #64585) | 8,181 | 7,329 |
| macOS aarch64 | 6,844 | 6,038 |

<details><summary>¹ package set</summary>

SparseArrays, LinearAlgebra, Statistics, Dates, Random, Printf, Markdown, InteractiveUtils, Test, Serialization, REPL, Pkg, DataFrames, CairoMakie, Distributions, ForwardDiff, StaticArrays, JSON, Revise, Nemo, Interpolations, PrettyTables, Unitful, IntervalArithmetic, ComponentArrays, Ferrite, JuliaInterpreter, DataStructures, OffsetArrays, ProgressMeter. Repeat runs agree within 5 MIs.
</details>

🤖 Generated with Claude Code

Diff: 2 lines (+1 / -1) across 1 files Reviewer: topolarity Review duration: 369m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.10) × (1 − Review Confidence (0.69)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.10 · 2 lines diff across 1 files
0.10
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.57 · 2 substantive comment(s)
0.57
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
69%
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.066
Real PR Conversation Timeline
5 items
topolarity topolarity approved these changes on Nov 02, 2026 19:33 UTC
Approved Reviewer

Approved these changes.

topolarity topolarity commented on Nov 02, 2026 19:35 UTC
Contributor

Loading a package that adds a write(::IO, ::Symbol) method invalidates showerror(::IO, ::MethodError)

This sounds like the more fundamental fix / issue, but nothing wrong with an extra barrier on a cold path

aviatesk aviatesk approved these changes on Nov 02, 2026 23:56 UTC
Approved Reviewer

Approved these changes.

KristofferC KristofferC commented on Nov 03, 2026 08:30 UTC
Author

https://github.com/JuliaLang/julia/pull/64604 should attack more of the root cause to this.

Reviewers
Assignees
KristofferC KristofferC
Labels
risk: low confidence: 69.2% 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: 9.6% (LOW) · Higher = larger blast radius
9.6%
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: 69.2% · Lower = rushed or shallow review
69.2%
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: 2.9% · Safe to merge
2.9%