fix(dev): rt and base no longer hold the base's lock while their jobs wait in the queue #3197
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3197
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/dev-base-lock-queue"
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?
Summary
Two
dev.pyjobs on one PC could deadlock the whole job queue. On 2026-12-04 it stood still for about 23 minutes, withsix jobs waiting, until one was cancelled by hand:
rtheld the shared base's lock and queued its job, which waited behind a timed run.dev.py queue run ... -- sh -c "dev.py rt ...", whosertwaited for the base's lock.dev.py rt(andrt --empty) now take the base's lock inside each job, once it has its slot, throughdev.py base-locked <base> -- CMD. Nothing holds the lock while a job waits for a slot.dev.py baseheld its lock thesame way around its build; outside a job it now queues the whole of itself, and takes the lock once it runs. This is the
rule
packs.builderalready keeps for the builder's compile.Read first:
locked_cmd,cmd_baseandcmd_rtinscripts/devtools/build.py.Testing
Tested: CachyOS (Linux 7.3.3).
tests/test_dev_build.pyandtests/test_dev_packs.py: four tests fail at the testcommit and pass with the fix; they check that the lock is free at every queue call and that
base-lockedholds it forits command.
test_dev_ab,test_dev_diskandtest_job_queuepass. Two tests intest_dev_packs.pyasserted thelock held around the queue calls; they now assert that each job's command takes this base's lock and that none is held
while queued.
mise run test: 881 passed, 13 skipped, 12 failed. The failures are in renderer, UI, title and builder checks, none inthe dev tools; they are being run on
main @ 8c058ddbto name which fail there too (a comment follows).Still to test:
dev.py rtandrt --emptythrough the queue, expecting both runtimes made (queued; a commentfollows).
dev.py rt, expecting the runtime made, withbase-lockedholding the lock under msvcrt (by hand).Measurements
Nothing to measure: dev tooling, no change to the game or its build's output.
Risks
A checkout without this change still holds the lock while it waits, so the circle can still close between an old
checkout and a new one until each is up to date. Between
rt's two jobs (the build and the shaders' preparation) thelock is now let go, so another job on the same base may run between them.
rtstill marks the base used before queuing,so
dev.py disk --pruneleaves it while a job waits. A revert is enough.Checklist
Ready for review
main; the title is a Conventional Commit.rtrun is still queued)mise run testpasses (any failure that also fails onmainis named). (the run onmainis still queued)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e3Wd6AA2ofRgZt7Lqm
WIP: fix(dev): rt and base no longer hold the base's lock while their jobs wait in the queueto fix(dev): rt and base no longer hold the base's lock while their jobs wait in the queueThe two checks still pending when this merged:
main @ 7c9055d9(which has this change), CachyOS:dev.py rtanddev.py rt --emptythrough the queue both exited 0 and made their runtimes. Duringrt, a step waited for another holder of the base from inside its job, then went on.mise run testfailures: 11 of the 12 fail onmain @ 8c058ddbtoo, run there one by one (test_dlssg,test_present_geometry_trace,test_ui_renderer,test_present_image_free,test_no_game_title,test_vk_draw_overhead_lean,test_sync_watch_event,test_turf_budget,test_pass_barrier,test_present_held_image,test_present_acquire_ahead). The twelfth istest_lifter, whosethe_repository_s_lock_and_the_table_agreewas already failing onmainearlier the same day; I did not run it again on8c058ddb.Windows has not run it.