fix(vk): release frame interpolation resources when setup fails #1445
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1445
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/framegen-resource-rollback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When an optional interpolation pipeline or image-view creation fails, the earlier Vulkan objects can remain allocated. Sampler creation errors are also ignored, allowing initialization to report success with an unusable sampler.
Construct pipelines/images locally and publish them only when complete. Roll back earlier setup objects and partial image sets on failure, clear size/history, and preserve the existing session-long interpolation disable policy so ordinary presentation can continue. Keep the existing display-job/device drain before replacing submitted images. The failure predicate is atomic for the game-thread Reflex reader. Independent scaling retains its own state.
Validation:
Based on main
9a2e80e. No game assets, generated guest code, private fault switches, new settings or quality-policy changes are included. The fixture includes the production cleanup helper used by independent scaling. Source overlap with #1386 and #1352 was checked; both merge cleanly at the fetched heads.Current-head validation
Current head
9613130, based on main5609af4. 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.
This landed in the v2.0.12 branch (merged there for testing; it reaches
mainwith that release), so closing. Thanks!Reopened: closing this was a mistake on my side. It was tested in the v2.0.12 branch, and it will be merged into main here, so it shows as merged. Sorry for the noise.
Looks good to me. I went through the rollback paths for double frees, objects still in flight, and half-built state, and didn't find anything:
make_pipe/make_imgnow build into a local and only write to the caller's struct on success, so a failure leaves the target untouched. A laterdrop_setup()/drop_size()then only destroys handles that were really published, and nothing gets destroyed twice.init_scaleclearingscale.linearon sampler failure closes the same gap there.init()can't report success with a null sampler anymore.ensure_size, bothdrop_size()calls run after the jobs/busy-set wait anddevice_wait_idle_locked(), so no submitted work still references the old images. The new images on the failure path were never recorded. Committingw/h/multonly after every image exists also fixes the stalefg.multthat main left behind on failure.framegen_recordreturning false leavesinterpolatedfalse, sodo_presentpresents the frame directly in both the inline andfg_afterpaths, andframegen_on()stays false after that.failedatomic is right, since Reflex reads it from the game thread throughframegen_on().tests/run_all.py, thetest_upscale_independent.pychange picks updrop_pipe, and no settings or option ids are touched.One small comment-only nit inline. There are no checks on the upstream PR yet (the fork runs are linked in the description).
Nit: dropping the pipelines/samplers here is only safe because
framegen_recordcallsensure_sizebefore it records anypass()intocmd, and because older submissions were drained above. A one-line comment saying so would stop someone from later moving apass()ahead ofensure_sizewithout noticing.Added the ordering comment: older submissions are drained and ensure_size runs before framegen_record records any pass. The production rollback regression passes; refreshing the three fork workflows on the comment-only head. Commit
944b550.