Skip to content

Return held movie inputs without decoding after end of stream - #1938

Closed
JS-banana wants to merge 1 commit into
seedds:mainfrom
JS-banana:fix/movie-input-after-eos
Closed

JS-banana wants to merge 1 commit into
seedds:mainfrom
JS-banana:fix/movie-input-after-eos

Conversation

@JS-banana

@JS-banana JS-banana commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Tied Together's Unity player acquires four movie inputs and submits each as end of stream. The host queued all four, causing repeated completion notifications after the first handler had freed the event list.

Return later client-held inputs once without decoding or signalling them, whether or not they carry EOS. Reject queued or decoding inputs, check queue capacity before changing ownership, and set in_eos only after accepting a packet. Flush and Stop still allow a new stream. The movie entry covers the ownership rules.

Checked

Recheck on upstream main (2026-11-12)

  • Rebased on upstream main at 1ee02525. The AVC fixture passed with the upstream Annex B tests and the four-input EOS regression. Six documentation tests and git diff --check passed.
  • make -C dm/host/tests GAME=010015100B514000 -j4 tsan-threads passed on the Mac, including the audio-device test that timed out in the initial CI run. regress.py impact main..HEAD identified SendInputBufferForDecode. The four existing usage manifests do not record it, and 158 profiles lack a manifest. Game routes and Metal GPU tests remain open for the rebased commit.

Initial checks (2026-11-09)

  • The new four-input regression fails on main (7ffa63c). make -C dm/host/tests GAME=010015100B514000 -j3 run passes, as do a separate ASan/UBSan build and run of t_movie_avc, the host build and six docs tests.

  • LLVM 23.1.4 lint_c.py tidy --against main exits 1: 224 findings against 223 baseline entries. The excess is a nullability warning in unchanged t_pso_archive.m; all three reported sites reproduce on unmodified main. Explicitly checking t_movie_avc.c also reports an unchanged line 60 warning that reproduces on main. hle_movie.c has no findings. The GitHub CI run reproduces the same excess finding on the xcode-27 runner. No lint baseline was changed.

  • Earlier local repair: Tied Together (0100B6D00C2DE000) 1.0.2 passed the intro and reached its menu; two-player gameplay was reported working on November 8. This port to current main has not been played.

  • Apple M1 Pro, macOS 27.2, Xcode 27.2.

  • regress.py impact main..HEAD identifies SendInputBufferForDecode. None of the four profiles with usage manifests calls it; 149 profiles are unknown. Game launches were excluded from this session, so no regress.py check report is available. GPU tests were not run.

  • CI: Tool tests fail only at test_dmsh_abi.Ratchet.test_no_new_abi_literals: the unchanged nvn_mtl.m has three "?" literals against a baseline of two. The same test fails on unmodified 7ffa63c.

  • Sanitizers: the ASan/UBSan steps pass; TSan stops at t_audio_device.c:191, waiting three seconds for a mock Stop signal, without a race report. That test does not load the movie implementation, and the same audio sources passed TSan in main's job 128989173279. A scheduling-sensitive timeout is plausible, not confirmed. A job-only rerun was requested but GitHub requires repository admin rights.

  • iOS build: ld: framework 'IOBluetooth' not found, from the unchanged framework generator. Upstream iOS builds link again: gen_build.py leaves IOBluetooth out of the iOS frameworks, as it does Cocoa #1906 addresses this shared build failure.

Docs

  • Added the finding to docs/reference/movies.md and ran python3 dm/tools/docs_symptoms.py.
  • No game files, keys or data extracted from a game in the change or attachments.

@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) docs Documentation labels Nov 9, 2026
Tied Together's Unity player submits all four held inputs as EOS. The
host decoded each one, producing repeated completion notifications after
the first handler had freed the event list. Return later client-held
inputs once without decoding or signalling them. Validate the queue
before changing ownership and commit EOS only for an accepted packet.

Exercise the real Send entry point, duplicate inputs, late data and
Flush reuse in the AVC fixture. The regression fails on main. Host tests,
the AVC ASan/UBSan check and the host build pass. Document the mechanism.
@JS-banana
JS-banana force-pushed the fix/movie-input-after-eos branch from b802fde to b280618 Compare November 12, 2026 03:57
seedds added a commit that referenced this pull request Nov 12, 2026
…of decoding them, as ACodec does (PR #1938): Tied Together's Unity player acquires all four inputs and sends each one marked end of stream. in_eos only stopped new acquisitions (h_movie_AcqIn), so the three buffers the client already held were queued and decoded too, four end-of-stream outputs came back, and the game's first completion handler freed the event list the later ones still walked. h_movie_SendIn now returns a client-held input sent after an accepted end-of-stream packet once, with no decode and no signal, whether or not it carries the flag; an input that is queued or being decoded is refused, and one a Flush already returned is not put on the free list twice. The duplicate and full-queue checks now come before any change of ownership, and only an accepted packet sets in_eos: before, a refused end-of-stream packet still closed the stream. Flush and Stop still open a new stream. New reference entry (Input buffers already held when end of stream arrives), symptom index regenerated. t_movie_avc feeds four held inputs through SendInputBufferForDecode and drains them (one end-of-stream output), and covers late ordinary data, duplicate and invalid sends, an input being decoded and held inputs sent after a Flush. Checked on 0f19bdf (M4 Pro): t_movie_avc three runs; the PR's fixture against the previous hle_movie.c fails (four packets queued, line 176); the host tests' run list; test_docs. The PR's author: Tied Together 1.0.2 reached its title menu on an older base. Not run: Tied Together on this revision (not on a drive here), another movie game (none built here; Fire Emblem Engage's Unity player would be the nearest), regress.py (low reach: only refused sends and sends after end of stream change), the iPhone

Co-authored-by: JS-banana <42017491+JS-banana@users.noreply.github.com>
@seedds

seedds commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Landed on main as 637f3fa, unchanged on top of current main (0f19bdf), with you as co-author. Thank you for the clear diagnosis and the negative fixture.

Checked here: t_movie_avc passes three runs, your fixture fails against the previous hle_movie.c (four packets queued), and the host tests' run list and test_docs pass. Tied Together itself has not been played on this revision (it isn't on a drive here). If you can, a quick retest of the intro to the title menu on current main would close that gap.

@seedds seedds closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants