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

JuliaLang / julia / #37876
77%

Build:
DEFAULT BRANCH: master
Ran 20 Aug 2024 10:44AM UTC
Jobs 1
Files 361
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

20 Aug 2024 02:58AM UTC coverage: 87.845% (+0.02%) from 87.823%
#37876

push

local

web-flow
inference: model partially initialized structs with `PartialStruct` (#55297)

There is still room for improvement in the accuracy of `getfield` and
`isdefined` for structs with uninitialized fields. This commit aims to
enhance the accuracy of struct field defined-ness by propagating such
struct as `PartialStruct` in cases where fields that might be
uninitialized are confirmed to be defined. Specifically, the
improvements are made in the following situations:
1. when a `:new` expression receives arguments greater than the minimum
number of initialized fields.
2. when new information about the initialized fields of `x` can be
obtained in the `then` branch of `if isdefined(x, :f)`.

Combined with the existing optimizations, these improvements enable DCE
in scenarios such as:
```julia
julia> @noinline broadcast_noescape1(a) = (broadcast(identity, a); nothing);

julia> @allocated broadcast_noescape1(Ref("x"))
16 # master
0  # this PR
```

One important point to note is that, as revealed in
JuliaLang/julia#48999, fields and globals can revert to `undef` during
precompilation. This commit does not affect globals. Furthermore, even
for fields, the refinements made by 1. and 2. are propagated along with
data-flow, and field defined-ness information is only used when fields
are confirmed to be initialized. Therefore, the same issues as
JuliaLang/julia#48999 will not occur by this commit.

101 of 111 new or added lines in 5 files covered. (90.99%)

38 existing lines in 6 files now uncovered.

78174 of 88991 relevant lines covered (87.84%)

16547832.09 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
87.96
-0.11% base/compiler/typelattice.jl
2
87.01
0.17% base/compiler/typelimits.jl
3
91.92
0.04% base/compiler/abstractinterpretation.jl
4
89.81
0.19% base/compiler/tfuncs.jl

Uncovered Existing Lines

Lines Coverage ∆ File
1
96.19
1.82% stdlib/LinearAlgebra/src/diagonal.jl
1
87.96
-0.11% base/compiler/typelattice.jl
1
87.1
-0.04% base/compiler/ssair/passes.jl
3
97.84
-1.3% base/bitset.jl
10
84.4
0.0% base/file.jl
22
94.08
0.0% base/intfuncs.jl
Jobs
ID Job ID Ran Files Coverage
1 #37876.1 20 Aug 2024 10:44AM UTC 361
87.84
Source Files on build #37876
  • Tree
  • List 361
  • Changed 248
  • Source Changed 0
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 9650510b on github
  • Prev Build on master
  • Next Build on master
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