Skip to content

fix(vk): release modules from failed shader variants - #116

Merged
soltros merged 2 commits into
mainfrom
fix/failed-shader-variant-leak
Nov 11, 2026
Merged

soltros merged 2 commits into
mainfrom
fix/failed-shader-variant-leak

Conversation

@soltros

@soltros soltros commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

A state-list shader translation can create an earlier stage's Vulkan module before a later stage fails. seed_variant_of discarded that temporary Program without destroying its modules. The failure branch now releases each nonnull stage module before returning, preventing repeated failed translations from leaking driver resources.

Related: #18. This fixes a demonstrated ownership bug; the cause of every reported multi-gigabyte RAM-growth symptom remains unverified. Successful cached programs and their submitted modules keep their existing lifetime. Duplicate-variant cleanup is unchanged.

The game-free fixture executes the actual seed_variant_of function with authored translation results and a counted Vulkan boundary. Unchanged main fails immediately on a retained module. The fix passes 1,000 alternating failed graphics/mesh translations, resets translation-context pointers, retains successful cached ownership and releases duplicate modules exactly once. The same stress test passes GCC UBSan with recovery disabled.

Final Actions validation at head 9655e27: Linux 330 passed, 0 failed, 9 skipped; Windows 318 passed, 0 failed, 21 skipped. Windows Builder, Linux AppImage, actionlint and both focused shader jobs passed. Local combined suite: 275 passed, 12 unchanged environment failures, 52 skipped, with no new failing paths. Existing capture resource/retry and slot-ownership fixtures also pass when run explicitly.

No physical Vulkan driver, gameplay session, process-RSS improvement or game-derived material was used. Keep #18 open for the remaining memory audit.

@soltros soltros mentioned this pull request Nov 11, 2026
3 tasks done
@soltros
soltros marked this pull request as ready for review November 11, 2026 03:58
@soltros
soltros merged commit 381a7ce into main Nov 11, 2026
10 checks passed
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.

1 participant