Skip to content

Remove MMCE one-at-a-time blocking throttle in art loader#11

Merged
NathanNeurotic merged 4 commits intoincebtion-round-fourfrom
copilot/improve-mmce-art-performance
Mar 19, 2026
Merged

Remove MMCE one-at-a-time blocking throttle in art loader#11
NathanNeurotic merged 4 commits intoincebtion-round-fourfrom
copilot/improve-mmce-art-performance

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 19, 2026

MMCE art almost never popped in and navigation felt clogged. The root cause: a blocking guard in cacheGetTextureInternal prevented BG and SCR from queuing until COV fully finished loading — a slow or missing COV (open() failure on MMCE can take 100–500 ms) stalled all subsequent art types, and an extra render-frame dead gap separated each type.

Changes

  • Removed the cacheHasActiveInteractiveModeLocked + cacheHasQueuedInteractiveModeLocked blocking guard from the MMCE throttle block in cacheGetTextureInternal
// Before — BG/SCR blocked until COV fully loaded:
if ((cacheHasActiveInteractiveModeLocked(MMCE_MODE) && !gArtCurrentReq->abortRequested) ||
    cacheHasQueuedInteractiveModeLocked(MMCE_MODE)) {
    cacheUnlock();
    return NULL;
}

// After — removed; all three art types pre-queue together
  • Kept the game-change drop (drop a stale queued request when the game changes) as a safety net, with an explanatory comment
  • The 1-frame COV head-start delay (from prior commit) remains, so COV still queues on frame 8 and BG/SCR on frame 9
  • The art thread is already single-threaded FIFO — it serializes COV → BG → SCR in queue order with no extra mechanism needed; cacheAdvanceGeneration() on navigation drops all queued requests at once and handles abort/discard via generation tracking

Copilot AI and others added 4 commits March 19, 2026 12:19
Use cacheAdvanceGenerationPreservePrefetch() for MMCE mode in both
menuInvalidateArtSelection and menuAdvanceArtSelectionOnMove.

Previously each navigation step (scroll within MMCE list or device
switch) called cacheAdvanceGeneration() which downgrades ALL
CACHE_ENTRY_READY/PRIMED entries to DISPLAYABLE.  For MMCE this
prevented surviving art from being pre-uploaded to VRAM via
cachePrimeReadyTexture, causing a first-draw stall on the 3rd pass
after returning from another device.

cacheAdvanceGenerationPreservePrefetch() still aborts in-flight MMCE
IO, drops queued MMCE requests, and advances the generation.  The only
difference is READY/PRIMED entries are preserved so cachePrimeReadyTexture
can upload them to VRAM during idle time before they are needed.

Co-authored-by: NathanNeurotic <109461996+NathanNeurotic@users.noreply.github.com>
… worse)

Co-authored-by: NathanNeurotic <109461996+NathanNeurotic@users.noreply.github.com>
Co-authored-by: NathanNeurotic <109461996+NathanNeurotic@users.noreply.github.com>
…queue together

The `cacheHasActiveInteractiveModeLocked` + `cacheHasQueuedInteractiveModeLocked`
guard in cacheGetTextureInternal prevented BG and SCR art from queuing until the
active MMCE request (typically COV) fully finished loading.  This added a dead
render-frame gap between each art type and meant a slow or missing COV file held
up all subsequent art.

The art thread already processes requests one-at-a-time (FIFO) so the serial
constraint existed only in the queue submission, not execution.  With the 1-frame
COV head-start delay still in place, COV queues on frame 8 and BG/SCR on frame 9;
the art thread then loads them in that order without any extra render-frame waits.
On navigation cacheAdvanceGeneration() drops all queued requests and signals abort
on the active one — generation tracking discards stale completions correctly.

The game-change drop (drop queued request for a different game) is kept as a
safety net with an explanatory comment.

Co-authored-by: NathanNeurotic <109461996+NathanNeurotic@users.noreply.github.com>
@NathanNeurotic NathanNeurotic marked this pull request as ready for review March 19, 2026 16:45
@NathanNeurotic NathanNeurotic merged commit 6002f57 into incebtion-round-four Mar 19, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants