Skip to content

fix(agc): hold flip behind worker - #2666

Merged
2 commits merged into
boykopovar:mainfrom
sridhar777911:fix/agc-hold-flip-behind-worker
Oct 10, 2026
Merged

2 commits merged into
boykopovar:mainfrom
sridhar777911:fix/agc-hold-flip-behind-worker

Conversation

@sridhar777911

Copy link
Copy Markdown

Description

This PR safely resubmits PR #1745 which was previously closed due to administrative/conventions issues initially, now resolved.

What

A title that paces itself on pending flips can get further ahead of the queue 0 worker than its per-frame memory allows, and the worker then records a frame from memory the title has already rewritten.
A submission on queue 0 that carries a flip now waits until the worker has reached the flip of every earlier one. The wait ends early when queue 0 is blocked on memory that no running, held or pending work writes, the criterion orderReleased uses, since only the title can end that wait.

Tested

Windows 11, RTX 5070 Ti, Astro Bot (PPSA21564, 01.007.000), built from b3fcd6d (an older main) with this change. 45 s runs through the intro.

Checklist

  • Tested with ctest
  • Checked with tools/check_conventions.py
  • No inline comments

AymanFE and others added 2 commits October 10, 2026 22:58
…evious one

A title that paces itself on pending flips assumes what hardware gives it:
the command processor consumes a submitted buffer at once, so a pending flip
is a frame whose commands have been read and that only waits for the display.
The queue worker is slower than that. With three flips pending it can still be
recording the oldest frame while the title rewrites that frame's slot of a
three-deep ring of per-frame memory for the frame after next, and the draws
are then recorded with the later frame's (or half-written) constants.

A submission on queue 0 that carries a flip now waits until the worker has
reached the flip of every earlier one. The wait ends early when queue 0 is
blocked on memory that no running or pending work writes, since only the
title can end that wait. APS5_NO_FLIP_HOLD=1 submits as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MPYE7P9ob12aAE1H4JtHF
The hold no longer polls every millisecond and has no switch to turn it
off. A held submission waits on the driver's condition variable until no
flip is ahead of it, or until queue 0 waits for memory that only the
title can store. The queue 0 worker reports the second case from its
memory and rewind waits, and the worker that reaches a flip wakes the
holders.

agc_driver_flip_tests: a flip held behind a rendering wait is released
when the worker goes on to wait for a label only the title stores, with
no further submission.
@sridhar777911
sridhar777911 changed the base branch from ci/reject-newcomers-pr-task to main October 10, 2026 10:29
@github-actions github-actions Bot added the agc libSceAgc* label Oct 10, 2026
@oneandonlydean oneandonlydean closed this pull request by merging all changes into boykopovar:main in 2ba993a Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants