Repository navigation
bink_async_test: the exe's async Bink decode matches BinkDoFrame on 515 streams (RT-BINK-ASYNC) - #7897
bink_async_test: the exe's async Bink decode matches BinkDoFrame on 515 streams (RT-BINK-ASYNC)#7897quackottu wants to merge 2 commits into
Conversation
… BinkRegisterFrameBuffers) over movies.rpf (RT-BINK-FRAMEBUFFERS) The retail exe imports 23 Bink2Scarlett functions and none of BinkCopyToBuffer, so the existing Bink tests never ran its path. Package-gated test: 515 of 515 streams pass; layout, 4:2:0 planes, size and pitch rounding measured in docs/movies.md.
…l 515 streams (RT-BINK-ASYNC) BinkStartAsyncThread, BinkNextFrame + BinkDoFrameAsyncMulti + BinkDoFrameAsyncWait, and the two stop calls, with argument shapes read from the exe's call sites. Measured in docs/movies.md.
tupacfan04
left a comment
There was a problem hiding this comment.
The test is package-gated: it exits 77 unless LEONIDA_GAME_DIR and LEONIDA_BINK_INDEX are set, then requires movies.rpf/Bink2Scarlett.dll; there is no synthetic stream fixture, and the PR is stacked on #7405 (it also carries that PR’s framebuffers test/docs). It cannot be validated under a synthetic-only policy.
Code-level false-pass paths (visible without running):
s.framesis read but unused; the test always decodes three frames, andBinkNextFrame’s result is discarded. A stream with fewer than three frames, or a failedBinkNextFrame, can compare the same stale frame in both runs and report a match.- After
check(bink != 0, ...),if (!bink) break;leaveshasheszero.twice/equalare then computed from zeros, the equality check passes, andsame++increments. The overall result still fails on the open check, but the per-stream equality/“identical” count is a false pass. BinkDoFrameAsyncMulti,BinkDoFrame,BinkGetFrameBuffersInfo,BinkCloseand the stop calls discard their returns;BinkDoFrameAsyncWaitis checked only globally, andchanged > 0is aggregate, so one stream can fail while another’s pixels make it pass.hash_planestrusts the frame-buffer pointers, two frame sets and pitches before validating them; a malformed stream can fault outsideguarded().
If package-gated tests are acceptable, add frames >= 3 (skip/reject short streams), check every decode/next/result return, only compare when the stream opened and all frames advanced, and add a negative open-failure case that does not print “PASS”/increment same. Otherwise the PR needs a synthetic fixture or an explicit exception.
No game data used. AI-assisted (OpenCode).
RT-BINK-ASYNC, claimed in #7496 (comment)
Depends on: #7405 (this branch is stacked on it; its commit shows in the diff until #7405 merges, the new files are
runtime/test/bink_async_test.cpp, a CMake target and a docs/movies.md section).The exe decodes with
BinkNextFrame,BinkDoFrameAsyncMulti(bink, thread_ids, count)andBinkDoFrameAsyncWait(bink, 0xffffffff)on threads fromBinkStartAsyncThread, stopped with the two...AsyncThreadsMulticalls. The argument shapes come from the exe's call sites (read locally, nothing quoted). The new package-gatedbink_async_test(ctestbink_async, skip 77 withoutLEONIDA_GAME_DIR/LEONIDA_BINK_INDEX) runs that sequence throughrt::Loaderand requires frames 1 and 2 to equalBinkDoFrame's, plane for plane over the picture area.Measured (Windows 11, MSVC, RelWithDebInfo, 1.0.2.1):
LEONIDA_BINK_LIMIT=515, two runs, 515 of 515 identical both times,BinkDoFrameAsyncWaitnon-zero in all 1,030 calls, both stop calls return (no hang). Default 8 streams: about 1.4 s. Two things found on the way:BinkNextFramehas to come before the async decode, and a finite wait of 10000 returned early on 10 to 45 of 515 streams (output differing run to run), so the test uses the exe's0xffffffff.No game data in the diff (
check_no_game_data.pyclean). Still unmeasured:BinkSetMemory,BinkSetOSFileCallbacks, more than one decode thread.AI-assisted.