Skip to content

Debounce MMCE interactive art enqueue and coalesce pending targets#31

Merged
NathanNeurotic merged 1 commit into
masterfrom
codex/implement-mmce-interactive-request-optimizations
May 1, 2026
Merged

Debounce MMCE interactive art enqueue and coalesce pending targets#31
NathanNeurotic merged 1 commit into
masterfrom
codex/implement-mmce-interactive-request-optimizations

Conversation

@NathanNeurotic
Copy link
Copy Markdown
Owner

Motivation

  • Reduce interactive art request churn in MMCE mode caused by per-frame selection changes and repeated requeues while a previous title's MMCE load is still in flight.
  • Ensure queued MMCE interactive requests are coalesced by the stable startup key so only the intended newest target is kept.
  • Preserve existing texture cleanup and displaced-texture behavior unless leak evidence appears.

Description

  • Added a short MMCE-only debounce window (CACHE_MMCE_INTERACTIVE_DEBOUNCE) and tracking state (gMmceInteractiveDebounceUntilFrame, gMmceInteractiveDebounceValue) to delay enqueueing interactive MMCE requests for a few frames after a selection change, wired into cacheGetTextureInternal to gate interactive enqueue. (src/texcache.c)
  • Implemented coalescing helpers that detect queued MMCE requests with the same startup value and drop queued MMCE requests for different values: cacheHasQueuedInteractiveMmceValueLocked, cacheDropQueuedInteractiveMmceDifferentValueLocked, and cacheShouldDebounceMmceInteractiveLocked. (src/texcache.c)
  • Prevent reentrant MMCE churn by: dropping older queued MMCE interactive requests for different titles when a new title is selected, and when an MMCE interactive load is active, avoiding enqueueing replacements every frame if the newest target is already pending. (src/texcache.c)
  • Left existing texture release/cleanup logic (cacheReleaseTexture, displaced texture handling, request cleanup/abort paths) unchanged. (src/texcache.c)
  • Reviewed cacheAbortMmceImageLoadsTimed usage; confirmed the notable callsite in mmceLaunchGame remains a transition-time abort and was not altered. (src/mmcesupport.c)

Testing

  • Attempted a full build with make -j2, which failed in this environment due to missing generated language source files (lng_src/Albanian.yml, lng_src/English.yml), so a complete build/test could not be completed here. (failure)
  • Performed local code inspection and exercised the cache enqueue/dequeue logic paths with rg/sed/nl to verify inserted functions are called from the interactive enqueue flow and that existing request cleanup/abort paths remain intact. (inspection)

Codex Task

Add a short MMCE-only selection-change debounce window and tighten queue handling so interactive requests do not churn while an older MMCE title is still loading. Requests now collapse to the newest startup key, preventing repeated requeues each frame without altering existing texture release/displaced-texture cleanup behavior.
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@NathanNeurotic NathanNeurotic merged commit 939a0ad into master May 1, 2026
10 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant