Trying to track down a pernicious bug that appears to make no sense.
Given two CRGBArrays that are (currently) 120 LEDs long each, named “leds” and “actual”, the code applies changes to leds, remaps leds[] to actual[], and then displays actual[].
In an effort to reduce memory consumption, I attempted to use actual[] as a scratch space instead, remapping one 12-LED segment of leds[] to actual[] with the shuffling, then moving actual[] back to leds[] in order over the original segment of leds[] that was shuffled into actual[].
When the re-move from actual[] to leds[] occurs, BOTH arrays end up with corrupted data. This is despite the fact that actual[] is not modified in the extra step, but its data is corrupted when sent out to the physical LEDs instead of leds[]. If the shift back is not present, actual[] has expected data in the first 12 addresses, and of course leds[] has the pre-remapped data. If actual[0] through actual[11] get assigned back to the leds[] section that they originally came from (in a different order) using a basic leds[i] = actual[locali] (where i is a running count of the leds[] position and locali resets to run 0-11 each segment), both actual and the segment it was copied to show unexpected behavior.
When “corrupted”, the behavior gets very odd:
A pattern that should run from 0-11 and then repeat, using a beat() at 10 BPM (so relatively slow) with a fade(200) running against the whole set 100 times a second outside and separate from the remapping ends up with the initially-set LED apparently accurate, then skip one LED, apply a partial fade to the third, skip, apply fade to the fifth, , skip, apply fade to the 7th, and then everything else is out. The 100 fade() functions per second don’t appear to be taking effect at all.
Spitting out diagnostic information over serial, all of the values going into the array positions are correct.
The only thing that anybody has been able to figure is that multiple CRGBArray arrays may not be fully copy/assignment safe back and forth. Is this the case? Failing at that futile grasp for answers, does anybody have any other insights?