Skip to content

Conversation

timholy
Copy link
Member

@timholy timholy commented Apr 9, 2025

Fixes #58

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.47%. Comparing base (6b5623a) to head (5f2bfcc).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
+ Coverage   81.72%   82.47%   +0.75%     
==========================================
  Files           3        3              
  Lines          93       97       +4     
==========================================
+ Hits           76       80       +4     
  Misses         17       17              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

have_float |= mi.specTypes.parameters[2] === Float64
end
@test !have_float # not wrapped inside `@compile_workload`
@test_broken have_char # is wrapped
Copy link
Member Author

@timholy timholy Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mortenpi @benlorenz note that the pattern used in your reports blocks effective precompilation. If you haven't followed, here's the issue: if you compile external (outside of the package, e.g., Base or whatever) code before you reach @compile_workload, it will not be cached. The problem is that your construct forces compilation of the anonymous function before @compile_workload turns on. Thus, any code not "owned" by your package that can't be inferrably traced back to a caller in your package will be dropped from the precompile cache.

As a guide to understanding the test, know that Base.inferencebarrier is used in NotPrecompiled to force runtime dispatch, so that the isa_bool specializations cannot be traced back to NotToplevel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also CC @jpthiele

@jpthiele
Copy link

jpthiele commented Apr 9, 2025

I added this branch manually to my local nightly version and was able to precompile HTTP.

@jpthiele
Copy link

jpthiele commented Apr 9, 2025

But switching @compile_workload and withenv fixes the problem as well, see JuliaWeb/HTTP.jl#1219

timholy added 2 commits April 10, 2025 07:47
It wasn't appearing before
@timholy
Copy link
Member Author

timholy commented Apr 10, 2025

I've added a warning to the documentation about avoiding this withenv(...) do @compile_workload begin ... end end pattern. Even though it doesn't error in this PR, it's self-defeating.

In case someone gets to this before me, I've tagged this merge me.

@timholy timholy merged commit 990c356 into main Apr 10, 2025
6 checks passed
@timholy timholy deleted the teh/toplevel branch April 10, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

World age increment not at top level regression with v1.3.1
2 participants