Skip to content

Digital Fauxice v0.3.0

Choose a tag to compare

@rohanpandula rohanpandula released this 18 Jul 12:26

A Metal backend and the hybrid repair tool

Two additions since v0.2.0.

The engine gains a Metal backend for Apple Silicon. It holds the same receipt-backed claim as the CUDA and compiled CPU backends: byte-identical output, counters, RNG accounting, and diagnostics planes against the CPU reference on both complete validation frames, 26 binding checks per frame. Apple GPUs have no double-precision hardware, so every binary64 operation runs through a software IEEE-754 implementation in integer arithmetic, which no compiler mode can contract or reassociate. About eight seconds per full 4000 dpi frame on an M4 Mac mini. A startup self-test proves byte parity in every process before a real frame is accepted, and the backend fails closed with a specific reason when the Metal binding, a device, or the compiled host writer is missing. The auto order is now cuda, metal, cpu-fast, cpu. Receipts: evidence/metal-frame-1-parity.json and metal-frame-2-parity.json.

The hybrid repair tool is now published in this repo under hybrid/ as the fauxce-hybrid package. It routes unusually broad defects, where the engine's defect score saturates at its floor, to a bounded LaMa inpainting fallback, and leaves the exact result everywhere else. Every synthesized pixel is disclosed in a mask, receipts bind every artifact by hash, outside-mask bytes are guaranteed identical to the pure output, and the routed area is capped at 2% of the frame. Both validation frames were reproduced byte-for-byte on this release's engine before publication. The IOPaint 1.6.0 runtime and the big-lama weights are supplied by the user and never redistributed; the docs cover the pinned setup and the weight checksum. Inpainting runs on cpu; mps is refused because IOPaint 1.6.0 blocklists LaMa on MPS and would otherwise silently run on cpu while reporting mps.

Backend Time per full 4000 dpi frame Requires
cpu (reference) roughly an hour numpy only
cpu-fast 9.2 to 9.5 s the fast extra (numba)
metal about 8 s (Apple M4) the metal extra (pyobjc, numba)
cuda 5.3 to 5.8 s (RTX A4000) the cuda extra (cupy, numba, NVIDIA driver)

Install

python -m pip install \
  "portable-digital-ice[metal] @ https://github.com/rohanpandula/digital-fauxice/releases/download/v0.3.0/portable_digital_ice-0.3.0-py3-none-any.whl"
python -m pip install \
  https://github.com/rohanpandula/digital-fauxice/releases/download/v0.3.0/fauxce_hybrid-0.3.0-py3-none-any.whl

The parity receipts binding this source tree are evidence/metal-frame-*-parity.json; the cuda and cpu-fast receipts bind the tree they were minted on and chain to the same pinned fixture hashes.