You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: green-light CI — Dense fit-flag tracer, buffer-donation test pollution, L1 loss contract; Codecov token (#855)
fix: make full test suite (CI) green — Dense fit-flag tracer, buffer-donation pollution, L1 loss; Codecov token
Source fix
----------
brainpy/dnn/linear.py: ``Dense.update`` did
``if share.load('fit', False) and self.online_fit_by is not None:``. Inside a
grad-/jit-traced fit step (BPFF/BPTT) the ``fit`` share value is a JAX tracer,
so converting it to a Python bool raised ``TracerBoolConversionError`` and broke
the canonical Dense/RNNCell back-prop training example. Reordered to consult the
static ``*_fit_by`` configuration first; the ``and`` then short-circuits before
the tracer is forced when online/offline fitting is not configured.
This also removes a cross-test pollution: when the fit raised mid-trace it left
a stale traced ``fit`` in the global ``share`` store, so the next test running
``Dense.update`` (e.g. ``LoopOverTime`` over a ``Dense``) also raised.
Test isolation
--------------
brainpy/running/jax_multiprocessing_test.py: ``test_vectorize_map_partial_chunk_clear_buffer``
ran ``jax_vectorize_map(..., clear_buffer=True)``, which invokes the process-global
``bm.clear_buffer_memory()`` and deletes EVERY live device buffer, poisoning later
test modules ("deleted/donated buffer" errors). Patched the wipe to a no-op for the
duration of the call (same guard already used in boost_misc_test and
train_analysis_glue_fixes_test) so the code path stays covered without nuking the
shared session.
Test contract updates
---------------------
brainpy/train/back_propagation_test.py: rewrote the pinned-defect test into a
regression test that asserts ``Dense`` trains under BPFF (finite losses, weight
moves) and that a subsequent plain forward pass does not raise (pollution guard).
brainpy/losses/comparison_coverage_test.py: ``l1_loss`` delegates to
``braintools.metric.l1_loss`` (>=0.3.0, the required/CI dependency), which reduces
each sample to its mean absolute error then applies the batch reduction. Updated
the L1 expectations (none -> [1.5, 3.5], sum -> 5.0, mean -> 2.5) and comments to
the 0.3.0 contract; the previous numbers pinned stale braintools 0.1.10 behaviour.
CI
--
.github/workflows/CI.yml: Codecov upload now passes
``token: ${{ secrets.CODECOV_TOKEN }}`` and ``slug: brainpy/BrainPy``.
0 commit comments