﻿# SGLang Diffusion CLI needs an exit status that reflects failed output writes

A November 18 SGLang Diffusion proposal makes zero available results fail the CLI. Here is how to qualify artifact creation, exit status, and partial batches.

Author: Retrivium editorial team
Updated: 2026-11-19
Canonical URL: https://retrivium.ai/journal/daily-20261119-sglang-diffusion-cli-output-exit/
Language: en

On November 18, 2026, an SGLang contributor reported an output failure that left the Diffusion command with a successful exit status even though no request produced a saved result. Pull request #51362 proposes changing the command to exit with status 1 in the case the maintainer investigated. The contributor reports a check on an NVIDIA H200 under the same output failure. This is evidence from the proposed change and its test setup. A deployment pinned to an earlier build should verify its own command behavior.

## Distinguish computation from persistence

A diffusion job can complete its GPU work and still fail when it writes the result. An orchestrator that promotes the job based on the process status alone may advance a pipeline with an empty output directory. Track completion at two levels. First record the command outcome. Then check the expected output path or manifest and verify that each artifact the next stage requires can be opened. Keep the job identifier with both observations. Leftover files from another run can otherwise make a failing current job appear to have produced the required images.

## Build a controlled output failure

Use a disposable workspace and a small fixture you own. Compare a normal writable destination with an output destination your test process cannot use. Begin from fresh directories and pin the same model, runtime, and command options. Record the status, relevant diagnostic messages, and directory contents. The test should exercise result persistence rather than fail earlier during model initialization. Keeping the initial model-loading evidence is useful when the observed failure looks similar at the orchestration layer.

## Decide what a partial batch means

The reported case concerns a command that produced no usable results. An application can have a different contract when some outputs succeed. Preserve the identity of each requested item and compare it with validated outputs before you label a batch complete. An image could be present but fail to decode, or the required metadata could be missing. Specify whether to retry only failed work or reject the whole output set, based on what the downstream consumer can interpret. The change does not define every batch orchestration policy.

## Keep Python and CLI callers distinct

The proposal describes retaining the Python API’s recoverable absent-result behavior while changing the CLI status. A worker that embeds a Python generator must still inspect the returned result and its own logs. A command runner instead has a process signal to handle. Test both surfaces if a service provides both forms of integration. A wrapper should also preserve the subprocess status when collecting diagnostics or running cleanup, because cleanup itself can succeed after generation fails.

## Establish the evidence before changing the queue

Record the exact package or commit, failing condition, exit status, and verified artifact inventory. Run a success control after resolving the simulated output failure. This shows that a particular worker distinguishes a persisted output from a failed request. It says nothing about model accuracy, speed, or the rate of storage failures in production. The useful boundary is simple: the next operation should receive the files it needs and a status that agrees with what was actually saved.

## Sources

- [SGLang 1.0 release tracker](https://github.com/sgl-project/sglang/issues/50045)
- [Proposed CLI correction](https://github.com/sgl-project/sglang/pull/51362)

## Related reading

- [Reproducible inference environments](/journal/software-stack-reproducibility/)
- [Retries and operation identity](/journal/provider-post-retry-idempotency-ledger/)
