Pipeline workers: keep slow-build limits after first-use promotion under memory pressure #56

Open
opened 2026-11-26 03:31:37 +00:00 by github-bot · 3 comments
Owner

@⁠npalissi on GitHub · 2026-11-26 00:35 UTC · original

Problem

A pipeline already classified as slow can bypass the slow-build concurrency limit as soon as a draw or dispatch asks for it. Several expensive driver builds can then overlap during world loading. The render wait budget controls how long the caller waits, while the builds can keep running and retaining memory.

Evidence from this fork

The scheduler comments describe a run where all 16 workers were occupied by slow builds during loading. Only 97 pipelines were made in 20 seconds. The first 90 seconds in the world ran at 0.5 to 1.6 seconds per frame, with up to 2,900 draws omitted per frame. The fork's findings also report stretches of frames over 200 ms coinciding with pipeline creation. These observations do not measure the memory used by the promoted jobs specifically. Scheduler measurements · Fork findings

Reproduction on 0a435665

  1. Queue::push_as and Queue::pop route first-use jobs to the requested or screen queue before considering the slow classification. Only a claim from the slow queue increments slow_now.
  2. The existing scheduler test deliberately exercises this: hold one slow job with the limit at one, promote a second slow job to first use, then claim it with was_slow == false. The unchanged queue and test passed in a standalone Windows Rust harness without opening D3D12 or running the title.
  3. slow_limit also derives the limit from the CPU-based default worker count. Slow keys are learned from completed builds, so cold keys without history can still be expensive.

#34 reports device loss near concurrent compute builds and low available physical memory in another run. That report does not establish a causal link. #43 discusses prebuilding and cache limits. This proposal concerns concurrent cold builds.

Proposed fix

Add an opt-in low-memory mode that keeps urgency and build cost separate. Preserve first-use and screen priority, but count known-slow cold builds across all priorities against a limit derived from the configured worker count. Give requested jobs the next free slow slot ahead of speculative work. Keep cache hits and eligible quick jobs moving while a slow miss is deferred, including when it stands at the head of its queue.

With one slow slot, a requested pipeline may take longer to become available if another slow build is already running. The goal is to reduce peak system commit and stalls from concurrent compilation. One large build can still exhaust memory. If measurements justify a follow-up for unseen keys, consider reducing speculative admission when Windows commit headroom is low.

Acceptance tests

  • Hold one slow slot. Confirm a second slow miss requested at first use or by a screen pass waits while an eligible quick job proceeds. Release the slot and verify that the highest-priority waiting slow job starts once.
  • Cover cache hits, cache misses, disabled pipeline library, worker-count overrides and low-memory mode off.
  • Compare the same scene and driver with isolated cold caches. Measure peak private bytes, minimum system commit headroom, time to the first world frame, longest gap between presents and omitted draws or dispatches. Include a warm-cache control.

The queue behavior is reproduced. The effect on VIctory's in-game memory and freeze duration still needs a hardware comparison. AI-assisted source review and drafting.

