Skip to content

[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
mainfrom
codex/sentry-fix/7872816480
Open

Ooooze wants to merge 1 commit into
mainfrom
codex/sentry-fix/7872816480

Conversation

@Ooooze

@Ooooze Ooooze commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

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. copyAllFrom lists the donor directory (readdir) and then copies every expected DLL with a bare copyFile and no error handling. When a listed donor DLL has disappeared between the listing and the copy (antivirus quarantine, concurrent pack update/removal), copyFile throws a raw ENOENT that propagates out of deliverWindowsCudaRuntime and out of BackendService.install, whose catch calls onFailure(e, { component: 'backend', operation: 'install' }). classifyFailure finds no diagnostic and no mapped code (ENOENT is absent from OPERATIONAL), so the report becomes failure_category=unknown, failure_reason=unknown, cause_code=ENOENT, message backend install: unknown at 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: copyAllFrom catches ENOENT/ENOTDIR per file via donorEntryMissing() and returns false, 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 order with '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 (copyAllFrom is 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 exact source: operation report in the card.
Base src/backend/install/cuda-runtime-source.ts copyAllFrom(): await mkdir(toDir, { recursive: true }) then bare await 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: OPERATIONAL has no ENOENT entry, and an error without a diagnostic object 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 around copyFile in copyAllFrom, returning false on 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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant