-
Notifications
You must be signed in to change notification settings - Fork 10
Completely Refactor #179
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
Open
willtebbutt
wants to merge
70
commits into
main
Choose a base branch
from
wct/refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Completely Refactor #179
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
55dcca5
Rework test cases a bit
willtebbutt 8f9c3ce
Add formatter config
willtebbutt 9f0ad12
Update gitignore to remove redundant items
willtebbutt ffd86e2
Bump minor version because small breaking change
willtebbutt 2d06346
Tell users that various old types have been actually removed
willtebbutt 0c545bb
Formatting of perf
willtebbutt dc5ab50
Remove old code
willtebbutt 5228dc2
Rework includes in package and runtests
willtebbutt fc01732
More formatting
willtebbutt 5ddfb60
Add in copyable_task files
willtebbutt 159fe13
Clean up runtests
willtebbutt 61594e4
Update project deps etc
willtebbutt ae6d000
Drop 1.7 from CI
willtebbutt dc4a0be
Initial transfer of code
willtebbutt 7e9ba1e
Fix bug for function with no produce statements
willtebbutt 8e6f1b6
Test for construction of new mutable struct
willtebbutt 71e6444
Fix more test cases
willtebbutt 4d18d47
Add another test case
willtebbutt f1b247d
More test cases
willtebbutt 85ec6a2
More work
willtebbutt 04544ca
Formatting
willtebbutt ecbf41c
Remove unhelpful docstring
willtebbutt 22f6f67
Relax Test compat a bit
willtebbutt 04e4dcd
Lower minor version to make integration tests run
willtebbutt b25d2f4
Handle code_coverage_effect
willtebbutt 94aed2f
Some tweaks + docs
willtebbutt 1579bff
Fix copying
willtebbutt 5114d64
Formatting
willtebbutt b803f58
Enable more tests
willtebbutt 6aeaac3
Implement dynamic scope
willtebbutt b546f21
Test dynamic scope correctness
willtebbutt 8f4e4b5
README and NEWS overhaul
willtebbutt 4d0b423
Export get_dynamic_scope and set_dynamic_scope
willtebbutt bde142f
Placeholder docstring for produce
willtebbutt 4e58e11
Initial docs
willtebbutt 21816ee
Ignore build folder of docs
willtebbutt 3205273
Update cache action
willtebbutt 06c168f
Formatting
willtebbutt 258a4cd
Ignore all top-level manifest files
willtebbutt a3c2162
Add dependency on ScopedValues
willtebbutt 4bb0dfa
Fix on LTS
willtebbutt a63660e
Do not check for stale deps on 1.11
willtebbutt 4e1e5df
Some docs
willtebbutt 54c745c
Docs action
willtebbutt 0102653
Tidy up docs
willtebbutt e751db3
Tidy up docs slightly
willtebbutt 6a221c2
Refactor + basic nested produce handling
willtebbutt f94ea17
Fomatting
willtebbutt 57b808c
Dynamic nested calls and uses of return values of calls which might p…
willtebbutt bf1893c
Fix docs build
willtebbutt 2c82159
Update CI
willtebbutt b393c54
Handle callable structs
willtebbutt 906cb66
Fix docs and add doctest
willtebbutt 4f80127
Test kwargs
willtebbutt 065fb19
More tests
willtebbutt 1ba2dfe
Fix inference bug
willtebbutt 999f5bc
Improve documentation
willtebbutt ec9edb7
Performance enhancements
willtebbutt 5135c4a
Caching and tweaks
willtebbutt b42227e
Fix docs build
willtebbutt aa86594
Docs and tidy up
willtebbutt 5b07ec1
Include specifics from Mooncake
willtebbutt bc480c2
Tidy up further
willtebbutt 35e9b7a
Tidy up further
willtebbutt 42096b3
Merge branch 'main' into wct/refactor
willtebbutt c54dc5c
Remove undefined export
willtebbutt b2e65b8
Bump patch version
willtebbutt 01a0b34
Test produce global performance
willtebbutt ebe8f91
Remove more references to dynamic scope
willtebbutt 2907f03
Document type assertion
willtebbutt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
style = "blue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: '*' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
statuses: write | ||
actions: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: '1' | ||
arch: x64 | ||
include-all-prereleases: false | ||
- name: Install dependencies | ||
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.update(); Pkg.instantiate()' | ||
- name: Build and deploy | ||
env: | ||
GKSwstype: nul # turn off GR's interactive plotting for notebooks | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token | ||
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key | ||
run: julia --project=docs/ docs/make.jl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,4 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Linker output | ||
*.ilk | ||
*.map | ||
*.exp | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
*.dSYM/ | ||
*.su | ||
*.idb | ||
*.pdb | ||
|
||
# Kernel Module Compile Results | ||
*.mod* | ||
*.cmd | ||
.tmp_versions/ | ||
modules.order | ||
Module.symvers | ||
Mkfile.old | ||
dkms.conf | ||
|
||
# Projects files | ||
Manifest.toml | ||
deps/build.log | ||
deps/deps.jl | ||
deps/usr/ | ||
deps/tmp-build.jl | ||
Manifest* | ||
*.cov | ||
docs/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- From v0.6.0, Libtask is implemented by recording all the computing | ||
to a tape and copying that tape. Before that version, it is based on | ||
a tricky hack on the Julia internals. You can check the commit | ||
history of this repo to see the details. | ||
|
||
- From version 0.9.0, the old `TArray` and `TRef` types are completely removed, where | ||
previously they were only deprecated. Additionally, the internals have been completely | ||
overhauled, and the public interface more precisely defined. See the docs for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,23 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f" | |
license = "MIT" | ||
desc = "Tape based task copying in Turing" | ||
repo = "https://github.com/TuringLang/Libtask.jl.git" | ||
version = "0.8.8" | ||
version = "0.9.0" | ||
|
||
[deps] | ||
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e" | ||
LRUCache = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
MistyClosures = "dbe65cb8-6be2-42dd-bbc5-4196aaced4f4" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is Test meant to be a strong dep of the package and not just of tests? |
||
|
||
[compat] | ||
FunctionWrappers = "1.1" | ||
LRUCache = "1.3" | ||
julia = "1.7" | ||
Aqua = "0.8.11" | ||
JuliaFormatter = "1.0.62" | ||
MistyClosures = "2.0.0" | ||
Test = "1" | ||
julia = "1.10.8" | ||
|
||
[extras] | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test", "BenchmarkTools"] | ||
test = ["Aqua", "JuliaFormatter", "Test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
Libtask = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Documenter, Libtask | ||
|
||
DocMeta.setdocmeta!(Libtask, :DocTestSetup, :(using Libtask); recursive=true) | ||
|
||
makedocs(; | ||
sitename="Libtask", doctest=true, pages=["index.md", "internals.md"], modules=[Libtask] | ||
) | ||
|
||
deploydocs(; repo="github.com/TuringLang/Libtask.jl.git", push_preview=true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||
# Libtask | ||||||
|
||||||
Libtask is best explained by the docstring for [`TapedTask`](@ref): | ||||||
```@docs; canonical=true | ||||||
Libtask.TapedTask | ||||||
``` | ||||||
|
||||||
The functions discussed the above docstring (in addition to [`TapedTask`](@ref) itself) form the | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
public interface of Libtask.jl. | ||||||
They divide neatly into two kinds of functions: those which are used to manipulate | ||||||
[`TapedTask`](@ref)s, and those which are intended to be used _inside_ a | ||||||
[`TapedTask`](@ref). | ||||||
First, manipulation of [`TapedTask`](@ref)s: | ||||||
```@docs; canonical=true | ||||||
Libtask.consume | ||||||
Base.copy(::Libtask.TapedTask) | ||||||
Libtask.set_taped_globals! | ||||||
``` | ||||||
|
||||||
Functions for use inside a [`TapedTask`](@ref)s are: | ||||||
```@docs; canonical=true | ||||||
Libtask.produce | ||||||
Libtask.get_taped_globals | ||||||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Internals | ||
|
||
```@docs; canonical=true | ||
Libtask.produce_value | ||
Libtask.is_produce_stmt | ||
Libtask.might_produce | ||
Libtask.stmt_might_produce | ||
Libtask.LazyCallable | ||
Libtask.inc_args | ||
Libtask.get_type | ||
Libtask._typeof | ||
Libtask.replace_captures | ||
Libtask.BasicBlockCode | ||
Libtask.opaque_closure | ||
Libtask.misty_closure | ||
Libtask.optimise_ir! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've switched to
pre
over nightly in other TuringLang repos.