WIP: fix(dev): a timed run's noise names the queue's jobs that ran beside it #2187
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2187
Loadingβ¦
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:fix/queue-noise-beside"
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
A timed run's history keeps how busy the rest of the PC was, so a noisy measurement shows. Two of those readings, the CPU pressure and the load, come from Linux alone and are always 0 on Windows. And the queue's own other jobs running beside a timed run were never noted. A light job starts beside a timing one. In two
dev.py abseries for #2185, another session's runtime builds ran beside three runs and prepared shaders on the GPU: those runs gave 27.9, 29.1 and 41.1 fps against 65 to 72, with the noise all zeros.The noise now names each other queue job active while the timed run ran (
"jobs_beside": ["rt-pr1937 (light)"]), on every system. The run's line then says the PC was busy while it measured.Read first:
Noiseand_keep_apartinscripts/devtools/jobqueue.py.Testing
Tested: not run yet.
tests/test_job_queue.pyhas a case for the record's new field. Not run yet.Still to test:
dev.py queue historyto name that job underjobs_beside, and the run's line to say the PC was busy (by hand)Measurements
Nothing to measure: what the queue records, not how a run goes.
Risks
A timed run with a job beside it now ends with the "busy while it measured" line; nothing is refused or moved. Reverting is enough.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). Not run yet.main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
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
A timed run's history kept the PC's CPU pressure and load, both read from Linux alone, and the builds outside the queue. On Windows the first two are always 0, and the queue's own jobs beside a timed run were never noted: a light job starts beside a timing one, and two series of dev.py ab had runs spoiled by another session's runtime builds (their shader preparation took the GPU; 27.9 and 29.1 fps against 65 to 68) with the noise all zeros. The noise now names each other job active while the timed run ran ("name (mode)"), on every system, and the run's line says the PC was busy when there was one. Co-Authored-By: Claude Opus 5.5 <[email protected]>On Windows β the platform the PR's own #2185 series is about β
jobs_besideis always empty: the only code that fills it is inside_keep_apart, and that thread is started onlyif timing_cpus and not common.WINDOWS.The collection gate (blocker).
Noise.besideis added in_keep_apart'sfor t in read_tickets(...)loop.run()starts_keep_apartonlyif timing_cpus and not common.WINDOWS. On Windowscommon.WINDOWSis true; on a Linux PC with one L3 domain (or no sysfs)l3_domains()leavestiming_cpusNone and the queue itself prints "no pinning". In both, no sampler runs:jobs_besideis[],noise.straysis empty andcpu_pressure/loadare 0, so therunline'sif noise.strays or noise.beside or noise.cpu_pressure > 20never fires anddev.py queue historyshows a false quiet. The PR's Windows Still-to-test ("expectingdev.py queue historyto name that job underjobs_beside") cannot pass today.Noise's docstring and the PR's "seen on every system" are false. Fix: collect theread_tickets/beside(andheavy_procsif wanted) independent of the pinning thread and the OS β the pinning, PSI and load are the Linux-only parts; start the sampler whenevercpu == "quiet"and let_keep_apartskip theprocs.pincalls whentiming_cpusis None/Windows. Add a test that drives a fake queue directory through the sampler, not justrecord().The verdict does not use it.
scripts/devtools/ab.pyhas nonoise/jobs_beside; thedev.py abwrite-up (results.json/measurements.md) reads the game's log, not the queue history. The only consumers arejobqueue.run's "busy" line anddev.py queue history. So a noisy A/B still writes up a verdict; the #2185 series would still produce a gain/loss unless someone separately reads the queue history. If the field is meant to protect measurements,ab.py'srun_one/verdict should read the queue history'snoiseand mark or refuse the run; the PR's Risks says "nothing is refused", which is the gap.Sampling.
_keep_apartpolls every 2 s (while not stop.wait(2));besideis the set of tickets active at a sample, not an exact interval overlap. A light/shared job shorter than the poll, or one starting/ending inside the first or last 2 s, is not named. Therunhistory hasstarted/ended, so an exact overlap could be computed if the finished tickets' times were kept. The PR's "active while the timed run ran" is approximate. (The Windows/no-pinning gate matters more.)What "noise" measures now.
cpu_pressure_max(Linux PSI cpu some),load_max(Linux load),builds_outside(heavy processes outside the queue, thestrays), and the newjobs_beside(the queue's own active jobs asname (mode), e.g.rt-pr1937 (light)).builds_outsideandjobs_besideare distinct: outside the queue vs the queue's own. On Linux with pinning,read_ticketsadds every active ticket whatever itscpu/affinity, so a build (heavy),sharedorlightjob β including one pinned toother_cpusβ is named; the timing run's own ticket is excluded (pid != me["pid"]), waiting jobs aren't named (they didn't run), and the timing job's child processes are not tickets. That part is right.The test.
NoiseBeside.test_recordonly checksn.record()["jobs_beside"]aftern.beside.update(...); it doesn't runrun()/_keep_apart, mock Windows or a no-pinning Linux, or exercise the 2 s sample. I ran it: on the headtests/test_job_queue.pyis 26 tests OK (5 skipped); ona2dc5385with only the head's test it is 26 run, 1 error (KeyError: 'jobs_beside'). The red is just the missing field; a real Windows run would still be quiet and the test would still pass.What remains. A sampler that runs on Windows/no-pinning; the A/B verdict reading the queue noise; an exact overlap or a documented sampling window; a collection test; and the Windows
dev.py queue historyrun (the PR's Still to test) β which the current code would fail. I ran only the game-free test.No approval, no claim.
dazemc referenced this pull request2026-11-22 14:29:51 +00:00
See #2403
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.