Repository navigation
[sentry:7872816480] On a Windows CUDA backend install, deliverWindowsCudaRuntime borrows the missing CUDA runtime from another installed pack, the legacy lib folder, or a host CUDA toolkit - #142
Open
Ooooze wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a Windows CUDA backend install,
deliverWindowsCudaRuntimeborrows the missing CUDA runtime from another installed pack, the legacy lib folder, or a host CUDA toolkit.copyAllFromlists the donor directory (readdir) and then copies every expected DLL with a barecopyFileand no error handling. When a listed donor DLL has disappeared between the listing and the copy (antivirus quarantine, concurrent pack update/removal),copyFilethrows a rawENOENTthat propagates out ofdeliverWindowsCudaRuntimeand out ofBackendService.install, whose catch callsonFailure(e, { component: 'backend', operation: 'install' }).classifyFailurefinds nodiagnosticand no mapped code (ENOENTis absent fromOPERATIONAL), so the report becomesfailure_category=unknown,failure_reason=unknown,cause_code=ENOENT, messagebackend install: unknownat error level — even though the release companion, NVIDIA redistributables or the pinned companion could still have supplied the runtime. Archive-based sources already treat a failed copy as one unusable source (attempt()records it and continues), and ADR 2026-11-04 states 'only a completed copy establishes success'. Fix applied:copyAllFromcatchesENOENT/ENOTDIRper file viadonorEntryMissing()and returnsfalse, so that donor is skipped and the source ladder continues; every other filesystem error still propagates. The saved regression test passes against the patched tree. The independent full-suite run reported exactly one failure,src/core/create.test.ts > image generation through the owner > wires the diffusion service to the control API, the journal, the events and the shutdown orderwith 'the abandoned job was not cancelled' at a 10s polling deadline; that test exercises diffusion job cancellation on Linux and is untouched by and unreachable from the CUDA runtime donation path (copyAllFromis only called on the win32 CUDA install branch), so it is an unrelated timing-sensitive flake outside the saved plan. All four planned files are present: patched source, regression test, ADR and its INDEX bullet.Evidence:
Event atomic-chat-core@0.24.10, dist 5267d2d: operation=install, component=backend, failure_category=unknown, failure_reason=unknown, cause_code=ENOENT, diagnostic_cause_code=ENOENT, diagnostic_version=core-v1, os.name=win32, gpu_vendor=nvidia, exception 'Error: backend install: unknown', frames empty, no diagnostic_code.
src/backend/install/service.ts install(): the win32 branch calls deliverWindowsCudaRuntime(staging) inside the try, and the catch reports
this.deps.onFailure?.(e, { component: 'backend', operation: 'install' })then rethrows — the exactsource: operationreport in the card.Base src/backend/install/cuda-runtime-source.ts copyAllFrom():
await mkdir(toDir, { recursive: true })then bareawait copyFile(...)in the loop with no try/catch, so an fs error aborts deliverWindowsCudaRuntime before host-toolkit/companion/NVIDIA/pinned sources run.src/telemetry/diagnostics.ts classifyFailure:
OPERATIONALhas noENOENTentry, and an error without adiagnosticobject yields category/reason 'unknown' — matching the card's tags.Probe reproduced the exact signature: raw 'Error: ENOENT: no such file or directory, copyfile ... cudart64_12.dll' at cuda-runtime-source.ts:138 (copyAllFrom) from deliverWindowsCudaRuntime local-donor loop (line 302), with no code mapping and no diagnostic.
src/backend/install/cuda-runtime-source.test.ts 'refuses a failed DLL copy even when directory entries now have every expected name' shows copy failures for archive sources are caught inside attempt() and the next source is tried — copy failure invalidates one source, not the install.
docs/decisions/2026-11-04-keep-cuda-runtime-repair-cancellable-and-coherent.md: 'Only a completed copy establishes success; directory entries after a copy error do not prove a usable runtime'.
Repair applied in src/backend/install/cuda-runtime-source.ts: new
donorEntryMissing()predicate plus try/catch aroundcopyFileincopyAllFrom, returningfalseon ENOENT/ENOTDIR and rethrowing everything else.Check run of src/backend/install/cuda-runtime-source-donor-vanished.test.ts on the patched tree: 1 test, 1 passed — 'falls back to the next source when a listed donor DLL has vanished before the copy' (exit code 0).
Independent full-suite run on the patch: 12498 passed, 2 skipped, 1 failed — only src/core/create.test.ts:1091 'the abandoned job was not cancelled' (diffusion job cancellation, 10s deadline), a timing-sensitive test unrelated to the CUDA donor copy path.
docs/decisions/2026-11-29-a-vanished-donor-dll-falls-through-to-the-next-cuda-runtime-source.md exists and docs/decisions/INDEX.md contains its bullet at line 300.
Regression tests: src/backend/install/cuda-runtime-source-donor-vanished.test.ts
Full CI and human review are required.
Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/c5a69139-f2f1-452f-93f4-f6f48f3cf6ce
Sentry: https://atomic-chat.sentry.io/issues/7872816480/