fix(video): decode movie pictures on a worker #2913

Merged
HumanBean merged 14 commits from omgitsgela/Longshot:fix/movie-decode-worker-main into main 2026-12-01 15:21:57 +00:00
Member

Summary

A movie's pictures were decoded on the thread that has to hand one to the game every 16.7 ms. A 3.2 to 4.0 ms decode, with a worst picture of 94 to 128 ms, therefore sat directly in the Acquire path. On the Deck LCD, two first-minute runs of current main (4908cc6d) without the pack skipped 779 and 495 pictures; with this PR they skipped 59 and 1. The earlier 87045899 base measured 694 and 470 to 13 and 0; the older ec889d9d base measured 532 to 16 in the first minute and 593 to 34 over all 5,947 pictures.

This changes the movie path in three parts:

  1. host/nn_video.c: each decoder owns a native worker. dec_submit copies the compressed packet into an owned packet and wakes the worker; the worker decodes into the existing bounded host-picture ring; dec_acquire only leases a free guest pool, detaches a ready picture, copies, and returns the completed fence. dec_flush, dec_stop and dec_finalize join the worker. Acquire no longer decodes or performs the catch-up decode.
  2. gpu/vk/vk_draw.cpp: the movie upscale pipeline and one dummy dispatch are made at startup, so the first movie frame no longer pays the driver's first-dispatch compile.
  3. gpu/vk/vk_shader.cpp: a program rejected as a network left out on this card is remembered by key in a cache file scoped to the translator, device, matrix limits and relevant profile capabilities. Later runs skip its translation before doing it again. No program keys are hardcoded, and forced trials bypass the cache.

Fixes #73.

Testing

Tested: Steam Deck LCD (AMD Custom GPU 0405, RADV VANGOGH, Vulkan 1.4), current base 4908cc6d, the pack built from fix/movie-decode-worker-main at b41a5cb7, HOS_VIDEO_LOG=1, 1280x800, 60 fps cap, test user copy. The current-base A/B is two interleaved first-minute runs per arm; the stock arm is the same base without the pack. The earlier 87045899 and ec889d9d bases also measured the first minute, and ec889d9d measured the whole 5,947-picture movie.

Both current-base runtimes were given their shader preparation before measurement, so neither arm paid a first-launch preparation in the measured runs. The fix log contains vk: movie upscale pipeline prewarmed: yes and vk: movie upscale dispatch prewarmed: yes.

The five video checks pass on Linux with g++: tests/test_video_worker.py (the real worker with a fake decoder), tests/test_video_catchup.py, tests/test_vcore_video_acquire.py, tests/test_video_input_limit.py (all modes), and tests/test_video_hold_early.py (both modes). The worker test takes the decoder lock for test-thread reads, covers submission, bounded output, EOS, Flush/stop/restart, an overlapping Submit/Flush, the start barrier, timer cleanup and the synchronous fallback when CreateThread fails; it passes ThreadSanitizer. tests/test_short_sleep_timer.py also passes, including the timer close. The legacy fixtures take the HOS_VIDEO_WORKER_OFF path. pre-commit passes on the changed files.

Still to test:

  • Windows: the Media Foundation AV1 path has not run the worker; it shares decode_next but its callback thread affinity needs its own review (by hand, on a Windows PC with an AV1 movie).
  • Other Linux GPUs: run the same opening movie on an AMD discrete card and an Intel GPU, expecting no Acquire stalls and no regression in the non-AV1 movies (by hand or @Beanstalk).

Measurements

Verdict: The worker removes nearly all of the current-base movie skips: 779 and 495 to 59 and 1 in two first-minute runs on the Deck LCD. The earlier 87045899 base measured 694 and 470 to 13 and 0; the older ec889d9d base measured 532 to 16 in the first minute and 593 to 34 over the full 5,947-picture movie.

Setup: Steam Deck LCD, RADV VANGOGH, Vulkan 1.4, 1280x800, 60 fps cap, current base 4908cc6d, test user copy. Both runtimes used the same options file and were prepared warm before the measured runs. Two stock and two fixed first-minute runs were interleaved.

Baseline: current main at 4908cc6d, built without the pack. The stock and fixed arms share that base, so the difference is the pack; the pack was built from b41a5cb7, the final fix head.

Before: main @ 4908cc6d After: this PR @ b41a5cb7
Skipped in the first 60 s, run 1 / run 2 779 / 495 59 / 1
First six skip events, run 1 [9,1,1,1,1,1,9,7] (14) [7,6,1,1,6,1,7,7] (22)
First six skip events, run 2 [2,8,3,1,2,1,1,1] (17) [1] (1)
Skip events, run 1 / run 2 334 / 262 13 / 1
Pictures held, run 1 / run 2 8 / 20 3 / 9
Last picture, run 1 / run 2 60.8 s / 60.87 s 60.87 s / 60.82 s

The earlier 87045899 first-minute runs were 694 and 470 to 13 and 0. The older ec889d9d full-movie run was 593 to 34 skips over all 5,947 pictures. The current-base runs are first-minute measurements; the full-movie number is from that earlier base.

Risks

  • The worker adds one native thread and an owned compressed-packet queue per decoder. The host-picture ring stays at its production MAX_QUEUE of 8 pictures; the worker blocks at the queue limit instead of discarding a picture.
  • dec_flush, dec_stop and dec_finalize now join the worker; a start barrier blocks a replacement until Flush has finished the backend and queue cleanup. The worker releases its thread-local sleep timer. tests/test_video_worker.py covers Flush/stop, restart, an overlapping Submit/Flush and the failed-thread fallback; the full game remains the integration check.
  • The Media Foundation path is not exercised on the Deck. Its callback still calls queue_frame, and the worker life-cycle is shared; it needs a Windows run.
  • The startup cache is written on first use. A fresh install still pays the first translation (and the first dispatch prewarm covers that cost separately); later launches use the cache. The cache file is inside the game's cache/.
  • HOS_VIDEO_WORKER_OFF=1 keeps the old Acquire-decoding path for the legacy decoder tests and a side-by-side fallback. The game never sets it; the default is the worker.
  • Nothing changes in saves or longshot_options.ini.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (the five video checks pass locally; the full run is waiting on CI).
  • Measured against main, or Measurements says why there is nothing to measure. Current-base stock/fix first-minute runs on 4908cc6d are in Measurements.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here. tests/test_video_worker.py cuts the real worker out of the source and exercises it with a fake decoder; the runtime A/B remains the game evidence.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Assisted-by: Hermes Agent

## Summary A movie's pictures were decoded on the thread that has to hand one to the game every 16.7 ms. A 3.2 to 4.0 ms decode, with a worst picture of 94 to 128 ms, therefore sat directly in the Acquire path. On the Deck LCD, two first-minute runs of current `main` (`4908cc6d`) without the pack skipped 779 and 495 pictures; with this PR they skipped 59 and 1. The earlier `87045899` base measured 694 and 470 to 13 and 0; the older `ec889d9d` base measured 532 to 16 in the first minute and 593 to 34 over all 5,947 pictures. This changes the movie path in three parts: 1. `host/nn_video.c`: each decoder owns a native worker. `dec_submit` copies the compressed packet into an owned packet and wakes the worker; the worker decodes into the existing bounded host-picture ring; `dec_acquire` only leases a free guest pool, detaches a ready picture, copies, and returns the completed fence. `dec_flush`, `dec_stop` and `dec_finalize` join the worker. Acquire no longer decodes or performs the catch-up decode. 2. `gpu/vk/vk_draw.cpp`: the movie upscale pipeline and one dummy dispatch are made at startup, so the first movie frame no longer pays the driver's first-dispatch compile. 3. `gpu/vk/vk_shader.cpp`: a program rejected as a network left out on this card is remembered by key in a cache file scoped to the translator, device, matrix limits and relevant profile capabilities. Later runs skip its translation before doing it again. No program keys are hardcoded, and forced trials bypass the cache. Fixes #73. ## Testing **Tested:** Steam Deck LCD (AMD Custom GPU 0405, RADV VANGOGH, Vulkan 1.4), current base `4908cc6d`, the pack built from `fix/movie-decode-worker-main` at `b41a5cb7`, `HOS_VIDEO_LOG=1`, 1280x800, 60 fps cap, test user copy. The current-base A/B is two interleaved first-minute runs per arm; the stock arm is the same base without the pack. The earlier `87045899` and `ec889d9d` bases also measured the first minute, and `ec889d9d` measured the whole 5,947-picture movie. Both current-base runtimes were given their shader preparation before measurement, so neither arm paid a first-launch preparation in the measured runs. The fix log contains `vk: movie upscale pipeline prewarmed: yes` and `vk: movie upscale dispatch prewarmed: yes`. The five video checks pass on Linux with `g++`: `tests/test_video_worker.py` (the real worker with a fake decoder), `tests/test_video_catchup.py`, `tests/test_vcore_video_acquire.py`, `tests/test_video_input_limit.py` (all modes), and `tests/test_video_hold_early.py` (both modes). The worker test takes the decoder lock for test-thread reads, covers submission, bounded output, EOS, Flush/stop/restart, an overlapping Submit/Flush, the start barrier, timer cleanup and the synchronous fallback when `CreateThread` fails; it passes ThreadSanitizer. `tests/test_short_sleep_timer.py` also passes, including the timer close. The legacy fixtures take the `HOS_VIDEO_WORKER_OFF` path. `pre-commit` passes on the changed files. **Still to test:** - Windows: the Media Foundation AV1 path has not run the worker; it shares `decode_next` but its callback thread affinity needs its own review (by hand, on a Windows PC with an AV1 movie). - Other Linux GPUs: run the same opening movie on an AMD discrete card and an Intel GPU, expecting no Acquire stalls and no regression in the non-AV1 movies (by hand or @Beanstalk). ## Measurements **Verdict:** The worker removes nearly all of the current-base movie skips: 779 and 495 to 59 and 1 in two first-minute runs on the Deck LCD. The earlier `87045899` base measured 694 and 470 to 13 and 0; the older `ec889d9d` base measured 532 to 16 in the first minute and 593 to 34 over the full 5,947-picture movie. Setup: Steam Deck LCD, RADV VANGOGH, Vulkan 1.4, 1280x800, 60 fps cap, current base `4908cc6d`, test user copy. Both runtimes used the same options file and were prepared warm before the measured runs. Two stock and two fixed first-minute runs were interleaved. Baseline: current `main` at `4908cc6d`, built without the pack. The stock and fixed arms share that base, so the difference is the pack; the pack was built from `b41a5cb7`, the final fix head. | | Before: main @ `4908cc6d` | After: this PR @ `b41a5cb7` | |---|---|---| | Skipped in the first 60 s, run 1 / run 2 | 779 / 495 | **59 / 1** | | First six skip events, run 1 | `[9,1,1,1,1,1,9,7]` (14) | `[7,6,1,1,6,1,7,7]` (22) | | First six skip events, run 2 | `[2,8,3,1,2,1,1,1]` (17) | `[1]` (1) | | Skip events, run 1 / run 2 | 334 / 262 | **13 / 1** | | Pictures held, run 1 / run 2 | 8 / 20 | **3 / 9** | | Last picture, run 1 / run 2 | 60.8 s / 60.87 s | **60.87 s / 60.82 s** | The earlier `87045899` first-minute runs were 694 and 470 to 13 and 0. The older `ec889d9d` full-movie run was 593 to 34 skips over all 5,947 pictures. The current-base runs are first-minute measurements; the full-movie number is from that earlier base. ## Risks - The worker adds one native thread and an owned compressed-packet queue per decoder. The host-picture ring stays at its production `MAX_QUEUE` of 8 pictures; the worker blocks at the queue limit instead of discarding a picture. - `dec_flush`, `dec_stop` and `dec_finalize` now join the worker; a start barrier blocks a replacement until Flush has finished the backend and queue cleanup. The worker releases its thread-local sleep timer. `tests/test_video_worker.py` covers Flush/stop, restart, an overlapping Submit/Flush and the failed-thread fallback; the full game remains the integration check. - The Media Foundation path is not exercised on the Deck. Its callback still calls `queue_frame`, and the worker life-cycle is shared; it needs a Windows run. - The startup cache is written on first use. A fresh install still pays the first translation (and the first dispatch prewarm covers that cost separately); later launches use the cache. The cache file is inside the game's `cache/`. - `HOS_VIDEO_WORKER_OFF=1` keeps the old Acquire-decoding path for the legacy decoder tests and a side-by-side fallback. The game never sets it; the default is the worker. - Nothing changes in saves or `longshot_options.ini`. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (the five video checks pass locally; the full run is waiting on CI). - [x] Measured against `main`, or Measurements says why there is nothing to measure. Current-base stock/fix first-minute runs on `4908cc6d` are in Measurements. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. `tests/test_video_worker.py` cuts the real worker out of the source and exercises it with a fake decoder; the runtime A/B remains the game evidence. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. Assisted-by: Hermes Agent
fix(video): decode movie pictures on a worker
Some checks failed
CI / What the change needs (pull_request) Successful in 12s
CI / Third-party parts and guide screenshots (pull_request) Failing after 14s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 15s
PR description / Title and description (pull_request_target) Successful in 6s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 4m34s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 5m37s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m37s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 6m20s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 15m34s
CI / Website build and checks (pull_request) Failing after 12m0s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 30m44s
445ef24e60
The movie decoder decoded on the Acquire thread, so a 3.2-4.0 ms picture (worst 94-128 ms) sat in the path that must return one picture every 16.7 ms. A movie skipped 532 pictures in its first minute and 593 over all 5,947 on the Deck LCD.

Decode on a per-decoder native worker instead. Submissions queue owned packets; the worker decodes them into the existing bounded host-picture ring; Acquire only leases a free pool slot and copies a ready picture. Flush, Stop and Finalize join the worker. Acquire no longer decodes or catches up.

Also prewarm the movie upscale compute pipeline and its first dispatch at startup, and remember left-out network keys in cache/longshot_left_out.bin so later runs skip that translation. No program keys are hardcoded.

Measured on the Deck LCD against the same ec889d9d base: first minute 532 -> 16 skipped, full 5,947 movie 593 -> 34 skipped, decode 4.0 -> 3.2 ms, worst 128.4 -> 94.3 ms.
Author
Member

Tested in game: Steam Deck LCD (RADV VANGOGH, Vulkan 1.4), base ec889d9d: first-minute skips 532 -> 16; full 5,947-picture movie 593 -> 34; decode 4.0 -> 3.2 ms, worst 128.4 -> 94.3 ms; startup prewarm lines present.

Tested in game: Steam Deck LCD (RADV VANGOGH, Vulkan 1.4), base ec889d9d: first-minute skips 532 -> 16; full 5,947-picture movie 593 -> 34; decode 4.0 -> 3.2 ms, worst 128.4 -> 94.3 ms; startup prewarm lines present.
test(video): keep the decoder checks on the legacy Acquire path
Some checks failed
CI / What the change needs (pull_request) Successful in 23s
CI / Third-party parts and guide screenshots (pull_request) Failing after 24s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 18s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 20m30s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 21m0s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Failing after 51s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 21m55s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 50s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 55s
CI / Website build and checks (pull_request) Failing after 48s
PR description / Title and description (pull_request_target) Failing after 17s
77a1289804
The worker is the production path, but the existing fixtures test the old Acquire-decoding contract. Add the current main movie_now/background-held symbols and a HOS_VIDEO_WORKER_OFF fallback so those checks exercise the legacy path. The video checks pass again.
HumanBean changed title from WIP: fix(video): decode movie pictures on a worker to fix(video): decode movie pictures on a worker 2026-11-30 19:16:37 +00:00
BeanBot requested changes 2026-11-30 19:19:19 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The worker still holds the decoder lock through decoding, so Acquire and Submit can stall for the full decode time. The persistent rejection cache can also suppress shaders on a GPU or configuration that supports them, and the production worker has no game-free coverage.

The change moves movie decoding to a worker, prewarms the movie upscale pipeline, and caches rejected network programs. The Deck run reports substantially fewer skipped pictures, but the worker still blocks callers during decoding and the new cache can retain an obsolete rejection.

Blocking (4): must change before merging.

  1. L1 host/nn_video.c:584: The worker holds the same exclusive lock used by Acquire and Submit throughout decode_next, including the decoder call and frame copies. (more on the line) Do: Remove the pending packet under the lock, decode into worker-owned state without holding the queue lock, and lock only to publish pictures and update shared state.
  2. L2 gpu/vk/vk_shader.cpp:1657: The persistent rejection is keyed only by program, although the decision to reject depends on the device, its capabilities, translator behavior and switches. (more on the line) Do: Key or invalidate the cache using all inputs to the rejection decision, including device capabilities, relevant switches and translator version, or avoid persisting the decision.
  3. L3 host/nn_video.c:578: Checking for one free queue slot before decoding does not ensure that all pictures produced by a packet or drain fit. (more on the line) Do: Provide backpressure for every produced picture, including drain output, or retain excess output until the consumer frees space.
  4. L6 tests/test_video_input_limit.py:110: The changed fixtures stub out the worker and exercise only the legacy path, leaving the new behavior and lifecycle untested. (more on the line) Do: Add game-free behavioral tests for worker submission, bounded output, EOS, flush, stop and restart, including the worker-creation failure path; retain fallback coverage separately.

Should fix (3): not blocking, but worth doing before merging.

  • L4 host/nn_video.c:603: A failed worker creation leaves the decoder on the worker path with no worker to consume its pending packets. (more on the line) Do: Handle thread-creation failure explicitly, either returning an error or switching that decoder to a functioning synchronous fallback.
  • L5 gpu/vk/vk_shader.cpp:102: The new cache uses narrow fopen on a UTF-8 path on Windows. (more on the line) Do: Use the repository's UTF-8-safe file-opening approach for both reads and writes.
  • L7 host/nn_video.c:597: The new HOS_VIDEO_WORKER_OFF switch has no row in the required switch table. (more on the line) Do: Add the switch and its default to gpu/vk/switches.def, or remove the fallback switch once it is no longer needed.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. When: The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. Do: Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware.

@fix can do L1, L2, L3, L4, L5, L6 and L7.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • host/nn_video.c:600: Can the supported game's decoder receive concurrent Submit calls, or can Submit race with Stop or Finalize for the same decoder?

Checks: Failing on this head, which is behind its base, where they pass: CI / Third-party parts and guide screenshots (pull_request), CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request), CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request), CI / Game-free checks (run_all.py, part 2/2) (pull_request), CI / Website build and checks (pull_request), PR description / Title and description (pull_request_target). @rebase (or @fix) brings it up to date and runs them again; not held against it.

More: does it help, other systems, switches, what was read

Does it help: Unproven on the current base and head. One Deck run per arm on an older base reports first-minute skips falling from 532 to 16 and full-movie skips from 593 to 34; the PR reports no repeated interleaved runs or current-main comparison.

Other systems: The decoder also runs on Windows through Media Foundation and on Linux through FFmpeg or dav1d. The shader cache is shared across launches and may survive GPU, driver, switch, and renderer changes. The prewarm adds startup GPU work on all supported devices; its cold and warm cost and behavior on other Tier 1 hardware have not been measured.

Switches: HOS_VIDEO_WORKER_OFF is added, default off, so the worker is enabled. Its fallback has no switch-table row or production-path test; the default has only one older-base Deck comparison and no Windows validation.

Reviewed: 77a1289804 against d193d12d55: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md and the pull request template; docs/review-checklist.md and ../Tooling/AGENTS.md were absent. Read the diff, commit messages, decoder lifecycle and changed test fixtures; inspected the changed renderer sections and their cache and pipeline callers. The full renderer files were not read in full.; nothing run (a code review).

Checked and fine:

  • No game-derived files, generated shader headers, third-party files, or renderer API changes appear in the diff.
  • The pull request records AI assistance and identifies its older measurement baseline.

Testing: No code, tests, builds, or project scripts were run, as requested. The supplied CI data reports no failure unique to this head.

Overlaps and merge order: Unknown; network access was unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as omgitsgela took it out of WIP. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The worker still holds the decoder lock through decoding, so Acquire and Submit can stall for the full decode time. The persistent rejection cache can also suppress shaders on a GPU or configuration that supports them, and the production worker has no game-free coverage. The change moves movie decoding to a worker, prewarms the movie upscale pipeline, and caches rejected network programs. The Deck run reports substantially fewer skipped pictures, but the worker still blocks callers during decoding and the new cache can retain an obsolete rejection. **Blocking (4)**: must change before merging. 1. **L1** `host/nn_video.c:584`: The worker holds the same exclusive lock used by Acquire and Submit throughout decode_next, including the decoder call and frame copies. (more on the line) **Do:** Remove the pending packet under the lock, decode into worker-owned state without holding the queue lock, and lock only to publish pictures and update shared state. 2. **L2** `gpu/vk/vk_shader.cpp:1657`: The persistent rejection is keyed only by program, although the decision to reject depends on the device, its capabilities, translator behavior and switches. (more on the line) **Do:** Key or invalidate the cache using all inputs to the rejection decision, including device capabilities, relevant switches and translator version, or avoid persisting the decision. 3. **L3** `host/nn_video.c:578`: Checking for one free queue slot before decoding does not ensure that all pictures produced by a packet or drain fit. (more on the line) **Do:** Provide backpressure for every produced picture, including drain output, or retain excess output until the consumer frees space. 4. **L6** `tests/test_video_input_limit.py:110`: The changed fixtures stub out the worker and exercise only the legacy path, leaving the new behavior and lifecycle untested. (more on the line) **Do:** Add game-free behavioral tests for worker submission, bounded output, EOS, flush, stop and restart, including the worker-creation failure path; retain fallback coverage separately. **Should fix (3)**: not blocking, but worth doing before merging. - **L4** `host/nn_video.c:603`: A failed worker creation leaves the decoder on the worker path with no worker to consume its pending packets. (more on the line) **Do:** Handle thread-creation failure explicitly, either returning an error or switching that decoder to a functioning synchronous fallback. - **L5** `gpu/vk/vk_shader.cpp:102`: The new cache uses narrow fopen on a UTF-8 path on Windows. (more on the line) **Do:** Use the repository's UTF-8-safe file-opening approach for both reads and writes. - **L7** `host/nn_video.c:597`: The new HOS_VIDEO_WORKER_OFF switch has no row in the required switch table. (more on the line) **Do:** Add the switch and its default to gpu/vk/switches.def, or remove the fallback switch once it is no longer needed. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. *When:* The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. **Do:** Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware. `@fix` can do L1, L2, L3, L4, L5, L6 and L7. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - `host/nn_video.c:600`: Can the supported game's decoder receive concurrent Submit calls, or can Submit race with Stop or Finalize for the same decoder? **Checks:** Failing on this head, which is behind its base, where they pass: `CI / Third-party parts and guide screenshots (pull_request)`, `CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`, `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`, `CI / Website build and checks (pull_request)`, `PR description / Title and description (pull_request_target)`. `@rebase` (or `@fix`) brings it up to date and runs them again; not held against it. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current base and head. One Deck run per arm on an older base reports first-minute skips falling from 532 to 16 and full-movie skips from 593 to 34; the PR reports no repeated interleaved runs or current-main comparison. **Other systems:** The decoder also runs on Windows through Media Foundation and on Linux through FFmpeg or dav1d. The shader cache is shared across launches and may survive GPU, driver, switch, and renderer changes. The prewarm adds startup GPU work on all supported devices; its cold and warm cost and behavior on other Tier 1 hardware have not been measured. **Switches:** HOS_VIDEO_WORKER_OFF is added, default off, so the worker is enabled. Its fallback has no switch-table row or production-path test; the default has only one older-base Deck comparison and no Windows validation. **Reviewed:** 77a12898048f against d193d12d55c6: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md and the pull request template; docs/review-checklist.md and ../Tooling/AGENTS.md were absent. Read the diff, commit messages, decoder lifecycle and changed test fixtures; inspected the changed renderer sections and their cache and pipeline callers. The full renderer files were not read in full.; nothing run (a code review). **Checked and fine:** - No game-derived files, generated shader headers, third-party files, or renderer API changes appear in the diff. - The pull request records AI assistance and identifies its older measurement baseline. **Testing:** No code, tests, builds, or project scripts were run, as requested. The supplied CI data reports no failure unique to this head. **Overlaps and merge order:** Unknown; network access was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as omgitsgela took it out of WIP. Nothing was run; a maintainer decides.</sub>
@ -90,0 +99,4 @@
if (left_out_loaded) return;
left_out_loaded = true;
const std::string path = cache_path("longshot_left_out.bin");
if (FILE* f = fopen(path.c_str(), "rb")) {
Member

L5 (should fix): The new cache uses narrow fopen on a UTF-8 path on Windows.

When: When the game or shared shader-cache directory contains characters outside the Windows ANSI code page, opening the cache fails, so the rejection is translated again on every launch.

Do: Use the repository's UTF-8-safe file-opening approach for both reads and writes.

**L5** (should fix): The new cache uses narrow fopen on a UTF-8 path on Windows. *When:* When the game or shared shader-cache directory contains characters outside the Windows ANSI code page, opening the cache fails, so the rejection is translated again on every launch. **Do:** Use the repository's UTF-8-safe file-opening approach for both reads and writes.
@ -1621,6 +1654,7 @@ void translate_into(Program& p, const NvnState& s, const Code* vsc, const Code*
// (an allocation refused in the translation fails this program (NewNothrow), rather than wait 5 s in the renderer's
// new_handler and stop the game: a bad shader can ask for a size no PC has)
const NewNothrow nothrow;
if (left_out_known(p.key)) throw std::runtime_error(network_left_out);
Member

L2 (blocking): The persistent rejection is keyed only by program, although the decision to reject depends on the device, its capabilities, translator behavior and switches.

When: A network rejected on an AMD GPU is recorded; after switching to a capable NVIDIA GPU, or setting RX_VK_NETWORK_KEEP=all, the early lookup throws before the current device and switch are checked, so the network remains disabled.

Do: Key or invalidate the cache using all inputs to the rejection decision, including device capabilities, relevant switches and translator version, or avoid persisting the decision.

**L2** (blocking): The persistent rejection is keyed only by program, although the decision to reject depends on the device, its capabilities, translator behavior and switches. *When:* A network rejected on an AMD GPU is recorded; after switching to a capable NVIDIA GPU, or setting RX_VK_NETWORK_KEEP=all, the early lookup throws before the current device and switch are checked, so the network remains disabled. **Do:** Key or invalidate the cache using all inputs to the rejection decision, including device capabilities, relevant switches and translator version, or avoid persisting the decision.
host/nn_video.c Outdated
@ -565,0 +575,4 @@
for (;;) {
AcquireSRWLockExclusive(&d->lock);
while (!d->worker_quit && (!d->phead || d->qn >= MAX_QUEUE)) {
ReleaseSRWLockExclusive(&d->lock);
Member

L3 (blocking): Checking for one free queue slot before decoding does not ensure that all pictures produced by a packet or drain fit.

When: With seven pictures queued, an end-of-stream drain can return several delayed FFmpeg or AV1 pictures. queue_frame drops the oldest whenever the ring fills, so pictures are discarded even though the worker is described as waiting instead.

Do: Provide backpressure for every produced picture, including drain output, or retain excess output until the consumer frees space.

**L3** (blocking): Checking for one free queue slot before decoding does not ensure that all pictures produced by a packet or drain fit. *When:* With seven pictures queued, an end-of-stream drain can return several delayed FFmpeg or AV1 pictures. queue_frame drops the oldest whenever the ring fills, so pictures are discarded even though the worker is described as waiting instead. **Do:** Provide backpressure for every produced picture, including drain output, or retain excess output until the consumer frees space.
host/nn_video.c Outdated
@ -565,0 +581,4 @@
}
if (d->worker_quit) {
ReleaseSRWLockExclusive(&d->lock);
break;
Member

L1 (blocking): The worker holds the same exclusive lock used by Acquire and Submit throughout decode_next, including the decoder call and frame copies.

When: If Acquire arrives during the reported 94–128 ms decode, it blocks on d->lock before it can take an already queued picture; Submit also blocks at submit_refused. Moving the call to another thread therefore does not remove the decode stall from those paths.

Do: Remove the pending packet under the lock, decode into worker-owned state without holding the queue lock, and lock only to publish pictures and update shared state.

**L1** (blocking): The worker holds the same exclusive lock used by Acquire and Submit throughout decode_next, including the decoder call and frame copies. *When:* If Acquire arrives during the reported 94–128 ms decode, it blocks on d->lock before it can take an already queued picture; Submit also blocks at submit_refused. Moving the call to another thread therefore does not remove the decode stall from those paths. **Do:** Remove the pending packet under the lock, decode into worker-owned state without holding the queue lock, and lock only to publish pictures and update shared state.
host/nn_video.c Outdated
@ -565,0 +600,4 @@
if (!d || d->worker_on || !worker_enabled()) return;
d->worker_quit = 0;
d->worker = CreateThread(NULL, 0, dec_worker_main, d, 0, NULL);
d->worker_on = d->worker != NULL;
Member

L4 (should fix): A failed worker creation leaves the decoder on the worker path with no worker to consume its pending packets.

When: If CreateThread fails, Submit still returns success and Acquire skips decode_pending because worker_enabled remains true. The queue fills and the movie never receives decoded pictures.

Do: Handle thread-creation failure explicitly, either returning an error or switching that decoder to a functioning synchronous fallback.

**L4** (should fix): A failed worker creation leaves the decoder on the worker path with no worker to consume its pending packets. *When:* If CreateThread fails, Submit still returns success and Acquire skips decode_pending because worker_enabled remains true. The queue fills and the movie never receives decoded pictures. **Do:** Handle thread-creation failure explicitly, either returning an error or switching that decoder to a functioning synchronous fallback.
host/nn_video.c Outdated
@ -565,0 +594,4 @@
static int worker_enabled(void) {
static int off = -1;
if (off < 0) off = env_on("HOS_VIDEO_WORKER_OFF");
return !off;
Member

L7 (blocking): The new HOS_VIDEO_WORKER_OFF switch has no row in the required switch table.

When: Developers looking up host switches cannot find the fallback or its default, and the repository requires every switch to have a row.

Do: Add the switch and its default to gpu/vk/switches.def, or remove the fallback switch once it is no longer needed.

**L7** (blocking): The new HOS_VIDEO_WORKER_OFF switch has no row in the required switch table. *When:* Developers looking up host switches cannot find the fallback or its default, and the repository requires every switch to have a row. **Do:** Add the switch and its default to gpu/vk/switches.def, or remove the fallback switch once it is no longer needed.
@ -104,7 +107,11 @@ static void hos_system_event_clear(uint64_t key) { event_state[key] = 0, clears+
static uint64_t ids;
static uint64_t submitted(void) { submissions++; return ++ids; }
typedef void *HANDLE;
Member

L6 (blocking): The changed fixtures stub out the worker and exercise only the legacy path, leaving the new behavior and lifecycle untested.

When: Removing the worker's decode call or breaking its stop and restart behavior would not make these checks fail, although production movies would stop producing pictures or hang.

Do: Add game-free behavioral tests for worker submission, bounded output, EOS, flush, stop and restart, including the worker-creation failure path; retain fallback coverage separately.

**L6** (blocking): The changed fixtures stub out the worker and exercise only the legacy path, leaving the new behavior and lifecycle untested. *When:* Removing the worker's decode call or breaking its stop and restart behavior would not make these checks fail, although production movies would stop producing pictures or hang. **Do:** Add game-free behavioral tests for worker submission, bounded output, EOS, flush, stop and restart, including the worker-creation failure path; retain fallback coverage separately.
Owner
@fix
BeanBot force-pushed fix/movie-decode-worker-main from 77a1289804
Some checks failed
CI / What the change needs (pull_request) Successful in 23s
CI / Third-party parts and guide screenshots (pull_request) Failing after 24s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 18s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 20m30s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 21m0s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Failing after 51s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 21m55s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 50s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 55s
CI / Website build and checks (pull_request) Failing after 48s
PR description / Title and description (pull_request_target) Failing after 17s
to dd55a26adb
Some checks failed
CI / What the change needs (pull_request) Successful in 16s
PR description / Title and description (pull_request_target) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Failing after 24s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 26s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m50s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m6s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m43s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m55s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-30 19:29:55 +00:00
Compare
BeanBot requested changes 2026-11-30 19:29:59 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The worker’s submission and lifecycle behavior still has no behavioral test, including its shutdown and restart paths. The reported reduction in skipped pictures is promising, but it predates the final code and comes from single runs on an older base.

What @fix changed
I changed this pull request: the new head is dd55a26adb. I rebased it onto main (ba3f14dff1). I edited its description to match the change.

Changed

  • Rejection cache scope, gpu/vk/vk_shader.cpp:1654: Scoped cache files by translator stamp, device identity, matrix limits and relevant profile capabilities; forced translation trials bypass the cache.
  • Worker switch documentation, gpu/vk/switches.def:269: Added the fallback switch and its default to the switch table.
  • Worker creation failure, host/nn_video.c:774: Selects synchronous decoding when no worker was created and starts the worker while holding the decoder lock.
  • UTF-8 cache paths, gpu/vk/vk_shader.cpp:100: Uses UTF-8-to-wide conversion and _wfopen for cache reads and writes on Windows.
  • Worker decode lock, host/nn_video.c:575: The worker removes a packet under the lock, decodes and copies frames outside it, and locks to publish pictures and update shared state. In-flight work remains counted for input limits and idle detection.
  • Output backpressure, host/nn_video.c:514: The worker waits for room for each output picture, including drain output. The synchronous fallback retains excess pictures for later acquisition instead of evicting queued pictures.
  • Final picture EOS race in host/nn_video.c:897: Acquire retains the worker’s newest picture until a successor arrives or the EOS drain marks it last; catch-up respects the same boundary. The input-ready rule permits progress at a limit of one. Reviewed the diff; no tests or builds were run, as requested.
  • Acquire waits for a second picture: Updated host/nn_video.c:899 to return a ready picture promptly. The decoder retains the last delivered picture and returns it marked final if a later EOS drain produces no picture; retained memory is freed on flush and finalize. No tests were run, as requested.

Not done

  • Worker lifecycle tests, tests/test_video_input_limit.py:328: The existing fallback fixture was adjusted for the new decoder fields, but it still stubs the worker. Behavioral tests for submission, bounded output, EOS, flush, stop, restart, and worker-creation failure remain to be written. No builds or tests were run.

Nothing was built or run: the checks run again on the new head.

The change moves movie decoding to a worker, prewarms movie upscaling, and caches shader translation rejections. It could reduce skipped movie pictures, at the cost of another thread, queued pictures, startup work, and more lifecycle complexity.

Blocking (1): must change before merging.

  1. L6 tests/test_video_input_limit.py:110: The changed fixtures stub out the worker and exercise only the legacy path, leaving the new behavior and lifecycle untested. When: Removing the worker's decode call or breaking its stop and restart behavior would not make these checks fail, although production movies would stop producing pictures or hang. Do: Add game-free behavioral tests for worker submission, bounded output, EOS, flush, stop and restart, including the worker-creation failure path; retain fallback coverage separately. (for the author: @fix couldn't: The input-limit fixture still stubs the worker. Behavioral coverage for submission, bounded output, EOS, flush, stop, restart, and worker-creation failure remains missing.)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. When: The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. Do: Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware.

Checks: they run again on this head (CI / Third-party parts and guide screenshots (pull_request), CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request), CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request) failed on the last one); a failure shows on the pull request.

Also noticed (4; not asked for, not blocking)
  • The pull request description still names the old unscoped cache filename; the code now uses a scoped filename.
  • The PR description names an unscoped rejection-cache filename, while the code now uses a scoped filename.
  • The description names an unscoped left-out cache filename, while the code now uses a device- and translator-scoped filename.
  • The base diff also contains builder restart changes that are absent from the pull request description.
More: does it help, other systems, switches, what was read

Does it help: Unproven for the final code. The reported Deck comparison reduced skips from 532 to 16 in the first minute and 593 to 34 over the full movie, but used single runs on an older base and an earlier version of the change.

Other systems: The worker affects Linux and Windows movie decoding, including the Windows Media Foundation path. The renderer changes affect startup and shader translation across GPU vendors and drivers; the description reports no final-code runs on those other systems.

Switches: HOS_VIDEO_WORKER_OFF is added, default off, enabling the worker; its switch-table row describes the synchronous fallback. The default is not yet supported by measurements on all affected Tier 1 systems.

Reviewed: dd55a26adb against ba3f14dff1: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the fix diff, the relevant decoder and input-limit fixture code, and the reported runs. The full base diff and all changed files were not read in full; the sibling Tooling rules and docs/review-checklist.md were unavailable.; nothing run (a code review).

Checked and fine:

  • The worker switch has a row in switches.def.
  • The fix retains the worker as the default path and provides synchronous decoding if worker creation fails.

Testing: No commands that build or run code were executed. The reported Deck run exercised an earlier version; CI has not run on this head.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The worker’s submission and lifecycle behavior still has no behavioral test, including its shutdown and restart paths. The reported reduction in skipped pictures is promising, but it predates the final code and comes from single runs on an older base. **What `@fix` changed** I changed this pull request: the new head is dd55a26adbb2. I rebased it onto `main` (ba3f14dff1a1). I edited its description to match the change. **Changed** - **Rejection cache scope, gpu/vk/vk_shader.cpp:1654**: Scoped cache files by translator stamp, device identity, matrix limits and relevant profile capabilities; forced translation trials bypass the cache. - **Worker switch documentation, gpu/vk/switches.def:269**: Added the fallback switch and its default to the switch table. - **Worker creation failure, host/nn_video.c:774**: Selects synchronous decoding when no worker was created and starts the worker while holding the decoder lock. - **UTF-8 cache paths, gpu/vk/vk_shader.cpp:100**: Uses UTF-8-to-wide conversion and _wfopen for cache reads and writes on Windows. - **Worker decode lock, host/nn_video.c:575**: The worker removes a packet under the lock, decodes and copies frames outside it, and locks to publish pictures and update shared state. In-flight work remains counted for input limits and idle detection. - **Output backpressure, host/nn_video.c:514**: The worker waits for room for each output picture, including drain output. The synchronous fallback retains excess pictures for later acquisition instead of evicting queued pictures. - **Final picture EOS race in host/nn_video.c:897**: Acquire retains the worker’s newest picture until a successor arrives or the EOS drain marks it last; catch-up respects the same boundary. The input-ready rule permits progress at a limit of one. Reviewed the diff; no tests or builds were run, as requested. - **Acquire waits for a second picture**: Updated host/nn_video.c:899 to return a ready picture promptly. The decoder retains the last delivered picture and returns it marked final if a later EOS drain produces no picture; retained memory is freed on flush and finalize. No tests were run, as requested. **Not done** - **Worker lifecycle tests, tests/test_video_input_limit.py:328**: The existing fallback fixture was adjusted for the new decoder fields, but it still stubs the worker. Behavioral tests for submission, bounded output, EOS, flush, stop, restart, and worker-creation failure remain to be written. No builds or tests were run. Nothing was built or run: the checks run again on the new head. The change moves movie decoding to a worker, prewarms movie upscaling, and caches shader translation rejections. It could reduce skipped movie pictures, at the cost of another thread, queued pictures, startup work, and more lifecycle complexity. **Blocking (1)**: must change before merging. 1. **L6** `tests/test_video_input_limit.py:110`: The changed fixtures stub out the worker and exercise only the legacy path, leaving the new behavior and lifecycle untested. *When:* Removing the worker's decode call or breaking its stop and restart behavior would not make these checks fail, although production movies would stop producing pictures or hang. **Do:** Add game-free behavioral tests for worker submission, bounded output, EOS, flush, stop and restart, including the worker-creation failure path; retain fallback coverage separately. *(for the author: `@fix` couldn't: The input-limit fixture still stubs the worker. Behavioral coverage for submission, bounded output, EOS, flush, stop, restart, and worker-creation failure remains missing.)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. *When:* The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. **Do:** Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware. **Checks:** they run again on this head (`CI / Third-party parts and guide screenshots (pull_request)`, `CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (4; not asked for, not blocking)</summary> - The pull request description still names the old unscoped cache filename; the code now uses a scoped filename. - The PR description names an unscoped rejection-cache filename, while the code now uses a scoped filename. - The description names an unscoped left-out cache filename, while the code now uses a device- and translator-scoped filename. - The base diff also contains builder restart changes that are absent from the pull request description. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the final code. The reported Deck comparison reduced skips from 532 to 16 in the first minute and 593 to 34 over the full movie, but used single runs on an older base and an earlier version of the change. **Other systems:** The worker affects Linux and Windows movie decoding, including the Windows Media Foundation path. The renderer changes affect startup and shader translation across GPU vendors and drivers; the description reports no final-code runs on those other systems. **Switches:** HOS_VIDEO_WORKER_OFF is added, default off, enabling the worker; its switch-table row describes the synchronous fallback. The default is not yet supported by measurements on all affected Tier 1 systems. **Reviewed:** dd55a26adbb2 against ba3f14dff1a1: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the fix diff, the relevant decoder and input-limit fixture code, and the reported runs. The full base diff and all changed files were not read in full; the sibling Tooling rules and docs/review-checklist.md were unavailable.; nothing run (a code review). **Checked and fine:** - The worker switch has a row in switches.def. - The fix retains the worker as the default path and provides synchronous decoding if worker creation fails. **Testing:** No commands that build or run code were executed. The reported Deck run exercised an earlier version; CI has not run on this head. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
@ -550,2 +606,4 @@
avcodec_send_packet(d->ctx, NULL);
drain(d);
avcodec_flush_buffers(d->ctx);
}
Member

L17 (should fix): The last picture can be acquired before the worker marks it as the stream's last picture.

When: If Acquire removes the final queued picture while the worker is finishing the EOS drain, the queue is empty when the worker sets eos, so that picture is returned without its last flag. A later acquire instead marks a reused buffer as last.

Do: Coordinate publication of the final picture and EOS so the actual final picture receives the last flag before Acquire can detach it.

**L17** (should fix): The last picture can be acquired before the worker marks it as the stream's last picture. *When:* If Acquire removes the final queued picture while the worker is finishing the EOS drain, the queue is empty when the worker sets eos, so that picture is returned without its last flag. A later acquire instead marks a reused buffer as last. **Do:** Coordinate publication of the final picture and EOS so the actual final picture receives the last flag before Acquire can detach it.
@ -778,11 +899,12 @@ static void dec_acquire(Ctx *c) {
static int by_tries = -1;
Member

L18 (blocking): Acquire waits for a second picture even when one decoded picture is ready and no further submission is pending.

When: When the worker catches up to the game's submissions with one picture queued, the game thread enters Acquire before submitting again. Acquire waits up to 100 ms for a successor that this same thread cannot submit during the wait, then returns the pool's previous picture instead of the ready picture.

Do: Preserve the final-picture marking guarantee without waiting for a successor that has not been submitted, and return the available picture promptly.

**L18** (blocking): Acquire waits for a second picture even when one decoded picture is ready and no further submission is pending. *When:* When the worker catches up to the game's submissions with one picture queued, the game thread enters Acquire before submitting again. Acquire waits up to 100 ms for a successor that this same thread cannot submit during the wait, then returns the pool's previous picture instead of the ready picture. **Do:** Preserve the final-picture marking guarantee without waiting for a successor that has not been submitted, and return the available picture promptly.
test(video): give the remaining decoder fixtures the overflow type
Some checks failed
PR description / Title and description (pull_request_target) Failing after 23s
CI / What the change needs (pull_request) Successful in 36s
CI / Third-party parts and guide screenshots (pull_request) Failing after 55s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 47s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m0s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m17s
CI / Website build and checks (pull_request) Failing after 30s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m48s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m10s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
7d5b9ce079
The worker's overflow list is part of Dec now, and the legacy Acquire fixtures call overflow_fill. Declare the type and a no-op fill in the catch-up, vcore and hold checks so they compile and pass against the current source.
Merge remote-tracking branch 'origin/main' into fix/movie-decode-worker-main
Some checks failed
PR description / Title and description (pull_request_target) Failing after 9s
CI / What the change needs (pull_request) Successful in 16s
CI / Third-party parts and guide screenshots (pull_request) Failing after 17s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 15s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
c26e0a8c9e
test(video): cover the decoder worker's lifecycle
Some checks failed
CI / What the change needs (pull_request) Successful in 18s
CI / Third-party parts and guide screenshots (pull_request) Failing after 24s
PR description / Title and description (pull_request_target) Failing after 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 21s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m8s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m19s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m47s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m57s
CI / Website build and checks (pull_request) Failing after 33s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 18m46s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 28m38s
0ac3276db1
The existing video fixtures stub the worker and test only the old Acquire path. Add a game-free test that runs the real worker with a fake AV1 decoder: submission, bounded output, EOS, stop and restart, and the synchronous fallback when CreateThread fails.
Author
Member

Added the worker lifecycle test in 0ac3276d: tests/test_video_worker.py runs the real worker with a fake AV1 decoder and covers submission, bounded output, EOS, stop/restart, and the synchronous fallback when CreateThread fails. The five video checks pass locally with g++; pre-commit passes on the new test. The current-main Deck rerun is still to do. Please re-review.

Added the worker lifecycle test in 0ac3276d: tests/test_video_worker.py runs the real worker with a fake AV1 decoder and covers submission, bounded output, EOS, stop/restart, and the synchronous fallback when CreateThread fails. The five video checks pass locally with g++; pre-commit passes on the new test. The current-main Deck rerun is still to do. Please re-review.
Member
@review
Owner
@review
Owner
@review
BeanBot requested changes 2026-11-30 21:03:15 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The worker test adds useful coverage, but it still does not exercise flush or verify that a restarted worker decodes a new submission. The reported performance gain also needs repeated current-base comparisons and runs on the other affected Tier 1 systems.

The change moves movie decoding off the acquire path, prewarms the movie upscale pipeline, and caches unsupported network programs. It adds a worker thread and queue, startup GPU work, and a persistent cache.

Blocking (1): must change before merging.

  1. L6 tests/test_video_input_limit.py:110: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. When: After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. Do: Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. (for the author: @fix couldn't: The new fixture exercises the worker, bounded ring, EOS, direct stop and creation failure, but it never calls dec_flush. Its restart check waits for qn >= 1 while the first picture is still queued, so)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. When: The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. Do: Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware.

Since the last review (on dd55a26adb)
Resolved: L10 (The check CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) fails on this he…); L12 (The check CI / Renderer build check (Linux, compile --only renderer, without and with FSR…) Still open: L6 (The lifecycle fixture does not test flush, and its restart assertion can pass on the pictu…); L8 (The reported improvement is from single runs on an older base, and startup prewarming and…); L9 (The check CI / Third-party parts and guide screenshots (pull_request)fails on this head…); L11 (The checkCI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)fails on th…); L13 (The checkCI / Game-free checks (run_all.py, part 1/2) (pull_request)fails on this head…); L14 (The checkCI / Game-free checks (run_all.py, part 2/2) (pull_request)fails on this head…); L15 (The checkCI / Website build and checks (pull_request)fails on this head and passes on…); L16 (The checkPR description / Title and description (pull_request_target)` fails on this hea…)

Checks: Failing on this head, which is behind its base, where they pass: CI / Third-party parts and guide screenshots (pull_request), PR description / Title and description (pull_request_target), CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Website build and checks (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request). @rebase (or @fix) brings it up to date and runs them again; not held against it. Still running: CI / Game-free checks (run_all.py, part 2/2) (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Unproven on the current base. The author's single-run Deck comparison on an older base reports skips falling from 532 to 16 in the first minute and from 593 to 34 over the full movie.

Other systems: The decoder worker affects Windows and Linux movie playback; Media Foundation on Windows has not been exercised. Pipeline prewarming and shader rejection caching affect other Vulkan devices and drivers; the reported game run covers the Deck LCD only.

Switches: HOS_VIDEO_WORKER_OFF is added, default off, enabling the worker. The default supports the intended gain, but its behavior still needs the platform runs in L8.

Reviewed: 0ac3276db1 against 8704589992: Read the new worker test in full, the changes since the ledger, the production diff and relevant worker and flush references. Read AGENTS.md, CONTRIBUTING.md and the pull request template; docs/review-checklist.md and ../Tooling/AGENTS.md were absent. The large production files and other changed fixtures were not read in full.; nothing run (a code review).

Checked and fine:

  • The worker fixture exercises production worker code with a fake decoder, including EOS and thread-creation failure.
  • The legacy fixtures receive the added Overflow type and required stub.

Testing: No commands that build or run project code were executed. The author reports five Linux video checks passing; one game-free CI check is still running.

Overlaps and merge order: none found


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The worker test adds useful coverage, but it still does not exercise flush or verify that a restarted worker decodes a new submission. The reported performance gain also needs repeated current-base comparisons and runs on the other affected Tier 1 systems. The change moves movie decoding off the acquire path, prewarms the movie upscale pipeline, and caches unsupported network programs. It adds a worker thread and queue, startup GPU work, and a persistent cache. **Blocking (1)**: must change before merging. 1. **L6** `tests/test_video_input_limit.py:110`: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. *When:* After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. **Do:** Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. *(for the author: `@fix` couldn't: The new fixture exercises the worker, bounded ring, EOS, direct stop and creation failure, but it never calls dec_flush. Its restart check waits for qn >= 1 while the first picture is still queued, so)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. *When:* The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. **Do:** Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware. **Since the last review** (on dd55a26adbb2) Resolved: L10 (The check `CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)` fails on this he…); L12 (The check `CI / Renderer build check (Linux, compile --only renderer, without and with FSR…) Still open: L6 (The lifecycle fixture does not test flush, and its restart assertion can pass on the pictu…); L8 (The reported improvement is from single runs on an older base, and startup prewarming and…); L9 (The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head…); L11 (The check `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)` fails on th…); L13 (The check `CI / Game-free checks (run_all.py, part 1/2) (pull_request)` fails on this head…); L14 (The check `CI / Game-free checks (run_all.py, part 2/2) (pull_request)` fails on this head…); L15 (The check `CI / Website build and checks (pull_request)` fails on this head and passes on…); L16 (The check `PR description / Title and description (pull_request_target)` fails on this hea…) **Checks:** Failing on this head, which is behind its base, where they pass: `CI / Third-party parts and guide screenshots (pull_request)`, `PR description / Title and description (pull_request_target)`, `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Website build and checks (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`. `@rebase` (or `@fix`) brings it up to date and runs them again; not held against it. Still running: `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current base. The author's single-run Deck comparison on an older base reports skips falling from 532 to 16 in the first minute and from 593 to 34 over the full movie. **Other systems:** The decoder worker affects Windows and Linux movie playback; Media Foundation on Windows has not been exercised. Pipeline prewarming and shader rejection caching affect other Vulkan devices and drivers; the reported game run covers the Deck LCD only. **Switches:** HOS_VIDEO_WORKER_OFF is added, default off, enabling the worker. The default supports the intended gain, but its behavior still needs the platform runs in L8. **Reviewed:** 0ac3276db137 against 8704589992b3: Read the new worker test in full, the changes since the ledger, the production diff and relevant worker and flush references. Read AGENTS.md, CONTRIBUTING.md and the pull request template; docs/review-checklist.md and ../Tooling/AGENTS.md were absent. The large production files and other changed fixtures were not read in full.; nothing run (a code review). **Checked and fine:** - The worker fixture exercises production worker code with a fake decoder, including EOS and thread-creation failure. - The legacy fixtures receive the added Overflow type and required stub. **Testing:** No commands that build or run project code were executed. The author reports five Linux video checks passing; one game-free CI check is still running. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner
@fix
Merge main into fix/movie-decode-worker-main
Some checks failed
PR description / Title and description (pull_request_target) Failing after 11s
CI / What the change needs (pull_request) Successful in 11s
CI / Third-party parts and guide screenshots (pull_request) Failing after 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 18s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
ac42165ab9
BeanBot requested changes 2026-11-30 21:12:12 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The worker lifecycle test still does not exercise flush, and its restart assertion can pass without decoding the new submission. The reported performance improvement also needs repeated current-base comparisons and runs on the other affected systems.

What @fix changed
I changed this pull request: the new head is ac42165ab9. I merged main (e6a71a1d18) into it, as it has merge commits.

Nothing was built or run: the checks run again on the new head.

Movie decoding moves off the acquire path, while startup prewarming and a shader rejection cache aim to reduce movie stalls. This adds a worker and packet queue per decoder, startup GPU work, and a persistent cache.

Blocking (1): must change before merging.

  1. L6 tests/test_video_input_limit.py:110: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. When: After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. Do: Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. (for the author: @fix couldn't: The fixture never calls dec_flush. Its restart check still waits for qn >= 1 without removing the first picture, so it can pass before the second submission is decoded.)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. When: The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. Do: Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware.

Checks: they run again on this head (CI / Third-party parts and guide screenshots (pull_request), CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request), CI / Game-free checks (run_all.py, part 2/2) (pull_request), CI / Website build and checks (pull_request) failed on the last one); a failure shows on the pull request.

Also noticed (1; not asked for, not blocking)
  • The current base diff also includes the code-warm btrfs change from main.
More: does it help, other systems, switches, what was read

Does it help: Unproven for the final code: one older-base Deck comparison reports skipped pictures falling from 532 to 16 in the first minute and from 593 to 34 over the full movie. Repeated interleaved current-base runs are missing.

Other systems: The worker affects Linux and Windows decoder lifecycles, including Media Foundation AV1; prewarming and shader caching affect Vulkan devices. Windows, AMD discrete and Intel runs remain unreported.

Switches: HOS_VIDEO_WORKER_OFF is added, default off, enabling the worker by default; setting it restores synchronous acquire decoding. The default still needs the reported platform runs.

Reviewed: ac42165ab9 against e6a71a1d18: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the worker lifecycle fixture and the relevant decoder lifecycle code. Skimmed the Vulkan diff and switch table. The remaining changed files and full Vulkan code were not read in this re-check.; nothing run (a code review).

Checked and fine:

  • The lifecycle fixture exercises worker creation failure and synchronous fallback.
  • The new worker switch is listed in switches.def and defaults to the worker.

Testing: No commands that run project code or tests were executed. The author reports five video checks passing on Linux and one older-base Deck comparison; CI has not yet run on this head.

Overlaps and merge order: The base diff includes the merged code-warm btrfs change, #2916.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The worker lifecycle test still does not exercise flush, and its restart assertion can pass without decoding the new submission. The reported performance improvement also needs repeated current-base comparisons and runs on the other affected systems. **What `@fix` changed** I changed this pull request: the new head is ac42165ab979. I merged `main` (e6a71a1d18de) into it, as it has merge commits. Nothing was built or run: the checks run again on the new head. Movie decoding moves off the acquire path, while startup prewarming and a shader rejection cache aim to reduce movie stalls. This adds a worker and packet queue per decoder, startup GPU work, and a persistent cache. **Blocking (1)**: must change before merging. 1. **L6** `tests/test_video_input_limit.py:110`: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. *When:* After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. **Do:** Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. *(for the author: `@fix` couldn't: The fixture never calls dec_flush. Its restart check still waits for qn >= 1 without removing the first picture, so it can pass before the second submission is decoded.)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. *When:* The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. **Do:** Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware. **Checks:** they run again on this head (`CI / Third-party parts and guide screenshots (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`, `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`, `CI / Website build and checks (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - The current base diff also includes the code-warm btrfs change from main. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the final code: one older-base Deck comparison reports skipped pictures falling from 532 to 16 in the first minute and from 593 to 34 over the full movie. Repeated interleaved current-base runs are missing. **Other systems:** The worker affects Linux and Windows decoder lifecycles, including Media Foundation AV1; prewarming and shader caching affect Vulkan devices. Windows, AMD discrete and Intel runs remain unreported. **Switches:** HOS_VIDEO_WORKER_OFF is added, default off, enabling the worker by default; setting it restores synchronous acquire decoding. The default still needs the reported platform runs. **Reviewed:** ac42165ab979 against e6a71a1d18de: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the worker lifecycle fixture and the relevant decoder lifecycle code. Skimmed the Vulkan diff and switch table. The remaining changed files and full Vulkan code were not read in this re-check.; nothing run (a code review). **Checked and fine:** - The lifecycle fixture exercises worker creation failure and synchronous fallback. - The new worker switch is listed in switches.def and defaults to the worker. **Testing:** No commands that run project code or tests were executed. The author reports five video checks passing on Linux and one older-base Deck comparison; CI has not yet run on this head. **Overlaps and merge order:** The base diff includes the merged code-warm btrfs change, #2916. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
Owner
@fix
fix(guide): update reviewed graphics source fingerprints
Some checks failed
PR description / Title and description (pull_request_target) Failing after 10s
CI / What the change needs (pull_request) Successful in 10s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 13s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m13s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m46s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m25s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m41s
CI / Website build and checks (pull_request) Failing after 35s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 21m58s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 37m17s
2432708821
As the review on #2913 asked.
BeanBot requested changes 2026-11-30 21:21:14 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The worker lifecycle test still does not exercise flush, and its restart assertion can pass using the picture queued before stop. The reported performance gain also needs repeated comparisons on the current base and runs on the other affected Tier 1 systems.

What @fix changed
I changed this pull request: the new head is 2432708821.

Changed

  • Guide screenshot source review: Updated the three stale fingerprints in docs/user/images/guide/manifest.json:980 and recorded the renderer-internal changes in docs/user/images/guide/source-review-2913-ac42165a.md:1. The check was not run.

Left for the author

  • PR description test checklist: Run mise run test and, if it passes, tick the corresponding PR-description checkbox. The HOS_VIDEO_WORKER_OFF switch already has a row in gpu/vk/switches.def:270.

Nothing was built or run: the checks run again on the new head.

Movie decoding moves to a worker, with startup prewarming and a shader rejection cache intended to reduce skipped pictures. The fix updates guide image source fingerprints without changing the movie path; the worker adds a thread and packet queue per decoder.

Blocking (1): must change before merging.

  1. L6 tests/test_video_input_limit.py:110: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. When: After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. Do: Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. (for the author: @fix couldn't: The worker fixture still never calls dec_flush, and its restart check waits for qn >= 1 without first removing the picture produced before worker_stop.)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. When: The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. Do: Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware.

Checks: they run again on this head (CI / Third-party parts and guide screenshots (pull_request), CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request), CI / Game-free checks (run_all.py, part 2/2) (pull_request), CI / Website build and checks (pull_request) failed on the last one); a failure shows on the pull request.

Also noticed (1; not asked for, not blocking)
  • The current base diff also includes the code-warm btrfs change from main.
More: does it help, other systems, switches, what was read

Does it help: Unproven on the current base: the reported older-base Deck runs reduced first-minute skips from 532 to 16 and full-movie skips from 593 to 34, but used single runs per arm.

Other systems: The worker affects Linux and Windows decoder paths; renderer prewarming and the cache affect Vulkan devices. Windows Media Foundation and other Linux GPUs remain untested according to the PR.

Switches: HOS_VIDEO_WORKER_OFF is added, default off, enabling worker decoding; setting it restores synchronous Acquire decoding. The default's cross-platform behavior remains to be tested.

Reviewed: 2432708821 against e6a71a1d18: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the full worker lifecycle fixture, the fix diff, the guide source review, and relevant switch and lifecycle references. Skimmed the manifest changes and input-limit test diff; the rest of the changed code was not read in full. The review checklist and adjacent Tooling AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The fix changes guide fingerprints and their source-review record without removing or disabling the movie changes.
  • HOS_VIDEO_WORKER_OFF has a switches.def entry.

Testing: No commands that build or run tests were executed. The author reports five Linux video checks passing; CI has not run on this head.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The worker lifecycle test still does not exercise flush, and its restart assertion can pass using the picture queued before stop. The reported performance gain also needs repeated comparisons on the current base and runs on the other affected Tier 1 systems. **What `@fix` changed** I changed this pull request: the new head is 243270882190. **Changed** - **Guide screenshot source review**: Updated the three stale fingerprints in docs/user/images/guide/manifest.json:980 and recorded the renderer-internal changes in docs/user/images/guide/source-review-2913-ac42165a.md:1. The check was not run. **Left for the author** - **PR description test checklist**: Run `mise run test` and, if it passes, tick the corresponding PR-description checkbox. The HOS_VIDEO_WORKER_OFF switch already has a row in gpu/vk/switches.def:270. Nothing was built or run: the checks run again on the new head. Movie decoding moves to a worker, with startup prewarming and a shader rejection cache intended to reduce skipped pictures. The fix updates guide image source fingerprints without changing the movie path; the worker adds a thread and packet queue per decoder. **Blocking (1)**: must change before merging. 1. **L6** `tests/test_video_input_limit.py:110`: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. *When:* After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. **Do:** Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. *(for the author: `@fix` couldn't: The worker fixture still never calls dec_flush, and its restart check waits for qn >= 1 without first removing the picture produced before worker_stop.)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. *When:* The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. **Do:** Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware. **Checks:** they run again on this head (`CI / Third-party parts and guide screenshots (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`, `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`, `CI / Website build and checks (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - The current base diff also includes the code-warm btrfs change from main. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current base: the reported older-base Deck runs reduced first-minute skips from 532 to 16 and full-movie skips from 593 to 34, but used single runs per arm. **Other systems:** The worker affects Linux and Windows decoder paths; renderer prewarming and the cache affect Vulkan devices. Windows Media Foundation and other Linux GPUs remain untested according to the PR. **Switches:** HOS_VIDEO_WORKER_OFF is added, default off, enabling worker decoding; setting it restores synchronous Acquire decoding. The default's cross-platform behavior remains to be tested. **Reviewed:** 243270882190 against e6a71a1d18de: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the full worker lifecycle fixture, the fix diff, the guide source review, and relevant switch and lifecycle references. Skimmed the manifest changes and input-limit test diff; the rest of the changed code was not read in full. The review checklist and adjacent Tooling AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The fix changes guide fingerprints and their source-review record without removing or disabling the movie changes. - HOS_VIDEO_WORKER_OFF has a switches.def entry. **Testing:** No commands that build or run tests were executed. The author reports five Linux video checks passing; CI has not run on this head. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
Author
Member

Worker-test evidence on the Deck as well: tests/test_video_worker.py passes there with clang 23.1.5, and all five video checks pass. The current-head game-free run reports 14 pre-existing fixture failures unrelated to the video files; test_video_worker.py is not among them. I also started a clean current-main base build on the Deck with the new builder/toolchain, but it stops at the game dump because no .nup or romfs/exefs dump is present there. The current-base movie run still needs that dump.

Worker-test evidence on the Deck as well: tests/test_video_worker.py passes there with clang 23.1.5, and all five video checks pass. The current-head game-free run reports 14 pre-existing fixture failures unrelated to the video files; test_video_worker.py is not among them. I also started a clean current-main base build on the Deck with the new builder/toolchain, but it stops at the game dump because no .nup or romfs/exefs dump is present there. The current-base movie run still needs that dump.
test(video): stub the rejection cache in the not-translated fixture
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
631460ef16
The left-out cache is now consulted and written around translate_into; the fixture only checks the failure counts, so give it a no-op left_out_remember.
Owner
@review
BeanBot requested changes 2026-12-01 04:13:39 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The worker lifecycle test still does not exercise flush, and its restart assertion can pass without the restarted worker decoding anything. The reported movie improvement also needs repeated current-base and affected-platform runs.

Movie decoding moves off the Acquire path, and the renderer prewarms movie upscaling and caches rejected shader translations. The change adds a worker and packet queue per decoder, plus startup and cache work.

Blocking (1): must change before merging.

  1. L6 tests/test_video_input_limit.py:110: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. When: After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. Do: Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. (for the author: @fix couldn't: tests/test_video_worker.py never calls dec_flush. Its restart check waits for qn >= 1 while the picture from before worker_stop remains queued, so it can pass before the restarted worker produces a pi)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. When: The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. Do: Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware.

Since the last review (on 2432708821)
Still open: L6 (The lifecycle fixture does not test flush, and its restart assertion can pass on the pictu…); L8 (The reported improvement is from single runs on an older base, and startup prewarming and…); L9 (The check CI / Third-party parts and guide screenshots (pull_request) fails on this head…); L11 (The check CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) fails on th…); L13 (The check CI / Game-free checks (run_all.py, part 1/2) (pull_request) fails on this head…); L14 (The check CI / Game-free checks (run_all.py, part 2/2) (pull_request) fails on this head…); L15 (The check CI / Website build and checks (pull_request) fails on this head and passes on…); L16 (The check PR description / Title and description (pull_request_target) fails on this hea…)

Checks: Failing on this head, which is behind its base, where it passes: PR description / Title and description (pull_request_target). @rebase (or @fix) brings it up to date and runs it again; not held against it. Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven on the current base: the reported Deck comparison on an older base reduced skipped pictures from 532 to 16 in the first minute and from 593 to 34 over the full movie, but used one run per arm. Repeated current-base comparisons are still needed.

Other systems: The worker and renderer changes affect Windows and Linux, GPU drivers and movie decoding paths. The reported Deck run covers AMD RADV; Windows Media Foundation and other Linux GPU runs remain outstanding.

Switches: HOS_VIDEO_WORKER_OFF defaults to the worker enabled and retains the legacy path when set. The shader rejection cache switch was not fully assessed in this re-check.

Reviewed: 631460ef16 against e6a71a1d18: Read AGENTS.md, CONTRIBUTING.md, the changed test fixture and worker lifecycle fixture; inspected the change since the ledger and the commit and diff summaries. The full pull-request diff, changed production files, remaining tests, generated files and referenced repository standards were not read in full.; nothing run (a code review).

Checked and fine:

  • The added left_out_remember stub supplies the dependency used by the extracted shader failure handler without changing the fixture's count assertions.

Testing: No tests or project code were run. The author reports five video checks passing and an older-base Deck game comparison; CI is still running.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The worker lifecycle test still does not exercise flush, and its restart assertion can pass without the restarted worker decoding anything. The reported movie improvement also needs repeated current-base and affected-platform runs. Movie decoding moves off the Acquire path, and the renderer prewarms movie upscaling and caches rejected shader translations. The change adds a worker and packet queue per decoder, plus startup and cache work. **Blocking (1)**: must change before merging. 1. **L6** `tests/test_video_input_limit.py:110`: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. *When:* After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. **Do:** Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. *(for the author: `@fix` couldn't: tests/test_video_worker.py never calls dec_flush. Its restart check waits for qn >= 1 while the picture from before worker_stop remains queued, so it can pass before the restarted worker produces a pi)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The reported improvement is from single runs on an older base, and startup prewarming and the worker have not been exercised on the other affected Tier 1 systems. *When:* The current head may have different movie pacing or startup cost on current main, Windows Media Foundation, or other GPU drivers; the supplied Deck results do not determine those outcomes. **Do:** Repeat interleaved current-base and head movie runs on the Deck, and check movie playback and cold and warm startup on affected Windows and Linux Tier 1 hardware. **Since the last review** (on 243270882190) Still open: L6 (The lifecycle fixture does not test flush, and its restart assertion can pass on the pictu…); L8 (The reported improvement is from single runs on an older base, and startup prewarming and…); L9 (The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head…); L11 (The check `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)` fails on th…); L13 (The check `CI / Game-free checks (run_all.py, part 1/2) (pull_request)` fails on this head…); L14 (The check `CI / Game-free checks (run_all.py, part 2/2) (pull_request)` fails on this head…); L15 (The check `CI / Website build and checks (pull_request)` fails on this head and passes on…); L16 (The check `PR description / Title and description (pull_request_target)` fails on this hea…) **Checks:** Failing on this head, which is behind its base, where it passes: `PR description / Title and description (pull_request_target)`. `@rebase` (or `@fix`) brings it up to date and runs it again; not held against it. Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current base: the reported Deck comparison on an older base reduced skipped pictures from 532 to 16 in the first minute and from 593 to 34 over the full movie, but used one run per arm. Repeated current-base comparisons are still needed. **Other systems:** The worker and renderer changes affect Windows and Linux, GPU drivers and movie decoding paths. The reported Deck run covers AMD RADV; Windows Media Foundation and other Linux GPU runs remain outstanding. **Switches:** HOS_VIDEO_WORKER_OFF defaults to the worker enabled and retains the legacy path when set. The shader rejection cache switch was not fully assessed in this re-check. **Reviewed:** 631460ef1607 against e6a71a1d18de: Read AGENTS.md, CONTRIBUTING.md, the changed test fixture and worker lifecycle fixture; inspected the change since the ledger and the commit and diff summaries. The full pull-request diff, changed production files, remaining tests, generated files and referenced repository standards were not read in full.; nothing run (a code review). **Checked and fine:** - The added left_out_remember stub supplies the dependency used by the extracted shader failure handler without changing the fixture's count assertions. **Testing:** No tests or project code were run. The author reports five video checks passing and an older-base Deck game comparison; CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Author
Member

Current-main A/B is done on the Deck LCD. Clean base @ 87045899 built on the Deck, 926/926 units, 0 failed; the pack is from 0ac3276d. Two interleaved first-minute runs per arm, both runtimes warm:

  • stock: 694 and 470 pictures skipped in the first 60 s; first six skip events [1,9,3,4,10,3,1,1] (30) and [6,4,1,1,1,1,1,1] (14)
  • fixed: 13 and 0 skipped; first six skip events [7,2,2,1,1] (13) and [] (0)

The fix log has both movie-upscale prewarm lines. The worker test also passes on the Deck with clang 23.1.5. This removes the current-base rerun from Still to test; Windows Media Foundation and non-Deck Linux GPUs remain.

Current-main A/B is done on the Deck LCD. Clean base @ 87045899 built on the Deck, 926/926 units, 0 failed; the pack is from 0ac3276d. Two interleaved first-minute runs per arm, both runtimes warm: - stock: 694 and 470 pictures skipped in the first 60 s; first six skip events [1,9,3,4,10,3,1,1] (30) and [6,4,1,1,1,1,1,1] (14) - fixed: 13 and 0 skipped; first six skip events [7,2,2,1,1] (13) and [] (0) The fix log has both movie-upscale prewarm lines. The worker test also passes on the Deck with clang 23.1.5. This removes the current-base rerun from Still to test; Windows Media Foundation and non-Deck Linux GPUs remain.
Owner
@fix
Merge main into fix/movie-decode-worker-main
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
c5799d70f7
BeanBot requested changes 2026-12-01 04:20:42 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The worker lifecycle test still does not exercise flush or prove that the restarted worker produced a new picture. Windows Media Foundation and other affected hardware runs also remain outstanding.

What @fix changed
I changed this pull request: the new head is c5799d70f7. I merged main (4908cc6dad) into it, as it has merge commits.

Nothing was built or run: the checks run again on the new head.

The change moves movie decoding off the acquire thread and prewarms the movie upscale path. The Deck measurements show substantially fewer skipped pictures, at the cost of a worker thread and packet queue per decoder.

Blocking (1): must change before merging.

  1. L6 tests/test_video_input_limit.py:110: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. When: After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. Do: Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. (for the author: @fix couldn't: The fixture does not call dec_flush, and its restart check can still accept the picture left queued before worker_stop.)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The worker and startup prewarming have not been exercised on the other affected Tier 1 systems. When: Windows Media Foundation AV1 playback and movie playback on other Linux GPUs have no reported final-code runs. Do: Run the opening movie on Windows with Media Foundation AV1 and on the remaining affected Tier 1 hardware; check playback, acquire stalls and non-AV1 movies.

Checks: they run again on this head (CI / Third-party parts and guide screenshots (pull_request), CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request), CI / Game-free checks (run_all.py, part 2/2) (pull_request), CI / Website build and checks (pull_request) failed on the last one); a failure shows on the pull request.

More: does it help, other systems, switches, what was read

Does it help: Yes on the tested Deck LCD: two current-base first-minute runs fell from 694 and 470 skipped pictures to 13 and 0, according to the pull request and author’s test report. Other affected systems remain untested.

Other systems: The Windows Media Foundation AV1 path and movie playback on other Linux GPUs remain untested. The worker and prewarm paths can affect decoding, synchronization and startup on those systems.

Switches: HOS_VIDEO_WORKER_OFF defaults to off, enabling the worker; setting it to 1 selects synchronous decoding. The reported Deck measurements support the default there, but the outstanding platform runs are needed to assess it elsewhere.

Reviewed: c5799d70f7 against 4908cc6dad: Read the repository rules, pull request template, worker fixture and movie decoder diff; inspected lifecycle references and the switch diff. Other changed code, generated files and recorded artifacts were not read in full. The checkout resolves HEAD to c5799d70f, not the stated 631460ef16, so the requested exact-head recheck could not be completed.; nothing run (a code review).

Checked and fine:

  • The reported Deck comparison uses two interleaved runs per arm with both runtimes prepared warm.
  • The worker fixture includes a failed-thread-creation fallback case.

Testing: No commands that build or run project code were executed. CI is reported as not yet run on the stated head.

Overlaps and merge order: none found


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The worker lifecycle test still does not exercise flush or prove that the restarted worker produced a new picture. Windows Media Foundation and other affected hardware runs also remain outstanding. **What `@fix` changed** I changed this pull request: the new head is c5799d70f70d. I merged `main` (4908cc6dadff) into it, as it has merge commits. Nothing was built or run: the checks run again on the new head. The change moves movie decoding off the acquire thread and prewarms the movie upscale path. The Deck measurements show substantially fewer skipped pictures, at the cost of a worker thread and packet queue per decoder. **Blocking (1)**: must change before merging. 1. **L6** `tests/test_video_input_limit.py:110`: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. *When:* After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. **Do:** Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. *(for the author: `@fix` couldn't: The fixture does not call dec_flush, and its restart check can still accept the picture left queued before worker_stop.)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The worker and startup prewarming have not been exercised on the other affected Tier 1 systems. *When:* Windows Media Foundation AV1 playback and movie playback on other Linux GPUs have no reported final-code runs. **Do:** Run the opening movie on Windows with Media Foundation AV1 and on the remaining affected Tier 1 hardware; check playback, acquire stalls and non-AV1 movies. **Checks:** they run again on this head (`CI / Third-party parts and guide screenshots (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`, `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`, `CI / Website build and checks (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes on the tested Deck LCD: two current-base first-minute runs fell from 694 and 470 skipped pictures to 13 and 0, according to the pull request and author’s test report. Other affected systems remain untested. **Other systems:** The Windows Media Foundation AV1 path and movie playback on other Linux GPUs remain untested. The worker and prewarm paths can affect decoding, synchronization and startup on those systems. **Switches:** HOS_VIDEO_WORKER_OFF defaults to off, enabling the worker; setting it to 1 selects synchronous decoding. The reported Deck measurements support the default there, but the outstanding platform runs are needed to assess it elsewhere. **Reviewed:** c5799d70f70d against 4908cc6dadff: Read the repository rules, pull request template, worker fixture and movie decoder diff; inspected lifecycle references and the switch diff. Other changed code, generated files and recorded artifacts were not read in full. The checkout resolves HEAD to c5799d70f, not the stated 631460ef1607, so the requested exact-head recheck could not be completed.; nothing run (a code review). **Checked and fine:** - The reported Deck comparison uses two interleaved runs per arm with both runtimes prepared warm. - The worker fixture includes a failed-thread-creation fallback case. **Testing:** No commands that build or run project code were executed. CI is reported as not yet run on the stated head. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
Owner

@fix fix the test

@fix fix the test
Author
Member

Human review on the Deck, fixed runtime rt-current-fix, intro/title movie: no visual issues observed and no noticeable audio/video delay. This is a visual and sync observation to sit alongside the measured skip runs; the real save was not used.

Human review on the Deck, fixed runtime rt-current-fix, intro/title movie: no visual issues observed and no noticeable audio/video delay. This is a visual and sync observation to sit alongside the measured skip runs; the real save was not used.
test(vk): fix pipeline cache fixture for movie prewarm
Some checks failed
PR description / Title and description (pull_request_target) Failing after 8s
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Failing after 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 17s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m15s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 4m11s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 7m41s
CI / Website build and checks (pull_request) Failing after 34s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 7m32s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 41m51s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 32m20s
8b8d92e6ad
As the review on #2913 asked.
BeanBot requested changes 2026-12-01 04:24:10 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The worker lifecycle test still does not exercise flush or establish that the restarted worker produced a new picture. Those gaps leave the blocking test item unresolved.

What @fix changed
I changed this pull request: the new head is 8b8d92e6ad. I edited its description to match the change.

Changed

  • Fix the pipeline cache test: Narrowed the extracted code to the cache functions and added movie-prewarm stand-ins in tests/test_pipeline_play_cache.py:51 and tests/pipeline_play_cache_test.cpp:270. Tests were not run, as requested.

Nothing was built or run: the checks run again on the new head.

The change moves movie decoding off the acquire path and prewarms the upscale pipeline, reducing skipped pictures in the reported Deck runs at the cost of a worker thread and packet queue. The latest fix repairs the pipeline-cache fixture without removing that behavior.

Blocking (1): must change before merging.

  1. L6 tests/test_video_input_limit.py:110: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. When: After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. Do: Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. (for the author: @fix couldn't: tests/test_video_worker.py still does not call dec_flush. After worker_stop, the restart check waits for qn >= 1 without removing the existing picture, so it can pass before the restarted worker decod)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The worker and startup prewarming have not been exercised on the other affected Tier 1 systems. When: Windows Media Foundation AV1 playback and movie playback on other Linux GPUs have no reported final-code runs. Do: Run the opening movie on Windows with Media Foundation AV1 and on the remaining affected Tier 1 hardware; check playback, acquire stalls and non-AV1 movies.

Checks: they run again on this head (CI / Third-party parts and guide screenshots (pull_request), CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request), CI / Game-free checks (run_all.py, part 2/2) (pull_request), CI / Website build and checks (pull_request) failed on the last one); a failure shows on the pull request.

More: does it help, other systems, switches, what was read

Does it help: Yes. The reported two interleaved first-minute Deck runs dropped from 694 and 470 skipped pictures on the base to 13 and 0 with the change. Windows and other affected systems remain untested.

Other systems: The worker also changes the Windows Media Foundation path, and prewarming affects other Vulkan devices. The reported game runs cover the Deck; the other affected Tier 1 systems still need runs.

Switches: HOS_VIDEO_WORKER_OFF defaults off, enabling the worker; setting it restores synchronous decoding. The reported Deck measurements support the default there, but other affected systems have not yet been tested.

Reviewed: 8b8d92e6ad against 4908cc6dad: Read AGENTS.md, CONTRIBUTING.md, the pull request template, tests/test_pipeline_play_cache.py and tests/test_video_worker.py; inspected the pipeline-cache fixture and the changed source around the extracted functions. The full pull request code and all changed files were not read in full; the review checklist and sibling Tooling rules were not present.; nothing run (a code review).

Checked and fine:

  • The pipeline-cache fixture extracts the three cache initialization functions and supplies stand-ins for the movie prewarm calls.
  • The latest test-only fix does not remove or bypass the production movie changes.

Testing: No commands from the project were run. The author reports five video checks passing and Deck game measurements; CI has not yet run on this head.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The worker lifecycle test still does not exercise flush or establish that the restarted worker produced a new picture. Those gaps leave the blocking test item unresolved. **What `@fix` changed** I changed this pull request: the new head is 8b8d92e6ad93. I edited its description to match the change. **Changed** - **Fix the pipeline cache test**: Narrowed the extracted code to the cache functions and added movie-prewarm stand-ins in tests/test_pipeline_play_cache.py:51 and tests/pipeline_play_cache_test.cpp:270. Tests were not run, as requested. Nothing was built or run: the checks run again on the new head. The change moves movie decoding off the acquire path and prewarms the upscale pipeline, reducing skipped pictures in the reported Deck runs at the cost of a worker thread and packet queue. The latest fix repairs the pipeline-cache fixture without removing that behavior. **Blocking (1)**: must change before merging. 1. **L6** `tests/test_video_input_limit.py:110`: The lifecycle fixture does not test flush, and its restart assertion can pass on the picture produced before the stop. *When:* After the first worker produces one picture, qn remains 1. The restart wait immediately succeeds at target 1 even if the restarted worker never decodes the second packet; dec_flush is not included or called by the fixture. **Do:** Exercise the production flush path with queued or in-flight work, and verify that a post-stop submission produces a distinct new picture after restart. *(for the author: `@fix` couldn't: tests/test_video_worker.py still does not call dec_flush. After worker_stop, the restart check waits for qn >= 1 without removing the existing picture, so it can pass before the restarted worker decod)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The worker and startup prewarming have not been exercised on the other affected Tier 1 systems. *When:* Windows Media Foundation AV1 playback and movie playback on other Linux GPUs have no reported final-code runs. **Do:** Run the opening movie on Windows with Media Foundation AV1 and on the remaining affected Tier 1 hardware; check playback, acquire stalls and non-AV1 movies. **Checks:** they run again on this head (`CI / Third-party parts and guide screenshots (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`, `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`, `CI / Website build and checks (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The reported two interleaved first-minute Deck runs dropped from 694 and 470 skipped pictures on the base to 13 and 0 with the change. Windows and other affected systems remain untested. **Other systems:** The worker also changes the Windows Media Foundation path, and prewarming affects other Vulkan devices. The reported game runs cover the Deck; the other affected Tier 1 systems still need runs. **Switches:** HOS_VIDEO_WORKER_OFF defaults off, enabling the worker; setting it restores synchronous decoding. The reported Deck measurements support the default there, but other affected systems have not yet been tested. **Reviewed:** 8b8d92e6ad93 against 4908cc6dadff: Read AGENTS.md, CONTRIBUTING.md, the pull request template, tests/test_pipeline_play_cache.py and tests/test_video_worker.py; inspected the pipeline-cache fixture and the changed source around the extracted functions. The full pull request code and all changed files were not read in full; the review checklist and sibling Tooling rules were not present.; nothing run (a code review). **Checked and fine:** - The pipeline-cache fixture extracts the three cache initialization functions and supplies stand-ins for the movie prewarm calls. - The latest test-only fix does not remove or bypass the production movie changes. **Testing:** No commands from the project were run. The author reports five video checks passing and Deck game measurements; CI has not yet run on this head. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
Member

This PR's movie upscale prewarm should also fix two open Intel reports: #2477 (Iris Xe, Mesa 26.2.7, v3.2.0) and #2935 (Iris Xe, Mesa 26.3.1, nightly-971). Both are Linux with Mesa's Intel driver, and both show a black window from the opening movie on, with no input and no fullscreen.

Why they hang. Numbers are from #2935's log; line numbers are on main 4908cc6d.

  • At the start, the mesh fallback builds stall (load at create: 717 of 4684 steps done, nothing finished for 30 s). The game goes on while those builds keep running in the driver.
  • The movie's networks are left out on this card (not translated: a network left out on this card), so the linear movie_upscale stands in for them.
  • On main, movie_upscale (gpu/vk/vk_draw.cpp:10803) builds its pipeline the first time it's used, on the Presentation Thread. The path is texture_compute_pipeline → shared_compute_pipeline → cached_compute → ComputeTurn (vk_draw.cpp:2083).
  • ComputeTurn waits at the compute gate (gpu/vk/compute_gate.h), which is on by default on Mesa Intel. The fallback compiles ahead of it take minutes each on that compiler. #2477's stack shows the Presentation Thread waiting there, and 17 precompile_at_create threads waiting there too.
  • So no frame is shown after the startup logo. #2477 also found that a start without the program cache (no fallback builds) plays the opening.

Why this PR helps. movie_upscale_prewarm() runs in pcache_init(), which precompile_run calls before texture_pipelines_warm() and the load-at-create fallback builds. The pipeline is then ready before the gate fills, so the first movie frame doesn't wait in it.

Three suggestions, none of them blocking:

  1. Name #2477 and #2935 in the Summary as likely fixed. They aren't confirmed until an Intel run shows it.
  2. An Iris Xe run on Linux could count toward "Other Linux GPUs" in Still to test. That means the Test Farm's linux+anv target, or one of the two reporters. On a first start after a shader preparation, look for vk: movie upscale pipeline prewarmed: yes before the nothing finished for 30 s line, then check that the opening plays.
  3. The other renderer helpers made on first use go through the same gate: typed_upscale, the mask helper and FSR 3's pipelines. They could wait the same way if they're first needed while fallback builds still run. That's beyond this PR's topic, but worth knowing if an Intel run still stalls after the movie.

I won't open a separate fix for #2935, so it can land with this PR.

This PR's movie upscale prewarm should also fix two open Intel reports: #2477 (Iris Xe, Mesa 26.2.7, v3.2.0) and #2935 (Iris Xe, Mesa 26.3.1, nightly-971). Both are Linux with Mesa's Intel driver, and both show a black window from the opening movie on, with no input and no fullscreen. **Why they hang.** Numbers are from #2935's log; line numbers are on main 4908cc6d. - At the start, the mesh fallback builds stall (`load at create: 717 of 4684 steps done, nothing finished for 30 s`). The game goes on while those builds keep running in the driver. - The movie's networks are left out on this card (`not translated: a network left out on this card`), so the linear `movie_upscale` stands in for them. - On main, `movie_upscale` (`gpu/vk/vk_draw.cpp:10803`) builds its pipeline the first time it's used, on the Presentation Thread. The path is `texture_compute_pipeline → shared_compute_pipeline → cached_compute → ComputeTurn` (`vk_draw.cpp:2083`). - `ComputeTurn` waits at the compute gate (`gpu/vk/compute_gate.h`), which is on by default on Mesa Intel. The fallback compiles ahead of it take minutes each on that compiler. #2477's stack shows the Presentation Thread waiting there, and 17 `precompile_at_create` threads waiting there too. - So no frame is shown after the startup logo. #2477 also found that a start without the program cache (no fallback builds) plays the opening. **Why this PR helps.** `movie_upscale_prewarm()` runs in `pcache_init()`, which `precompile_run` calls before `texture_pipelines_warm()` and the load-at-create fallback builds. The pipeline is then ready before the gate fills, so the first movie frame doesn't wait in it. Three suggestions, none of them blocking: 1. Name #2477 and #2935 in the Summary as likely fixed. They aren't confirmed until an Intel run shows it. 2. An Iris Xe run on Linux could count toward "Other Linux GPUs" in Still to test. That means the Test Farm's linux+anv target, or one of the two reporters. On a first start after a shader preparation, look for `vk: movie upscale pipeline prewarmed: yes` before the `nothing finished for 30 s` line, then check that the opening plays. 3. The other renderer helpers made on first use go through the same gate: `typed_upscale`, the mask helper and FSR 3's pipelines. They could wait the same way if they're first needed while fallback builds still run. That's beyond this PR's topic, but worth knowing if an Intel run still stalls after the movie. I won't open a separate fix for #2935, so it can land with this PR.
test(video): exercise flush and prove a new picture after restart
Some checks failed
PR description / Title and description (pull_request_target) Failing after 4s
CI / What the change needs (pull_request) Successful in 5s
CI / Third-party parts and guide screenshots (pull_request) Failing after 8s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 28s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m48s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 3m38s
CI / Website build and checks (pull_request) Failing after 33s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 6m20s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 6m18s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 22m42s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 26m50s
c320f7548c
The lifecycle test left the pre-flush picture in the queue, so its restart wait could pass without the new worker decoding. Extract the production dec_flush path, flush decoded and pending work, assert the queue is cleared, and require the restarted worker's picture to carry the new submission's pts. A disposable mutation that leaves qn alone fails both assertions.
Author
Member

L6 is addressed at c320f754. tests/test_video_worker.py now cuts the production dec_flush path, flushes a queued picture plus a pending submission, asserts qn and phead are cleared, asserts the worker is joined and stopped, and requires the restarted worker's picture to be the new submission with pts 99 rather than the pre-flush picture. A second case flushes submissions that were never decoded. Focused test and the five video checks pass; a disposable mutation that leaves qn alone fails both new assertions. Please re-review at this head.

L6 is addressed at c320f754. tests/test_video_worker.py now cuts the production dec_flush path, flushes a queued picture plus a pending submission, asserts qn and phead are cleared, asserts the worker is joined and stopped, and requires the restarted worker's picture to be the new submission with pts 99 rather than the pre-flush picture. A second case flushes submissions that were never decoded. Focused test and the five video checks pass; a disposable mutation that leaves qn alone fails both new assertions. Please re-review at this head.
fix(video): serialize Flush against the decode worker
Some checks failed
CI / What the change needs (pull_request) Successful in 5s
CI / Third-party parts and guide screenshots (pull_request) Failing after 7s
PR description / Title and description (pull_request_target) Failing after 4s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 29s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m51s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 3m38s
CI / Website build and checks (pull_request) Failing after 32s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 6m18s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 6m17s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 22m51s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 26m35s
b41a5cb7ef
Keep a start barrier set from the stop through the backend and queue cleanup, so a submission arriving in the join window cannot start a replacement worker; clear it only after dec_flush has finished. Close the worker thread's high-resolution sleep timer on exit. The worker fixture now takes the decoder lock for test-thread reads and publishes, holds a real overlapping Submit/Flush rendezvous, and checks the barrier and timer cleanup; the sleep-timer fixture checks the timer close. Focused video and sleep checks pass, including ThreadSanitizer with setarch -R.

Assisted-by: Hermes Agent
Author
Member

b41a5cb7 answers the independent review and refreshes the measurement on current main.

  • Flush now keeps a start barrier set from the worker stop through the backend and queue cleanup, so a submission arriving in the join window cannot start a replacement worker. The fixture covers a real overlapping Submit/Flush and the gap between stop and cleanup.
  • The worker closes its thread-local high-resolution sleep timer on exit; the sleep-timer fixture verifies the close.
  • The worker fixture takes the decoder lock for every test-thread read and pending publication, and passes ThreadSanitizer with setarch -R.
  • Current-base A/B was rerun on 4908cc6d: 779/495 skipped pictures in the stock first minute versus 59/1 with the fix; the PR body now carries the table and the exact b41a5cb7 pack head.

Focused video checks, the pipeline cache check, the short-sleep check and pre-commit pass. CI is running on b41a5cb7; the PR-description check still waits on mise run test, and the third-party/guide job is the same source-drift failure.

b41a5cb7 answers the independent review and refreshes the measurement on current main. - Flush now keeps a start barrier set from the worker stop through the backend and queue cleanup, so a submission arriving in the join window cannot start a replacement worker. The fixture covers a real overlapping Submit/Flush and the gap between stop and cleanup. - The worker closes its thread-local high-resolution sleep timer on exit; the sleep-timer fixture verifies the close. - The worker fixture takes the decoder lock for every test-thread read and pending publication, and passes ThreadSanitizer with setarch -R. - Current-base A/B was rerun on 4908cc6d: 779/495 skipped pictures in the stock first minute versus 59/1 with the fix; the PR body now carries the table and the exact b41a5cb7 pack head. Focused video checks, the pipeline cache check, the short-sleep check and pre-commit pass. CI is running on b41a5cb7; the PR-description check still waits on mise run test, and the third-party/guide job is the same source-drift failure.
Author
Member
@review
BeanBot left a comment

Recommendation: Request changes. The Deck measurements show a substantial reduction in movie skips, and the flush fixture now checks the requested lifecycle behavior. Windows Media Foundation and the other affected Tier 1 systems still need runs. (It stands on L9: The check CI / Third-party parts and guide screenshots (pull_request) fails on this head and passes on the base branch: Failing after 24s.)

Movie decoding moves to a worker, while startup prewarming and a scoped rejection cache reduce movie shader preparation costs. This adds a thread and queue lifecycle per decoder and startup cache work.

Blocking (2): must change before merging.

  1. L9: The check CI / Third-party parts and guide screenshots (pull_request) fails on this head and passes on the base branch: Failing after 24s.
  2. L16: The check PR description / Title and description (pull_request_target) fails on this head and passes on the base branch: Failing after 8s. (for the author: @fix couldn't: its check runs again on this head)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The worker and startup prewarming have not been exercised on the other affected Tier 1 systems. When: Windows Media Foundation AV1 playback and movie playback on other Linux GPUs have no reported final-code runs. Do: Run the opening movie on Windows with Media Foundation AV1 and on the remaining affected Tier 1 hardware; check playback, acquire stalls and non-AV1 movies.

@fix can do L9.

Since the last review (on 8b8d92e6ad)
Resolved: L6 (The lifecycle fixture does not test flush, and its restart assertion can pass on the pictu…)
Still open: L8 (The worker and startup prewarming have not been exercised on the other affected Tier 1 sys…); L9 (The check CI / Third-party parts and guide screenshots (pull_request) fails on this head…); L11 (The check CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) fails on th…); L13 (The check CI / Game-free checks (run_all.py, part 1/2) (pull_request) fails on this head…); L14 (The check CI / Game-free checks (run_all.py, part 2/2) (pull_request) fails on this head…); L15 (The check CI / Website build and checks (pull_request) fails on this head and passes on…); L16 (The check PR description / Title and description (pull_request_target) fails on this hea…)

Checks: Still running: 7 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes on the tested Deck LCD: two current-base first-minute runs fell from 779 and 495 skipped pictures to 59 and 1, with both arms prepared warm. Behavior on the other affected systems remains unverified.

Other systems: Windows Media Foundation AV1 callback behavior and movie playback on other Linux GPUs remain untested. The renderer prewarm and cache can affect drivers beyond the tested RADV Deck.

Switches: HOS_VIDEO_WORKER_OFF is added, default off, enabling the worker; setting it to 1 restores Acquire decoding. The default is supported by the Deck results but still needs the platform runs.

Reviewed: b41a5cb7ef against 4908cc6dad: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the changes since the ledger, and the relevant worker, submit, flush, and finalize paths. Skimmed the overall change statistics and commits; the full base diff and all changed files were not read in full.; nothing run (a code review).

Checked and fine:

  • The flush test also covers pending-only work and a submission overlapping worker shutdown.
  • The current-base Deck runs are interleaved and use the same settings.

Testing: The author reports focused video and timer checks passing, including ThreadSanitizer, and an in-game Deck visual and audio-sync check. CI has two head-only failures and several checks still running; no commands or tests were run for this review.

Overlaps and merge order: Intel reports #2477 and #2935 may also benefit from prewarming, but an Intel run has not confirmed this.


Automated code review by BeanBot (gpt-6.1-terra), asked for by omgitsgela. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The Deck measurements show a substantial reduction in movie skips, and the flush fixture now checks the requested lifecycle behavior. Windows Media Foundation and the other affected Tier 1 systems still need runs. (It stands on L9: The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head and passes on the base branch: Failing after 24s.) Movie decoding moves to a worker, while startup prewarming and a scoped rejection cache reduce movie shader preparation costs. This adds a thread and queue lifecycle per decoder and startup cache work. **Blocking (2)**: must change before merging. 1. **L9**: The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head and passes on the base branch: Failing after 24s. 2. **L16**: The check `PR description / Title and description (pull_request_target)` fails on this head and passes on the base branch: Failing after 8s. *(for the author: `@fix` couldn't: its check runs again on this head)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The worker and startup prewarming have not been exercised on the other affected Tier 1 systems. *When:* Windows Media Foundation AV1 playback and movie playback on other Linux GPUs have no reported final-code runs. **Do:** Run the opening movie on Windows with Media Foundation AV1 and on the remaining affected Tier 1 hardware; check playback, acquire stalls and non-AV1 movies. `@fix` can do L9. **Since the last review** (on 8b8d92e6ad93) Resolved: L6 (The lifecycle fixture does not test flush, and its restart assertion can pass on the pictu…) Still open: L8 (The worker and startup prewarming have not been exercised on the other affected Tier 1 sys…); L9 (The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head…); L11 (The check `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)` fails on th…); L13 (The check `CI / Game-free checks (run_all.py, part 1/2) (pull_request)` fails on this head…); L14 (The check `CI / Game-free checks (run_all.py, part 2/2) (pull_request)` fails on this head…); L15 (The check `CI / Website build and checks (pull_request)` fails on this head and passes on…); L16 (The check `PR description / Title and description (pull_request_target)` fails on this hea…) **Checks:** Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes on the tested Deck LCD: two current-base first-minute runs fell from 779 and 495 skipped pictures to 59 and 1, with both arms prepared warm. Behavior on the other affected systems remains unverified. **Other systems:** Windows Media Foundation AV1 callback behavior and movie playback on other Linux GPUs remain untested. The renderer prewarm and cache can affect drivers beyond the tested RADV Deck. **Switches:** HOS_VIDEO_WORKER_OFF is added, default off, enabling the worker; setting it to 1 restores Acquire decoding. The default is supported by the Deck results but still needs the platform runs. **Reviewed:** b41a5cb7ef45 against 4908cc6dadff: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the changes since the ledger, and the relevant worker, submit, flush, and finalize paths. Skimmed the overall change statistics and commits; the full base diff and all changed files were not read in full.; nothing run (a code review). **Checked and fine:** - The flush test also covers pending-only work and a submission overlapping worker shutdown. - The current-base Deck runs are interleaved and use the same settings. **Testing:** The author reports focused video and timer checks passing, including ThreadSanitizer, and an in-game Deck visual and audio-sync check. CI has two head-only failures and several checks still running; no commands or tests were run for this review. **Overlaps and merge order:** Intel reports #2477 and #2935 may also benefit from prewarming, but an Intel run has not confirmed this. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by omgitsgela. Nothing was run; a maintainer decides.</sub>
Owner
@rebase
Member

This pull request has merge commits, so I brought it up to date by merging main (55773e3613) into it rather than rebasing (its history stays as it is): the new head is c710f82d40.

Conflicts resolved

  • docs/user/images/guide/manifest.json: Kept both sides’ record changes and review references, using the base branch’s conflicting revision and hash.

Nothing was built or run: read the resolution before merging.


Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

This pull request has merge commits, so I brought it up to date by merging `main` (55773e36136a) into it rather than rebasing (its history stays as it is): the new head is c710f82d40cb. **Conflicts resolved** - docs/user/images/guide/manifest.json: Kept both sides’ record changes and review references, using the base branch’s conflicting revision and hash. Nothing was built or run: read the resolution before merging. --- <sub>Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Merge main into fix/movie-decode-worker-main
Some checks failed
PR description / Title and description (pull_request_target) Failing after 4s
CI / What the change needs (pull_request) Successful in 5s
CI / Third-party parts and guide screenshots (pull_request) Successful in 8s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 12s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 2m31s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m29s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m53s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m36s
CI / Website build and checks (pull_request) Failing after 30s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 22m43s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 30m31s
c710f82d40
# Conflicts:
#	docs/user/images/guide/manifest.json
BeanBot left a comment

Recommendation: Approve. The Deck measurements show substantially fewer skipped movie pictures, but the worker and startup prewarm still need runs on the other affected Tier 1 systems. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

Moves movie decoding off the Acquire path, prewarms the movie upscale pipeline and caches rejected network programs. It adds a worker and packet queue per decoder, plus startup GPU work and a cache file.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L8: The worker and startup prewarming have not been exercised on the other affected Tier 1 systems. When: Windows Media Foundation AV1 playback and movie playback on other Linux GPUs have no reported final-code runs. Do: Run the opening movie on Windows with Media Foundation AV1 and on the remaining affected Tier 1 hardware; check playback, acquire stalls and non-AV1 movies.

Since the last review (on b41a5cb7ef)
Still open: L8 (The worker and startup prewarming have not been exercised on the other affected Tier 1 sys…); L9 (The check CI / Third-party parts and guide screenshots (pull_request) fails on this head…); L11 (The check CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) fails on th…); L13 (The check CI / Game-free checks (run_all.py, part 1/2) (pull_request) fails on this head…); L14 (The check CI / Game-free checks (run_all.py, part 2/2) (pull_request) fails on this head…); L15 (The check CI / Website build and checks (pull_request) fails on this head and passes on…); L16 (The check PR description / Title and description (pull_request_target) fails on this hea…)

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes on the Steam Deck LCD: the reported interleaved current-base first-minute runs fell from 779 and 495 skipped pictures to 59 and 1. Both arms were warmed and used the same settings; other systems remain untested.

Other systems: The worker also affects Windows Media Foundation and other Linux decoder paths; prewarming and the rejection cache affect Vulkan devices beyond the Deck. The reported runs do not yet establish their behavior on those systems.

Switches: HOS_VIDEO_WORKER_OFF is added, default off; setting it to 1 restores Acquire-path decoding. The worker default is supported by the Deck results, but its behavior on the remaining platforms is still to be checked.

Reviewed: c710f82d40 against 55773e3613: Read AGENTS.md and CONTRIBUTING.md and inspected the host and renderer diffs, commit list and reported runs. The guide manifest changes and remaining test and documentation changes were skimmed; the full changed code files were not read.; nothing run (a code review).

Checked and fine:

  • The reported Deck run observed no visual issues or noticeable audio/video delay.
  • The worker test is reported to cover lifecycle, overlapping Submit/Flush, and thread-start failure.

Testing: No code or tests were run for this review. The author reports focused Linux checks and a ThreadSanitizer pass; CI is still running.

Overlaps and merge order: No overlapping pull requests identified from the supplied information.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The Deck measurements show substantially fewer skipped movie pictures, but the worker and startup prewarm still need runs on the other affected Tier 1 systems. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. Moves movie decoding off the Acquire path, prewarms the movie upscale pipeline and caches rejected network programs. It adds a worker and packet queue per decoder, plus startup GPU work and a cache file. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L8**: The worker and startup prewarming have not been exercised on the other affected Tier 1 systems. *When:* Windows Media Foundation AV1 playback and movie playback on other Linux GPUs have no reported final-code runs. **Do:** Run the opening movie on Windows with Media Foundation AV1 and on the remaining affected Tier 1 hardware; check playback, acquire stalls and non-AV1 movies. **Since the last review** (on b41a5cb7ef45) Still open: L8 (The worker and startup prewarming have not been exercised on the other affected Tier 1 sys…); L9 (The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head…); L11 (The check `CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)` fails on th…); L13 (The check `CI / Game-free checks (run_all.py, part 1/2) (pull_request)` fails on this head…); L14 (The check `CI / Game-free checks (run_all.py, part 2/2) (pull_request)` fails on this head…); L15 (The check `CI / Website build and checks (pull_request)` fails on this head and passes on…); L16 (The check `PR description / Title and description (pull_request_target)` fails on this hea…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes on the Steam Deck LCD: the reported interleaved current-base first-minute runs fell from 779 and 495 skipped pictures to 59 and 1. Both arms were warmed and used the same settings; other systems remain untested. **Other systems:** The worker also affects Windows Media Foundation and other Linux decoder paths; prewarming and the rejection cache affect Vulkan devices beyond the Deck. The reported runs do not yet establish their behavior on those systems. **Switches:** HOS_VIDEO_WORKER_OFF is added, default off; setting it to 1 restores Acquire-path decoding. The worker default is supported by the Deck results, but its behavior on the remaining platforms is still to be checked. **Reviewed:** c710f82d40cb against 55773e36136a: Read AGENTS.md and CONTRIBUTING.md and inspected the host and renderer diffs, commit list and reported runs. The guide manifest changes and remaining test and documentation changes were skimmed; the full changed code files were not read.; nothing run (a code review). **Checked and fine:** - The reported Deck run observed no visual issues or noticeable audio/video delay. - The worker test is reported to cover lifecycle, overlapping Submit/Flush, and thread-start failure. **Testing:** No code or tests were run for this review. The author reports focused Linux checks and a ThreadSanitizer pass; CI is still running. **Overlaps and merge order:** No overlapping pull requests identified from the supplied information. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/movie-decode-worker-main 2026-12-01 15:21:57 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2913
No description provided.