fix(vk): disable failed frame log sinks and unwind startup #1531

Merged
Arkex-ai merged 1 commit from fix/frame-log-sink-failure into main 2026-11-10 07:17:49 +00:00
Arkex-ai commented 2026-11-10 06:53:50 +00:00 (Migrated from github.com)

The binary frame logger can announce recording before its worker opens the file. If opening fails, records are silently discarded; partial GPU startup leaks resources, and write/flush failures leave a dead sink accepting more records. This makes diagnostic captures unreliable.

Open the sink before publishing readiness and unwind its complete startup resource set on failure. Check record writes and flushes in the worker; disable capture, clear queued CPU records and close the file once after an IO error. Enqueue checks the disabled state under the same queue lock. Report the failing stage once, preserving the existing no-retry-per-process policy.

Validation at 27f1810 on main 854c34c:

  • Production startup, cleanup, worker and enqueue code:15 cases, including every allocation/map failure, file/thread creation failure, real CPU-thread short writes/flush errors, late producers, unchanged healthy records and queue bounds.
  • Eight original-main controls reproduce assertion failures; the candidate passes them. Six removal mutations restore assertion failures. Windows LLVM, Linux GCC and GCC ASan/UBSan pass.
  • Full Windows suite217 passed/3 failed/23 skipped versus exact main216/3/23, with the same existing NUP privilege, FPS include and native SDK limitations. No green full-suite claim.
  • Official matching API11 host/backend build passes. Native runs at c824f6e on a72690c: FG2 healthy capture parses128 records,64 generated,0 missing; maximize/restore and exit0. A separate run with a directory as the output path reports the open error once, emits no false recording announcement, continues rendering and resizing, and exits0. Original checkpoint hashes are unchanged. The final rebase changes only the Linux updater and its test; GPU, host and nx2 Git trees are identical. Native evidence retains its original head rather than being relabeled as another run.

Runtime IO failure retains resources potentially used by submitted GPU work. Successful output keeps its format, per-record flush and512-record queue bound. The healthy worker still has its existing process lifetime: this does not add shutdown/draining or promise process-exit durability. Disk-full hardware faults and GPU reset were not induced; partial writes/flush failures use the real worker with IO stand-ins. See docs/framelog-sink-failures.md.

Readback visibility (#1502), normal screenshot slot ownership (#1519), and device-loss reporting (#1515) remain separate contracts. No game assets, captures, generated game code or binaries are included. Three exact-head fork workflows follow.

Current-head validation

Current head 0e4e752, based on main 509579b. Earlier local/runtime results describe their recorded source hashes.

The standalone contribution patch is unchanged after the audited main refresh; exact-head build/source checks are refreshed below. Earlier runtime evidence remains tied to its recorded hash.

Fork runs are separate from upstream Actions approval; no maintainer approval gate is bypassed.

The binary frame logger can announce recording before its worker opens the file. If opening fails, records are silently discarded; partial GPU startup leaks resources, and write/flush failures leave a dead sink accepting more records. This makes diagnostic captures unreliable. Open the sink before publishing readiness and unwind its complete startup resource set on failure. Check record writes and flushes in the worker; disable capture, clear queued CPU records and close the file once after an IO error. Enqueue checks the disabled state under the same queue lock. Report the failing stage once, preserving the existing no-retry-per-process policy. Validation at `27f1810` on main `854c34c`: - Production startup, cleanup, worker and enqueue code:15 cases, including every allocation/map failure, file/thread creation failure, real CPU-thread short writes/flush errors, late producers, unchanged healthy records and queue bounds. - Eight original-main controls reproduce assertion failures; the candidate passes them. Six removal mutations restore assertion failures. Windows LLVM, Linux GCC and GCC ASan/UBSan pass. - Full Windows suite217 passed/3 failed/23 skipped versus exact main216/3/23, with the same existing NUP privilege, FPS include and native SDK limitations. No green full-suite claim. - Official matching API11 host/backend build passes. Native runs at `c824f6e` on `a72690c`: FG2 healthy capture parses128 records,64 generated,0 missing; maximize/restore and exit0. A separate run with a directory as the output path reports the open error once, emits no false recording announcement, continues rendering and resizing, and exits0. Original checkpoint hashes are unchanged. The final rebase changes only the Linux updater and its test; GPU, host and nx2 Git trees are identical. Native evidence retains its original head rather than being relabeled as another run. Runtime IO failure retains resources potentially used by submitted GPU work. Successful output keeps its format, per-record flush and512-record queue bound. The healthy worker still has its existing process lifetime: this does not add shutdown/draining or promise process-exit durability. Disk-full hardware faults and GPU reset were not induced; partial writes/flush failures use the real worker with IO stand-ins. See `docs/framelog-sink-failures.md`. Readback visibility (#1502), normal screenshot slot ownership (#1519), and device-loss reporting (#1515) remain separate contracts. No game assets, captures, generated game code or binaries are included. Three exact-head fork workflows follow. <!-- goal15-current-validation --> ### Current-head validation Current head `0e4e752`, based on main `509579b`. Earlier local/runtime results describe their recorded source hashes. The standalone contribution patch is unchanged after the audited main refresh; exact-head build/source checks are refreshed below. Earlier runtime evidence remains tied to its recorded hash. - [Linux AppImage](https://github.com/Arkex-ai/Hookshot/actions/runs/42773055505): success. - [Windows builder](https://github.com/Arkex-ai/Hookshot/actions/runs/42773050126): success. - [Game-free source regressions](https://github.com/Arkex-ai/Hookshot/actions/runs/42773046517): in_progress. Fork runs are separate from upstream Actions approval; no maintainer approval gate is bypassed.
Commenting is not possible because the repository is archived.
No description provided.