Skip to content

Fix Chrome seek corruption and AV1 fallback during accelerated playback - #5

Merged
AoTofu merged 18 commits into
mainfrom
fix/youtube-av1-double-speed
Sep 15, 2026
Merged

AoTofu merged 18 commits into
mainfrom
fix/youtube-av1-double-speed

Conversation

@AoTofu

@AoTofu AoTofu commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Chrome can show stale or split frames after seeking, and AV1 playback can fail during decoder reinitialization and fall back to VP9. Complete writes to shared surfaces before returning from EndPicture, propagate resolve failures, and preserve valid DMA-BUF reuse across decoder resets and backing-cache eviction.

  • Recover missing legacy PRIME modifiers from matching cached buffers, and reopen native packed NVKMS buffers through DRM when their CUDA backing cache entry has been evicted. Validate the layout and explicit PRIME_2 modifiers, preserve pixels, and release imported mappings.
  • Recover broken Chrome launchers, update the configured driver path, and refresh KDE's application cache so normal launches use the installed fix.
  • Add regression coverage for exported-surface completion, failed exports, PRIME roundtrips after eviction, pixel preservation, FD lifetime, and launcher updates. Extend browser diagnostics and frame-ID seek fixtures; include the investigation reports.

Validation on RTX 5080 / NVIDIA 610.57.04 / Chrome 153.0.8010.36:

  • Latest merged branch: GCC debugoptimized and Clang release each pass all 12 CPU/GPU tests; ASan/UBSan passes all 8 CPU tests.
  • 100 patterned NV12/P010 images, from 64x48 through 1920x1080, survive 200 legacy/PRIME_2 imports after cache eviction with exact pixel matches and stable FD counts.
  • AV1 4K60 arrow-key bursts: 150 trials with zero incorrect frame IDs or split IDs, with the detached cache disabled.
  • The reported YouTube video completes all 14m50s at 2x in the normal Chrome profile after a page reload: all 443 playing samples report rate 2, 26,673 AV1 picture submissions, 725 native reimports, and zero driver errors. The new driver mapping and YouTube end screen were verified.

The native reimport path is limited to validated single-object packed layouts; it does not infer arbitrary foreign tiled layouts from legacy PRIME descriptors. GPU/browser validation was performed locally; the GitHub workflow covers the compiler/VP9/sanitizer matrix.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T00:44:20.240211Z e345272 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AoTofu
AoTofu merged commit 83bd5fa into main Sep 15, 2026
8 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e345272164

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1348 to +1349
int fd = export_dmabuf_memory(&drv->driverContext, img->fds[0]);
if (fd < 0) return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Verify the native buffer's tiling before reimporting it

For a legacy PRIME import from another NVIDIA allocator, successfully exporting the GEM object to an RM memory FD proves only that it is native NVKMS storage; the export ioctl returns no surface-layout metadata. Pitches, offsets, and allocation size do not uniquely determine the DRM modifier, so a linear buffer or one using a different block height can satisfy the preceding geometry checks and then be mapped with planes' inferred block-linear layout, corrupting reads and writes. Restrict this path to allocations whose modifier was previously recorded by this driver, or obtain and verify the actual layout before creating the CUDA arrays.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant