1024px image generation end-to-end on a consumer RDNA2 GPU, and a NULL-deref segfault root-caused
Ran Tao (Octoryn Research)
Abstract
A 1024px image-generation pipeline runs end-to-end on a consumer-class RDNA2 GPU with the vendor BLAS library fully stubbed out, reaching final-latent cosine 0.99999999 against a reference diffusion implementation (gate >= 0.999) and exiting cleanly. The primary contribution root-causes a deterministic post-denoise segfault: a missing output-directory argument yielded a NULL file handle whose unguarded write dereferenced NULL before decode; the fix creates the directory and guards the writes, with no kernel or numerics change. A correctness-validation result, not a throughput or quality claim.
Contribution
Claimed. A 1024px image-generation end-to-end pipeline runs to completion on a consumer-class RDNA2 GPU under a ROCm/HIP toolchain with the vendor BLAS library fully stubbed out inline (de-BLAS'd), producing a final latent whose cosine similarity to a reference diffusion implementation's golden output is 0.99999999 (acceptance gate >= 0.999, PASS). The run completes cleanly and emits its end-of-pipeline marker reproducibly across two invocations. Separately and primarily, this note root-causes a segmentation fault that occurred after the denoise phase: a missing output-directory argument caused the latent-write file open to return a NULL handle, and an unguarded write call then dereferenced NULL before the decode stage was ever reached. The fix creates the output directory and adds NULL guards at all write sites, with no kernel or math change.
NOT claimed. This is an engineering / correctness-validation result, not a novel algorithm. It does NOT claim throughput competitiveness, generation quality beyond single-latent parity, generalization to other resolutions or image models, or that the cosine parity reflects perceptual or sample quality. The performance numbers are single-box, single-run wall-clock timings, not a benchmarked distribution. The segfault fix restores reachability of the output path; it does not alter or re-validate the numerical pipeline beyond confirming parity is untouched.
Methods
| Field | Value |
|---|---|
| Hardware | Consumer-class RDNA2 GPU (16 GB) |
| Stack | ROCm / HIP toolchain; vendor BLAS library fully stubbed inline (de-BLAS'd) |
| Dependency check | Dynamic-dependency inspection: no vendor BLAS / MKL; only the core HIP runtime and system libraries |
| Oracle / baseline | Reference diffusion implementation golden final latent (version not recorded in source notes) |
| Procedure | Build the end-to-end source, run the 1024px image pipeline, compare the final latent to the reference golden, then rerun twice from a fresh missing output directory to confirm the fix |
| Precision | Not recorded in source notes |
| Metric + gate | Final-latent cosine vs reference golden; gate >= 0.999 |
| Stimulus / inputs | 1024px image generation end-to-end (prompt / seed not recorded in source notes) |
Results
| Measurement | Value |
|---|---|
| Denoise phase | ~188s |
| Decode phase | ~9-10s |
| Wall clock | ~197s |
| Final-latent cosine vs reference golden | 0.99999999 (gate >= 0.999, PASS) |
| Reproducibility | Ran twice from a fresh missing output directory; both completed cleanly with the end-of-pipeline marker |
| Pre-fix failure | Deterministic segmentation fault right after denoise (~188s), never reaching the decode stage |
| Dependency footprint | Dynamic-dependency inspection: no vendor BLAS / MKL; core HIP runtime and system libraries only |
Threats to validity / Limitations
- Sample size. Parity is a single final-latent cosine on one configuration, a correctness smoke test, not a benchmark-scale evaluation. No multi-prompt, multi-seed, or distributional coverage is recorded.
- No variance. Phase and wall-clock figures are single-box, single-run timings (the two reruns confirmed clean reachability, not timing variance). No mean or standard deviation across runs.
- Parity is not quality. A cosine of 0.99999999 to a reference latent demonstrates numerical agreement of the latent, not perceptual or sample-generation quality, and not human-judged fidelity.
- Precision ceiling unrecorded. The numerical precision of the engine path is not recorded in the source notes, so the cosine result cannot be bounded against a known ULP floor.
- Scope bound. The result is specific to 1024px on this consumer RDNA2 GPU with a single image model; other resolutions, models, or GPUs are out of scope.
- Baseline version unpinned. The reference diffusion golden was used as oracle, but its version is not recorded in the source notes; the "validate the oracle" provenance is therefore incomplete.
- The fix is reachability, not math. The segfault fix restores the output path; it adds no new numerical validation beyond asserting parity was untouched.
- Reproduction strength. The reproducibility evidence is limited to two clean reruns of the same configuration, not an independent re-derivation.
Reproducibility / Provenance
- Failure mode (pre-fix): A missing output-directory argument caused the latent-write file open to return a NULL handle; the subsequent unguarded write dereferenced NULL, producing a deterministic segmentation fault on the box immediately after the denoise phase (~188s).
- Fix: Ensure the output directory exists (create-if-missing) in the entry path, and guard the file handle at all write sites. No kernel or math change; parity untouched.
- Build note: Compiling and linking against the appropriate GPU architecture requires explicitly linking the core HIP runtime; the default link invocation otherwise fails with an undefined runtime-registration symbol.
- Dependency footprint: Dynamic-dependency inspection shows only the core HIP runtime and system libraries (no vendor BLAS / MKL / inference-primitives library).
- Source provenance: Specific commit, branch, and file paths are omitted from this disclosure layer.
Claim boundary
The author's explicit scope — what this work does and does not establish — carried over from the Octoryn Research publishing model.
Proves
- A 1024px image-generation pipeline runs end-to-end on a consumer-class RDNA2 GPU with the vendor BLAS library fully stubbed out, reaching final-latent cosine 0.99999999 vs a reference diffusion implementation and exiting cleanly across two runs.
- The post-denoise segfault was caused by a missing output-directory argument yielding a NULL file handle plus an unguarded write; the fix adds directory creation and NULL guards with no change to kernels or numerics.
Does not prove
- Throughput competitiveness or generation quality beyond single-latent numerical parity.
- Generalization to other resolutions, image models, or GPUs.
- Distributional or benchmark-scale correctness: parity is a single final-latent cosine on one configuration, a smoke test, not multi-prompt or multi-seed.
- Timing reproducibility or variance: phase and wall-clock numbers are single-run with no mean or standard deviation.
Applies when
- A 1024px image-generation pipeline on this consumer-class RDNA2 GPU configuration with the output directory present.
Does not apply when
- Any throughput, quality, or perceptual-fidelity claim, or other resolutions, models, or GPUs.
- Any precision-bounded claim (engine precision not recorded) or reference-version-pinned claim (reference implementation version not recorded).
- Generalizing the two clean reruns to a benchmarked timing distribution.
Authors
- Ran Tao — Investigation, Writing
Cite this
Citation
Tao, R., Octoryn Research. (2026). 1024px image generation end-to-end on a consumer RDNA2 GPU, and a NULL-deref segfault root-caused (TR-2026-0023). Octopus Research Institute.
BibTeX
@techreport{oritr20260023,
title = {1024px image generation end-to-end on a consumer RDNA2 GPU, and a NULL-deref segfault root-caused},
author = {Tao, Ran and {Octoryn Research}},
institution = {Octopus Research Institute},
year = {2026},
note = {Permanent ID TR-2026-0023. Not peer reviewed.}
}Disclosures
- Funding
- Hardware and infrastructure provided by Octoryn / Octopus Core Pty Ltd.
- Conflicts of interest
- Octoryn ships commercial inference and governance tooling; findings are reported independently.
