Skip to content

examples: denoiser vs oidn-web (split view + benchmark) - #20

Merged
DennisSmolek merged 1 commit into
mainfrom
feat/oidn-web-compare
Oct 24, 2026
Merged

DennisSmolek merged 1 commit into
mainfrom
feat/oidn-web-compare

Conversation

@DennisSmolek

Copy link
Copy Markdown
Member

Adds examples/oidn-web-compare. It runs one path-traced frame through this library and through oidn-web, the denoiser three-gpu-pathtracer's OIDNDenoiser runs. It shows the result as a draggable split view or a |left − right| difference view, and includes a benchmark with timings and PSNR.

split view

What it compares

  • denoiser: runs on whichever runtime the page loads with (?runtime=).
  • oidn-web 0.5:
    • its WGSL engine with the default tiles, which is what OIDNDenoiser uses;
    • its WGSL engine with wholeImage;
    • its WebNN engine.
  • oidn-web 0.3.5: its last TensorFlow.js build, installed as oidn-web-tfjs, with default tiles and as a single tile.

oidn-web dropped TensorFlow.js in 0.4. OIDNDenoiser takes initUNetFromURL from the app, so the app chooses the oidn-web version. The tracer's own demo pins ^0.4.0.

Keeping the comparison fair

  • Same weights. Every contender loads the same rt_hdr_calb_cnrm{_small,,_large}.tza.
  • Same inputs. All contenders denoise one frozen frame with one rasterized albedo/normal G-buffer. Normals are written in both encodings: we map [-1, 1] ourselves, oidn-web expects OIDN's [0, 1].
  • Same device and precision. One shared GPUDevice, fp16 for everyone (?precision=fp32 switches both). The TF.js build always runs fp32.
  • One at a time. Each contender runs with nothing else on the GPU.
  • Same clock. Wall time from the call until the output texture is written and the queue is idle.

Measured

The numbers are shown on the page from src/measured/*.json. Setup: Apple M-series (metal-3), Chrome 155, Eiffel scene, 8 spp, rt_hdr_calb_cnrm, fp16. Times are warm medians in ms over 7 runs; a range means the two runs differed.

size ours WGSL ours Auto (WebNN) 0.5 WGSL, default tiles 0.5 WGSL, whole image 0.5 WebNN 0.3.5 TF.js 0.3.5 TF.js, one tile
960×540 17.5 20.8 50–53 24.5–27.5 60–70 287 164–191
1280×720 32.0 29.9 79–95 50–65 95–106 598–624 263–279
1920×1080 89.5 50.5 251–316 115–134 220–231 1185–1241 fails (TF.js dispatch limit)

Quality is the same across contenders: 33.5–33.9 dB against a 2048-spp reference, and oidn-web's output matches ours to 52–57 dB.

Notes

  • Reuses the Pipeline Lab scenes (../pipeline-lab/src/scenes.ts).
  • Added to the CI typecheck list.
  • Registered in examples.json with a shot but deployed: false. The production build passes (vite build), but I haven't verified it on Pages.
  • Only measured on an Apple GPU so far.

Verification

  • Checked in headless Chrome over CDP: live split, difference view, reference/PSNR and the full benchmark, with no WebGPU validation errors.
  • tsc --noEmit, biome lint and vite build pass for the example.

🤖 Generated with Claude Code

…t view, difference view, benchmark)

A new example comparing this library with pissang/oidn-web, the denoiser
three-gpu-pathtracer's OIDNDenoiser runs: oidn-web 0.5 (hand-written WGSL with
default tiles or the whole image, and its WebNN engine) and 0.3.5, its last
TensorFlow.js build (installed as oidn-web-tfjs).

Every contender gets the same .tza weights, one frozen frame and one rasterized
albedo/normal G-buffer (normals written in both encodings: ours maps [-1, 1],
oidn-web expects OIDN's [0, 1]), the same GPUDevice and fp16, and runs alone.
Times are wall clock from the call until the output texture is written and the
queue is idle.

The page shows the measured numbers (Apple M-series, Chrome, Eiffel scene, two
runs saved as src/measured/*.json): warm median at 1920x1080 is 89.5 ms for our
WGSL runtime and 50.5 ms on Auto (WebNN), against 251-316 ms for oidn-web 0.5
WGSL with its default tiles, 115-134 ms whole-image, 220-231 ms WebNN, and
1185-1241 ms for the TF.js build. Quality is equal (33.5-33.9 dB vs a 2048 spp
reference; outputs agree to 52-57 dB).

Not deployed yet. Added to the CI typecheck list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DennisSmolek
DennisSmolek merged commit 5cb71fd into main Oct 24, 2026
2 checks passed
@DennisSmolek
DennisSmolek deleted the feat/oidn-web-compare branch October 24, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant