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

missed coverage for a method whose body is an isbits literal #54214

Open
nsajko opened this issue Apr 23, 2024 · 3 comments
Open

missed coverage for a method whose body is an isbits literal #54214

nsajko opened this issue Apr 23, 2024 · 3 comments
Labels
domain:code coverage kind:bug Indicates an unexpected problem or unintended behavior

Comments

@nsajko
Copy link
Contributor

nsajko commented Apr 23, 2024

In an otherwise empty directory, I have j.jl:

f( ::Tuple{}) = 1
f(t::Tuple{Int}) = only(t)

f(())
f((3,))

When I run julia --code-coverage=@ j.jl, I get:

        - f( ::Tuple{}) = 1
        1 f(t::Tuple{Int}) = only(t)
        - 
        - f(())
        - f((3,))

So the empty tuple method doesn't seem to get any code coverage recorded.

julia> versioninfo()
Julia Version 1.12.0-DEV.387
Commit b5bfd83a3d0 (2024-04-22 13:12 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × AMD Ryzen 3 5300U with Radeon Graphics
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver2)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_NUM_PRECOMPILE_TASKS = 3
  JULIA_PKG_PRECOMPILE_AUTO = 0

Hitting this here: JuliaArrays/FixedSizeArrays.jl#26

@nsajko nsajko added test This change adds or pertains to unit tests domain:code coverage and removed test This change adds or pertains to unit tests labels Apr 23, 2024
@nsajko
Copy link
Contributor Author

nsajko commented Apr 29, 2024

Judging by #54293, @kshyatt , it seems like methods such as the one below have the same issue as above, coverage isn't being recorded for them:

ATAN_1_O_2_HI(::Type{Float64}) = 4.63647609000806093515e-01

@nsajko nsajko added the kind:bug Indicates an unexpected problem or unintended behavior label Apr 29, 2024
@nsajko
Copy link
Contributor Author

nsajko commented Apr 29, 2024

I guess (just guessing) this comes down to the different ways a function can be executed. If a method only ever gets executed via that abstract interpretation thing/constant folding, I guess it doesn't get recorded at all for the purposes of code coverage.

@nsajko nsajko changed the title missed coverage for a method taking an empty tuple missed coverage for a method whose body is an isbits literal May 1, 2024
@nsajko
Copy link
Contributor Author

nsajko commented May 3, 2024

Usually it is constant-folded values that get evaluated, but not run so they end up not getting counted

#35395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:code coverage kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant