Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
=======================================
Coverage 96.22% 96.22%
=======================================
Files 1 1
Lines 106 106
=======================================
Hits 102 102
Misses 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@ChrisRackauckas let's roll-up an agent review on my agent assisted PR. Should be fine, but another check doesn't hurt, well, additional energy consumption. |
Review round 1 · Upstream fix requested ·
Evidence and checksPR: #37 Reviewed head: 51f6787 Risk assessment
Review reportVERDICT: UPSTREAM
Riskhigh (H1: all three threaded differentiation entry points reject previously accepted callable inputs when Polyester uses workers) Blocking findings
Non-blocking findingsNone. Upstream redirectUpstream repo: JuliaSIMD/Polyester.jl using Polyester
function captured!(out, f)
batch((length(out), Threads.nthreads()), out) do (out,), lo, hi
for i in lo:hi
out[i] = f(i)
end
end
end
function probe()
data = [2, 7]
f = i -> data[1] * i + data[2]
out = zeros(Int, 97)
captured!(out, f)
@assert out == 2 .* (1:97) .+ 7
end
probe()With five threads, the capturing form passed on x86-64 and errored inside Downstream follow-up: After the Polyester fix is released, retain the ARM64 matrix and capturing-callable tests against the fixed dependency. Include the callable-array regression test when verifying the downstream integration. What I ran
What I did not verifyNative macOS, 32-bit Julia, the newest Julia CI entry, and the remote CI logs. The CI status is supplied review metadata. The exact linked issue text was outside the blind review inputs. AUTHOR_GRADE: {"task":"bugfix","score":3,"difficulty":3,"rounds":1,"author_harness":"unknown","author_model":"unknown","note":"The ARM64 closure tests fail on the base and pass on the head. The change bypasses an isolated Polyester callback failure and breaks callable dense arrays in all three threaded entry points."} Head link: 51f6787 🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol |
This issue has been annoying me for a while now. With some 🤖 assistance here is a solution.
🤖
Cause
Polyester builds a
@cfunctionfrom thebatchbody. Thedoblock capturedf(andcheck), so whenfcarries data the block is not a singleton. Polyesterthen needs a runtime closure cfunction, which Julia only supports on x86/x86_64.
Changes
fandcheckthroughbatch's argument tuple instead ofcapturing them. The
doblock captures nothing and stays a singleton on everyplatform. No behaviour change on x86.
closures capturing datatest set that coversthreaded_gradient!and both
threaded_jacobian!methods with data-capturing closures, withVal{false}()andVal{true}(), a length that isn't a multiple of the chunksize, and repeated runs with an allocating loss.
macos-latest(aarch64) jobs for Julia1and~1.10.0-0. The newtests only catch this bug on Arm with more than one thread, and the existing
matrix is Linux x86/x64 only. The jobs use the same
JULIA_NUM_THREADS=5.Testing
Locally on Apple silicon (Julia 1.13.4): the new tests error with the message
above on the old code and pass with the fix, with both 8 threads and 1 thread.
closes #36