Skip to content

Resync the CircuitPython modules with 11.0.0-alpha.2 - #313

Merged
bdbarnett merged 4 commits into
mainfrom
upstream/resync-11.0.0-alpha.2
Oct 22, 2026
Merged

bdbarnett merged 4 commits into
mainfrom
upstream/resync-11.0.0-alpha.2

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Moves the oracle pin from CircuitPython 11.0.0-alpha.1 to 11.0.0-alpha.2 (d53b2277c) and takes the three upstream commits that touched the ported modules in between. All three are in audiomixer and synthio_sat16; nothing else in the eight modules changed, and lib/mp3 is the same commit.

What upstream changed

  • Integer mixer (11a329885, fc57c0f36; Fix audiomixer phase inversion and use DSP on Cortex-M33 adafruit/circuitpython#11617). A voice is scaled as (ai * mul) >> 15, where it was ai * (mul / 32767.0f) truncated toward zero, and a centred pan is 32768 - panning, where it was 32767 - panning. Taken as upstream has it in src/audiomixer/Mixer.c, the CPython scaling kernel and src/cpython/audiomixer.py.
  • Inline synthio_sat16 (cbbde1208; #11621). Taken in src/synthio/__init__.h. The branch-free rounding is the same arithmetic, so no sample changes.

What moved, and why

Every mixer level below 1.0 moves by up to one LSB, and a small negative sample now rounds down (-1 at level 0.5 stays -1). A voice at level 1.0 is a wire without help, so this port's unity branch (audiodsp#95) is deleted and that difference is retired; a stereo voice at pan 0 no longer has its left channel a step below the right. On the CPython target the pass-through at unity is keyed on Q15 32768 alone, since 32767 no longer multiplies by exactly 1.

Stored digests that moved, both re-captured from the new oracle's own output (CPython and desktop MicroPython reproduce it):

  • streaming_component, streaming half: f3ffad8e... to 33b27a2f... (its mixer voices are below unity).
  • synthtools_acceptance: b6e3b06f... to 757d944a... (the lead, bend and bass lines; the other five are unchanged).

Held, and reproduced by the new oracle: midi_component, effects_component, biquad_component, mixdown_knee.

The oracle is bin/circuitpython-oracle-11.0.0-alpha.2, 64 voices, sha256 ee0cc93c12691859ec1588df89e1839056cef52d4c95ed0515a14d2461757b66, pinned in tests/test_voice_ceiling_consistency.py.

mixer_q15_level_probe.py replaces mixer_level_precision_probe.py (its float32-versus-float64 flips no longer exist). A MicroPython build from before the change prints different bytes from the oracle on it, and the new build prints the same.

Gates

  • verify_dsp.py with --micropython and --circuitpython (the alpha.2 oracle): 106 comparisons, 0 failures.
  • The five stored-digest gates (verify_acceptance, verify_effects, verify_streaming, verify_biquad, verify_mixdown_knee) pass on the new goldens; cp11_files_probe.py prints its PASS line on MicroPython and on the oracle.
  • python -m unittest discover -s tests: 576 tests, OK (3 skipped); flake8 clean.
  • audiocomponents' instrument parity sequences, all 53 instruments, rendered with a build from before and a build from after on CPython and on MicroPython: 106 comparisons, none moved.

Recorded in docs/upstream-sync.md and docs/upstream-diff.md.

…sat16

audiomixer (11a329885, fc57c0f36; adafruit/circuitpython#11617): a voice is
scaled as (ai * mul) >> 15 where it was ai * (mul / 32767.0f) truncated toward
zero, and a centred pan is 32768 - panning where it was 32767 - panning. Taken
in upstream's words in src/audiomixer/Mixer.c, in the CPython extension's
scaling kernel and in src/cpython/audiomixer.py, whose float32 helpers go.

Every level below 1.0 moves by up to one LSB, and a small negative sample now
rounds down (-1 at level 0.5 stays -1). A voice at level 1.0 is a wire without
help, so the unity branch this port added in audiodsp#95 is deleted, and a
stereo voice at pan 0 no longer has its left channel one step below the right.
The CPython target's block-level pass-through at unity is keyed on Q15 32768
alone now: 32767 no longer multiplies by exactly 1.

synthio (cbbde1208; adafruit/circuitpython#11621): synthio_sat16 is inline in
src/synthio/__init__.h as upstream has it, with __ssat on cores that define
__ARM_FEATURE_SAT. The rounding is the same arithmetic without a branch, so no
sample changes.

mixer_q15_level_probe.py replaces mixer_level_precision_probe.py, whose
material was the float32-versus-float64 flips that no longer exist. It renders
the rails and the values either side of zero at four levels and five pans,
mono and stereo, and verify_dsp.py holds CircuitPython, MicroPython and CPython
to the same bytes. test_cpython_audiomixer_level.py and
test_cpython_mixer_scale.py are rewritten around the integer arithmetic.
…gests

CIRCUITPYTHON_ORACLE names d53b2277c, and tests/test_voice_ceiling_consistency.py
pins the sha256 of the 64-voice binary built from it (ee0cc93c...).

Two stored digests moved with the integer mixer, re-captured from the new
oracle's own output, which CPython and desktop MicroPython reproduce:

- streaming_component, streaming half: f3ffad8e... to 33b27a2f.... The mixer
  voices in streaming_component_probe.py are below unity.
- synthtools_acceptance: b6e3b06f... to 757d944a.... The lead, bend and bass
  lines moved; the other five lines are unchanged.

Every other stored digest held and reproduces on the new oracle:
midi_component, effects_component, biquad_component and mixdown_knee. The
oracle labels in effects_component and streaming_component follow the pin.
upstream-sync.md gets the new "last resync" entry (the alpha.1 one becomes the
one before it), upstream-diff.md says what upstream's integer mixer changed
and which digests moved, and the audiodsp#95 section becomes a record of a
difference upstream now shares, as the alpha.1 resync did for its five.
A float32 MicroPython build prints 100 / 127 with fewer digits than CPython,
so the probe's label line differed where the samples agreed.
@bdbarnett
bdbarnett merged commit 46f78dc into main Oct 22, 2026
31 checks passed
@bdbarnett
bdbarnett deleted the upstream/resync-11.0.0-alpha.2 branch October 22, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant