Skip to content

xcl run: XCL_SHORT_MOVIES=1 ends a title's Bink videos after their first frame - #681

Open
pr1sm-dev wants to merge 1 commit into
xcl-dev:mainfrom
pr1sm-dev:short-movies
Open

pr1sm-dev wants to merge 1 commit into
xcl-dev:mainfrom
pr1sm-dev:short-movies

Conversation

@pr1sm-dev

Copy link
Copy Markdown

A switch for test runs: with XCL_SHORT_MOVIES=1 a title's Bink videos end after their first frame. A retail game plays its intro through the console's Bink DLL and takes no button to skip it, so every test run waited about 40 s for it. Without the switch nothing changes; the game's files are never touched.

How: the resolver wraps three exports of the game's bink2*.dll that the title imports. A video opened with more than one frame goes to its last frame (the DLL's own BinkGoto) at its first BinkNextFrame, so the title's own end-of-video test is met. Not at the open: the title registers its frame buffers after it, and a goto there read a null pointer inside the DLL.

What is in it

  • crates/xcl/src/resolver.rs: mod short_movies (the switch, wrappers of BinkOpenWithOptions / BinkNextFrame / BinkClose, the list of opened videos), the hook in resolve_import for imports from a game DLL, and a unit test of the list (short_movies_step_a_video_to_its_end_once).
  • README.md: one entry for the switch.

Tested

  • Linux Mint 22.2, kernel 6.17, Wine 11.22 (winehq-devel), vkd3d-proton v3.1 with the patch of Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257, DXVK 3.1.1; RTX 3070 8 GB, driver 595.91.07; Ryzen 7 5800X; Rust 1.100.0, release, target x86_64-pc-windows-gnu. No Windows machine: everything below is under Wine.
  • This commit (8caf783), a retail title, 120 s, XCL_SHORT_MOVIES=1, same script and settings as the regression runs below: the log has "a video of 450 frames went to its last frame (XCL_SHORT_MOVIES)" at 46.3 s, the video was cut on screen, and the run went on and ended by itself: exit 0x0, 1156 (PresentX 1156) frames shown, 0 crashes, 0 device removals. (Fewer frames than the runs below because the time the video took is now spent on the loading screen, which presents more slowly.)
  • resolver:: unit tests under Wine, on a local tree with the same resolver.rs (main at 7ebf1b8 plus other open PRs, so not this commit): 6 passed, 0 failed, 664 filtered out.
  • Two earlier forms did not work on that title and are not in this PR: setting the frame count on the title's first (probe) open did not end the video, and a BinkGoto at the open crashed inside the DLL.

Regression run

  • Made with scripts/linux/smoke.sh of Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257 (the Linux port of scripts/smoke.ps1, not merged) under Wine, not with smoke.ps1: I have no Windows machine. Default settings (the switch off), 120 s, scripted A / D-pad presses (XCL_PRESS_AT) in both. The game folder is mounted under a neutral name.
  • main was run three times and ended in an access violation twice (at 92 s and 99 s, 0xc0000005 reading title memory under a memcpy; the script prints no block for a run that does not reach its end). The block below is the third run. The PR's default run was made once.

main:

xcl-smoke v1
commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95
gpu: NVIDIA GeForce RTX 3070
title: retail-title
seconds: 120
exit: 0x0
frames shown: 1446 (PresentX 1446)
presents per 2 s (last 3): 3 2 0
device removals: 0
crashes: 0
peak commit: 0 MB

PR:

xcl-smoke v1
commit: 8caf783923c7ac348e28622f3200cb497c5390a7
gpu: NVIDIA GeForce RTX 3070
title: retail-title
seconds: 120
exit: 0x0
frames shown: 1861 (PresentX 1861)
presents per 2 s (last 3): 0 0 14
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • Windows (any GPU): not built with MSVC, scripts/smoke.ps1 not run.
  • cargo test --workspace: not run (no Windows; under Wine only the resolver:: tests above).
  • Titles other than one retail game; videos played after the intro (they end early too while the switch is on); looping videos; Bink DLLs other than Bink2Scarlett.dll (the switch matches bink2*.dll from the game folder).
  • Whether the title's audio for a shortened video stops cleanly in every case (no problem heard in the runs above).

AI use

  • Claude Code with Claude Fable 5.2 wrote the code, the test, the commit message and this description, and ran the builds and runs above on my machine. I watched the runs and confirmed on screen that the video was cut.

…rst frame

A retail game plays its intro through the console's Bink DLL from its own
folder and takes no button to skip it, so every test run waits through the
video (about 40 s of each run here).

With XCL_SHORT_MOVIES=1 the resolver wraps three of that DLL's exports the
title imports (BinkOpenWithOptions, BinkNextFrame, BinkClose): a video
opened with more than one frame goes to its last frame, with the DLL's own
BinkGoto, at its first BinkNextFrame. The title's end-of-video test is then
met after one frame. The goto is not made at the open: the title registers
its frame buffers after it, and a goto there read a null pointer inside the
DLL. Without the switch the imports are the DLL's own, and nothing in the
game's files changes either way.

Measured under Wine on a local tree (not this commit, see the PR): the
450-frame intro ended 4 s after its open and loading began about 20 s
earlier in the run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@pr1sm-dev
pr1sm-dev marked this pull request as ready for review November 24, 2026 03:28
@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of 8caf783923c7ac348e28622f3200cb497c5390a7 on AMD RDNA4. I merged it onto current main f4ce27c locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 658 passed, 3 failed, 21 ignored, exit code 101; 0 SKIPPED
  • the 3 failures: placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted, d32s8_targets_take_their_own_size_of_video_memory. These three also fail on main f4ce27c with no PR applied (cargo test -p xcl --lib -- --test-threads=4: 657 passed, 3 failed), so they are not from this change. The first is placed_title_textures_share_vram_and_preserve_pixels at cubemap extra_pages must be reused at same va; the other two are PoisonErrors from the lock it poisons (Tests: a panicking title-texture test no longer poisons the others #673 addresses the cascade, Tests: check cubemap tile reuse independently of idle page reclamation #447 the cubemap check). It is intermittent: alone it passes 3 of 3, and in the parallel lib run it failed on 6 of 7 runs at f4ce27c, 2 of 6 at d852f9a and 1 of 3 at 1387b4b on this machine.
  • short_movies_step_a_video_to_its_end_once passes.

Review: Opt-in for test runs (XCL_SHORT_MOVIES=1); it wraps exports of the title's Bink DLL and leaves the game's files alone, and without the variable nothing changes. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

@mastrr9

mastrr9 commented Nov 24, 2026

Copy link
Copy Markdown

Code audit + Windows MSVC / NVIDIA RTX 5080 full-suite test run on 8caf783923c7ac348e28622f3200cb497c5390a7:

Review

Looks clean and well-isolated behind XCL_SHORT_MOVIES=1:

  • Only wraps BinkOpenWithOptions / BinkNextFrame / BinkClose on bink2* DLLs when BinkGoto resolves inside a game DLL, leaves frames <= 1 untouched, and replaces stale entries if a handle address is reused.

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), rustc 1.100.0 (MSVC), debug build.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 691 passed, 0 failed, 41 ignored.
  • New test resolver::tests::short_movies_step_a_video_to_its_end_once: passed.
  • SKIPPED GPU/D3D12 tests: gpu_geometry_wave32_prefix_count_over_a_mask / gpu_wave32_program_in_wave64_hardware (no wave64), plus 2 D3D12 debug-layer tests (no d3d12SDKLayers.dll).

Not tested

  • Retail title / scripts/smoke.ps1 run with XCL_SHORT_MOVIES=1 (test suite only).
  • AMD / Intel GPUs.

AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.

@Anon64

Anon64 commented Nov 24, 2026

Copy link
Copy Markdown

Regression runs for this PR's head 8caf783 and for its base main dd2ae9a, on a retail title (same title, 60 s each), made with scripts/smoke.ps1 (release, clean tree at each commit) and pasted unedited, for Regression run.

main:

xcl-smoke v1
commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1647 (PresentX 1647)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14680 MB