**@⁠npalissi** on GitHub · 2026-11-26 00:35 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/56) ## Problem A pipeline already classified as slow can bypass the slow-build concurrency limit as soon as a draw or dispatch asks for it. Several expensive driver builds can then overlap during world loading. The render wait budget controls how long the caller waits, while the builds can keep running and retaining memory. ## Evidence from this fork The scheduler comments describe a run where all 16 workers were occupied by slow builds during loading. Only 97 pipelines were made in 20 seconds. The first 90 seconds in the world ran at 0.5 to 1.6 seconds per frame, with up to 2,900 draws omitted per frame. The fork's findings also report stretches of frames over 200 ms coinciding with pipeline creation. These observations do not measure the memory used by the promoted jobs specifically. [Scheduler measurements](https://github.com/avatarmanz/VIctory-7900XTX/blob/0a435665/crates/victory-gpu/src/pipeline/make.rs#L270-L289) · [Fork findings](https://github.com/avatarmanz/VIctory-7900XTX/blob/0a435665/docs/findings.md#what-is-next) ## Reproduction on `0a435665` 1. [Queue::push_as and Queue::pop](https://github.com/avatarmanz/VIctory-7900XTX/blob/0a435665/crates/victory-gpu/src/pipeline/make.rs#L316-L357) route first-use jobs to the requested or screen queue before considering the slow classification. Only a claim from the slow queue increments `slow_now`. 2. The existing [scheduler test](https://github.com/avatarmanz/VIctory-7900XTX/blob/0a435665/crates/victory-gpu/src/pipeline/make.rs#L542-L565) deliberately exercises this: hold one slow job with the limit at one, promote a second slow job to first use, then claim it with `was_slow == false`. The unchanged queue and test passed in a standalone Windows Rust harness without opening D3D12 or running the title. 3. [slow_limit](https://github.com/avatarmanz/VIctory-7900XTX/blob/0a435665/crates/victory-gpu/src/pipeline/make.rs#L273-L289) also derives the limit from the CPU-based default worker count. Slow keys are learned from completed builds, so cold keys without history can still be expensive. [#34](https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/34) reports device loss near concurrent compute builds and low available physical memory in another run. That report does not establish a causal link. [#43](https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/43) discusses prebuilding and cache limits. This proposal concerns concurrent cold builds. ## Proposed fix Add an opt-in low-memory mode that keeps urgency and build cost separate. Preserve first-use and screen priority, but count known-slow cold builds across all priorities against a limit derived from the configured worker count. Give requested jobs the next free slow slot ahead of speculative work. Keep cache hits and eligible quick jobs moving while a slow miss is deferred, including when it stands at the head of its queue. With one slow slot, a requested pipeline may take longer to become available if another slow build is already running. The goal is to reduce peak system commit and stalls from concurrent compilation. One large build can still exhaust memory. If measurements justify a follow-up for unseen keys, consider reducing speculative admission when Windows commit headroom is low. ## Acceptance tests - Hold one slow slot. Confirm a second slow miss requested at first use or by a screen pass waits while an eligible quick job proceeds. Release the slot and verify that the highest-priority waiting slow job starts once. - Cover cache hits, cache misses, disabled pipeline library, worker-count overrides and low-memory mode off. - Compare the same scene and driver with isolated cold caches. Measure peak private bytes, minimum system commit headroom, time to the first world frame, longest gap between presents and omitted draws or dispatches. Include a warm-cache control. The queue behavior is reproduced. The effect on VIctory's in-game memory and freeze duration still needs a hardware comparison. AI-assisted source review and drafting.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:37 +00:00
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-26 06:03 UTC · original

Hi @⁠avatarmanz and @⁠npalissi,

I'd like to contribute to this fork, including actual implementation work rather than only hardware testing.

My available hardware includes:

  • Ryzen 9 9950X3D, 192 GB RAM, RTX 5090
  • Radeon 860M and RTX 5060 Laptop
  • RTX 2080 Ti
  • Ryzen 9950X3D integrated Radeon GPU
  • Steam Deck with Windows 11 and SteamOS

I've previously contributed independent synthetic GPU validation to FrameLab and VIctory.

Is #56 still available? I'd be interested in implementing the pipeline scheduling improvements with deterministic regression tests and synthetic contention and memory benchmarks. I'm also interested in the texture streaming work described in #118, if it is unassigned.

Alternatively, I can provide independent hardware validation for #98, #120, #119 and other open PRs.

Is there a preferred claim process, or are there other unassigned development tasks you would recommend?

I use Codex and Claude Code for AI-assisted development and testing. I'll work with public licensed source and original synthetic test data, coordinate with existing contributors, and provide reproducible results.

Thank you!

**@⁠JoeY54** on GitHub · 2026-11-26 06:03 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/56#issuecomment-7184060023) Hi @⁠avatarmanz and @⁠npalissi, I'd like to contribute to this fork, including actual implementation work rather than only hardware testing. My available hardware includes: - Ryzen 9 9950X3D, 192 GB RAM, RTX 5090 - Radeon 860M and RTX 5060 Laptop - RTX 2080 Ti - Ryzen 9950X3D integrated Radeon GPU - Steam Deck with Windows 11 and SteamOS I've previously contributed independent synthetic GPU validation to FrameLab and VIctory. Is #56 still available? I'd be interested in implementing the pipeline scheduling improvements with deterministic regression tests and synthetic contention and memory benchmarks. I'm also interested in the texture streaming work described in #118, if it is unassigned. Alternatively, I can provide independent hardware validation for #98, #120, #119 and other open PRs. Is there a preferred claim process, or are there other unassigned development tasks you would recommend? I use Codex and Claude Code for AI-assisted development and testing. I'll work with public licensed source and original synthetic test data, coordinate with existing contributors, and provide reproducible results. Thank you!
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 06:14 UTC · original

Hi Joseph, you can add me on Discord @ avatarmanz and we can chat there.
If that doesn't work because of Discord privacy settings can you please
email me your Discord name and I'll add you as a friend there.
My email address is @.***

EDIT: Is there a reason you want to contribute to this vs creating a fork?

On Thu, Nov 26, 2026 at 12:04 AM Joseph Yang @.***>
wrote:

JoeY54 left a comment (avatarmanz/VIctory-7900XTX#56)
https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/56

Hi @⁠avatarmanz https://github.com/avatarmanz and @⁠npalissi
https://github.com/npalissi,

I'd like to contribute to this fork, including actual implementation work
rather than only hardware testing.

My available hardware includes:

  • Ryzen 9 9950X3D, 192 GB RAM, RTX 5090
  • Radeon 860M and RTX 5060 Laptop
  • RTX 2080 Ti
  • Ryzen 9950X3D integrated Radeon GPU
  • Steam Deck with Windows 11 and SteamOS

I've previously contributed independent synthetic GPU validation to
FrameLab and VIctory.

Is #56 https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/56 still
available? I'd be interested in implementing the pipeline scheduling
improvements with deterministic regression tests and synthetic contention
and memory benchmarks. I'm also interested in the texture streaming work
described in #118
https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/118, if it is
unassigned.

Alternatively, I can provide independent hardware validation for #98
https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/pulls/98, #120
https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/pulls/120, #119
https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/pulls/119 and other open
PRs.

Is there a preferred claim process, or are there other unassigned
development tasks you would recommend?

I use Codex and Claude Code for AI-assisted development and testing. I'll
work with public licensed source and original synthetic test data,
coordinate with existing contributors, and provide reproducible results.

Thank you!

—
Reply to this email directly, view it on GitHub
https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/56?email_source=notifications&email_token=APKYWARP6K7EMQDHDHDZBM3527BWNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMJYGQYDMMBQGIZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-7184060023,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APKYWARTNULL2YDWNWIZRHT527BWNAVCNFSNUABGKJSXA33TNF2G64TZHMYTINZSGM4TMOJZGY5US43TOVSTWNRWGE3DONRSGAYTLILWAI
.
You are receiving this because you were mentioned.Message ID:
<avatarmanz/VIctory-7900XTX/issues/56/7184060023 @.***
.com>

**@⁠avatarmanz** on GitHub · 2026-11-26 06:14 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/56#issuecomment-7184225546) Hi Joseph, you can add me on Discord @ avatarmanz and we can chat there. If that doesn't work because of Discord privacy settings can you please email me your Discord name and I'll add you as a friend there. My email address is ***@***.*** EDIT: Is there a reason you want to contribute to this vs creating a fork? On Thu, Nov 26, 2026 at 12:04 AM Joseph Yang ***@***.***> wrote: > *JoeY54* left a comment (avatarmanz/VIctory-7900XTX#56) > <https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/56> > > Hi @⁠avatarmanz <https://github.com/avatarmanz> and @⁠npalissi > <https://github.com/npalissi>, > > I'd like to contribute to this fork, including actual implementation work > rather than only hardware testing. > > My available hardware includes: > > - Ryzen 9 9950X3D, 192 GB RAM, RTX 5090 > - Radeon 860M and RTX 5060 Laptop > - RTX 2080 Ti > - Ryzen 9950X3D integrated Radeon GPU > - Steam Deck with Windows 11 and SteamOS > > I've previously contributed independent synthetic GPU validation to > FrameLab and VIctory. > > Is #56 <https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/56> still > available? I'd be interested in implementing the pipeline scheduling > improvements with deterministic regression tests and synthetic contention > and memory benchmarks. I'm also interested in the texture streaming work > described in #118 > <https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/118>, if it is > unassigned. > > Alternatively, I can provide independent hardware validation for #98 > <https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/pulls/98>, #120 > <https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/pulls/120>, #119 > <https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/pulls/119> and other open > PRs. > > Is there a preferred claim process, or are there other unassigned > development tasks you would recommend? > > I use Codex and Claude Code for AI-assisted development and testing. I'll > work with public licensed source and original synthetic test data, > coordinate with existing contributors, and provide reproducible results. > > Thank you! > > — > Reply to this email directly, view it on GitHub > <https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/56?email_source=notifications&email_token=APKYWARP6K7EMQDHDHDZBM3527BWNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMJYGQYDMMBQGIZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-7184060023>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/APKYWARTNULL2YDWNWIZRHT527BWNAVCNFSNUABGKJSXA33TNF2G64TZHMYTINZSGM4TMOJZGY5US43TOVSTWNRWGE3DONRSGAYTLILWAI> > . > You are receiving this because you were mentioned.Message ID: > <avatarmanz/VIctory-7900XTX/issues/56/7184060023 ***@***.*** > .com> >
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-26 08:14 UTC · original

Hi @⁠avatarmanz @⁠npalissi,

Following up on my earlier comment and our Discord chat: I'd like to claim this issue for implementation. If you'd rather keep it with npalissi or someone else, just say so and I'll switch to verification only.

Plan (based on main @ 39031cb; pipeline/make.rs is unchanged since 0a435665):

  1. Add an opt-in low-memory mode (off by default, behind a switch). When it is on, known-slow cold builds count against the slow limit at every priority: first-use, screen and speculative alike. First-use and screen jobs still get the next free slow slot ahead of speculative work. Cache hits and eligible quick jobs keep moving while a slow miss waits, including when that miss is at the head of its queue.
  2. Derive the slow limit from the configured worker count, so worker-count overrides apply.
  3. Add deterministic queue tests from the acceptance list: one held slow slot; a second slow miss at first use or from a screen pass waits while a quick job runs; on release, the highest-priority waiting slow job starts exactly once. Also cover cache hit and miss, a disabled pipeline library, worker-count overrides, and the mode switched off (the current test must keep passing unchanged).
  4. Hardware comparison: cold and warm caches, measuring peak private bytes, minimum commit headroom, time to the first world frame, longest present gap, and omitted draws. I'll run it on my machines; results on the RX 7900 XTX would be welcome as well.

I'll coordinate with #125, #144 and #128, which touch the same worker code, and rebase onto whichever lands first. Work will go on a separate branch and come back as a draft PR. Only public source and synthetic tests are used; no game data.


Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-26 08:14 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/56#issuecomment-7186362614) Hi @⁠avatarmanz @⁠npalissi, Following up on my earlier comment and our Discord chat: I'd like to claim this issue for implementation. If you'd rather keep it with npalissi or someone else, just say so and I'll switch to verification only. **Plan (based on `main` @ `39031cb`; `pipeline/make.rs` is unchanged since `0a435665`):** 1. Add an opt-in low-memory mode (off by default, behind a switch). When it is on, known-slow cold builds count against the slow limit at every priority: first-use, screen and speculative alike. First-use and screen jobs still get the next free slow slot ahead of speculative work. Cache hits and eligible quick jobs keep moving while a slow miss waits, including when that miss is at the head of its queue. 2. Derive the slow limit from the configured worker count, so worker-count overrides apply. 3. Add deterministic queue tests from the acceptance list: one held slow slot; a second slow miss at first use or from a screen pass waits while a quick job runs; on release, the highest-priority waiting slow job starts exactly once. Also cover cache hit and miss, a disabled pipeline library, worker-count overrides, and the mode switched off (the current test must keep passing unchanged). 4. Hardware comparison: cold and warm caches, measuring peak private bytes, minimum commit headroom, time to the first world frame, longest present gap, and omitted draws. I'll run it on my machines; results on the RX 7900 XTX would be welcome as well. I'll coordinate with #125, #144 and #128, which touch the same worker code, and rebase onto whichever lands first. Work will go on a separate branch and come back as a draft PR. Only public source and synthetic tests are used; no game data. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/avatarmanz--VIctory-7900XTX#56
No description provided.