circuitpython/supervisor/shared
Jeff Epler 40ab5c6b21 compression: Implement ciscorn's dictionary approach
Massive savings.  Thanks so much @ciscorn for providing the initial
code for choosing the dictionary.

This adds a bit of time to the build, both to find the dictionary
but also because (for reasons I don't fully understand), the binary
search in the compress() function no longer worked and had to be
replaced with a linear search.

I think this is because the intended invariant is that for codebook
entries that encode to the same number of bits, the entries are ordered
in ascending value.  However, I mis-placed the transition from "words"
to "byte/char values" so the codebook entries for words are in word-order
rather than their code order.

Because this price is only paid at build time, I didn't care to determine
exactly where the correct fix was.

I also commented out a line to produce the "estimated total memory size"
-- at least on the unix build with TRANSLATION=ja, this led to a build
time KeyError trying to compute the codebook size for all the strings.
I think this occurs because some single unicode code point ('ァ') is
no longer present as itself in the compressed strings, due to always
being replaced by a word.

As promised, this seems to save hundreds of bytes in the German translation
on the trinket m0.

Testing performed:
 - built trinket_m0 in several languages
 - built and ran unix port in several languages (en, de_DE, ja) and ran
   simple error-producing codes like ./micropython -c '1/0'
2020-09-12 10:10:45 -05:00
..
external_flash Add license to some obvious files. 2020-07-06 19:16:25 +01:00
usb Merge pull request #3225 from hathach/improve-highspeed-usb 2020-07-30 07:15:20 -05:00
autoreload.c Updates based on feedback from jepler 2020-04-06 16:03:31 -07:00
autoreload.h Refine _bleio 2019-10-21 18:57:03 -07:00
background_callback.c background callbacks: Clear any callbacks that were queued 2020-07-20 08:44:39 -05:00
bluetooth.c wip: advertising; not tested 2020-07-12 19:45:23 -04:00
bluetooth.h wip: compiles 2020-08-02 11:36:38 -04:00
board.c pygamer and pybadge boards were not resetting neopixels 2020-01-24 09:32:28 -05:00
board.h reset NeoPixels on CPB on soft reload 2020-01-23 20:16:31 -05:00
display.c supervisor: Always allocate at least a 1x1 terminal 2020-09-01 10:55:45 -05:00
display.h Turn off terminalio for ja and ko 2020-08-17 17:17:59 -07:00
filesystem.c Allow drive name to be set per target, with fallback to pre-existing behaviour 2020-02-12 11:09:48 +00:00
flash.c flash: Correctly signal error on invalid flash read 2020-06-22 10:24:21 -05:00
internal_flash.h Hopefully fix flash flush and hopefully audio as well. 2020-03-13 11:12:31 -07:00
memory.c Initial ESP32S2 port. 2020-05-15 15:36:16 -07:00
micropython.c supervisor: use mp_handle_pending to check for exceptions 2020-08-23 09:12:01 -05:00
rgb_led_colors.h Reduce DotStar status brightness; macros for status colors 2019-11-01 13:37:36 -04:00
rgb_led_status.c Fix RGB LED use 2020-08-24 18:29:50 -07:00
rgb_led_status.h Disable bitbangio on Itsy M0 2019-08-27 15:21:47 -07:00
safe_mode.c Fix heap without PSRAM. Never set heap_size. 2020-09-08 17:06:09 -07:00
safe_mode.h Fix heap without PSRAM. Never set heap_size. 2020-09-08 17:06:09 -07:00
serial.c Turn off terminalio for ja and ko 2020-08-17 17:17:59 -07:00
stack.c Initial ESP32S2 port. 2020-05-15 15:36:16 -07:00
stack.h Initial ESP32S2 port. 2020-05-15 15:36:16 -07:00
status_leds.c Add feature conditionals and clean up 2019-07-22 12:58:28 -04:00
status_leds.h Move atmel-samd to tinyusb and support nRF flash. 2018-11-08 17:25:30 -08:00
tick.c merge from upstream 2020-08-30 14:39:03 -04:00
tick.h supervisor: factor supervisor_background_tasks from sundry ports 2020-07-15 11:49:44 -05:00
translate.c compression: Implement ciscorn's dictionary approach 2020-09-12 10:10:45 -05:00
translate.h translations: document the compressed format 2020-05-28 11:30:46 -05:00