Remove Transducers extension, always await spawned loader tasks - #229
Merged
Conversation
Drops the `TransducersExt` weakdep extension entirely. It provided a `Transducers.__foldl__` method for `DataLoader`, but that capability was never documented (no mention in the docs, the `DataLoader` docstring, or the README) and was only exercised by a single testset. Removing it clears the last `Transducers` reference from the package, so `MLUtils` now precompiles with no dependency on it. Also hardens the parallel `Loader`'s divide-and-conquer: the right-half `@spawn`ed task is now awaited via `try`/`finally`, so it never outlives the call when the left half throws. The happy path is unchanged (`wait` still propagates a right-half failure); on the error path the outer handler's `close(ch, e)` unblocks any `put!` the right half is parked on so it can terminate instead of leaking as an orphan. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #215.
Remove the Transducers extension
#215 moved
Transducersto a weakdep +TransducersExt, which provided aTransducers.__foldl__method forDataLoader. This PR removes that extension entirely:ext/TransducersExt.jland the[weakdeps]/[extensions]/[compat]Transducersentries.Transducersfrom the test dependencies and theusing Transducersimport.Rationale: the fold protocol was never documented — there's no mention of
Transducers/foldl/eductionin the docs, theDataLoaderdocstring, or the README, andeachobsparallel/Loaderare internal. It was only exercised by that one testset. After this changeMLUtilsprecompiles with no reference toTransducersat all.Always await the right-half spawned task
Hardens the parallel
Loaderdivide-and-conquer (_spawn_foreach): the@spawned right half is now awaited viatry/finally, so it never outlives the call when the left half throws.waitstill propagates a right-half failure.close(ch, e)unblocks anyput!the right half is parked on, so it terminates instead of leaking as an orphaned task (which could surface as a stray "unhandled task failure" log).Testing
eachobsparalleltestset: 9/9 pass.DataLoadertestset passes (Transducers foldl testset removed).Transducers.getobsthat throws partway, across 1/2/4/8 threads × 50 reps × 7 size/fail-point configs — every case propagates the error to the consumer with no hang, and the happy path stays correct and complete.🤖 Generated with Claude Code