Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ breaking release).
- **The test suite compiles less.** `test/layers/sympnet_upscaling.jl` checks its three symplectic identities on 12 pairs `(N, N2)` instead of all 120 with `N` in `2:2:20` and `N2` in `(2N):2:(4N)`: `(2, 4)`, `(2, 6)`, `(2, 8)`, `(4, 10)`, `(6, 12)`, `(6, 20)`, `(8, 24)`, `(10, 30)`, `(12, 36)`, `(14, 42)`, `(20, 40)` and `(20, 80)`. They keep the smallest pair, `N2 = 2N`, `N2 = 4N`, `N2` not a multiple of `N`, and the largest `N`. The layers carry the sizes in their types, so each pair is a new compilation (about 1.3 s per pair, not once per file as the [0.8.0] entry assumed); the file has 36 assertions instead of 360, and takes 19.7 s cold; it stays in `slow`. The two training tests of `test/loss/training_method_losses.jl` use the network shape of the rest of the file, `StandardHamiltonianArchitecture(2n, 4, 1)` and `LagrangianNeuralNetwork(2; width = 4, nhidden = 1)`, in place of `(2n, 5, 2)` and `width = 5, nhidden = 2`; each still asserts that training reduces the loss. `test/architectures/lagrangian_neural_network_tests.jl` moves from `core` to `slow`: it takes 122.7 s cold, above the 60 s of a `core` file. It still runs in CI and in `Pkg.test()`, and leaves only the local `core` run. Every other `core` file takes at most 37.9 s cold. The times are cold, from one fresh Julia process that runs the `core` files in the order of `test/runtests.jl` (and from one fresh process for each of the two files named), on an Apple M4 Max with Julia 1.13.1, at a load average below 4 at the start.
- **The optimizer reads `show_progress` as a `Bool`** instead of comparing it with `== true`. A non-`Bool` value now raises a `TypeError`: before, `nothing`, `0` or a string hid the progress bar with no error, and `1` or `1.0` showed it. Every call in the tests and the manual passes `false`, and every call in `scripts/` passes `true`.
- **fatou reports no finding in `src/` or `test/`.** Only tests and one lint suppression changed; no behaviour of the package changed. `test/layers/multi_head_attention_stiefel_setup.jl` defined `check_setup(ps::NetworkParameters)` twice, and the later method silently replaced the `mapparameters` one, which never ran. The later method is deleted, and the test now asserts that the matrix method of `check_setup` runs once per leaf of the parameters, counted with `foldparameters`. The unused destructured values `Σ`, `Vt` and `Ũ₂` in `test/optimizers/psd_optim.jl` and `test/optimizers/svd_optim.jl` are now `_`; those files check `Ũ₁` and `Ũ₃` and never checked `Ũ₂`. The unreachable `new{…}(…)` after the `error` in the `GeneralizedHamiltonianArchitecture` constructor stays, because it records the field order for the future constructor, under `# fatou-ignore unreachable-code`.
- **Three test files left the top level of `test/`**, because a test file sits there only where it mirrors `src/<name>.jl`. `test/norm_eltype.jl` tests `_norm` of `src/utils.jl` and is now `test/utils.jl`; `test/map_to_cpu_tests.jl` tests `src/map_to_cpu.jl` and is now `test/map_to_cpu.jl`; `test/documented_defaults.jl` tests the keyword defaults of `src/layers/symplectic_attention.jl`, `src/architectures/symplectic_transformer.jl` and `src/architectures/standard_transformer_integrator.jl`, whose deepest common directory is `src/` itself, and is now `test/integration/documented_defaults.jl`. Only the paths in `test/runtests.jl` changed; the labels, groups and order are the same.

### Fixed

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if "core" in GROUPS
@safetestset "Linear Symplectic Attention" include("layers/linear_symplectic_attention.jl")
@safetestset "parameterlength(::MultiHeadAttention{M,M,true}) is exact" include("layers/multi_head_attention_parameterlength.jl")
@safetestset "compute_output_of_mha infers concretely" include("layers/multi_head_attention_inference.jl")
@safetestset "Documented keyword defaults are the constructed ones" include("documented_defaults.jl")
@safetestset "Documented keyword defaults are the constructed ones" include("integration/documented_defaults.jl")
@safetestset "Test setup of transformer with Stiefel weights" include("layers/transformer_setup.jl")
@safetestset "Sinusoidal positional encoding" include("layers/positional_encoding.jl")
@safetestset "Check if the transformer can be applied to a tensor." include("layers/transformer_application.jl")
Expand All @@ -48,7 +48,7 @@ if "core" in GROUPS
@safetestset "SymplecticAutoencoder tests" include("architectures/symplectic_autoencoder_tests.jl")
@safetestset "Check if autoencoder error is lower than PSD error" include("architectures/sae_error_lower_than_psd_error.jl")
@safetestset "Check reduced model" include("reduced_system/reduced_system.jl")
@safetestset "_norm keeps the element type of its argument" include("norm_eltype.jl")
@safetestset "_norm keeps the element type of its argument" include("utils.jl")
@safetestset "Symplectic Euler and variational midpoint losses" include("loss/training_method_losses.jl")
@safetestset "Test NetworkLoss + Optimizer" include("integration/losses_and_optimization.jl")
@safetestset "ReducedLoss through the Optimizer functor" include("integration/reduced_loss_optimization.jl")
Expand All @@ -63,7 +63,7 @@ if "core" in GROUPS
@safetestset "The GO-native leaf step scales in the parameter's own element type" include("optimizers/step_size_element_type.jl")
@safetestset "_custom_mul: NetworkParameters gradient structure" include("layers/double_multiplication_network_parameters_gradient.jl")
@safetestset "Symplectic attention: NetworkParameters gradient structure" include("layers/symplectic_attention_network_parameters_gradient.jl")
@safetestset "map_to_cpu" include("map_to_cpu_tests.jl")
@safetestset "map_to_cpu" include("map_to_cpu.jl")
@safetestset "changebackend" include("integration/changebackend_tests.jl")
@safetestset "HDF5 save/load for GML special array types" include("integration/hdf5_support.jl")
@safetestset "Test data loader for q and p data" include("data_loader/batch_data_loader_qp_test.jl")
Expand Down
File renamed without changes.
Loading