Skip to content

An axis is measured by its length, whatever iterates it - #314

Merged
sshin23 merged 1 commit into
mainfrom
anvil/axis-length
Aug 14, 2026
Merged

An axis is measured by its length, whatever iterates it#314
sshin23 merged 1 commit into
mainfrom
anvil/axis-length

Conversation

@sshin23

@sshin23 sshin23 commented Aug 14, 2026

Copy link
Copy Markdown
Member

First fix of the release-candidate iteration (per the PR-per-fix loop).

COPS field testing supplied two iterator types in sequence: catmix's collocation table (fixed by _length(::AbstractArray) in #313) and then steering's zip(2:4, angles) boundary conditions — the same failure shape, a MethodError swallowed into a status-2 layout query that leaves the model unconstructable through the consumer while compiling clean. Enumerating iterator types is the losing game, so this generalizes the rule: a number is the count itself, a symbolic node defers, every other axis answers length.

Verified by sweeping all seventeen COPS models (each built with its own _args defaults): every block of every model resolves to integer dims. Regression test covers the zip axis beside the data axis. Gates: ExaModels 1623 / 0 failed / 2 broken, ExaModelsCompiler 252/252.

Unblocks: steering (the last of Nabla's original six), and COPS's full 35-model verification round.

🤖 Generated with Claude Code

The data-axis fix added _length(::AbstractArray); steering immediately
supplied the next iterator type — zip(2:4, angles), its boundary
conditions — as the same swallowed status 2 in a compiled library's
layout query. Enumerating iterator types is the losing game, so the
rule is now general: a number is the count itself, a symbolic node
defers, and every other axis answers length. Swept against all
seventeen COPS models: every block of every model resolves.

Gates: ExaModels 1623/0/2 broken (grew by the zip regression test),
ExaModelsCompiler 252/252.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Your PR requires formatting changes to meet the project's style guidelines.

Please run:

julia --project=@runic -e 'using Pkg; Pkg.add("Runic")'
julia --project=@runic -e "using Runic; exit(Runic.main(ARGS))" -- --fix <files>

(or git runic main if you have the git wrapper installed)

Note: the full diff is omitted because it can exceed GitHub Actions input limits.

@sshin23
sshin23 merged commit c8055d2 into main Aug 14, 2026
18 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results


Relative timing: current / main  (values < 1.0 are improvements)

================================================================================
  backend-instance-param          |      obj     cons     grad      jac     hess
================================================================================
  CUDA-OPF-case1354               |    1.003    1.009    1.035    1.001    1.003
  CUDA-OPF-case14                 |    0.957    0.961    0.956    0.890    0.998
  CUDA-OPF-case30000              |    1.040    1.009    0.901    1.003    1.007
  CUDA-chain-10                   |    1.001    0.995    0.996    1.003    0.997
  CUDA-chain-100                  |    1.011    0.996    0.980    1.027    1.090
  CUDA-chain-1000                 |    0.987    1.002    0.997    0.998    0.999
  CUDA-elec-10                    |    1.022    1.000    0.976    1.001    1.009
  CUDA-elec-100                   |    1.003    1.007    1.136    1.003    1.000
  CUDA-elec-1000                  |    1.022    0.996    0.609    1.037    1.028
  CUDA-rosenrock-1000             |    0.979    0.985    0.964    0.988    0.969
  CUDA-rosenrock-10000            |    1.013    0.948    0.959    0.996    0.965
  CUDA-rosenrock-100000           |    1.002    0.957    0.962    0.988    0.981
--------------------------------------------------------------------------------
  AMDGPU-OPF-case1354             |    1.003    1.008    0.985    0.974    0.998
  AMDGPU-OPF-case14               |    0.997    0.997    0.991    0.992    1.005
  AMDGPU-OPF-case30000            |    0.996    0.992    0.952    0.964    0.979
  AMDGPU-chain-10                 |    0.996    1.001    1.003    0.980    1.020
  AMDGPU-chain-100                |    0.999    0.992    0.998    0.997    1.039
  AMDGPU-chain-1000               |    1.001    1.028    0.994    0.958    1.015
  AMDGPU-elec-10                  |    1.002    1.008    1.003    1.048    1.002
  AMDGPU-elec-100                 |    0.997    0.993    0.979    0.982    0.989
  AMDGPU-elec-1000                |    0.996    1.007    1.039    0.988    0.966
  AMDGPU-rosenrock-1000           |    0.990    1.032    0.988    0.964    1.042
  AMDGPU-rosenrock-10000          |    0.978    1.034    1.005    0.973    1.048
  AMDGPU-rosenrock-100000         |    0.924    0.964    0.955    0.964    1.305
--------------------------------------------------------------------------------
  oneAPI-OPF-case1354             |    0.863   17.400    4.344    1.251    0.975
  oneAPI-OPF-case14               |    1.089    0.753    0.847    0.523    1.429
  oneAPI-OPF-case30000            |    0.743    0.662    2.718    1.410    4.356
  oneAPI-chain-10                 |    0.575    3.566    1.659    1.372    1.126
  oneAPI-chain-100                |    0.822    1.655    1.168    5.967    1.265
  oneAPI-chain-1000               |    0.695    1.448    1.341    0.957    1.435
  oneAPI-elec-10                  |    1.087    2.278    0.850    1.249    1.987
  oneAPI-elec-100                 |    4.141    2.361    1.316   25.341    1.012
  oneAPI-elec-1000                |    1.017    1.395    0.969    1.961    2.562
  oneAPI-rosenrock-1000           |    0.710    1.251    1.308    0.139    1.210
  oneAPI-rosenrock-10000          |    1.198    1.315    1.448    0.091    0.759
  oneAPI-rosenrock-100000         |    0.368    1.200    0.785    1.118    0.980
--------------------------------------------------------------------------------
  nothing-OPF-case1354            |    1.094    1.000    1.010    0.975    1.059
  nothing-OPF-case14              |    0.979    0.984    1.009    1.012    1.374
  nothing-OPF-case30000           |    0.995    0.984    0.980    0.988    1.042
  nothing-chain-10                |    0.967    0.907    0.676    0.874    0.994
  nothing-chain-100               |    0.971    0.988    0.750    0.944    0.717
  nothing-chain-1000              |    1.000    1.053    0.818    0.998    0.636
  nothing-elec-10                 |    1.031    1.163    1.035    1.037    1.007
  nothing-elec-100                |    0.999    1.157    1.001    0.986    1.002
  nothing-elec-1000               |    1.000    1.176    0.984    0.993    1.022
  nothing-rosenrock-1000          |    0.996    0.999    1.003    0.963    1.211
  nothing-rosenrock-10000         |    1.000    0.998    1.000    0.987    0.303
  nothing-rosenrock-100000        |    1.056    1.041    1.057    0.991    0.878
================================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant