mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8018] [MERGED] fix: text and media take turns on a shared local GPU (MARINARA_SHARED_GPU_HOSTS) #8060
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8060
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8018
Author: @JamesMowery
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/shared-gpu-media-turns📝 Commits (8)
5b9f884fix: let text and media take turns on a shared local GPU227e8fctest: the prompt regression follows the selfie writer's reasoning stripb0a24a0docs: align the MARINARA_SHARED_GPU_HOSTS row with its tableacc8cc4fix: a media request waits for its shared GPU turn no longer than for a media permit7ad6055fix: a shared GPU wait limit past AbortSignal.timeout's range means no limit36db906fix: wait for the shared GPU turn before taking a media permit or admission4390cdcfix: a queued clip waits for its connection before its shared GPU turn6c6705bfix: a queued first-frame selfie waits for the shared GPU before a permit📊 Changes
11 files changed (+798 additions, -35 deletions)
View changed files
📝
.env.example(+3 -0)📝
docs/CONFIGURATION.md(+1 -0)📝
packages/server/src/services/generation/conversation-selfie-command-runtime.ts(+25 -7)➕
packages/server/src/services/generation/shared-gpu-turns.ts(+207 -0)📝
packages/server/src/services/image/image-generation-queue.ts(+18 -13)📝
packages/server/src/services/image/image-generation.ts(+10 -4)📝
packages/server/src/services/llm/provider-registry.ts(+3 -1)📝
packages/server/src/services/video/video-generation.ts(+8 -1)📝
scripts/regressions/prompt.regression.ts(+9 -9)➕
scripts/regressions/shared-gpu-queued-selfie.regression.ts(+165 -0)➕
scripts/regressions/shared-gpu-turns.regression.ts(+349 -0)📄 Description
Linked issue
Closes #8017
@SpicyMarinara
Why this change
What changed
MARINARA_SHARED_GPU_HOSTS(comma-separatedhost:port, off by default;.env.example,docs/CONFIGURATION.md): text and media requests to a listed host take turns (services/generation/shared-gpu-turns.ts).provider-registry.ts, so a turn is held only while the request is with the backend; a stream holds its turn until it closes). Images and videos go throughrunSharedGpuTurninside their existing admission and queues. Embeddings are not held, and a call already inside a turn runs straight through.MARINARA_MEDIA_GENERATION_WAIT_TIMEOUT_MS(10 minutes by default,0= no limit), so a stalled text stream can't hold it, and the text queued behind it, forever. Text waits for the render it follows..envedits apply without a restart. Unlisted hosts are untouched.VIDEO_GEN_TIMEOUTfor Undici's headers and body timeouts, so a render gate holdingPOST /promptno longer fails the clip at five minutes.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAutomated runs on 2026-10-21 on
staging5e7468ab4, Node 24.21.0:pnpm check: passes. Its one lint warning, inHomeProfessorMariChat.tsx, is not from this PR.pnpm localization:check: passes.shared-gpu-turns(new): host matching; a waiting media request holds back new text while the running text drains; one kind runs together; an abort while waiting lets the queue move on; nested calls run through; a throw releases the turn; a stream holds its turn until it closes; unlisted hosts are not wrapped; a media wait times out behind stalled text and lets the text queued behind it go ahead (it hangs without the fix).prompt: its source checks follow the selfie writer's think-block strip.media-generation-cappasses.pnpm regressionon227e8fccb: 961/961 pass. The later commits were checked withshared-gpu-turns,prompt,media-generation-capand a server type check.acc8cc4a7: a media request without its own signal could wait for its turn forever behind a stalled text stream; it now waits no longer thanMARINARA_MEDIA_GENERATION_WAIT_TIMEOUT_MS. A review of that commit: 2 findings, fixed in7ad605543(a limit pastAbortSignal.timeout's range means no limit; the regression's deadline has room and its rejection is observed from the start). A review of that commit: 0 findings.MARINARA_SHARED_GPU_HOSTS=phoenix:8081) made pictures and three group-chat clips arrive while several chats generated; before, they were lost. That was on 2026-10-18, before the timeout commits.pnpm smoke:uiandpnpm regression:ui(server-only change).Manual verification notes
MARINARA_SHARED_GPU_HOSTSunset that text, pictures and clips behave exactly as before.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)English docs updated:
docs/CONFIGURATION.md(MARINARA_SHARED_GPU_HOSTS), and.env.example. Translations: #8019UI evidence (if applicable)
No UI changes.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.