Skip to content

docs(debt): list sceVideoOutSetFlipRate under unknown function info - #12721

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
JJenkx:windows/docs-videoout-flip-rate-debt
Nov 1, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
JJenkx:windows/docs-videoout-flip-rate-debt

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What

docs/dev/debt/libSceVideoOut.md lists sceVideoOutSetFlipRate under Silent stubs, which CONTRIBUTING.md reserves for functions that do not do what they are supposed to. This one does: Output.cpp stores a rate of 0, 1 or 2 in the port config, VideoOutDriver.cpp copies it into each flip request (request->flipRate = cfg->flipRate), and the flip thread waits until lastFlipVblank + flipRate + 1 vblanks before presenting. That pacing has been there since fd5e236aad (2026-09-14); the entry was added under Silent stubs later, in 76e5edc (#5691), and extended by #10840.

What the entry actually records is unknown behaviour: PPSA13356 passes 60, and whether the console accepts that or returns the error is unverified. This PR moves the entry to Unknown function info and adds that each flip waits for rate + 1 vblanks. The rest of the entry is unchanged.

Tested

Docs only. tools/check_conventions.py passes. Checked the pacing against core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp on main 52c09d567d.

Current Linux qualification — 2026-10-29

Rebased onto main 5454cd2e455 as cce76375502acafaa8707d79e00079c632b0e6a4. The final reviewed SetFlipRate entry is unchanged, and main’s now-merged #11853 flip-master entry is retained exactly after it. Current setter/submission/pacing source still supports the wording; relative source links, conventions and whitespace pass. Documentation only: no production/test files or submodule pointers changed, and no runtime/GPU result is claimed. AI-assisted: yes.

Evidence: immutable Linux qualification bundle. Its SHA-256 is ca6b35926bcc6d3f21a9650517894c86b65594e2e2b653c5c32cd1c1de89c835. No fresh Windows runtime execution is claimed; older measurements retain their recorded source pins.

AI-assisted: yes (Codex).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@oneandonlydean oneandonlydean self-assigned this Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9880 docs/dev/debt/libSceVideoOut.md L12

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 4040 docs/dev/debt/libSceVideoOut.md
PR 6977 docs/dev/debt/libSceVideoOut.md
PR 9432 docs/dev/debt/libSceVideoOut.md
PR 10112 docs/dev/debt/libSceVideoOut.md
PR 12863 docs/dev/debt/libSceVideoOut.md
PR 14212 docs/dev/debt/libSceVideoOut.md

@rooklz rooklz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked against main 2960e9a (VideoOut sources match the 52c09d5 the body cites). Approving. Two wording nits and one merge-order note below.

Claims checked

  • Output.cpp L123-135: a rate outside 0..2 returns VIDEO_OUT_ERROR_INVALID_VALUE, otherwise cfg->flipRate = rate.
  • VideoOutDriver.cpp L189: request->flipRate = cfg->flipRate. In processFlip, L589-600 set interval = flipRate + 1 and target = lastFlipVblank + interval, wait for vblankStatus.count >= target, and then set lastFlipVblank = vblankStatus.count. So "waits until n + 1 vblanks have passed since the previous one" is right.
  • tests/Flip.cpp L552-570 (>= previousVblank + 3 at rate 2) and L771-783 (first flip lastFlipVblank >= 3) already assert this pacing.
  • History: the pacing is in fd5e236aad (back then an out-of-range rate threw). The Silent stubs entry 76e5edcacd came in through #5691 (merge f0a1e3443b, together with a1c56b5, the INVALID_VALUE change), and #10840 (5d92321d8c) extended it. All as the body says.
  • The function does what it is meant to do, so Silent stubs (CONTRIBUTING L10) is the wrong section. What the entry really records is the unverified rate-60 answer, which is Unknown function info.
  • check_conventions --base upstream/main --head passes, git diff --check is clean, both link targets exist at the head, and merge-tree against main is clean.

Nits (optional)

  1. "since the previous one": the first flip after sceVideoOutOpen has no previous flip. lastFlipVblank starts at 0 (VideoOutDriver.hpp L145), so the first flip waits for n + 1 vblanks counted from the port's first vblank. The L783 test asserts exactly this. You could write "since the previous flip, or since the port opened".
  2. The rate is read when the flip is submitted (L189), not when it is presented. A sceVideoOutSetFlipRate call does not change flips already in the queue. Whether the console works the same way is also unmeasured, so this could join the "unverified" sentence.

Merge order: #11853 (ionut27001, flip-master, updated today) rewrites the PPSA29866 flip-master bullet. That bullet is the line directly below the one this PR inserts, so git merge-tree of the two heads (7a2924b vs 7af0c1d) gives a textual conflict at L11-12. The pr-overlap bot also flags this. The resolution keeps both bullets: the SetFlipRate bullet, then #11853's flip-master bullet. Whichever PR merges second needs a one-line rebase.

@JJenkx

JJenkx commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@rooklz thanks for checking the history and the existing Flip.cpp assertions. I took both nits in 52c457567a:

  1. The pacing now counts "since the previous flip, or since the port opened for the first flip", matching lastFlipVblank starting at 0 and the L783 assertion.
  2. The entry says the rate is read when a flip is submitted, so a later call does not change queued flips, and the unverified sentence now also covers whether the console applies a new rate to queued flips.

On #11853: agreed, both bullets stay. Whichever PR merges second needs a one-line rebase putting this bullet before the flip-master one. Conventions pass at the new head.

AI-assisted: yes (Claude Code).

@github-actions github-actions Bot added the docs label Oct 29, 2026

@THEMANnt THEMANnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 52c457567a3250a4fffccf2bc9633f6dcb6cc54d against 52c09d567d2fa453494dd720fcf53a98149468e4. The pinned rate setter accepts 0..2 and the submission path copies that rate into each queued request; the driver uses rate+1 for its vblank interval. The added title-call observation explicitly leaves console acceptance and queued-update behavior unverified. No actionable finding in the documentation change.

Validation: inspected the changed wording and relevant pinned source; relative source links and git diff --check pass. Documentation-only validation: no runtime behavior changed. Author-reported title inventories, console/emulator observations and macOS/physical-GPU measurements were not independently reproduced; this review does not certify those measurements.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
JJenkx and others added 2 commits October 29, 2026 08:47
The entry sat under Silent stubs, but the function is implemented: the
rate it stores sets how many vblanks each flip waits for. What remains
open is whether the console accepts the rate 60 that PPSA13356 passes,
which is unknown function info.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first flip after the port opens has no previous flip, and the rate
is read when a flip is submitted, so queued flips keep their rate.
Whether the console applies a new rate to queued flips is unverified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JJenkx
JJenkx force-pushed the windows/docs-videoout-flip-rate-debt branch from 52c4575 to cce7637 Compare October 29, 2026 12:49
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
@JJenkx

JJenkx commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 5454cd2e455 as cce76375502acafaa8707d79e00079c632b0e6a4. The final reviewed SetFlipRate entry is unchanged, and main’s now-merged #11853 flip-master entry is retained exactly after it. Current setter/submission/pacing source still supports the wording; relative source links, conventions and whitespace pass. Documentation only: no production/test files or submodule pointers changed, and no runtime/GPU result is claimed. AI-assisted: yes.

Evidence: immutable Linux qualification bundle. Its SHA-256 is ca6b35926bcc6d3f21a9650517894c86b65594e2e2b653c5c32cd1c1de89c835. No fresh Windows runtime execution is claimed; older measurements retain their recorded source pins.

@ntamas94

Copy link
Copy Markdown
Contributor

On the open question in this entry (whether the console accepts rate 60 or returns the error) — measured on a PS4 Pro, firmware 10.71, on a main VideoOut port:

setFlipRate(h, -2)         = 0x80290001
setFlipRate(h, -1)         = 0x80290001
setFlipRate(h, 0)          = 0x00000000
setFlipRate(h, 1)          = 0x00000000
setFlipRate(h, 2)          = 0x00000000
setFlipRate(h, 3)          = 0x80290001
setFlipRate(h, 4)          = 0x80290001
setFlipRate(h, 20)         = 0x80290001
setFlipRate(h, 30)         = 0x80290001
setFlipRate(h, 59)         = 0x80290001
setFlipRate(h, 60)         = 0x80290001
setFlipRate(h, 61)         = 0x80290001
setFlipRate(h, 120)        = 0x80290001
setFlipRate(h, 0x7fffffff) = 0x80290001
setFlipRate(999, 0)        = 0x8029000b   (invalid handle)
setFlipRate(-1, 0)         = 0x8029000b

So 60 is rejected with VIDEO_OUT_ERROR_INVALID_VALUE (0x80290001); only 0, 1, 2 are accepted; an invalid handle gives VIDEO_OUT_ERROR_INVALID_HANDLE (0x8029000b).

For the record, the firmware 10.71 sceVideoOutSetFlipRate (vaddr 0xbde0) does not range-check the rate itself: it looks up the port, then calls a DCE driver entry (a function pointer at +0x80 of the object at +8) with the rate and returns what that returns, so the range check and the 0x80290001 live in the DCE driver; a missing driver entry returns 0x8029001b. Probe was a homebrew PRX opening a main VideoOut port (handle is an int, no null pointer to an sce API). Happy to attach the source if useful.

ntamas94 measured sceVideoOutSetFlipRate on a PS4 Pro (firmware
10.71): rate 60 returns VIDEO_OUT_ERROR_INVALID_VALUE, only 0, 1 and
2 are accepted, an unopened handle returns
VIDEO_OUT_ERROR_INVALID_HANDLE, and the range check is in the display
driver the call forwards to. Record it in the entry; the PS5 result
and the effect on queued flips stay unverified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JJenkx

JJenkx commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

@ntamas94 thank you, that answers the open part for the PS4. I've added it to the entry in 9614f3a030. A PS4 Pro (firmware 10.71) also accepts only 0, 1 and 2 and returns VIDEO_OUT_ERROR_INVALID_VALUE for 60, linked to your comment. So PPSA13356's call with 60 gets the same error main returns. The PS5 result, and whether a new rate applies to queued flips, stay listed as unverified. I left out the driver details (the forwarded call at +0x80 and 0x8029001b for a missing driver entry) to keep the entry under the debt length limit, but they're useful context here.

AI-assisted: yes (Claude Code).

@oneandonlydean
oneandonlydean merged commit d097bfb into boykopovar:main Nov 1, 2026
9 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.

5 participants