You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
koreader/spec/unit
NiLuJe 6d53f83286
The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415)
* ReaderDictionary: Port delay computations to TimeVal
* ReaderHighlight: Port delay computations to TimeVal
* ReaderView: Port delay computations to TimeVal
* Android: Reset gesture detection state on APP_CMD_TERM_WINDOW.
  This prevents potentially being stuck in bogus gesture states when switching apps.
* GestureDetector:
  * Port delay computations to TimeVal
  * Fixed delay computations to handle time warps (large and negative deltas).
  * Simplified timed callback handling to invalidate timers much earlier, preventing accumulating useless timers that no longer have any chance of ever detecting a gesture.
  * Fixed state clearing to handle the actual effective slots, instead of hard-coding slot 0 & slot 1.
  * Simplified timed callback handling in general, and added support for a timerfd backend for better performance and accuracy.
  * The improved timed callback handling allows us to detect and honor (as much as possible) the three possible clock sources usable by Linux evdev events.
    The only case where synthetic timestamps are used (and that only to handle timed callbacks) is limited to non-timerfd platforms where input events use
    a clock source that is *NOT* MONOTONIC.
    AFAICT, that's pretty much... PocketBook, and that's it?
* Input:
  * Use the <linux/input.h> FFI module instead of re-declaring every constant
  * Fixed (verbose) debug logging of input events to actually translate said constants properly.
  * Completely reset gesture detection state on suspend. This should prevent bogus gesture detection on resume.
  * Refactored the waitEvent loop to make it easier to comprehend (hopefully) and much more efficient.
    Of specific note, it no longer does a crazy select spam every 100µs, instead computing and relying on sane timeouts,
    as afforded by switching the UI event/input loop to the MONOTONIC time base, and the refactored timed callbacks in GestureDetector.
* reMarkable: Stopped enforcing synthetic timestamps on input events, as it should no longer be necessary.
* TimeVal:
  * Refactored and simplified, especially as far as metamethods are concerned (based on <bsd/sys/time.h>).
  * Added a host of new methods to query the various POSIX clock sources, and made :now default to MONOTONIC.
  * Removed the debug guard in __sub, as time going backwards can be a perfectly normal occurrence.
  * New methods:
    * Clock sources: :realtime, :monotonic, :monotonic_coarse, :realtime_coarse, :boottime
    * Utility: :tonumber, :tousecs, :tomsecs, :fromnumber, :isPositive, :isZero
* UIManager:
  * Ported event loop & scheduling to TimeVal, and switched to the MONOTONIC time base.
    This ensures reliable and consistent scheduling, as time is ensured never to go backwards.
  * Added a :getTime() method, that returns a cached TimeVal:now(), updated at the top of every UI frame.
    It's used throughout the codebase to cadge a syscall in circumstances where we are guaranteed that a syscall would return a mostly identical value,
    because very few time has passed.
    The only code left that does live syscalls does it because it's actually necessary for accuracy,
    and the only code left that does that in a REALTIME time base is code that *actually* deals with calendar time (e.g., Statistics).
* DictQuickLookup: Port delay computations to TimeVal
* FootNoteWidget: Port delay computations to TimeVal
* HTMLBoxWidget: Port delay computations to TimeVal
* Notification: Port delay computations to TimeVal
* TextBoxWidget: Port delay computations to TimeVal
* AutoSuspend: Port to TimeVal
* AutoTurn:
  * Fix it so that settings are actually honored.
  * Port to TimeVal
* BackgroundRunner: Port to TimeVal
* Calibre: Port benchmarking code to TimeVal
* BookInfoManager: Removed unnecessary yield in the metadata extraction subprocess now that subprocesses get scheduled properly.

* All in all, these changes reduced the CPU cost of a single tap by a factor of ten (!), and got rid of an insane amount of weird poll/wakeup cycles that must have been hell on CPU schedulers and batteries..
3 years ago
..
autofrontlight_spec.lua LuaSettings: Add a method to initialize a setting properly (#7371) 3 years ago
autosuspend_spec.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
background_runner_spec.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
background_task_plugin_spec.lua Tame BackgroundRunner: stop running when no more job (#6605) 4 years ago
batterystat_spec.lua Battery stats plugin: fix and improvements (#5626) 5 years ago
benchmark.lua Travis: run luacheck on unit tests (#3059) 7 years ago
cache_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
commonrequire.lua Tame BackgroundRunner: stop running when no more job (#6605) 4 years ago
dbg_spec.lua dbg_spec: setVerbose test 7 years ago
defaults_spec.lua Update UI layout code to use new SVG icons 4 years ago
depgraph_spec.lua Tame a few tests that relied on `pairs` being somewhat deterministic (#6371) 4 years ago
device_spec.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
docsettings_spec.lua Use fsync() for more robust setting files saving 5 years ago
document_registry_spec.lua Tests: make sure files are deleted (#6323) 4 years ago
document_spec.lua Update bundled fonts (#6242) 4 years ago
eink_optimization_spec.lua move e-ink related settings to a submenu (#4246) 6 years ago
evernote_plugin_main_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
filemanager_spec.lua Allow running shell scripts from the FileManager/Favorites (#5804) 4 years ago
filemanagerconverter_spec.lua Update UI layout code to use new SVG icons 4 years ago
focusmanager_spec.lua [FocusManager] More intuitive key navigation + spec (#3774) 6 years ago
font_spec.lua dbg(add): guard method to toggle assert at based at runtimemode 8 years ago
frontlight_spec.lua Slightly less crappy Nightmode (#4871) 5 years ago
gesturedetector_spec.lua Pocketbook: Implement HW screen rotation, bring in PB specific kludges from linuxfb (#6684) 4 years ago
gesturerange_spec.lua test(chore): remove side effects 7 years ago
gettext_spec.lua [i18n] GetText: ignore fuzzy strings (#5807) 4 years ago
hook_container_spec.lua Move kobo auto-suspension logic out of UIManager (#2933) 7 years ago
httpclient_spec.lua Travis: run luacheck on unit tests (#3059) 7 years ago
imagewidget_spec.lua Update UI layout code to use new SVG icons 4 years ago
input_spec.lua [spec] Input test stub (#3701) 6 years ago
inputtext_spec.lua [feat] Add ReaderBack (#3821) 6 years ago
koptinterface_spec.lua [spec] Replace custom assert[Not]AlmostEquals with assert.is[_not].near (#3885) 6 years ago
kosync_spec.lua [doc] Tag @todo, @fixme and @warning (#5244) 5 years ago
luadata_spec.lua LuaSettings: Add a method to initialize a setting properly (#7371) 3 years ago
luasettings_spec.lua LuaSettings: Add a method to initialize a setting properly (#7371) 3 years ago
menu_table_screen_color_spec.lua chore: add test for screen color toggle 5 years ago
menusorter_spec.lua Tame a few tests that relied on `pairs` being somewhat deterministic (#6371) 4 years ago
mock_time.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
mock_time_spec.lua Travis: run luacheck on unit tests (#3059) 7 years ago
network_manager_spec.lua [chore] Some Wi-Fi tweaks (#4564) 5 years ago
networksetting_spec.lua Various Wi-Fi QoL improvements (#6424) 4 years ago
nickel_conf_spec.lua [fix, Kobo] Don't crash trying to sync frontlight with Nickel. (#5361) 5 years ago
opds_spec.lua Screensaver: Fix a fallback snafu (#7397) 3 years ago
optmath_spec.lua [spec] Test all aspects of Math module (#3683) 6 years ago
persist_spec.lua add table persistence module 3 years ago
quickstart_spec.lua quickstart fix (#2804) 7 years ago
random_spec.lua Update KOSyncClient 8 years ago
readerbookmark_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readerdictionary_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readerfooter_spec.lua ReaderFooter: Fix some interactions between margins and text width (#7391) 3 years ago
readerhighlight_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readerlink_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readerpaging_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readerrolling_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readersearch_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readertoc_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readerui_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readerview_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
readhistory_spec.lua LuaSettings: Add a method to initialize a setting properly (#7371) 3 years ago
screenshoter_spec.lua Prevent Busted from blowing up on cdata finalizers by properly closing 4 years ago
size_spec.lua Added Size module 7 years ago
spore_spec.lua test(chore): remove side effects 7 years ago
switch_plugin_spec.lua SwitchPlugin and BackgroundTaskPlugin with tests (#3137) 7 years ago
textboxwidget_spec.lua TextBoxWidget: use xtext for text shaping 5 years ago
timeval_spec.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
toggleswitch_spec.lua [spec] Add ToggleSwitch spec stub (#5450) 5 years ago
touch_probe_spec.lua Travis: run luacheck on unit tests (#3059) 7 years ago
translator_spec.lua Fix translator, enable selected text translation 6 years ago
uimanager_bench.lua Travis: run luacheck on unit tests (#3059) 7 years ago
uimanager_spec.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
util_spec.lua Address assorted Weblate comments (#7154) 3 years ago
version_spec.lua [spec] Version: slight refactor 6 years ago
wakeupmgr_spec.lua [feat, Kobo] Autoshutdown (#5335) 5 years ago
widget_inputcontainer_spec.lua Tame a few tests that relied on `pairs` being somewhat deterministic (#6371) 4 years ago
widget_menu_spec.lua [fix] Use orderedPairs in touch menu item table (#6404) 4 years ago
widget_progresswidget_spec.lua [travis] Add protection against unscaled sizes 7 years ago
wikipedia_spec.lua Travis: run luacheck on unit tests (#3059) 7 years ago