• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PrincetonUniversity / PsyNeuLink / 25477451518
84%
master: 85%

Build:
Build:
LAST BUILD BRANCH: devel
DEFAULT BRANCH: master
Ran 07 May 2026 12:54PM UTC
Jobs 1
Files 163
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 May 2026 05:18AM UTC coverage: 84.215% (+0.004%) from 84.211%
25477451518

Pull #3534

github

younesStrittmatter
DriftOnASphereIntegrator: fix scalar-noise crash when wrapped in a Mechanism

Wrapping a `DriftOnASphereIntegrator` in any Mechanism
(`ProcessingMechanism`, `IntegratorMechanism`, etc.) and calling
`execute` / `Composition.run` crashes with

    ValueError: matmul: Input operand 1 has a mismatch in its core
    dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?)
    (size 1 is different from 24)

even when the integrator was constructed with a Python scalar
`noise=0.075`. Standalone `integ.execute(...)` works fine; only
the Mechanism-wrapped path crashes.

Root cause: PNL's parameter system stores the scalar noise as a
length-1 ndarray when the function is bound to a Mechanism. At
execute time `_function`'s vector-noise branch (`np.ndim(noise)
== 1`) then runs against that length-1 array as if it were a
true per-dimension noise vector — `B @ (noise * eps)` becomes
`(d, d-1) @ (1,)` and matmul errors with the size-1-vs-d-1
mismatch.

Fix: the vector-noise branch now requires `noise.size > 1` and
explicitly checks the length matches `d-1`, raising a clear
FunctionError for any other vector length. Length-1 ndarrays
fall through to the scalar branch, which now also `.item()`s
0-d/1-d arrays back to a Python float so the downstream
`noise * z` is unambiguous.

Verified against tests/functions/test_integrator.py — 18
DriftOnASphere tests still pass. Verified the original repro
end-to-end:

    integ = pnl.DriftOnASphereIntegrator(
        dimension=25, noise=0.075,
        initializer=unit_vec, default_variable=np.zeros(24))
    pm = pnl.ProcessingMechanism(default_variable=[[0.0]*24], function=integ)
    pm.execute([[0.0]*24])         # was: matmul crash; now: shape (1, 25) unit vector
    Composition().add_node(pm).run(...)  # also OK now
Pull Request #3534: DriftOnASphereIntegrator: fix scalar-noise crash when wrapped in a Mechanism

10519 of 13698 branches covered (76.79%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

36184 of 41759 relevant lines covered (86.65%)

0.87 hits per line

Jobs
ID Job ID Ran Files Coverage
1 25477451518.1 07 May 2026 12:54PM UTC 163
84.21
GitHub Action Run
Source Files on build 25477451518
  • Tree
  • List 163
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Pull Request #3534
  • PR Base - devel (#25299956806)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc