# LDF-VFI CPU benchmark and reproduction

**Both tested intervals were rejected.** All 17 raw frames were visually reviewed
by the project lead. The crossing figure becomes a crosswalk-colored ghost or
textured smear around frames 3–7 and 9–14, then returns near the observed anchors.
Street detail also changes. Accurate reconstructed anchors did not establish
credible intermediate motion. No clips were approved or published.

## Measured experiment

The native 352 × 240 Times Square sequence used three original observations at
receipt times 0, 1480 and 3737 ms, conditioned at model positions 0, 8 and 16.
A complete joint 20-frame window was generated with 16 sampling steps, seed 42,
t-shift 8, FP32 transformer, BF16 conditional VAE, and four CPU threads.
One 256 × 384 spatial tile covered the image. The last three extrapolated frames
were discarded: the decoder actually returned 20 frames, of which 17 were reviewed.

The 4 vCPU / 8 GiB CPU run completed in **1005.287 seconds (16.75 minutes)**.
Measured peak process RSS was **7490.699 MiB**. Raw anchor MAE was
2.1545, 2.9573 and 2.4331 on the 0–255 scale. All 17 deterministic HUD checks
passed after source anchors and the top 29-pixel observation strip were restored.
The raw outputs were reviewed separately from that wrapper.

The initial BF16 loading attempt failed before denoising because diffusers kept
a timestep projection in FP32. The reproduction runner explicitly coerces the
whole transformer to its selected dtype. FP32 also ran faster on this AVX512
CPU, which lacks native BF16/AMX instructions. No GPU parity was established.

## Sources and license

- [Paper](https://arxiv.org/abs/2601.14959).
- [Official code](https://github.com/xypeng9903/LDF-VFI), pinned at
  `61b34d2379df8a313e8e4cb467cc2f74c52b45d7`.
- [Code license at that exact revision](https://github.com/xypeng9903/LDF-VFI/blob/61b34d2379df8a313e8e4cb467cc2f74c52b45d7/LICENSE):
  Apache-2.0, verified October 19, 2026.
- [Official weights](https://huggingface.co/onecat-ai/LDF-VFI), pinned at
  `87816885edfe4dba20190aea399b40181239824f`.
  Its model-card metadata declares Apache-2.0.
- The runner verifies both large checkpoint SHA-256 values and the pinned transformer configuration before inference.
  These pins and hashes are constants in `worker/benchmark_ldf.py`.

No upstream source tree or model weights are vendored. Our CPU adapter and CLI
load separately obtained upstream files. Sampler and conditional-VAE layout
follow the upstream interfaces and are attributed in the runner. A copy of the
upstream Apache license accompanies these research notes in
`docs/licenses/ldf-vfi-Apache-2.0.txt`.

## Execution changes

The CPU adapter preserves the original attention-mask predicates and every
allowed key, while processing queries in chunks of 512 to bound mask memory.
The optional runner suppresses eager `torch.compile` only during upstream import,
then restores it. It does not modify the upstream checkout. The checkout must
have the exact pinned Git revision and no tracked modifications or untracked Python sources, including ignored sources.

Original mask predicates were compared with independently computed temporal and
spatial chunk IDs. Actual CPU PyTorch chunked attention was compared with full
SDPA at tolerance 1e-5. Five lightweight CI tests exercise mask contracts and
chunk boundaries without importing PyTorch or downloading weights. Eight further
provenance tests cover pinned configuration, checkout cleanliness and manifests.

A shared conditional VAE removes the original script's second VAE copy.
Its encode, condition-encode and decode methods clear their internal caches.
The benchmark uses one complete joint window rather than the official
long-sequence autoregressive schedule; this is an explicit experimental change.

The conditional VAE packs each five input frames into two latent times. Its
mask packs the first frame into four channels and the next four frames into
those channels at the second latent time. Thus the observed indices 0, 8 and 16
map to latent positions (0, all channels), (3, channel 2), and (7, channel 0).
Decoding four groups of two latents returns four groups of five frames.

## Reproduce with existing local inputs

Optional research dependencies are separate from normal worker dependencies.
The executed environment used Python 3.14, CPU PyTorch 2.14.1, diffusers 0.33.1,
accelerate 1.5.2, einops, safetensors, huggingface-hub 0.30.2, Pillow and NumPy.
Install compatible CPU builds and retain the verified upstream Git checkout
and weight directory. The runner performs no downloads or publication.

Create a source manifest; image paths resolve relative to the manifest:

```json
{
  "frames": [
    {"path": "000.jpg", "t_ms": 0, "sha256": "<actual SHA-256>"},
    {"path": "001.jpg", "t_ms": 1480, "sha256": "<actual SHA-256>"},
    {"path": "002.jpg", "t_ms": 3737, "sha256": "<actual SHA-256>"}
  ]
}
```

```sh
python worker/benchmark_ldf.py \
  --upstream /path/to/pinned/LDF-VFI \
  --weights /path/to/LDF-VFI-weights \
  --source-manifest /path/to/source.json \
  --output /path/to/new-run \
  --steps 16 --factor 8 --seed 42 --threads 4 \
  --dtype float32 --query-chunk 512 --hud-rows 29
```

The portable runner accepts two through five observations fitting one native
256 × 384 tile. A run writes exact settings, input hashes, progress, all raw
generated frames, separate deterministic wrappers, and the receipt timeline.
It saves encoded conditioning and a checkpoint after every denoising step,
including the final latent before decoding. The verified configuration hash is
part of the resume fingerprint; old checkpoints lacking that provenance are
rejected. Repeat the same command with
`--resume` to continue an identical configuration. These portable checkpoint
features were added after the measured run and were not used to obtain its
timing; the original run completed uninterrupted.

The portable CLI was checked with lint, import/CLI checks, mask tests and the
small CPU SDPA equivalence check. Full neural inference was performed by the
recorded experiment runner before its paths and arguments were made portable;
the portable CLI has not been independently rerun through all neural weights.

Uniform neural observation positions are remapped to actual irregular receipt
times for playback. That remapping does not make the network timestamp-aware.
Neither smoothness nor matching endpoints proves the factual motion between
unobserved frames. This remains a research backend, not approved site media.
