Issues found by claude
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- julia
- Lĩnh vực
- backend, compilers, documentation, performance, testing
Hướng nghiên cứu
Issue này tập hợp các mối quan tâm về runtime, tài liệu, tính đồng thời, hiệu năng và kiểm thử trong src/refelim.jl, src/transformation.jl, src/copyable_task.jl, src/bbcode.jl, src/test_utils.jl và docs/src/internals.md. Trước tiên, hãy chia checklist thành các thay đổi tập trung, sau đó đọc phần mã được nêu và chạy các test liên quan cùng với bản build tài liệu. Được xem là hoàn tất khi mỗi mục được chọn đều có bản sửa đúng trọng tâm, có phạm vi kiểm thử hồi quy khi áp dụng được và CI thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Verified on Julia 1.10, 1.11, and 1.12 where a runtime claim is made.
Bug
-
produceof a non-Intliteral whose result is used across a laterproducecrashesTapedTaskconstruction.src/refelim.jl:234,250(emitted atsrc/transformation.jl:812).function model() s = produce("hi") # constant literal as produce arg t = produce(s) # result `s` live across a later produce -> ref is kept return (s, t) end TapedTask(nothing, model) # ERROR: Unexpected value argument to set_ref_at!: hieliminate_refsonly handlesset_ref_at!value-args that areID,GlobalRef, or
Argument; a literal that survives constant-propagation into a kept cross-suspension ref
hitserror(...). TheIntcase is masked becauseCore.Constfolds the literal into all
use sites, leaving the produce-result SSA unused (no ref kept). Fix: handle a non-ID
constant value-arg like the existingGlobalRef/Argumentarm (store it as-is for a kept
set / substitute it for a dropped get) instead of erroring, in both branches.
Docs / CI
-
Doc build fails:
BasicBlockCode.remake_enterdocstring not indexed.docs/src/internals.md.
makedocs(; modules=[Libtask])enforcescheckdocs=:all;remake_enterhas a docstring
but no@docsentry →[:missing_docs], deterministically on all versions, so Documentation
CI is red. Fix: addLibtask.BasicBlockCode.remake_enterto the@docsblock.
(Already fixed on thesupport-trycatch-194branch; listed for completeness.) -
replace_capturesdocstring references nonexistentbuild_rrule(a Mooncake
leftover) and has a typo "intepreter".src/utils.jl:10. It's a documented internal, so the
stale text renders in the docs. Fix: reword to Libtask's actual use (reusing a compiled
MistyClosure's captures on copy/fresh_copyto avoid recompilation). -
optimise_ir!docstring signature is wrong.src/utils.jl:35. Shows
optimise_ir!(ir, show_ir=false)(positional) but the real signature is
optimise_ir!(ir; show_ir=false, do_inline=true)(keyword-only;do_inlineundocumented).
Documented internal → the rendered call form throwsMethodError. Fix: correct the
signature and documentdo_inline.
Robustness
-
consumeleavestaped_globalsin the calling task's TLS.src/copyable_task.jl:520.
consumesetstask_local_storage(TASK_VARIABLE_KEY, …)on the caller and never clears it,
so after anyconsume(t),get_taped_globals(::Type{T})called outside a TapedTask stops
throwingNotInTapedTaskErrorand returns the stale value — contradicting both docstrings.
(The existing test passes only because it is ordered first.) Fix: save/clear the key in a
try/finallyaround the inner call, or weaken the docstrings to state the key persists. -
get_function(x::Expr) = eval(x)runs arbitrary IR sub-expressions.src/transformation.jl:67,
fromstmt_might_produce's:callbranch. Result only feeds a conservative
isa(f, Union{IntrinsicFunction,Builtin,DataType})test, soevalis both unnecessary and a
side-effect/world-age hazard. Fix: for an unresolvedExprcallee, conservatively return
true(might-produce) instead of evaluating it. -
No
_find_id_uses!(::Switch)method.src/bbcode.jl:699-724.characterise_used_ids
would under-report IDs used only inSwitch.conds(latent today:Switchis synthesized after
the single call site and removed before lowering, butreplace_idsdoes handleSwitch, so
the asymmetry reads as a bug). Fix: add aSwitchmethod mirroringIDPhiNode, or comment
the invariant. -
necessary_ref_idsdedup relies on a non-local invariant.src/refelim.jl:184.
vcat(length(refs), …)force-includes the resume-block ref; correct only because that ref is
never touched viaget_ref_at/set_ref_at!. Fix: use a set union so dedup is explicit.
Concurrency / contract
-
set_taped_globals!over-restricts the new value's type, contradicting the docs.
src/copyable_task.jl:499,217. The method…(t::TapedTask{T}, ::T)and the parametric field
taped_globals::Ttaped_globalspin the type to construction time, so
set_taped_globals!(TapedTask(nothing, f), 5)throws aMethodError. The docstring says "set …
to anything you like." Fix: either widen the field/signature, or correct the docstring (and
the wrong signature shown in theset_taped_globals!docstring) to state the type is fixed. -
generate_irmutates the shared_id_countoutsidebuild_callable_lock.
src/copyable_task.jl:138. It callsseed_id!()and runs the full IR-deriving pipeline
unlocked — a second derivation path outside the lock the concurrency note (#227) forbids.
Debug-only, but violates the invariant. Fix: wrap the ID-generating body in
build_callable_lock. -
GlobalMCCache's internalReentrantLockis dead and its docstring misattributes
thread-safety.src/copyable_task.jl:228-243. All cache access is already under
build_callable_lock; onlysetindex!takes the inner lock (haskey/getindexdon't), so it
never contends and the comment points at the wrong mechanism. Fix: drop the inner lock (thin
Dict wrapper) or lock all accessors + correct the docstring to creditbuild_callable_lock.
Performance (build-time only)
-
get_block_id_from_intlinear-scans per resume site → ~O(blocks × resume_sites).
src/refelim.jl:57. Fix: build anint → IDdict once before the loop. -
Redundant
copyof an already-fresh slice.src/refelim.jl:321—
vcat(typeof(new_refs), copy(ir.argtypes[2:end])); the slice already copies. Fix: dropcopy.
Tests
-
allocsperf flag is a silent no-op for empty-result cases.src/test_utils.jl:52-64.
The allocation loop iteratesiteration_results, so cases with[]expected results assert
nothing — yet "no produce", "kwarg tester 1/2", and both "default kwarg tester" are marked
allocs. Fix: loop1:(length(results)+1)(also measure the terminatingconsume), or
downgrade those cases tonone. -
Duplicate test name + redundant case.
src/test_utils.jl:217-227. Two cases share the
name "default kwarg tester";kwargs=nothingandkwargs=(;)construct the identical task.
Fix: rename / drop the redundant one.
Trivial
- Dead assignment
new_argtypes = copy(ir.argtypes)overwritten on the next line.src/transformation.jl:979— delete it. -
throw(error(msg))double-wraps (and is inconsistent with sibling bareerror(...)sites).src/transformation.jl:77,692— useerror(msg). -
might_produceopt-in API documented but notexported/public.src/Libtask.jl/docs/src/index.md:31-35. Considerpublic might_produce, might_produce_if_sig_contains, @might_produce(guarded for Julia ≥ 1.11). - 1.12.0-prerelease
@warnhas nomaxlog→ floods logs in tight TapedTask-construction loops.src/copyable_task.jl:437— addmaxlog=1. - Typo "hanled" → "handled".
src/bbcode.jl:646(inherited from Mooncake).
- Ngôn ngữ chính
- Julia
- Star
- 22
- Fork
- 11
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TuringLang/Libtask.jl
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
TuringLang/Libtask.jl#244 ·
Tất cả issue của TuringLang/Libtask.jl
Issue tương tự
-
Release CorleoneInverse as 0.1.1Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
SciML/Corleone.jl#200 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
JuliaAI/MLJTransforms.jl#120 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
exercism/julia#1205 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
SciML/OrdinaryDiffEq.jl#5175 ·
Maintainer thường phản hồi trong vòng 1 ngày