Wan 3D-VAE decode parity on CPU (Swift): pinning the layout contract
Ran Tao (Octoryn Research)
摘要
A from-scratch Swift CPU reimplementation of the Wan2.1 AutoencoderKLWan decode path reaches cosine 1.0 against the diffusers reference, independently pinning three contracts the video pipeline depends on: the z latent layout, causal-convolution semantics, and temporal-upsample behaviour. This is a single-figure, decode-only correctness anchor, not a throughput or generation-quality result. CPU naive convolution is slow, and the encode side and other VAE variants are out of scope.
本 Research Object 以其原始语言(英文)发表。
Contribution
Claimed. A from-scratch Swift CPU reimplementation of the Wan2.1 AutoencoderKLWan decode path reaches cosine 1.0 against the diffusers reference decode. The value of the result is that it independently pins three layout/semantic contracts that the rest of the video pipeline depends on: the z latent layout (orientation / channel order), the causal-convolution semantics (temporal causality inside the 3D convolutions), and the temporal-upsample behaviour. Because the decode that turns latents into pixel frames is verified in isolation, upstream parity work (encoder, diffusion transformer) can be trusted to compose end to end rather than being undermined at the final hop.
NOT claimed. This is a correctness-validation (parity) result, not a novel algorithm and not a performance result. It does not claim decode throughput — the CPU naive-convolution implementation is explicitly slow. It does not claim perceptual or generation quality: numeric cosine parity against the reference is not a statement about visual fidelity of generated video. It does not cover the encode side, other VAE variants, or any non-decode path. The altitude here is an engineering correctness anchor, not a research advance.
Methods
| Field | Value |
|---|---|
| Hardware | Apple Silicon Mac (Swift CPU) |
| Stack / implementation | Swift CPU reimplementation of AutoencoderKLWan decode |
| Oracle / baseline | diffusers AutoencoderKLWan decode (reference); reference version not recorded in source notes |
| Precision | not recorded in source notes (reference path is fp32 per related pipeline notes; not asserted here) |
| Metric + gate | cosine similarity vs the diffusers reference output; reported value cosine 1.0 |
| Procedure | Reimplement the decode path (3D causal convolutions + temporal upsample), decode an identical latent, and compare the output tensor to the diffusers decode |
| Stimulus / inputs | a z latent fed to the decode; exact latent shape / count not recorded in source notes |
Results
| Measurement | Value |
|---|---|
| Decode output cosine vs diffusers | 1.0 |
No other quantitative measurements (timing, tensor shapes, PSNR, sample count) are recorded in the source note for this decode parity.
Threats to validity / Limitations
- Single reported metric, single configuration. The note records exactly one number (cosine 1.0) from what is structurally a parity smoke test. There is no reported sample size (number of latents / prompts), no variance, and no multi-input sweep — this validates the layout contract, not statistical robustness across inputs.
- Parity is not quality. Cosine 1.0 against the diffusers reference confirms the reimplementation matches that reference's numerics; it says nothing about perceptual quality of generated frames, and it inherits any limitation of the reference itself.
- No throughput claim, and CPU is slow. The implementation uses naive convolution on CPU and is explicitly not a performance vehicle; no timing is recorded here.
- Scope is decode-only. Encode side, other VAE variants, and non-decode pipeline stages are out of scope and untested by this note.
- Precision ceiling / details unrecorded. Reference precision, reference version, exact latent shape, and hardware SKU are not recorded in the source notes; "cosine 1.0" is reported as-is without an explicit numeric tolerance gate.
- Evidence standing. The note documents a single decode-parity figure; treat it as the standing claim rather than a fresh independent re-measurement.
Reproducibility / Provenance
- Implementation: Swift CPU
AutoencoderKLWandecode, validated by cosine comparison against the diffusers reference decode. - Build commands / version pins: not recorded in source notes for this specific decode-parity note.
- Sovereignty: no third-party ML framework is used in the decode path (vendor-native math primitives only).
- Oracle caveat: validate the diffusers reference decode against known-good output before treating engine-vs-oracle parity as meaningful; the parity statement is only as strong as the reference it is compared to.
声明边界
作者对范围的明确界定——本工作证明了什么、未证明什么——沿用自 Octoryn Research 的发表模型。
证明
- A Swift CPU reimplementation of Wan2.1 AutoencoderKLWan decode reaches cosine 1.0 vs the diffusers reference, pinning the z-layout, causal-convolution, and temporal-upsample contracts the video decode path depends on.
未证明
- Decode throughput: the CPU naive-convolution path is explicitly slow and no timing is reported.
- Encode-side parity or other VAE variants.
- Perceptual or generation quality: numeric cosine parity is not a statement about visual fidelity.
- Statistical robustness: a single cosine figure is reported, with no sample size, variance, or multi-input sweep.
适用于
- Verifying the Wan 3D-VAE decode layout and convolution/upsample semantics against the diffusers reference.
不适用于
- Reasoning about decode throughput or performance.
- Inferring generation or perceptual quality from numeric parity.
- Encode-side, non-decode pipeline stages, or other VAE models.
作者
- Ran Tao — 调查研究, 写作
引用本文
引用格式
Tao, R., Octoryn Research. (2026). Wan 3D-VAE decode parity on CPU (Swift): pinning the layout contract (TR-2026-0024). Octopus Research Institute.
BibTeX
@techreport{oritr20260024,
title = {Wan 3D-VAE decode parity on CPU (Swift): pinning the layout contract},
author = {Tao, Ran and {Octoryn Research}},
institution = {Octopus Research Institute},
year = {2026},
note = {Permanent ID TR-2026-0024. Not peer reviewed.}
}披露
- 资助
- 硬件与基础设施由 Octoryn / Octopus Core Pty Ltd 提供。
- 利益冲突
- Octoryn 提供商业推理与治理工具;相关发现独立报告。
