• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / 1457
77%

Build:
DEFAULT BRANCH: master
Ran 01 Mar 2026 11:38AM UTC
Jobs 3
Files 350
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Feb 2026 11:58PM UTC coverage: 76.892% (-0.003%) from 76.895%
1457

push

buildkite

web-flow
inference: Propagate conditional type refinement to aliased slots (#61168)

Continuation from #61041 (especially this PR implements @vtjnash 's
idea:
https://github.com/JuliaLang/julia/pull/61041#discussion_r2842290067)

When slot `y` is assigned from slot `x` (`y = x`), both hold the same
value. If a `Conditional` subsequently narrows the type of `x` (e.g. via
`x isa Int`), the same refinement should apply to `y`. The same applies
to `typeassert`-based slot refinements.

This adds `bb_slot_aliases` to `InferenceState` to track slot aliasing
across basic blocks. `slot_aliases[i] == j` means slot `i` currently
holds the same value as slot `j`. The table is always kept flat (aliases
point directly to the root slot), so a single lookup suffices.

Aliasing is tracked at two granularities:

- Intra-BB tracking (`slot_aliases`): this local variable in
`typeinf_local` is updated per-statement and reset at each basic-block
boundary.
- Cross-BB tracking (`bb_slot_aliases`): populated lazily during the
main inference loop by `update_bbstate!`, which copies the exit alias
state to each successor BB on first visit and intersects (meet
operation) on subsequent visits. Only aliases present on _all_ incoming
paths are retained.

When a `Conditional` fires, `refine_aliases!` propagates the same type
narrowing to every slot that is currently aliased to the conditional's
slot. The similar refinements from `apply_refinement!` are also applied.

---

For example, this PR improves type stability in cases like the
following:
```julia
@test Base.infer_return_type((Any,)) do x
    y = x
    if x isa Int
        return sin(y)
    end
    error("x is not Int")
end == Float64
```

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

71 of 84 new or added lines in 2 files covered. (84.52%)

786 existing lines in 19 files now uncovered.

63560 of 82661 relevant lines covered (76.89%)

23477491.84 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
13
83.36
1.31% Compiler/src/abstractinterpretation.jl

Uncovered Existing Lines

Lines Coverage ∆ File
1
48.09
-0.32% base/docs/Docs.jl
1
44.66
-0.32% base/methodshow.jl
1
83.1
-0.13% base/stream.jl
4
84.21
-0.4% base/bool.jl
5
76.61
-0.21% base/loading.jl
5
72.98
-0.14% base/reflection.jl
5
96.89
0.0% stdlib/InteractiveUtils/src/codeview.jl
6
60.87
0.0% base/coreio.jl
10
70.29
0.0% base/Base_compiler.jl
10
74.18
0.41% Compiler/src/utilities.jl
11
77.78
-4.37% base/experimental.jl
15
85.6
4.06% base/essentials.jl
24
77.73
-2.18% Compiler/src/typeinfer.jl
38
60.49
-18.54% base/strings/annotated_io.jl
39
68.34
-4.9% base/errorshow.jl
65
67.16
0.0% Compiler/src/tfuncs.jl
85
75.91
-2.13% base/boot.jl
224
83.36
1.31% Compiler/src/abstractinterpretation.jl
237
70.72
-0.48% base/show.jl
Jobs
ID Job ID Ran Files Coverage
1457 macos-coverage - 1457 01 Mar 2026 11:38AM UTC 350
75.46
1457 windows-coverage - 1457 01 Mar 2026 03:47PM UTC 319
75.2
1457 linux-coverage - 1457 01 Mar 2026 04:10PM UTC 349
75.47
Source Files on build 1457
  • Tree
  • List 350
  • Changed 64
  • Source Changed 14
  • Coverage Changed 62
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 44c83579 on github
  • Prev Build on master (#1456)
  • Next Build on master (#1458)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc