Repository navigation
Fix JET possible-undef finding in spectral_array_derivative - #694
Merged
ChrisRackauckas merged 1 commit intoSep 13, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
…ative JET reports `local variable 'rows' is not defined` in typo mode: `rows` is unconditionally assigned but conditionally reassigned inside the loop, so Julia 1.13 lowering boxes it and emits isdefined-guarded reads that JET flags as a possible-undef path. Computing the range into a fresh local keeps the closure capturing a variable with a single assignment. Verified: `JET.test_package(MethodOfLines; target_modules = (MethodOfLines,), mode = :typo)` now passes on Julia 1.13 (1/1, previously 1 report). Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Devin <[email protected]> Agent-Harness: Devin CLI 3000.10.21 Agent-Model: SWE-2 Max Agent-Session: /home/crackauc/.local/share/devin/cli/summaries/history_1130a74e0ebc4347.md
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 13, 2026
- Show reverse-mode adjoints in the neural network tutorial (#693) - Hoist the row range out of the ntuple closure in spectral_array_derivative (#694) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Summary
CI's QA job (
JET.test_package(MethodOfLines; target_modules = (MethodOfLines,), mode = :typo)on Julia 1.13) reports one finding:in
spectral_array_derivative.rowsis assigned unconditionally at the top of the loop body but conditionally reassigned in anif; Julia 1.13 lowering boxes the captured variable and emitsisdefined-guarded reads, and JET flags the guard as a possible-undef path even though it is unreachable at runtime.The fix computes
first(rows):last(rows)into a freshrowrangelocal, so thentupleclosure captures a variable with exactly one assignment — no box, no guarded read, no finding.Test plan
JET.test_package(MethodOfLines; target_modules = (MethodOfLines,), mode = :typo)on Julia 1.13.0: 1/1 pass (previously 1 report)🤖 Generated with Devin CLI (harness: Devin CLI 3000.10.21, model: SWE-2 Max)
Session (local transcript, no shareable URL):
/home/crackauc/.local/share/devin/cli/summaries/history_1130a74e0ebc4347.md