this PR:

xcl-smoke v1
commit: 8caf783923c7ac348e28622f3200cb497c5390a7
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1648 (PresentX 1648)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14586 MB

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 581.80, wave32), Intel Core i9-14900KF, Windows 11 25H2 26200.9974, Rust 1.90.0

Not tested

  • the unit and e2e tests on this machine
  • XCL_SHORT_MOVIES=1 itself: these runs leave it unset, so this is a regression check only

Report written with Claude Code (Claude Opus 5.5) from runs on this machine.

@ThiagoAlexsander

Copy link
Copy Markdown

Windows datapoint (native, not Wine): XCL_SHORT_MOVIES=1 works on the retail title.

Setup: Windows 11 Pro 26300, RTX 5080 16 GB (driver 32.0.16.1088), Ryzen 7 9800X3D, 62 GB. Rust 1.100.0, release. Retail title 1.0.2.1. The build was a local tree of main b7aa9f3 with this PR (8caf783), #541 and #1273 merged, plus an unpublished stall-dump switch of mine. It is not this PR alone.

What happened: the run had XCL_SHORT_MOVIES=1, XCL_NETWORK=0 and an A press at 10 s through XCL_PRESS_AT. The log shows Bink: XCL_SHORT_MOVIES=1 – videos of bink2scarlett.dll go to their last frame after the first, then a video of 450 frames went to its last frame at 11.9 s. The video was cut on screen, and the title went on with no crash and no device removal.

One observation, from a separate local experiment on an older base (930e8b4, not a controlled comparison): the title opens the 3840x2160, 450-frame intro four times, at about 6.5, 9.6, 9.7 and 9.8 s. A local wrapper set the frame count to 1 at the open, for every movie of at least 1280x720, and loading began at about 14 s. With this PR, one of the four went to its last frame, the Rockstar logo screen stayed up, and loading began at about 30 s.

So the other three handles may never get a first BinkNextFrame before they are closed or replaced. If that is so, Waiting never steps them. I haven't traced it further.

Not tested: this PR on its own, AMD, and a Windows regression run of this PR alone.

AI use: Claude Code (Claude Opus 5.5) built and ran this and wrote the report. Posted with my approval.

@JJAutoCompare

Copy link
Copy Markdown

Empirical test report (8caf783)

Hardware / environment

  • Verified detached HEAD 8caf783923c7ac348e28622f3200cb497c5390a7 for PR xcl run: XCL_SHORT_MOVIES=1 ends a title's Bink videos after their first frame #681.
  • Windows 11 Enterprise Evaluation x64, OS build 26200 (10.0.26200). CPU reported by Windows as AuthenticAMD, AMD64 family 23, model 113, stepping 0, approximately 3900 MHz, with 12 logical processors visible to the shell.
  • Rust 1.100.0 (0ef1bc386), host x86_64-pc-windows-msvc. Cargo 1.100.0. DXC 1.9.2609.5 (01b62ad47). Test profile unoptimized with debug info and incremental compilation disabled.
  • Both commands ran directly outside Invoke-ArcTest.ps1. The focused run used XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1 and held no Arc GPU mutex.

Commands and results

  • cargo test --workspace --no-run exited 0 and compiled the workspace test binaries without executing tests. Cargo emitted a deprecation warning for AtomicU32::fetch_update in XGameRuntime.
  • cargo test -p xcl --lib resolver::tests:: exited 0. The log records 6 passed, 0 failed, 0 ignored, 0 skipped (case-sensitive lines beginning with SKIPPED ), and 666 filtered out.

Observed behavior

The PR adds one test, short_movies_step_a_video_to_its_end_once. Its assertions confirmed that the resolver's waiting state yields the final frame number on the first step of a multi-frame video and consumes the entry. A single-frame video and a video closed before its first step yield no pending action. Opening a reused handle replaces its previous frame count. The five existing resolver tests also passed. The diff adds or modifies no integration tests.

Not tested

Full GPU workspace suite, live title Bink playback, and game smoke runs were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr681-focused.log and published.

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.

6 participants