Files
gen1recomp/tests/engine
Shane McGovern 7e2307f58c Use spare CPU cores to remove in-game hitches on low-power devices (#2872)
* Use spare CPU cores to remove in-game hitches on low-power devices

Per-frame game logic and drawing are cheap; the remaining stalls on
low-power handhelds are one-off main-thread hitches from chip SFX/cry
synthesis, RED++ atlas recolouring, image decodes and the require shim.
Move those onto background threads, each with a synchronous fallback so
behaviour is identical when threads are unavailable (POKEPORT_NO_THREAD=1,
no love.thread, worker failure).

Also adds an F3 frame-time overlay and POKEPORT_GAME_PROF headless
profiling to measure these costs.

* Address code review: shared WorkerLane, F3 gating, decode/epoch fixes

- Extract src/core/WorkerLane.lua (worker lifecycle, prioritised lanes,
  per-lane epochs, bounded LRU) and rebuild the SFX and atlas/decode
  prefetchers on it
- Keep decoded sprite sheets in every colour mode (the OBJ palette bake
  re-reads them), skip oversized decodes, and let palette changes drop
  only atlas bakes
- Only bump the SFX render epoch when the channel mix actually changes
- F3 overlay toggle no longer steals the key from rebinding screens or
  player bindings; profilers stop only when a quit really proceeds
- Require fast path: test hook instead of a hot-path counter
- Shared tests/drivers/perf_util.lua; drivers restore their patches

* WorkerLane: no budget leak on duplicate sends, keep priority on requeue

- Lane:pump only counts a job against the in-flight budget once per key
- requeueInflight puts entries back at the head of their own queue, so
  background hints no longer overtake front requests after a bump
- shutdown() keeps a fatally failed worker off
- Hiding the F3 overlay logs one summary line instead of a full block

* F3 overlay: last-120-frame stats, font-sized box, scale on large screens

* Prefetch: skip useless hints, no main-thread fallback, mix check vs worker config

- Don't queue decodes for sprite sheets whose Image and OBJ bake are cached
- Atlas hint is dropped (sync bake at build time) when the worker can't
  decode the tileset itself, instead of decoding on the main thread
- SFX epoch bump compares the live mix with what the worker was last
  configured with, replacing the load-time snapshot

* Sprite decode skip: raw-path cache check, never under RED++

* Gen 2 battles prefetch both parties' cries; sprite skip keyed by raw path

* Prefetch: skip cached tilesets outside RED++, log hint failures once

* Profiler: bench survives F3 hide, frame total excludes vsync; safer SFX pump, ordered requeue, tileset skip respects pending variants

* Profiler counts GPU stalls in present; water void-fill keeps tileset hint; README + test coverage

* Profiler vsync cap: measured cadence via RefreshRate, no per-frame allocation

* Use upstream's chip-worker prewarm for SFX/cries; drop our separate SFX worker

Our extra coverage (Gen 1 common SFX + party cries, both parties' battle
cries, lead move sounds, hit and battle SFX, Gen 2 bench cries) now goes
through ChipAudio.prewarmSfx/prewarmCry and a new Sound.prewarmMove.

* Skip decode hints for composed assets; share move cache key; drop dead demoteAll

* Drop dev-only profiling extras: POKEPORT_JITP hook and perf drivers

* README: name the worker threads POKEPORT_JIT leaves alone

* Profiler: count the pre-present vblank wait as present, log on NX quit

- time PresentSync.waitBeforePresent as "present" (the X11 GLX vblank wait
  lands there), so it is excluded like the wait inside present
- NX quit now emits the PROF summary / overlay line too
- love.quit's scripted check reads FrameProfiler.benchRequested, so
  POKEPORT_GAME_PROF=0 no longer counts as a bench run
- prefetchAtlas skips composed tileset sheets (Assets.isComposed)
- hit sounds defined once in EffectRegistry.HIT_SOUNDS, shared with the
  battle prewarm (each hit still gets its own copy)
- drop redundant obpPaths, dead FrameProfiler.visible and the unused
  Lane:bump requeue mode; restore applyOptions' doc comment
2026-10-12 08:38:45 +01:00
..
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-05 05:07:42 -04:00
2026-08-18 09:51:22 -04:00
2026-10-06 11:00:16 -04:00
2026-10-06 11:00:16 -04:00
2026-10-06 11:00:16 -04:00
2026-10-07 17:02:29 -04:00
2026-10-07 09:14:37 -04:00
2026-08-18 09:20:07 -04:00
2026-08-18 09:20:07 -04:00
2026-08-18 09:20:07 -04:00
2026-10-02 15:19:41 -04:00
2026-08-24 07:52:05 -04:00
2026-08-24 07:52:05 -04:00
2026-08-24 07:52:05 -04:00
2026-08-24 09:02:56 -04:00
2026-09-24 05:17:32 -04:00
2026-08-31 08:41:02 -04:00
2026-07-19 16:18:18 -04:00
2026-09-02 10:02:32 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-09-11 09:11:34 -04:00
2026-10-02 09:48:20 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-30 15:47:06 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-10-07 09:14:37 -04:00
2026-09-22 17:05:12 -04:00
2026-09-22 17:05:12 -04:00
2026-09-23 11:58:32 -04:00
2026-09-23 11:58:32 -04:00
2026-09-21 11:14:17 -04:00
2026-09-28 20:37:29 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-28 06:45:52 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-28 20:37:29 -04:00
2026-10-11 11:03:34 -04:00
2026-09-23 11:58:32 -04:00
2026-09-22 17:05:12 -04:00
2026-09-22 17:05:12 -04:00
2026-09-22 17:05:12 -04:00
2026-09-23 11:58:32 -04:00
2026-09-23 11:58:32 -04:00
2026-09-23 11:58:32 -04:00
2026-09-27 16:07:31 -04:00
2026-09-22 17:05:12 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-22 17:05:12 -04:00
2026-09-27 16:07:31 -04:00
2026-09-22 17:05:12 -04:00
2026-09-27 16:07:31 -04:00
2026-09-22 17:05:12 -04:00
2026-09-22 17:05:12 -04:00
2026-09-23 11:58:32 -04:00
2026-09-22 17:05:12 -04:00
2026-10-11 11:03:34 -04:00
2026-10-07 09:14:37 -04:00
2026-10-07 09:14:37 -04:00
2026-10-07 09:14:37 -04:00
2026-10-07 09:14:37 -04:00
2026-10-07 09:14:37 -04:00
2026-09-27 16:07:31 -04:00
2026-09-27 16:07:31 -04:00
2026-09-22 17:05:12 -04:00
2026-09-27 16:07:31 -04:00
2026-09-24 08:39:43 -04:00
2026-09-28 06:45:52 -04:00
2026-09-27 16:07:31 -04:00
2026-09-28 09:13:34 -04:00
2026-09-22 17:05:12 -04:00
2026-09-22 17:05:12 -04:00
2026-07-19 16:18:18 -04:00
2026-08-28 10:14:44 -04:00
2026-09-23 11:58:32 -04:00
2026-08-11 11:53:30 -04:00
2026-09-23 11:58:32 -04:00
2026-07-19 16:18:18 -04:00
2026-09-18 15:42:32 -04:00
2026-07-19 16:18:18 -04:00
2026-10-06 19:45:14 -04:00
2026-08-28 10:14:44 -04:00
2026-10-01 17:30:52 -04:00
2026-09-25 14:20:34 -04:00
2026-08-31 07:56:27 -04:00
2026-10-06 19:45:14 -04:00
2026-10-01 17:30:52 -04:00
2026-10-01 17:30:52 -04:00
2026-10-01 17:30:52 -04:00
2026-09-11 09:11:34 -04:00
2026-10-06 19:45:14 -04:00
2026-10-01 17:30:52 -04:00
2026-09-18 15:42:32 -04:00
2026-08-06 09:57:31 -04:00
2026-10-06 19:45:14 -04:00
2026-10-06 19:45:14 -04:00
2026-09-24 08:39:43 -04:00
2026-07-30 11:35:57 -04:00
2026-08-28 10:14:44 -04:00
2026-09-09 12:23:55 -04:00
2026-08-25 09:21:33 -04:00
2026-09-22 11:44:50 -04:00
2026-10-02 11:36:59 -04:00
2026-10-07 09:14:37 -04:00
2026-08-21 14:03:25 -04:00
2026-08-24 07:52:05 -04:00
2026-09-24 08:39:43 -04:00
2026-10-02 15:19:41 -04:00
2026-09-22 11:44:50 -04:00
2026-09-24 05:17:32 -04:00
2026-09-03 07:11:31 -04:00
2026-10-07 09:14:37 -04:00
2026-09-16 16:42:59 -04:00
2026-09-29 13:30:13 -04:00
2026-08-18 11:29:50 -04:00
2026-09-23 11:58:32 -04:00
2026-08-18 09:51:22 -04:00
2026-08-10 14:27:00 -04:00
2026-08-28 10:14:44 -04:00
2026-08-28 10:14:44 -04:00
2026-08-28 10:14:44 -04:00
2026-09-24 05:17:32 -04:00
2026-08-28 10:14:44 -04:00
2026-09-25 14:20:34 -04:00
2026-08-26 12:04:06 -04:00
2026-09-29 13:30:13 -04:00
2026-09-29 13:30:13 -04:00
2026-07-25 15:21:49 -04:00
2026-07-25 15:21:49 -04:00
2026-08-24 07:52:05 -04:00
2026-09-23 11:58:32 -04:00
2026-09-29 16:00:57 -04:00
2026-10-02 13:58:59 -04:00
2026-08-11 16:55:06 +02:00
2026-10-07 17:02:29 -04:00
2026-10-06 17:26:40 -04:00
2026-08-24 13:07:11 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 09:14:37 -04:00
2026-10-07 09:14:37 -04:00
2026-10-07 17:02:29 -04:00
2026-10-07 09:14:37 -04:00
2026-10-07 19:07:05 -04:00
2026-10-01 17:30:52 -04:00
2026-10-06 19:45:14 -04:00
2026-10-07 14:31:38 -04:00
2026-10-01 17:30:52 -04:00
2026-10-06 19:45:14 -04:00
2026-09-23 11:58:32 -04:00
2026-09-23 11:58:32 -04:00
2026-10-06 17:26:40 -04:00
2026-08-19 06:41:10 -04:00
2026-08-21 16:36:55 -04:00
2026-08-21 14:38:54 -04:00
2026-08-21 16:36:55 -04:00
2026-09-25 14:20:34 -04:00
2026-09-16 16:42:59 -04:00
2026-10-06 19:45:14 -04:00
2026-10-06 17:26:40 -04:00
2026-08-20 20:36:23 -04:00
2026-09-09 09:46:27 -04:00
2026-09-25 11:12:10 -04:00
2026-09-09 09:46:27 -04:00
2026-10-07 17:02:29 -04:00
2026-10-06 19:45:14 -04:00
2026-08-20 20:07:10 -04:00
2026-07-31 10:45:12 -04:00
2026-08-14 17:07:06 -04:00
2026-08-20 20:07:10 -04:00
2026-08-26 12:04:06 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 17:02:29 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 17:02:29 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 17:02:29 -04:00
2026-10-02 11:36:59 -04:00
2026-10-02 13:58:59 -04:00
2026-10-08 05:46:19 -04:00
2026-10-06 19:45:14 -04:00
2026-09-24 08:39:43 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-07 14:31:38 -04:00
2026-10-10 07:34:17 -04:00
2026-10-07 14:31:38 -04:00