Repository navigation
Fix squared/unicolor mean dispatch in both process overloads (fix #2057) - #2058
Conversation
Correct the squared multicolor and unicolor algorithm selections without changing mapping names or IDs. Add source-contract regression coverage for both overloads and all named modes. Independently reviewed before publication.
|
Hello @Kirorus 👋 I'm the Hyperion Project Bot and I want to thank you for To help you and other users test your pull requests faster, 🔗 https://github.com/hyperion-project/hyperion.ng/actions/runs/37353313393 Of course, if you make changes to your PR, I will create a new link. Best regards, |
|
Hey @Kirorus I created a new link to your workflow artifacts: |
|
@Kirorus Thank you for sharing your finding and already providing a fix via a PR. PS: I used the opportunity to fix the tracing category in the file too :). Hope that is OK for you. |
Summary
Fixes #2057.
mappingTypeToInt()andmappingTypeToStr()identify ID 1 asmulticolor_mean_squaredand ID 2 asunicolor_mean, but bothprocess()template overloads call the opposite algorithms.This PR corrects the four algorithm calls:
getMeanSqrtLedColor()(per-LED RMS).getUniLedColor()(whole-image arithmetic mean repeated on all LEDs).Mapping names, numeric IDs, JSON schemas, API conversions, LED coordinates, black-border processing, and pixel averaging implementations are not changed.
Adds a small Python standard-library source-contract regression test covering all seven names, their stable IDs/reverse conversions, and the algorithm selections in both overloads. It intentionally does not claim to test pixel arithmetic or instantiate a native Qt daemon.
What kind of change does this PR introduce?
If changing the UI of web configuration, please provide the before/after screenshot:
Not applicable: no UI change.
Does this PR introduce a breaking change?
No configuration schema or public API change. The two affected selections now perform their advertised algorithms. Users who intentionally selected the opposite label as a workaround will need to choose the correctly named mode after updating.
The PR fulfills these requirements:
If adding a new feature, the PR's description includes:
Not applicable: this is a dispatch bugfix, not a new feature.
PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD
Other information:
Verification
python3 test/test_image_processor_mapping.py -v: 2 tests pass, with algorithm checks for all seven named modes in both overloads.masterimplementation fails for bothmulticolor_mean_squaredandunicolor_mean; stable name/ID round-trips pass. This establishes that the regression test catches the original mismatch.git diff --check: passes.c++ -std=c++17 -Wall -Wextra -Werror -O2, using test doubles for Qt containers/logging, setup/border handling, and LED routines that report which algorithm was invoked. 26 checks / 4 failures on unmodified master; 26 checks / 0 failures with this fix. This is only dispatch validation, not a full Hyperion build or RGB calculation test.The standalone source-contract test can be run with Python 3 from the repository root using the command above; it is not wired into the existing native test runner.
Validation limits
A full native Qt/Hyperion build was not run locally because the review host lacks CMake and Qt development packages. Repository CI and maintainer review are still needed. The patched daemon has not been installed or tested against real LED hardware. The live 2.2.1 observation and ordinary-mean workaround are documented separately in #2057; there is no claim of an already-deployed fix.