Fix background shader and pipeline jobs left pending after exceptions #1874
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!1874
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/complete-failed-background-jobs"
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?
A C++ exception in shader translation or pipeline creation is caught by
run_guarded, but can leave the resource permanently pending. Draws may then wait indefinitely injobs_waitor keep skipping that resource.This change adds optional nonthrowing failure callbacks to the shared and serial job queues. They publish the resource's existing failure/completion state before the original exception is logged and waiters are notified. Wrapping before enqueue also covers jobs executed directly by
jobs_wait.Validation:
python -X utf8 -I -B tests/run_all.py --jobs 2: 253 passed, 17 failed, 51 skipped. All 17 failures were reproduced against unmodified base51de681; no additional failures appeared. Skips reflect unavailable tools/dependencies or platform exclusions.This handles C++ exceptions; it does not cancel Vulkan driver calls that never return or claim to fix the observed AMD pipeline-creation hang. The running game installation has not been replaced with this change.
Nice, tight fix. Wrapping before enqueue means the shared workers, the serial worker and jobs_wait's stolen jobs all get the same recovery, and the regression test exercises all three paths with std and non-std throws. I read each recovery against how its resource is consumed: shader failure (failed + ready, which the draw paths check), graphics (ready with a null pipeline hits the existing
if (!pl) SKIP_HERE(), and a linked pipeline is kept), fallback compute (state 2 with empty fallback_compute reads as failed in fallback_pipelines_ready) and compute (failed + state 2 -> SKIP_HERE). All consistent.Nits, none blocking:
translate_intoalready catchesstd::exceptionitself (sets failed, ready, bumps st_failed), so the new shader callbacks mostly cover non-std throws and anything escaping that handler. They don't bumpst_failedor log, so such a program won't show in the "N failed" count. Fine to leave; maybe worth a comment.failedlambda nullsq.compute_pipeline. If something threw afterq.compute_pipeline = made, that pipeline handle would be leaked rather than reused. Practically unreachable (only logging/counters follow), so leave it or just don't touch compute_pipeline there.tests/test_jobs_failure.pyfinds the recovery lambdas by[job]() noexcept {and hard-codes counts (2 in vk_shader.cpp, 3 in vk_draw.cpp). Adding a fourth callback or reformatting will trip it with a fairly cryptic message; fine, just be aware.No CI check runs are reported on this head, so I couldn't compare against main's known failures; the PR's 17 failures reproduced on base are consistent with that. Good to go from my side.