Commit b2fbe2b
Fix Julia 1.10 tests: replace Lux-internal NN tracer test with broadcast MLP (#49)
The test suite errored on Julia 1.10 with `UndefVarError: apply_activation
not defined`: `test/runtests.jl` called `Lux.apply_activation`, an internal
that no longer exists in modern Lux. Renaming it does not fix the suite —
modern Lux layer dispatch routes through device-detection / type-introspection
helpers (`fieldcount`, `can_setindex`, `__is_immutable_array_or_dual_val`,
`_reshape_uncolon`, ...) that contain genuine, but value-independent,
compile-time `GotoIfNot` branches. FunctionProperties' syntactic IR scan
cannot distinguish those from value-dependent branches, so tracing a real Lux
layer now reports `hasbranching == true`, which would make the
`@test !hasbranching(ann, ...)` and `@test !hasbranching(dxdt_, ...)`
assertions fail rather than pass. There is no Lux version on 1.10 where the
suite passes as written (#46).
Rework the neural-network portion of the test to exercise the same value flow
the tool actually inspects (SciML/SciMLSensitivity.jl#997: a neural-network-
shaped ODE right-hand side must trace branch-free so a tracing AD can compile
a tape) using explicit affine transforms plus broadcast activations instead of
a Lux layer. This drops the Lux test dependency entirely and removes the
silent resolution to incompatible Lux versions noted in the issue.
Also add `[compat]` bounds for the test dependencies (ComponentArrays, Random,
SafeTestsets, Test) and bump the patch version.
Co-authored-by: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 257dfc2 commit b2fbe2b
2 files changed
Lines changed: 38 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | | - | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | | - | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
39 | 47 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | | - | |
| 53 | + | |
47 | 54 | | |
48 | 55 | | |
49 | | - | |
| 56 | + | |
50 | 57 | | |
51 | | - | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | | - | |
| 61 | + | |
55 | 62 | | |
56 | | - | |
57 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
58 | 66 | | |
59 | | - | |
60 | | - | |
| 67 | + | |
61 | 68 | | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
67 | 79 | | |
68 | 80 | | |
| 81 | + | |
| 82 | + | |
69 | 83 | | |
70 | 84 | | |
71 | | - | |
72 | | - | |
| 85 | + | |
| 86 | + | |
73 | 87 | | |
74 | 88 | | |
75 | 89 | | |
| |||
0 commit comments